- Deploy the smart contracts (voting.sol is currently deployed on Rinkeby at 0xa1e3c1b3070d4a86dd9fc8bd3480d5f6140a23b8)
- Initialize the smart contracts
- Distribute the voting tokens by calling
issueTokens(address receiver, uint num)
wherereceiver
is the address that will be given the tokens andnum
is the amount of tokens that will be minted for that address. You will need to be the contract owner (own the adress that deployed the contract) to perform this action, if you're not just deploy a new instance of the contract and use that contract instead (you'll be the owner of the new contract). - Create an election by calling
createElection(address newAddress)
wherenewAddress
is the address of a smart contract that deepDAO will be upgraded to (replaced by) if the election is won (>51% of all the distributed tokens vote for it). Other elections can be created by calling the same function again.
- Distribute the voting tokens by calling
- Spin up a web server to serve static files from the web directory (
cd web && python -m SimpleHTTPServer
) - Open the voting app on your browser (localhost:8000)
- Use the app
- You can check your voting token balance in Metamask by adding a new ERC20 token with the address where voting.sol has been deployed. The contract behaves like an ERC20 that has transfers disabled so any product that can interact with ERC20 tokens should work too. It is also possible to just obtain the token balance of an address by just calling
balanceOf(address owner)
, per the ERC20 standard. - You can vote on a proposal by just entering the election id in the textbox (id that you get after creating an election) and clicking on the Vote button. You will need to be logged in Metamask
- If 51% of all the tokens distributed have voted for an upgrade, anyone can enforce the decision (upgrade the contract) by calling
finalize(uint id)
whereid
is the id of the election to enforce
- You can check your voting token balance in Metamask by adding a new ERC20 token with the address where voting.sol has been deployed. The contract behaves like an ERC20 that has transfers disabled so any product that can interact with ERC20 tokens should work too. It is also possible to just obtain the token balance of an address by just calling