Lido Community Staking Module (CSM) is a permissionless module allowing community stakers to operate Ethereum validators with lower entry costs. Stakers provide stETH bonds, serving as security collateral, and receive rewards in the form of bond rebase and staking rewards (including execution layer rewards), which are socialized across Lido’s staking modules.
More on CSM in the docs.
We welcome contributions! Please see our Contributing Guide.
- 
Install Foundry tools (version 1.2.3, see
.foundryref) - 
Install Just (version 1.24.0 or later)
 - 
Install jq (version 1.6 or later)
 
Some Linux distributions (like Arch Linux) might require additional install of netcat (nc). The preferred version is OpenBSD.
- Install project dependencies
 
just deps- Config environment variables
 
cp .env.sample .envFill vars in the .env file with your own values
- Build and test contracts
 
justRun unit tests only
just test-unitFor the following tests, make sure that the following variables are set in the .env file:
export CHAIN=holesky
export RPC_URL=<PUT_YOUR_URL_HERE>Deploy CSM to the fork and run deployment and integration tests over it
just test-localRun all tests in one (unit, deployment, integration)
just test-allIt requires all unit tests to be green
just gas-reportDependencies are managed using yarn. To install new dependencies, run:
yarn add <package-name>Whenever you install new libraries using yarn, make sure to update your
remappings.txt.
Deploy contracts to the local fork
just deploy-localSet up environment for the local fork Further test commands require the following environment variables to be set:
export RPC_URL=http://127.0.0.1:8545
export DEPLOY_CONFIG=./artifacts/local/deploy-holesky.jsonThe result of deployment is ./artifacts/local/deploy-holesky.json deployment config, which is required for integration testing
Verify deploy by running deployment tests.
Note that these are meant to be run only right after deployment, so they don't supposed to be green after any actions in the contracts
just test-deploymentIntegration tests should pass either before a vote, or after at any state of contracts
just test-integrationThere also fork helper scripts to prepare a fork state for e.g. UI testing purposes, see fork.just to get all available commands
just vote-upgradeAfter a vote, you can test the contracts in the new state. It includes both integration and vote-upgrade tests
just test-post-upgradeKill fork after testing
just kill-forkThe following commands are related to the deployment process:
- Dry run of deploy script to be sure it works as expected
 
just deploy-live-dry- Broadcast transactions
 
Note: pass
--legacyarg in case of the following error:Failed to get EIP-1559 fees
just deploy-liveAfter that there should be artifacts in the ./artifacts/latest directory,
which is might be moved to the particular directory and committed
mv ./artifacts/latest ./artifacts/$CHAIN