The DAO of DAB.
DAB DAO is Decentralized Autonomous Bank DAO. It is to redistribute and allocate the authorities and votes to the holders of all deposit tokens(DPT).
Democratic vote to execute the privilege functions.
Needs to achieve
A proposal contract that implements the Proposal Abstract Class, which can run a privilege function on DABDao after gaining a support rate that exceeds the threshold, and then upgrades the original contract.
In the process of voting, the voting DPT will be converted into a temporary Vote Token(VOT), and this token is controlled by the Proposal Contract, the voters can redeem their DPT from proposal contract by destroy their VOT after the proposal ended, either succeeds or fails.
If a proposal contract want to execute the DABDao privilege function, then the proposal needs to have a certain proportion of DPT. Such a mechanism can avoid the a DPT vote twice.
propose
function in the DABDao Contract.vote
function of the DABDao Contract, each DPT is a vote.Tests are included and can be run on using truffle and testrpc.
brew install npm
npm install -g truffle
npm install -g ethereumjs-testrpc
node v8.1.3+
npm v5.3.0+
truffle v3.4.5+
testrpc v4.0.1+
Test in the development period.
To run the test, execute the following commands from the project’s root folder.
npm start
npm test
Test in real private network
To migrate the contracts to the network, execute the following commands from the project’s truffle folder.
geth --dev --rpc --rpcport 8545 --rpcaddr 127.0.0.1 --rpcapi="eth,net,web3" --unlock 2e1609032a6e71eac236c6487c4dc3e0aaee3c9f --mine --minerthreads=1
truffle migrate --network dev