Skip to content

m0-foundation/protocol

Folders and files

NameName
Last commit message
Last commit date
Apr 15, 2024
Sep 27, 2023
Apr 15, 2024
Mar 1, 2024
Apr 15, 2024
Apr 24, 2024
May 3, 2024
May 1, 2024
Apr 24, 2024
Apr 15, 2024
Jan 8, 2024
Dec 28, 2023
Mar 7, 2024
Mar 8, 2024
Mar 27, 2024
Apr 10, 2024
Nov 14, 2023
May 15, 2024
Dec 15, 2023
Mar 27, 2024
Dec 28, 2023
Apr 15, 2024
Feb 23, 2024

Repository files navigation

M^0 Protocol

Overview

M^0 is an EVM-compatible, immutable protocol that enables minting and burning of the ERC20 token $M. It also allows for $M distributions to yield earners and governance token ($ZERO) holders. There are three main types of actors in the protocol - Minters, Validators, and Yield Earners - all of which are permissioned via governance. Protocol variables are also managed by governance and are stored in a Registrar configuration contract.

Development

Installation

You may have to install the following tools to use this repository:

  • foundry to compile and test contracts
  • lcov to generate the code coverage report
  • yarn to manage npm dependencies
  • slither to static analyze contracts

Install dependencies:

yarn
forge install

Env

Copy .env and write down the env variables needed to run this project.

cp .env.example .env

Compile

Run the following command to compile the contracts:

forge compile

Coverage

Forge is used for coverage, run it with:

yarn coverage

You can then consult the report by opening coverage/index.html:

open coverage/index.html

Test

To run all tests:

forge test

Run test that matches a test contract:

forge test --mc <test-contract-name>

Test a specific test case:

forge test --mt <test-case-name>

To run slither:

yarn slither

Code quality

Prettier is used to format Solidity code. Use it by running:

yarn prettier

Solhint is used to lint Solidity files. Run it with:

yarn solhint

Or to autofix some issues:

yarn solhint-fix

Documentation

Forge is used to generate the documentation. Run it with:

yarn doc

The command will generate the documentation in the docs folder and spinup a local server on port 4000 to view the documentation.

SC Architecture

protocol_architecture