Skip to content

Commit bc96c90

Browse files
committed
split out lido withdrawal strategy
1 parent 9e02eb1 commit bc96c90

File tree

2 files changed

+80
-54
lines changed

2 files changed

+80
-54
lines changed

contracts/deploy/mainnet/097_native_ssv_staking.js

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -148,44 +148,6 @@ module.exports = deploymentWithGovernanceProposal(
148148
// 10. Safe approve SSV token spending
149149
await cNativeStakingStrategy.connect(sDeployer).safeApproveAllTokens();
150150

151-
// 7. Deploy the Lido Withdrawal Strategy
152-
const dWithdrawalStrategyStrategyProxy = await deployWithConfirmation(
153-
"LidoWithdrawalStrategyProxy"
154-
);
155-
const cWithdrawalStrategyStrategyProxy = await ethers.getContractAt(
156-
"LidoWithdrawalStrategyProxy",
157-
dWithdrawalStrategyStrategyProxy.address
158-
);
159-
const dWithdrawalStrategyImpl = await deployWithConfirmation(
160-
"LidoWithdrawalStrategy",
161-
[
162-
[addresses.zero, cVaultProxy.address], //_baseConfig
163-
]
164-
);
165-
const cWithdrawalStrategyImpl = await ethers.getContractAt(
166-
"LidoWithdrawalStrategy",
167-
dWithdrawalStrategyImpl.address
168-
);
169-
170-
// 8. Init the Lido Withdrawal strategy proxy to point at the implementation, set the governor, and call initialize
171-
const withdrawalInitData =
172-
cWithdrawalStrategyImpl.interface.encodeFunctionData(
173-
"initialize(address[],address[],address[])",
174-
[
175-
[], // reward token addresses
176-
[], // asset token addresses
177-
[], // platform tokens addresses
178-
]
179-
);
180-
await withConfirmation(
181-
cWithdrawalStrategyStrategyProxy.connect(sDeployer)[proxyInitFunction](
182-
cWithdrawalStrategyImpl.address,
183-
addresses.mainnet.Timelock, // governance
184-
withdrawalInitData, // data for call to the initialize function on the strategy
185-
await getTxOpts()
186-
)
187-
);
188-
189151
// 11. Deploy Harvester
190152
const cOETHHarvesterProxy = await ethers.getContract("OETHHarvesterProxy");
191153
await deployWithConfirmation("OETHHarvester", [
@@ -204,14 +166,6 @@ module.exports = deploymentWithGovernanceProposal(
204166
);
205167
console.log("Fee accumulator proxy: ", cFeeAccumulatorProxy.address);
206168
console.log("Fee accumulator implementation: ", cFeeAccumulator.address);
207-
console.log(
208-
"Lido withdrawal strategy proxy: ",
209-
cWithdrawalStrategyStrategyProxy.address
210-
);
211-
console.log(
212-
"Lido withdrawal strategy implementation: ",
213-
cWithdrawalStrategyImpl.address
214-
);
215169
console.log(
216170
"New OETHHarvester implementation: ",
217171
dOETHHarvesterImpl.address
@@ -224,8 +178,6 @@ module.exports = deploymentWithGovernanceProposal(
224178
225179
This is going to become the main strategy to power the reward accrual of OETH by staking ETH in SSV validators.
226180
227-
Deployed a new strategy to convert stETH to WETH at 1:1 using the Lido withdrawal queue.
228-
229181
Upgraded the Harvester so ETH rewards can be sent straight to the Dripper as WETH.`,
230182
actions: [
231183
// 1. Add new strategy to vault
@@ -282,12 +234,6 @@ Upgraded the Harvester so ETH rewards can be sent straight to the Dripper as WET
282234
signature: "upgradeTo(address)",
283235
args: [dOETHHarvesterImpl.address],
284236
},
285-
// 9. Add new Lido Withdrawal Strategy to vault
286-
{
287-
contract: cVaultAdmin,
288-
signature: "approveStrategy(address)",
289-
args: [cWithdrawalStrategyStrategyProxy.address],
290-
},
291237
],
292238
};
293239
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
const { deploymentWithGovernanceProposal } = require("../../utils/deploy");
2+
const addresses = require("../../utils/addresses");
3+
4+
module.exports = deploymentWithGovernanceProposal(
5+
{
6+
deployName: "098_lido_withdrawal_strategy",
7+
forceDeploy: false,
8+
//forceSkip: true,
9+
reduceQueueTime: true,
10+
deployerIsProposer: false,
11+
// proposalId:
12+
},
13+
async ({ deployWithConfirmation, ethers, getTxOpts, withConfirmation }) => {
14+
const { deployerAddr } = await getNamedAccounts();
15+
const sDeployer = await ethers.provider.getSigner(deployerAddr);
16+
17+
// Current contracts
18+
const cVaultProxy = await ethers.getContract("OETHVaultProxy");
19+
const cVaultAdmin = await ethers.getContractAt(
20+
"OETHVaultAdmin",
21+
cVaultProxy.address
22+
);
23+
24+
// Deployer Actions
25+
// ----------------
26+
27+
// 1. Deploy the Lido Withdrawal Strategy
28+
const dWithdrawalStrategyStrategyProxy = await deployWithConfirmation(
29+
"LidoWithdrawalStrategyProxy"
30+
);
31+
const cWithdrawalStrategyStrategyProxy = await ethers.getContractAt(
32+
"LidoWithdrawalStrategyProxy",
33+
dWithdrawalStrategyStrategyProxy.address
34+
);
35+
const dWithdrawalStrategyImpl = await deployWithConfirmation(
36+
"LidoWithdrawalStrategy",
37+
[
38+
[addresses.zero, cVaultProxy.address], //_baseConfig
39+
]
40+
);
41+
const cWithdrawalStrategyImpl = await ethers.getContractAt(
42+
"LidoWithdrawalStrategy",
43+
dWithdrawalStrategyImpl.address
44+
);
45+
46+
// 2. Init the Lido Withdrawal strategy proxy to point at the implementation, set the governor, and call initialize
47+
const withdrawalInitData =
48+
cWithdrawalStrategyImpl.interface.encodeFunctionData(
49+
"initialize(address[],address[],address[])",
50+
[
51+
[], // reward token addresses
52+
[], // asset token addresses
53+
[], // platform tokens addresses
54+
]
55+
);
56+
const proxyInitFunction = "initialize(address,address,bytes)";
57+
await withConfirmation(
58+
cWithdrawalStrategyStrategyProxy.connect(sDeployer)[proxyInitFunction](
59+
cWithdrawalStrategyImpl.address,
60+
addresses.mainnet.Timelock, // governance
61+
withdrawalInitData, // data for call to the initialize function on the strategy
62+
await getTxOpts()
63+
)
64+
);
65+
66+
// Governance Actions
67+
// ----------------
68+
return {
69+
name: `Deployed a new strategy to convert stETH to WETH at 1:1 using the Lido withdrawal queue.`,
70+
actions: [
71+
// 1. Add new Lido Withdrawal Strategy to vault
72+
{
73+
contract: cVaultAdmin,
74+
signature: "approveStrategy(address)",
75+
args: [cWithdrawalStrategyStrategyProxy.address],
76+
},
77+
],
78+
};
79+
}
80+
);

0 commit comments

Comments
 (0)