Skip to content

Non rebasing M token alternative with additional possibility to preserve and forward yield to earners

License

Notifications You must be signed in to change notification settings

m0-foundation/smart-m-token

Repository files navigation

Smart M Token - Smart Wrapper contract

Overview

Non-rebasing M token alternative with an additional possibility to preserve and forward yield to earners.

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 node dependencies
  • slither to static analyze contracts

Install dependencies:

npm install
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:

npm run build

or

make build

Coverage

Forge is used for coverage, run it with:

npm run coverage

or

make coverage

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

open coverage/index.html

Test

To run all tests:

make tests

Test a specific test case:

./test.sh -v -t <test-case-name>

To run slither:

npm run slither

Code quality

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

npm run prettier

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

npm run solhint

Or to autofix some issues:

npm run solhint-fix

CI

The following Github Actions workflow are setup to run on push and pull requests:

It will build the contracts and run the test coverage, as well as a gas report.

The coverage report will be displayed in the PR by github-actions-report-lcov and the gas report by foundry-gas-diff.

For the workflows to work, you will need to setup the MNEMONIC_FOR_TESTS and MAINNET_RPC_URL repository secrets in the settings of your Github repository.

Some additional workflows are available if you wish to add fuzz, integration and invariant tests:

You will need to uncomment them to activate them.

Documentation

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

npm run doc

About

Non rebasing M token alternative with additional possibility to preserve and forward yield to earners

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages