Repository gathering useful libraries and contracts.
Install this repository as a forge dependency:
forge install morpho-dao/morpho-utils
Then add a remapping to your remappings.txt
:
@morpho-utils/=lib/morpho-utils/src/
You're good to go! Just import libraries with @morpho-utils/math/Math.sol
for example.
Please be aware that some known issues are inherent to the way some libraries work in this repository.
After cloning this repository, run:
git submodule update --init --recursive
Configure your VSCode to automatically format a file on save, using forge fmt
:
- Install emeraldwalk.runonsave
- Update your
settings.json
:
{
"[solidity]": {
"editor.formatOnSave": false
},
"emeraldwalk.runonsave": {
"commands": [
{
"match": ".sol",
"isAsync": true,
"cmd": "forge fmt ${file}"
}
]
}
}
For testing, run:
forge test
To run the Certora prover, run (with a CERTORAKEY in your environment):
./certora/scripts/verifyAll.sh
We thank the MEP team for their help on code optimization:
This repository is inspired by several sources: