cove-contracts-core
This repository contains the core smart contracts for the Cove Protocol.
The testing suite includes unit, integration, fork, and invariant tests.
For more detailed information, visit the documentation or the technical RFC.
[!IMPORTANT] You acknowledge that there are potential uses of the [Licensed Work] that could be deemed illegal or noncompliant under U.S. law. You agree that you will not use the [Licensed Work] for any activities that are or may reasonably be expected to be deemed illegal or noncompliant under U.S. law. You also agree that you, and not [Storm Labs], are responsible for any illegal or noncompliant uses of the [Licensed Work] that you facilitate, enable, engage in, support, promote, or are otherwise involved with.
Prerequisites
Ensure you have the following installed:
Installation
Setup pyenv and install the python dependencies:
pyenv install 3.9.17
pyenv virtualenv 3.9.17 cove-contracts-core
pyenv local cove-contracts-core
pip install -r requirements.txt
Install node and build dependencies:
# Install node dependencies
pnpm install
# Install submodules as soldeer dependencies
forge soldeer install
Usage
Build the contracts:
pnpm build
Run the tests:
pnpm test
Run slither static analysis
Install slither and run the tool:
pnpm slither
To run the upgradeability checks with
slither-check-upgradeability
:
pnpm slither-upgradeability
Run semgrep static analysis
Install semgrep and run the tool:
pnpm semgrep
Deploying contracts to live network
Local mainnet fork
# Run a fork network using anvil
anvil --rpc-url <fork_network_rpc_url>
Keep this terminal session going to keep the fork network alive.
Then in another terminal session:
# Deploy contracts to local fork network
pnpm localDeploy
- Deployments will be in
deployments/<chainId>-fork
. - Make sure not to commit
broadcast/
. - If trying to deploy a new contract, either use the default deployer functions or generate them with:
$ ./forge-deploy gen-deployer
.
Contract Architecture
Audits
Smart contract audits of the Cove Protocol are available here.