Governance is hard, especially on-chain. The Moloch aims to simplify âDecentralized Autonomous Organizationsâ. This is a sandbox for playing around with the mechanics and game theory behind a minimum viable DAO.
To get started, youâll need Clevis or at least Docker installed on your machine. With Clevis installed directly itâs faster, but there are few other commands to run. Iâll default to the Docker version because it works universally. Letâs start by cloning down the repo:
cd ~;git clone https://github.com/austintgriffith/moloch
Next, letâs fire up our Docker container. This will bring up a private blockchain, the dApp, and the Clevis command prompt:
docker run -ti --rm --name clevis -p 3000:3000 -p 8545:8545 -v ~/moloch/app:/dapp austingriffith/clevis:latest
Note: the
~/moloch/app
part needs to point to where you cloned down the Moloch repo, specifically theapp
directory.
Note: Make sure you donât have anything running on port 3000 or 8545 already. This container brings up ganache and CRA for you.
Eventually, you will get a clevis prompt and you can test that everything works by running:
Clevis:/dapp clevis test version
Note: donât paste in â Clevis:/dapp â this is just an indicator that you are putting a command in the Clevis container.
When the Clevis prompt comes up and everything is ready to go, youâll want to compile, deploy, test, and publish your smart contracts with:
Clevis:/dapp clevis test full
You can edit your code that is injecting into the Clevis container from your native operating system used a command like:
atom ~/moloch
When the container comes up, you will also have a Create React App ready:
http://localhost:3000
The first screen of the Moloch Sandbox is the deployment screen:
Youâll also notice in the top right that we donât have any ETH in our test accounts. Letâs fix that by editing the app/tests/clevis.js file. Look for the metamask() function in particular:
To make this test payout, you can run:
Clevis:/dapp clevis test metamask
Note: This will also run any time the âclevis test fullâ command runs.
foundersAddressesis a comma separated list of founding members for you Moloch DAO. They are added to the initial Members list with having to pay any tribute.
foundersVotingSharesis a comma separated list of the voting shares to be given each respective founding memeber.
periodDurationis the time in seconds each period will last. The default for this will be 86400 to represent one day.
votingPeriodLengthis the number of periods a proposal will be open for votes. The default for this will be 7.
gracePeriodLength is the number of periods after a proposal is closed for voting to allow members that voted no to âRageQuitâ (exchange their voting shares for tokens from the Guild Bank).
proposalDepositis mainly just for Sybil resistance. It is a stake that must be put up for each new proposal. Only one new proposal can be introduced per period so itâs important that they canât be spammed.
After you deploy your contract, you can see the specific parameters of your DAO along with current period information and total voting shares:
The first thing to test is to submit a proposal from your first account that will deposit some coins. Along with the Moloch contracts, clevis test full has also deployed two ERC20 tokens âSomeCoinâ and âAnotherCoinâ. You should edit the app/tests/clevis.js to mint you some of these on deploy.
If you ever see this âout of gasâ error, itâs because you need to update your period. This runs at the start of every major action too, but with short periods it can be very dynamic, so if you see this:
You will want to run:
Note: We will fix this soon so the frontend will fake what period it shows based on time, the updatePeriod will run on a cron, and major functions will be provided with the correct amount of gas to update first.
Once you submit your proposal, it will show up in the list with all the parameters:
As you vote for a proposal you will see the votes increase:
When enough periods have passed (keep hitting the updatePeriod button). You will be able to âProcessâ the proposal:
Once this vote passes, we will see coins deposited in the Guild Bank:
And we will also see the members section where voting shares has updated:
As an example, letâs say that first user now wantâs to Rage Quit. If they âCollect Loot Tokensâ and then âApproveâ and âRedeem Loot Tokensâ. They will exit the DAO and collect their share from the Guild Bank:
These are the basic mechanics of the Moloch DAO. You can fire up your own DAO locally with a couple commands and play with the game theory locally. Please contribute to this repo hereor the main Moloch repo here. Feedback is always welcome, Iâm @austingriffith on Twitter and Telegram. The original Moloch DAO code was created by Ameen Soleimani (@ameensol).
If you are interested in contributing to this project, a major UI design is in the works. A React wizard might be needed to help integrate a beautiful design.