Skip to content

Commit 4d28040

Browse files
committed
feat: deploy SR 1.5 upgrade to Sepolia
1 parent e2b5dfa commit 4d28040

File tree

2 files changed

+165
-8
lines changed

2 files changed

+165
-8
lines changed

deployed-sepolia.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"implementation": {
1616
"contract": "contracts/0.8.9/oracle/AccountingOracle.sol",
17-
"address": "0x082d16150BF75BB8F2197eEC1d293DbA96c93638",
17+
"address": "0x51675877eB673629e3D9d718eCB97A436808BBE1",
1818
"constructorArgs": [
1919
"0x8f6254332f69557A72b0DA2D5F0Bc07d4CA991E7",
2020
"0x3e3FE7dBc6B4C189E7128855dD526361c49b40Af",
@@ -145,7 +145,7 @@
145145
"app:node-operators-registry": {
146146
"implementation": {
147147
"contract": "contracts/0.4.24/nos/NodeOperatorsRegistry.sol",
148-
"address": "0xC3704E12c34D929e082257B793c8F114b7Bc7546",
148+
"address": "0xa603c624571417253AE8C910f66590C9aA92c0e1",
149149
"constructorArgs": []
150150
},
151151
"aragonApp": {
@@ -413,15 +413,15 @@
413413
},
414414
"implementation": {
415415
"contract": "contracts/0.8.9/LidoLocator.sol",
416-
"address": "0x604dc1776eEbe7ddCf4cf5429226Ad20a5a294eE",
416+
"address": "0x0443517a541cFf1527d2395D6F893Fc74239E791",
417417
"constructorArgs": [
418418
[
419419
"0xd497Be005638efCf09F6BFC8DAFBBB0BB72cD991",
420420
"0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5",
421421
"0x94B1B8e2680882f8652882e7F196169dE3d9a3B2",
422422
"0x3483c140EF7F2716460198Ff831a8e53F05F1606",
423423
"0x3e3FE7dBc6B4C189E7128855dD526361c49b40Af",
424-
"0xbac2A471443F18aC5C31078b96C5797A78fCc680",
424+
"0x69CBE6A06a450f2a2b8942b1091D53490b5A7A15",
425425
"0x3483c140EF7F2716460198Ff831a8e53F05F1606",
426426
"0x61Bb0Ef69262d5EF1cc2873cf61766751D99B699",
427427
"0x4F36aAEb18Ab56A4e380241bea6ebF215b9cb12c",
@@ -449,6 +449,11 @@
449449
},
450450
"lidoTemplateCreateStdAppReposTx": "0x2802c93e3a1ca061bfe2afadea564361368dad3f4c1f7bac0bacc24c6a890b23",
451451
"lidoTemplateNewDaoTx": "0x5ca036d147e01895921280bd89a4c3920a847b4cf66d5caa397a30e522a6c39f",
452+
"minFirstAllocationStrategy": {
453+
"contract": "contracts/common/lib/MinFirstAllocationStrategy.sol",
454+
"address": "0x8D1267FEbF6607b7427db8652F5095820F3C609E",
455+
"constructorArgs": []
456+
},
452457
"miniMeTokenFactory": {
453458
"address": "0x9D381f44d1fbdf8190fA0EcdC028e2Af24DdD3FE"
454459
},
@@ -489,14 +494,14 @@
489494
"maxPositiveTokenRebase": 5000000
490495
},
491496
"contract": "contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol",
492-
"address": "0xbac2A471443F18aC5C31078b96C5797A78fCc680",
497+
"address": "0x69CBE6A06a450f2a2b8942b1091D53490b5A7A15",
493498
"constructorArgs": [
494499
"0x8f6254332f69557A72b0DA2D5F0Bc07d4CA991E7",
495-
"0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5",
496-
[1500, 500, 1000, 250, 2000, 100, 100, 128, 5000000],
497-
[[], [], [], [], [], [], [], [], [], []]
500+
"0x32A0E5828B62AAb932362a4816ae03b860b65e83",
501+
[1500, 0, 1000, 250, 2000, 100, 100, 128, 5000000, 1000, 101, 74]
498502
]
499503
},
504+
"scratchDeployGasUsed": "143759466",
500505
"sepoliaDepositAdapter": {
501506
"implementation": {
502507
"contract": "contracts/0.8.9/SepoliaDepositAdapter.sol",
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
// Deploy StakingRouter 1.5 to Sepolia
2+
3+
import { assert } from "chai";
4+
import { ethers, run } from "hardhat";
5+
6+
import { deployContract, deployImplementation, deployWithoutProxy, log, readNetworkState, Sk } from "lib";
7+
8+
function sleep(ms: number): Promise<void> {
9+
return new Promise((resolve) => setTimeout(resolve, ms));
10+
}
11+
12+
export async function main(): Promise<void> {
13+
const deployer = (await ethers.provider.getSigner()).address;
14+
assert.equal(process.env.DEPLOYER, deployer);
15+
16+
const state = readNetworkState();
17+
18+
const DEPOSIT_CONTRACT_ADDRESS = state[Sk.chainSpec].depositContract;
19+
const APP_AGENT_ADDRESS = state[Sk.appAgent].proxy.address;
20+
const DEPOSIT_SECURITY_MODULE = state[Sk.deployer];
21+
const SC_ADMIN = APP_AGENT_ADDRESS;
22+
const LIDO = state[Sk.appLido].proxy.address;
23+
const STAKING_ROUTER = state[Sk.stakingRouter].proxy.address;
24+
const LOCATOR = state[Sk.lidoLocator].proxy.address;
25+
const LEGACY_ORACLE = state[Sk.appOracle].proxy.address;
26+
const ACCOUNTING_ORACLE_PROXY = state[Sk.accountingOracle].proxy.address;
27+
const EL_REWARDS_VAULT = state[Sk.executionLayerRewardsVault].address;
28+
const BURNER = state[Sk.burner].address;
29+
const TREASURY_ADDRESS = APP_AGENT_ADDRESS;
30+
const VEBO = state[Sk.validatorsExitBusOracle].proxy.address;
31+
const WQ = state[Sk.withdrawalQueueERC721].proxy.address;
32+
const WITHDRAWAL_VAULT = state[Sk.withdrawalVault].proxy.address;
33+
const ORACLE_DAEMON_CONFIG = state[Sk.oracleDaemonConfig].address;
34+
35+
// Deploy MinFirstAllocationStrategy
36+
const minFirstAllocationStrategyAddress = (
37+
await deployWithoutProxy(Sk.minFirstAllocationStrategy, "MinFirstAllocationStrategy", deployer)
38+
).address;
39+
40+
log(`MinFirstAllocationStrategy address: ${minFirstAllocationStrategyAddress}`);
41+
const libraries = {
42+
MinFirstAllocationStrategy: minFirstAllocationStrategyAddress,
43+
};
44+
45+
log(`Deploying StakingRouter`, DEPOSIT_CONTRACT_ADDRESS);
46+
const stakingRouter = await deployContract("StakingRouter", [DEPOSIT_CONTRACT_ADDRESS], deployer, true, {
47+
libraries,
48+
});
49+
50+
console.log(`StakingRouter deployed to ${stakingRouter.address}`);
51+
52+
const appNodeOperatorsRegistry = (
53+
await deployImplementation(Sk.appNodeOperatorsRegistry, "NodeOperatorsRegistry", deployer, [], { libraries })
54+
).address;
55+
56+
log(`NodeOperatorsRegistry address implementation: ${appNodeOperatorsRegistry}`);
57+
58+
const SECONDS_PER_SLOT = 12;
59+
const GENESIS_TIME = 1655733600;
60+
61+
const accountingOracleArgs = [LOCATOR, LIDO, LEGACY_ORACLE, SECONDS_PER_SLOT, GENESIS_TIME];
62+
63+
const accountingOracleAddress = (
64+
await deployImplementation(Sk.accountingOracle, "AccountingOracle", deployer, accountingOracleArgs)
65+
).address;
66+
67+
log(`AO implementation address: ${accountingOracleAddress}`);
68+
69+
const LIMITS = [1500, 0, 1000, 250, 2000, 100, 100, 128, 5000000, 1000, 101, 74];
70+
71+
const oracleReportSanityCheckerArgs = [LOCATOR, SC_ADMIN, LIMITS];
72+
73+
const oracleReportSanityCheckerAddress = (
74+
await deployWithoutProxy(
75+
Sk.oracleReportSanityChecker,
76+
"OracleReportSanityChecker",
77+
deployer,
78+
oracleReportSanityCheckerArgs,
79+
)
80+
).address;
81+
82+
log(`OracleReportSanityChecker new address ${oracleReportSanityCheckerAddress}`);
83+
84+
const locatorConfig = [
85+
[
86+
ACCOUNTING_ORACLE_PROXY,
87+
DEPOSIT_SECURITY_MODULE,
88+
EL_REWARDS_VAULT,
89+
LEGACY_ORACLE,
90+
LIDO,
91+
oracleReportSanityCheckerAddress,
92+
LEGACY_ORACLE,
93+
BURNER,
94+
STAKING_ROUTER,
95+
TREASURY_ADDRESS,
96+
VEBO,
97+
WQ,
98+
WITHDRAWAL_VAULT,
99+
ORACLE_DAEMON_CONFIG,
100+
],
101+
];
102+
103+
const locatorAddress = (await deployImplementation(Sk.lidoLocator, "LidoLocator", deployer, locatorConfig)).address;
104+
105+
log(`Locator implementation address ${locatorAddress}`);
106+
107+
log("sleep before starting verification of contracts...");
108+
await sleep(10_000);
109+
log("start verification of contracts...");
110+
111+
await run("verify:verify", {
112+
address: minFirstAllocationStrategyAddress,
113+
constructorArguments: [],
114+
contract: "contracts/common/lib/MinFirstAllocationStrategy.sol:MinFirstAllocationStrategy",
115+
});
116+
117+
await run("verify:verify", {
118+
address: stakingRouter.address,
119+
constructorArguments: [DEPOSIT_CONTRACT_ADDRESS],
120+
libraries: {
121+
MinFirstAllocationStrategy: minFirstAllocationStrategyAddress,
122+
},
123+
contract: "contracts/0.8.9/StakingRouter.sol:StakingRouter",
124+
});
125+
126+
await run("verify:verify", {
127+
address: appNodeOperatorsRegistry,
128+
constructorArguments: [],
129+
libraries: {
130+
MinFirstAllocationStrategy: minFirstAllocationStrategyAddress,
131+
},
132+
contract: "contracts/0.4.24/nos/NodeOperatorsRegistry.sol:NodeOperatorsRegistry",
133+
});
134+
135+
await run("verify:verify", {
136+
address: accountingOracleAddress,
137+
constructorArguments: accountingOracleArgs,
138+
contract: "contracts/0.8.9/oracle/AccountingOracle.sol:AccountingOracle",
139+
});
140+
141+
await run("verify:verify", {
142+
address: oracleReportSanityCheckerAddress,
143+
constructorArguments: oracleReportSanityCheckerArgs,
144+
contract: "contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol:OracleReportSanityChecker",
145+
});
146+
147+
await run("verify:verify", {
148+
address: locatorAddress,
149+
constructorArguments: locatorConfig,
150+
contract: "contracts/0.8.9/LidoLocator.sol:LidoLocator",
151+
});
152+
}

0 commit comments

Comments
 (0)