8000 GitHub - goncaloMagalhaes/common: M^0 common smart contracts
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

goncaloMagalhaes/common

 
 

Repository files navigation

Common M^ZERO Contracts

Overview

Common contracts and libraries used across the various M^ZERO Solidity projects.

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:

npm i
forge install

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

About

M^0 common smart contracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 98.6%
  • Other 1.4%
0