Non-rebasing M token alternative with an additional possibility to preserve and forward yield to earners.
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
Copy .env
and write down the env variables needed to run this project.
cp .env.example .env
Run the following command to compile the contracts:
forge compile
Forge is used for coverage, run it with:
npm run coverage
You can then consult the report by opening coverage/index.html
:
open coverage/index.html
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:
npm run slither
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
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:
- .github/workflows/test-fuzz.yml
- .github/workflows/test-integration.yml
- .github/workflows/test-invariant.yml
You will need to uncomment them to activate them.
Forge is used to generate the documentation. Run it with:
npm run doc