creator (address)
- electionName (string)
- electionDescription (string)
- algorithm (enum)
candidates (struct(id, name, voteCount))
- isOpen (boolean)
- sdate (string)
- edate (string)
voters (mapping(address => boolean))
- results (winners[string])
- userInfo
- elections (mapping(userid => [electionContract]))
- userPublicAddress
- userContracts (mapping(userPublicAddress => address))
Public address of the users will be considered as their userID.
- User creation
signup -> MainContract.createUser() -> new UserContract()
- Creating new election
UserContract.createElection(info) => new Election()
- One to Many relationship
MC -> user1, user2, user3, ....
user -> Election1, Election2, ....
Use the below command to build (compile) the smart contracts
npm run build
Use the below command to run tests on the compiled smart contracts
npm run test
All of the test should pass