New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eth-optimism/contracts-governance

Package Overview
Dependencies
Maintainers
5
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eth-optimism/contracts-governance

Optimism Governance Contracts</h1

  • 0.1.8
  • latest
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source
Optimism

Optimism Governance Contracts

codecov

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
npx

Instal the required packages by running:

nvm use
yarn
Compile

To compile the smart contracts run:

yarn build
Test

To run the tests run:

yarn test
Lint

To run the linter run:

yarn lint
Coverage

For coverage run:

yarn test:coverage
Deploying

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-main

Specification

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 OP token is an inflationary token. We allow for up to 2% annual inflation supply to be minted by the token MintManager.
  • 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)

FAQs

Package last updated on 08 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc