👹 Moloch Rises
Sandbox dApp for experimenting with Moloch DAO mechanics
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
~/moloch/apppart needs to point to where you cloned down the Moloch repo, specifically the
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:
When the container comes up, you will also have a Create React App ready:
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.
foundersAddresses is 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.
foundersVotingShares is a comma separated list of the voting shares to be given each respective founding memeber.
periodDuration is the time in seconds each period will last. The default for this will be 86400 to represent one day.
votingPeriodLength is 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).
proposalDeposit is 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 here or 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.