-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mainnet native staking fork tests #2037
Merged
naddison36
merged 36 commits into
sparrowDom/nativeStaking
from
nicka/native-staking-fork-tests
May 7, 2024
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
9a6fcfb
manuallyFixAccounting now uses delta values and only callable by the …
naddison36 389a260
Added pauseOnFail param to internal _doAccounting
naddison36 c12f770
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 a332c98
ran prettier
naddison36 e8201dc
Added Defender Relayer for validator registrator
naddison36 76c703f
Removed now redundant IWETH9 import
naddison36 f91e078
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 51e1748
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 8bf8f7d
moved more logic into native staking fixture
naddison36 86e7d29
Removed unused imports
naddison36 ba3fe44
fix native staking unit tests
naddison36 1ed5a17
Fail accounting if activeDepositedValidators < fullyWithdrawnValidators
naddison36 fe85d60
Updated the OETH value flows
naddison36 5333508
Added governable Hardhat tasks
naddison36 97c0cc7
deconstruct params for Hardhat tasks
naddison36 1498267
WIP Hardhat tasks for validator registration
naddison36 0ece8b9
Added depositSSV HH task
naddison36 ce11531
Updated OETH contract dependency diagram
naddison36 146465b
Update to diagrams
naddison36 aee4382
mini fixes
sparrowDom 274fbed
fix bug and minor test improvement
sparrowDom 91894c2
update yarn fulie
sparrowDom b5b2f56
unify the holesky and the mainnet fork tests
sparrowDom 0249e53
prettier
sparrowDom 9f6bbf2
re-deploy holesky native staking strategy (#2046)
sparrowDom f89f245
test updates
sparrowDom 22a31d7
also re-deploy the harvester
sparrowDom 476947f
upgrade harvester as well
sparrowDom 75b267a
fix test
sparrowDom d12957a
fix upgrade script and correct the bug in deploy actions
sparrowDom 97f1fcd
Merge branch 'sparrowDom/nativeStaking' into nicka/native-staking-for…
sparrowDom b99edec
Merge branch 'sparrowDom/nativeStaking' into nicka/native-staking-for…
sparrowDom 2969a4f
Deployed new Native Staking strategy including the proxy
naddison36 2632e40
Added Hardhat tasks for generic strategy functions
naddison36 ed3d232
Merge remote-tracking branch 'origin/nicka/native-staking-fork-tests'…
naddison36 eeed0c8
remove nativeStakingSSVStrategyProxy from js addresses file
naddison36 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const { | ||
upgradeNativeStakingSSVStrategy, | ||
upgradeOETHHarvester, | ||
} = require("../deployActions"); | ||
const { withConfirmation } = require("../../utils/deploy"); | ||
|
||
const mainExport = async () => { | ||
console.log("Running 004 deployment on Holesky..."); | ||
|
||
console.log("Upgrading native staking strategy"); | ||
await upgradeNativeStakingSSVStrategy(); | ||
|
||
console.log("deploying harvester"); | ||
const cOETHDripperProxy = await ethers.getContract("OETHDripperProxy"); | ||
const cOETHHarvester = await upgradeOETHHarvester(cOETHDripperProxy.address); | ||
|
||
const strategyProxy = await ethers.getContract( | ||
"NativeStakingSSVStrategyProxy" | ||
); | ||
const cStrategy = await ethers.getContractAt( | ||
"NativeStakingSSVStrategy", | ||
strategyProxy.address | ||
); | ||
|
||
console.log("configuring harvester and the strategy"); | ||
await withConfirmation( | ||
cOETHHarvester.setSupportedStrategy(strategyProxy.address, true) | ||
); | ||
|
||
await withConfirmation(cStrategy.setHarvesterAddress(cOETHHarvester.address)); | ||
|
||
console.log("Running 004 deployment done"); | ||
return true; | ||
}; | ||
|
||
mainExport.id = "004_upgrade_strategy"; | ||
mainExport.tags = []; | ||
mainExport.dependencies = []; | ||
mainExport.skip = () => false; | ||
|
||
module.exports = mainExport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const { parseEther } = require("ethers/lib/utils"); | ||
|
||
const { deployNativeStakingSSVStrategy } = require("../deployActions"); | ||
const { withConfirmation } = require("../../utils/deploy"); | ||
const { resolveContract } = require("../../utils/resolvers"); | ||
|
||
const mainExport = async () => { | ||
console.log("Running 005 deployment on Holesky..."); | ||
|
||
console.log("Deploying a new Native Staking strategy and proxy"); | ||
|
||
console.log("Deploying Native Staking"); | ||
const nativeStakingSSVStrategy = await deployNativeStakingSSVStrategy(); | ||
|
||
const { governorAddr } = await getNamedAccounts(); | ||
const sGovernor = await ethers.provider.getSigner(governorAddr); | ||
|
||
const cOETHHarvester = await resolveContract( | ||
"OETHHarvesterProxy", | ||
"OETHHarvester" | ||
); | ||
const cVault = await resolveContract("OETHVaultProxy", "VaultAdmin"); | ||
|
||
await withConfirmation( | ||
nativeStakingSSVStrategy | ||
.connect(sGovernor) | ||
.setHarvesterAddress(cOETHHarvester.address) | ||
); | ||
|
||
console.log("configuring harvester and the strategy"); | ||
await withConfirmation( | ||
cOETHHarvester | ||
.connect(sGovernor) | ||
.setSupportedStrategy(nativeStakingSSVStrategy.address, true) | ||
); | ||
|
||
await withConfirmation( | ||
cVault.connect(sGovernor).approveStrategy(nativeStakingSSVStrategy.address) | ||
); | ||
|
||
await withConfirmation( | ||
nativeStakingSSVStrategy.connect(sGovernor).setRegistrator(governorAddr) | ||
); | ||
|
||
const fuseStartBn = parseEther("21.6"); | ||
const fuseEndBn = parseEther("25.6"); | ||
|
||
await nativeStakingSSVStrategy | ||
.connect(sGovernor) | ||
.setFuseInterval(fuseStartBn, fuseEndBn); | ||
|
||
console.log("Running 005 deployment done"); | ||
return true; | ||
}; | ||
|
||
mainExport.id = "005_deploy_new_harvester"; | ||
mainExport.tags = []; | ||
mainExport.dependencies = []; | ||
mainExport.skip = () => false; | ||
|
||
module.exports = mainExport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,11 +114,23 @@ module.exports = deploymentWithGovernanceProposal( | |
// 7. Safe approve SSV token spending | ||
await cStrategy.connect(sDeployer).safeApproveAllTokens(); | ||
|
||
// 8. Deploy Harvester | ||
const cOETHHarvesterProxy = await ethers.getContract("OETHHarvesterProxy"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for catching this |
||
await deployWithConfirmation("OETHHarvester", [ | ||
cVaultProxy.address, | ||
addresses.mainnet.WETH, | ||
]); | ||
const dOETHHarvesterImpl = await ethers.getContract("OETHHarvester"); | ||
|
||
console.log( | ||
"Native Staking SSV Strategy address: ", | ||
cStrategyProxy.address | ||
); | ||
console.log("Fee accumulator address: ", cFeeAccumulator.address); | ||
console.log( | ||
"New OETHHarvester implementation address: ", | ||
dOETHHarvesterImpl.address | ||
); | ||
|
||
// Governance Actions | ||
// ---------------- | ||
|
@@ -152,6 +164,18 @@ module.exports = deploymentWithGovernanceProposal( | |
ethers.utils.parseEther("25.6"), | ||
], | ||
}, | ||
// 5. set validator registrator | ||
{ | ||
contract: cStrategy, | ||
signature: "setRegistrator(address)", | ||
args: [addresses.mainnet.validatorRegistrator], | ||
}, | ||
// 6. Upgrade the OETH Harvester | ||
{ | ||
contract: cOETHHarvesterProxy, | ||
signature: "upgradeTo(address)", | ||
args: [dOETHHarvesterImpl.address], | ||
}, | ||
], | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"001_core": 1714168010, | ||
"002_upgrade_strategy": 1714233842, | ||
"003_deposit_to_native_strategy": 1714307581 | ||
"003_deposit_to_native_strategy": 1714307581, | ||
"004_upgrade_strategy": 1714944723, | ||
"005_deploy_new_harvester": 1714998707 | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice cleanup