GovBlocks is a multi-factorial governance framework for blockchain applications.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Node >= 7.6
Firstly, you need to clone this repo. You can do so by downloading the repo as a zip and unpacking or using the following git command
git clone https://github.com/somish/govblocks-protocol.git
Now, It's time to install the dependencies.
npm install
We need to compile the contracts before deploying. We'll be using truffle for that (You can use Remix or solc directly).
truffle compile
To deploy the smart contracts, you need to set your mnemonic seed in truffle config (You can use remix or mist as well for deploying). To deploy the contracts with truffle on kovan testnet, run
truffle migrate --network kovan
Your GBTStandardToken and GovBlockMaster contract is live now, you can use these contract to setup the GovBlocks platform and create register dApps using the GUI provided by GovBlocks platform.
GovBlocks is built on the Ethereum blockchain and it uses a modular system for grouping of Ethereum smart contracts, allowing logical components of the system to be upgraded without affecting the other components. Following are the key modules of GovBlocks.
Master module of every contract is used to bind all the modules together. It contains addresses of all other contracts and updates them when a new version is added. Contract:
Some important functions :
- addNewVersion : It is used to add new version of all the contracts.
- switchToRecentVersion : It switches to new verison, updates all the dependency addresses in respective contracts.
- configureGlobalParameters : It is used to configure global parameters
Governance module is used for doing the core governance like submitting proposals. Contracts:
Some important functions :
- createProposal : It is used to submit new proposal.
- createProposalwithSolution : It is used to submit new proposal with a solution.
- calculateMemberReward : It is used to calculate the reward to be deistributed once the proposal is closed.
MemberRoles module of manages all the member roles. Every member role can have different authorizations Contract:
Some important functions :
- addNewMemberRole : It is used to add new member role.
- getAllAddressByRoleId : It returns all member address that have a particular role
Pool of every dApp holds the Ethereum and GBT for distributing the default incentive upon acceptance of a proposal. It is also used to call oraclize to close proposal when the time is over. Contract:
Some important functions :
- buyPoolGBT : It is used to buy GBT using Ethereum.
- closeProposalOraclise : Closes Proposal voting using oraclize once the time is over.
ProposalCategory module is used to manage the proposal categories and sub categories. It contains all the category and sub category data. Contract:
Some important functions :
- addNewCategory : It is used to add a new category.
- updateCategory : It updates an exisitng category.
- addNewSubCategory : It is used to add a new sub category under an existing category.
- updateSubCategory : It is used to edit an exisitng sub category.
SimpleVoting is a simple VotingType which works when only one solution can be selected for voting. It also helps distribute reward when a proposal is closed. Contract:
Some important functions :
- addSolution : It is used to add a solution to a proposal.
- proposalVoting : It is used for casting votes.
- closeProposalVote : It moves voting to next phase (if next phase is available)
- giveRewardAfterFinalDecision : It sets the reward to be distributed. Users can claim these rewards once the proposal is closed.
- Write Tests