cove-contracts-boosties

cove

codecov CI Discord X (formerly Twitter) Follow

This repository contains the core smart contracts for the Cove Protocol. It includes Boosties (a liquid locker and staking platform for Yearn), a governance token, and auxiliary contracts.

The testing suite includes unit, integration, fork, and invariant tests.

For more detailed information, visit the documentation.

[!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

Install rust using rustup:

rustup update

Setup pyenv and install the python dependencies:

pyenv install 3.9.17
pyenv virtualenv 3.9.17 cove-contracts-boosties
pyenv local cove-contracts-boosties
pip install -r requirements.txt

Install the forge libraries as submodules:

forge install

Install node and build dependencies:

pnpm install

Usage

Build forge-deploy if not already built:

pnpm forge-deploy:build

Build the contracts:

pnpm build

Run the tests:

pnpm test

Run invariant tests (echidna)

Install echidna and run the test for each Echidna test contract:

Echidna may fail if the contracts are not built cleanly. If you encounter issues, try running pnpm clean && pnpm build before running the tests.

pnpm invariant-test ERC20RewardsGauge_EchidnaTest

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 a live network

DEPLOYER_ADDRESS in the .env file will be used as sender for the script. Ensure this is defined before deploying.

Local mainnet fork

Fork mainnet on the local network using anvil with the provided script:

pnpm fork:mainnet

Keep this terminal session going to keep the fork network alive.

Then in another terminal session, deploy the contracts to the local network:

pnpm deploy:local
  • Deployments will be in deployments/<chainId>-fork.
  • Make sure to not commit broadcast/.
  • If trying to deploy new contract either use the default deployer functions or generate them with$./forge-deploy gen-deployer.

Mainnet

First ensure the .env file is set up with the correct addresses for the mainnet deployment.

Add the deployer account to the cast wallet management:

cast wallet import deployer --interactive

This will prompt you to enter the private key and the password for the deployer account. Then deploy the contracts to the mainnet:

pnpm deploy:prod
  • Deployments will be in deployments/<chainId>.
  • Ensure DEPLOYER_ADDRESS is set to the same public address as the deployer wallet account.

Once the script finishes running, commit the new deployments to the repository.

Contract Architecture

Boosties

boosties

Audits

Smart contract audits of the Cove Protocol are available here.