@eth-optimism/contracts-governance v0.1.8
TL;DR
The token and governance smart contracts for the Optimism DAO. Built using OpenZeppelin libraries with some customisations. The token is an ERC20 that is permissible and allows for delegate voting. The token is also burnable. See more in the Specification section.
Governance will initially be handled by Snapshot before moving to an on chain governance system like OpenZeppelins Governance contracts.
Getting set up
Requirements
You will need the following dependancies installed:
nvm
node
yarn
npxInstal the required packages by running:
nvm use
yarnCompile
To compile the smart contracts run:
yarn buildTest
To run the tests run:
yarn testLint
To run the linter run:
yarn lintCoverage
For coverage run:
yarn test:coverageDeploying
To deploy the contracts you will first need to set up the environment variables.
Duplicate the .env.example file. Rename the duplicate to .env.
Fill in the missing environment variables, take care with the specified required formatting of secrets.
Then run the command for your desired network:
# To deploy on Optimism Kovan
yarn deploy-op-kovan
# To deploy on Optimism
yarn deploy-op-mainSpecification
Below we will cover the specifications for the various elements of this repository.
Governance Token
The GovernanceToken.sol contract is a basic ERC20 token, with the following modifications:
- ✅ Non-upgradable
- This token is not upgradable.
- ✅ Ownable
- This token has an owner role to allow for permissioned minting functionality.
- ✅ Mintable
- The
OPtoken is an inflationary token. We allow for up to 2% annual inflation supply to be minted by the tokenMintManager.
- The
- ✅ Burnable
- The token allows for tokens to be burnt, as well as allowing approved spenders to burn tokens from users.
- 🛠 Permittable
- This token is permittable as defined by EIP2612. This allows users to approve a spender without submitting an onchain transaction through the use of signed messages.
- Delegate voting
- This token inherits Open Zeppelins ERC20Votes.sol to allow users to delegate voting power. This requires the token be permittable.
Mint Manager
The MintManager.sol contract is set as the owner of the OP token and is responsible for the token inflation schedule. It acts as the token "mint manager" with permission to the mint function only.
The current implementation allows minting once per year of up to 2% of the total token supply.
The contract is also upgradable to allow changes in the inflation schedule.
Snapshot Voting Strategy
(WIP)
Governance (DAO) Contracts
(WIP)
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago