Skip to content

Commit 325d495

Browse files
committed
Merge branch 'develop' into phase-2
2 parents 70a720e + 1784309 commit 325d495

75 files changed

Lines changed: 1503 additions & 983 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ oz-upgrades:
293293
294294
CURR_DIR=$(pwd)
295295
TMP_DIR=$(mktemp -d)
296-
git clone --depth 1 --branch main https://github.com/lidofinance/community-staking-module "$TMP_DIR"
296+
git clone --depth 1 --branch main https://github.com/lidofinance/staking-modules "$TMP_DIR"
297297
298298
cd "$TMP_DIR"
299299
just deps

README.md

Lines changed: 29 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,59 @@
11
<p align="center">
2-
<img src="logo.png" width="240" alt="CSM Logo"/>
2+
<img src="logo.png" width="240" alt="Staking Modules Logo"/>
33
</p>
4-
<h1 align="center"> Lido Community Staking Module </h1>
4+
<h1 align="center">Lido Staking Modules</h1>
55

66
## Intro
77

8-
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.
8+
Smart contracts for the staking modules of the [Lido](https://lido.fi) protocol. Three modules ship from this repository and share a common code base:
99

10-
More on CSM in the [docs](https://docs.lido.fi/staking-modules/csm/intro).
10+
- **Community Staking Module (CSM)** — permissionless module for community stakers. See more in [CSM docs](https://docs.lido.fi/staking-modules/csm/intro).
11+
- **CSM 0x02** — CSM dedicated to validators with the `0x02` withdrawal credentials prefix.
12+
- **Curated Module v2 (CMv2)** — next iteration of Lido's curated module. Reuses CSM components to introduce bond-based security, flexible operator classification, improved incentive alignment, and lower governance friction compared to the legacy curated module.
1113

12-
## Contributing
14+
## Repository layout
1315

14-
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md).
16+
- `src/` — Solidity sources
17+
- `script/` — deploy and helper scripts
18+
- `test/`[Foundry](https://github.com/foundry-rs/foundry) tests
19+
- `artifacts/` — per-chain deployment artifacts (`mainnet/`, `hoodi/`, plus `latest/` and `local/` working dirs)
1520

1621
## Getting Started
1722

18-
- Install [Foundry tools](https://book.getfoundry.sh/getting-started/installation) (version 1.2.3, see `.foundryref`)
19-
20-
- Install [Just](https://github.com/casey/just) (version 1.24.0 or later)
21-
22-
- Install [jq](https://jqlang.org/download/) (version 1.6 or later)
23+
Prerequisites:
2324

24-
> Some Linux distributions (like Arch Linux) might require additional install of [netcat (nc)](https://en.wikipedia.org/wiki/Netcat). The preferred version is OpenBSD.
25+
- [Foundry](https://book.getfoundry.sh/getting-started/installation) — version pinned in `.foundryref`.
26+
- [Just](https://github.com/casey/just) 1.24.0 or later.
27+
- [Yarn](https://classic.yarnpkg.com/) — 4.1 or later.
28+
- [jq](https://jqlang.org/download/) 1.6 or later.
29+
- OpenBSD-flavored `nc` (netcat) on some Linux distributions (e.g. Arch) for local fork recipes.
2530

26-
- Install project dependencies
31+
Bootstrap
2732

2833
```bash
2934
just deps
3035
```
3136

32-
- Config environment variables
33-
34-
```bash
35-
cp .env.sample .env
36-
```
37-
38-
Fill vars in the `.env` file with your own values
39-
40-
- Build and test contracts
41-
42-
```bash
43-
just
44-
```
45-
46-
## Run tests
47-
48-
Run unit tests only
37+
Build and run unit tests
4938

5039
```bash
40+
just build
5141
just test-unit
5242
```
5343

54-
For the following tests, make sure that the following variables are set in the `.env` file:
55-
56-
```bash
57-
export CHAIN=hoodi
58-
export RPC_URL=<PUT_YOUR_URL_HERE>
59-
```
60-
61-
Deploy CSM to the fork and run `deployment` and `integration` tests over it
62-
63-
```bash
64-
just test-local
65-
```
66-
67-
Run all tests in one (`unit`, `deployment`, `integration`)
68-
69-
```bash
70-
just test-all
71-
```
72-
73-
## Make a gas report
74-
75-
It requires all unit tests to be green
76-
77-
```bash
78-
just gas-report
79-
```
80-
81-
## Add new dependencies
82-
83-
Dependencies are managed using yarn. To install new dependencies, run:
84-
85-
```bash
86-
yarn add <package-name>
87-
```
88-
89-
Whenever you install new libraries using yarn, make sure to update your
90-
`remappings.txt`.
91-
92-
## Advanced testing scenarios using local fork
93-
94-
Deploy contracts to the local fork
95-
96-
```bash
97-
just deploy-local
98-
```
99-
100-
Set up environment for the local fork
101-
Further test commands require the following environment variables to be set:
102-
103-
```bash
104-
export RPC_URL=http://127.0.0.1:8545
105-
export DEPLOY_CONFIG=./artifacts/local/deploy-hoodi.json
106-
# Optional: utility deployment config for `test-utils`
107-
export UTILS_DEPLOY_CONFIG=./artifacts/local/utils/TwoPhaseFrameConfigUpdate/deploy-hoodi.json
108-
```
44+
Run `just --list` to see all available recipes.
10945

110-
The result of deployment is `./artifacts/local/deploy-hoodi.json` deployment config, which is required for integration testing
46+
## Utility contracts
11147

112-
Verify deploy by running `deployment` tests.
113-
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
48+
The repository also ships a few utilities used for the modules:
11449

115-
```bash
116-
just test-deployment
117-
```
50+
- **`TwoPhaseFrameConfigUpdate`** — shifts the Oracle report window by reconfiguring the `HashConsensus` in a safe manner
51+
- **`OneShotCurveSetup`** — atomically adds a new bond curve and applies its parameter overrides
11852

119-
Integration tests should pass either before a vote, or after at any state of contracts
53+
## ICS Assessment
12054

121-
```bash
122-
just test-integration
123-
```
124-
125-
There also fork helper scripts to prepare a fork state for e.g. UI testing purposes,
126-
see [fork.just](./fork.just) to get all available commands
127-
128-
```bash
129-
just vote-upgrade
130-
```
131-
132-
After a vote, you can test the contracts in the new state. It includes both `integration` and `vote-upgrade` tests
133-
134-
```bash
135-
just test-post-upgrade
136-
```
55+
Python utilities for assessing Identified Community Stakers (ICS) eligibility across engagement, experience, and humanity categories live in [`ics_assessment/`](./ics_assessment/). Methodology and scoring are described in the [Research Forum post](https://research.lido.fi/t/community-staking-module/5917/141); see [`ics_assessment/README.md`](./ics_assessment/README.md) for usage.
13756

138-
Kill fork after testing
139-
140-
```bash
141-
just kill-fork
142-
```
143-
144-
## Deploy on a chain
145-
146-
The following commands are related to the deployment process:
147-
148-
- Dry run of deploy script to be sure it works as expected
149-
150-
```bash
151-
just deploy-live-dry
152-
```
153-
154-
- Broadcast transactions
155-
156-
> Note: pass `--legacy` arg in case of the following error: `Failed to get EIP-1559 fees`
157-
158-
```bash
159-
just deploy-live
160-
```
161-
162-
After that there should be artifacts in the `./artifacts/latest` directory,
163-
which is might be moved to the particular directory and committed
57+
## Contributing
16458

165-
```bash
166-
mv ./artifacts/latest ./artifacts/$CHAIN
167-
```
59+
See the [Contributing Guide](CONTRIBUTING.md) and repository conventions in `AGENTS.md`.

artifacts/hoodi/curated/deploy-hoodi.json

Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.

artifacts/hoodi/upgrade-v3-hoodi.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"Accounting": "0xA54b90BA34C5f326BC1485054080994e38FB4C60",
3-
"AccountingImpl": "0x3a18675fFB2C37A4296dD794A7Ed94644225F881",
3+
"AccountingImpl": "0x690c68287c6e759059d48519274B6920356647F0",
44
"CSModule": "0x79CEf36D84743222f37765204Bec41E92a93E59d",
5-
"CSModuleImpl": "0x161b1DAa658fD0D78a4603860edd8Ed06f98F4cA",
5+
"CSModuleImpl": "0xB48d144A1c7aB43FDb0ac7582C65728E94e1Df0c",
66
"ChainId": 560048,
77
"CircuitBreaker": "0x44a5789dFeDa59cD176Ab5709ec2F4829dE4d555",
88
"DeployParams": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000e2ef9536daaaebff5b1c130957ab3e80056b06d80000000000000000000000000534aa41907c9631fae990960bcc72d75fa7cfed00000000000000000000000079a20fd0fa36453b2f45eabab19bfef43575ba9e0000000000000000000000000534aa41907c9631fae990960bcc72d75fa7cfed000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000067d811180000000000000000000000000000000000000000000000000000000000000627000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000a800000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000161c0040000000000000000000000000000000000000000000000000096000000000028000000000000000000000000000000000000000000000000000000b60000001800000000000000000000000000000000000000000000000000260000000000280000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026ac0000000000000000000000000000000000000000000000000000000000000c200000000000000000000000000000000000000000000000000000000000000cc00000000000000000000000000000000000000000000000000000000000000d6000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000001e13380000000000000000000000000000000000000000000000000000000000049d4000000000000000000000000004af43ee34a6fcd1feca1e1f832124c763561da530000000000000000000000000534aa41907c9631fae990960bcc72d75fa7cfed636f6d6d756e6974792d6f6e636861696e2d76310000000000000000000000000000000000000000000000004af43ee34a6fcd1feca1e1f832124c763561da530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000000000000000000000000000016345785d8a0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000016ca00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000ffffffff000000000000000000000000000000000000000000000000039499a2100d00000000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000054600000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000004af43ee34a6fcd1feca1e1f832124c763561da530000000000000000000000004af43ee34a6fcd1feca1e1f832124c763561da5300000000000000000000000000000000000000000000000000000000000000026ddbc639b18ef7eee4e4262baf6e2bec58724b40b9e557df4bc78a0d9c2e06070000000000000000000000000000000000000000000000000000000000000d800000000000000000000000000000000000000000000000000000000000000de0000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000e800000000000000000000000000000000000000000000000000000000000000f20000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000002631116b55e0000000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000006978000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000deadbeef0000000000000000000000000000000000000000000000000000000000000fc00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000000006978000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000044a5789dfeda59cd176ab5709ec2f4829de4d5550000000000000000000000004af43ee34a6fcd1feca1e1f832124c763561da5300000000000000000000000005172cbcdb7307228f781436b327679e4dae166b0000000000000000000000004af43ee34a6fcd1feca1e1f832124c763561da53000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000f7ae520e99ed3c41180b5e12681d31aa7302e4e5000000000000000000000000948a62cc0414979dc7aa9364ba5b96ecb29f87360000000000000000000000001932f53b1457a5987791a40ba91f71c5efd5788f000000000000000000000000219743f1911d84b32599bdc2df21fc8dba6f81a2000000000000000000000000fe43a8b0b481ae9fb1862d31826532047d2d538c0000000000000000000000004c75fa734a39f3a21c57e583c1c29942f021c6b7000000000000000000000000d3b1e36a372ca250eeff61f90e833ca070559970000000000000000000000000ca80ee7313a315879f326105134f938676cfd7a900000000000000000000000099b2b75f490ffc9a29e4e1f5987be8e30e690adf00000000000000000000000043c45c2455c49eed320f463ff4f1ece3d2bf5ae200000000000000000000000044e3996629a9026bf95c4be3c1a38242d1e64a010000000000000000000000000f30c4cebe7f3057e81949b0ab1591fc256226b500000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000214e8348c4f000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000120a871cc00200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000014d1120d7b1600000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000120a871cc00200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003b6261666b72656963723336337a6c7935676a33676b706d616d7532717a63706576773674796c77633736376678693376666332736b6378616e666900000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000014d1120d7b1600000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000120a871cc00200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000097000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000016ca0000000000000000000000000000000000000000000000000000000000000007736f6d65436964000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000014d1120d7b160000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000016ca00000000000000000000000000000000000000000000000000000000000000410000000000000000000000000000000000000000000000000000000000000d06",
@@ -22,20 +22,20 @@
2222
"IdentifiedDVTClusterCurveSetup": "0x75CC99052fB05eEb4D9f80Ba94A5D077e3a721C1",
2323
"IdentifiedDVTClusterGate": "0x887F8512F9998045f4b5993e6eaa6BCfE5F02A94",
2424
"ValidatorStrikes": "0x8fBA385C3c334D251eE413e79d4D3890db98693c",
25-
"ValidatorStrikesImpl": "0x47F96DCD5cf3e94492CD050c00C9F6e33b3ca677",
25+
"ValidatorStrikesImpl": "0x55D2206a4f7e81c170D3f5b7aFbD46B9f75Bc54d",
2626
"Verifier": "0x1773b2Ff99A030F6000554Cb8A5Ec93145650cbA",
2727
"VerifierV3": "0xC96406b0eADdAC5708aFCa04DcCA67BAdC9642Fd",
2828
"VettedGate": "0x10a254E724fe2b7f305F76f3F116a3969c53845f",
2929
"VettedGateFactory": "0x8B11fdbA811aeE889F8A55FF58CC0Bf0BbA800e1",
3030
"VettedGateImpl": "0x5Dd9dDC953f2a4352D9C8C42B8D5E2bf535e602F",
3131
"AssetRecovererLib": "0x37aDa408AE3c3992953688e2CCb9eE7a3dfdA902",
32-
"WithdrawnValidatorLib": "0x067937EA5aA29784E6b26de566981B95Eadf5D8c",
33-
"TopUpQueueOps": "0x9B8a37e5fDD5b07ad0C11eE179179Cd26C3F812e",
34-
"StakeTracker": "0x61979De8742542C8F79A656F878bb3BfdA21093A",
35-
"NodeOperatorOps": "0x88e5DAFe5Aeafcb35612d9A3f8FF971ea89Ffd36",
36-
"NOAddresses": "0x8ABa1E4a05026599DF8A3233594F4153CDE5F6a4",
32+
"WithdrawnValidatorLib": "0x3bf9674f062aF9BA94FdAe9Fcdf2D0001FFf0a3A",
33+
"TopUpQueueOps": "0xdA104f5f2a18405fC7cCD6E0A7FEB5B824843606",
34+
"StakeTracker": "0xbb6E4Db18182d45038F91B9F1195291c206fd8d2",
35+
"NodeOperatorOps": "0xDD42EE5D54A1822021782F3F455bb99fBC19499A",
36+
"NOAddresses": "0x9D9c8799189c797f6e2dA74F71aDF84492adA7D3",
3737
"GeneralPenalty": "0xF05545ED71c60bBba6E73B6B70B15D4f5F22C0f4",
38-
"DepositQueueOps": "0x801d20af9f77C8A5030f70070AB4e81cAE0A0bcE",
39-
"BondCurvesLib": "0x7f691D625998b71A311eb2411A331CD05F675566",
40-
"git-ref": "a46846629616353a5a5c7ceef888c367de3a832f"
38+
"DepositQueueOps": "0xb430AA6C70A352c2aaC9813AE049A210dB11aB41",
39+
"BondCurvesLib": "0xC4511d09639e5E174506083443da230D39196323",
40+
"git-ref": "a6be775483e17d76718f8852428b5251a75c6429"
4141
}

0 commit comments

Comments
 (0)