Skip to content

morpho-org/morpho-utils

Repository files navigation

Morpho Utils

Foundry Tests Certora Tests

Repository gathering useful libraries and contracts.

Getting started

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.


Known Issues

Please be aware that some known issues are inherent to the way some libraries work in this repository.


Development

After cloning this repository, run:

git submodule update --init --recursive

Configure your VSCode to automatically format a file on save, using forge fmt:

{
  "[solidity]": {
    "editor.formatOnSave": false
  },
  "emeraldwalk.runonsave": {
    "commands": [
      {
        "match": ".sol",
        "isAsync": true,
        "cmd": "forge fmt ${file}"
      }
    ]
  }
}

Testing

For testing, run:

forge test

Formal verification

To run the Certora prover, run (with a CERTORAKEY in your environment):

./certora/scripts/verifyAll.sh

External contributors

We thank the MEP team for their help on code optimization:


Acknowledgements

This repository is inspired by several sources: