Skip to content

Commit d5df02b

Browse files
authored
Merge pull request #220 from yieldnest/feat/slashing-ynETH
Feat/slashing yn eth
2 parents a2c6451 + ede6823 commit d5df02b

38 files changed

+1883
-634
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
commit = 1edc2ae004974ebf053f4eba26b45469937b9381
1717
[submodule "lib/eigenlayer-contracts"]
1818
path = lib/eigenlayer-contracts
19-
url = https://github.com/yieldnest/eigenlayer-contracts
20-
branch = v1.1.1-v4.9.0
19+
url = https://github.com/yieldnest/eigenlayer-contracts.git
20+
branch = v1.3.0-v4.9.0

deployments/ynETH-17000.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
"STAKING_NODES_OPERATOR": "0x9Dd8F69b62ddFd990241530F47dcEd0Dad7f7d39",
1212
"STAKING_NODE_CREATOR": "0x9Dd8F69b62ddFd990241530F47dcEd0Dad7f7d39",
1313
"VALIDATOR_MANAGER": "0x9Dd8F69b62ddFd990241530F47dcEd0Dad7f7d39",
14-
"implementation-stakingNodesManager": "0xC9cf6740282617f3B392f900De0449E687Ce05e3",
14+
"implementation-stakingNodesManager": "0x99a108a79419c62F2Ff384cE2441b435b918a252",
1515
"implementation-ynETH": "0x090D67d3C97712f6C17a037515CbB8502561EE57",
1616
"implementation-executionLayerReceiver": "0x1fbedf3773418f20b9dfeafcd9d263030eb0e42f",
1717
"implementation-consensusLayerReceiver": "0xe7acc0533c650ad0cc11f57f81c38fa19634b1d7",
1818
"implementation-rewardsDistributor": "0xb6ec4d9f71e437c672147c576f1c70ba5da8d159",
19-
"implementation-withdrawalsProcessor": "0x36a38AA91947DbE6539e19512E6FF26576015Bb2",
19+
"implementation-withdrawalsProcessor": "0xAbE3b5bF154d6441C63Dc34691E4F51Dbfac3bB0",
2020
"implementation-withdrawalQueueManager": "0x28732d8061D35B77dC2997926e0449dAdc3Ef3DD",
2121
"implementation-ynETHRedemptionAssetsVault": "0x7eBE6EAC9AD9B5e4D637c8f05191b273b009461a",
2222
"implementation-ynViewer": "0xBf1035e71E4a770a08462B20C95dE14763E1D186",
@@ -38,5 +38,5 @@
3838
"proxyAdmin-withdrawalQueueManager": "0x26425968beb4bD9c09b02C433996Cd05B1Fd4f07",
3939
"proxyAdmin-ynETHRedemptionAssetsVault": "0xd4d8E80d1c959CdC4601Cc6A0cc1EC18aBeB1888",
4040
"proxyAdmin-ynViewer": "0x3ffa0c3fba4adfe2b6e4d7e2f8e6e6324be5305b",
41-
"stakingNodeImplementation": "0xf07861349Ed0cB4603590B47D2269768Ed6E2821"
41+
"stakingNodeImplementation": "0xdd8e2B6B4D71E0E1b077dFcaea3Ca85fF31803a6"
4242
}

lib/eigenlayer-contracts

lib/openzeppelin-contracts

script/ContractAddresses.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ contract ContractAddresses {
3535
address STRATEGY_MANAGER_ADDRESS;
3636
address STRATEGY_MANAGER_PAUSER_ADDRESS;
3737
address REWARDS_COORDINATOR_ADDRESS;
38+
address ALLOCATION_MANAGER_ADDRESS;
3839
}
3940

4041
struct LSDAddresses {
@@ -97,7 +98,8 @@ contract ContractAddresses {
9798
DELEGATION_PAUSER_ADDRESS: 0x369e6F597e22EaB55fFb173C6d9cD234BD699111, // TODO: remove this if unused
9899
STRATEGY_MANAGER_ADDRESS: 0x858646372CC42E1A627fcE94aa7A7033e7CF075A,
99100
STRATEGY_MANAGER_PAUSER_ADDRESS: 0xBE1685C81aA44FF9FB319dD389addd9374383e90,
100-
REWARDS_COORDINATOR_ADDRESS: 0x7750d328b314EfFa365A0402CcfD489B80B0adda
101+
REWARDS_COORDINATOR_ADDRESS: 0x7750d328b314EfFa365A0402CcfD489B80B0adda,
102+
ALLOCATION_MANAGER_ADDRESS: 0x0000000000000000000000000000000000000000 // TODO: Update this with correct address after mainnet deployment
101103
}),
102104
lsd: LSDAddresses({
103105
SFRXETH_ADDRESS: 0xac3E018457B222d93114458476f3E3416Abbe38F,
@@ -158,7 +160,8 @@ contract ContractAddresses {
158160
DELEGATION_PAUSER_ADDRESS: 0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348, // Placeholder address, replaced with address(1) for holesky
159161
STRATEGY_MANAGER_ADDRESS: 0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6, // Placeholder address, replaced with address(1) for holesky
160162
STRATEGY_MANAGER_PAUSER_ADDRESS: 0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348,
161-
REWARDS_COORDINATOR_ADDRESS: 0xAcc1fb458a1317E886dB376Fc8141540537E68fE
163+
REWARDS_COORDINATOR_ADDRESS: 0xAcc1fb458a1317E886dB376Fc8141540537E68fE,
164+
ALLOCATION_MANAGER_ADDRESS: 0x78469728304326CBc65f8f95FA756B0B73164462
162165
}),
163166
lsd: LSDAddresses({
164167
SFRXETH_ADDRESS: 0xa63f56985F9C7F3bc9fFc5685535649e0C1a55f3,

script/delegation/DelegateTransactionDataBuilder.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {PooledDepositsVault} from "src/PooledDepositsVault.sol"; // Renamed from
99
import {ActorAddresses} from "script/Actors.sol";
1010
import {console} from "lib/forge-std/src/console.sol";
1111
import {IStakingNode} from "src/interfaces/IStakingNode.sol";
12-
import {ISignatureUtils} from "lib/eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol";
12+
import {ISignatureUtilsMixinTypes} from "lib/eigenlayer-contracts/src/contracts/interfaces/ISignatureUtilsMixin.sol";
1313
import {IStakingNodesManager} from "src/interfaces/IStakingNodesManager.sol";
1414
import {ContractAddresses} from "script/ContractAddresses.sol";
1515

@@ -52,7 +52,7 @@ contract DelegateTransactionBuilder is BaseScript {
5252
bytes memory delegateTxData = abi.encodeWithSelector(
5353
IStakingNode.delegate.selector,
5454
currentOperator,
55-
ISignatureUtils.SignatureWithExpiry({signature: "", expiry: 0}),
55+
ISignatureUtilsMixinTypes.SignatureWithExpiry({signature: "", expiry: 0}),
5656
bytes32(0)
5757
);
5858
console.log("Node address:", stakingNodes[i]);

script/ynETH/DeployStakingNode.s.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ contract DeployStakingNode is BaseYnETHScript {
3333
// Deployer Public Key: 0x445b64828683ae4B6D5f0542f9E97707d631A847
3434
// Staking Node Implementation: 0x79388c8cc46069c0e3f285f053692D7397e65e1e
3535
// Deployment JSON file written successfully: /Users/parth/Desktop/coding/yieldnest/prod-code-repos/yieldnest-protocol-private/deployments/ynETH-1.json
36+
37+
38+
// HOLESKY DEPLOYMENT
39+
// Staking Node Implementation: 0xdd8e2B6B4D71E0E1b077dFcaea3Ca85fF31803a6
40+

script/ynETH/DeployStakingNodesManager.s.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ contract DeployStakingNodesManager is BaseYnETHScript {
3333
// Deployer Public Key: 0x445b64828683ae4B6D5f0542f9E97707d631A847
3434
// StakingNodesManager Implementation: 0x8E0b49B4A4384D812Bc6F55fA6412547524D41Ab
3535
// Deployment JSON file written successfully: /Users/parth/Desktop/coding/yieldnest/prod-code-repos/yieldnest-protocol-private/deployments/ynETH-1.json
36+
37+
// HOLESKY DEPLOYMENT
38+
// StakingNodesManager Implementation: 0x99a108a79419c62F2Ff384cE2441b435b918a252
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// SPDX-License-Identifier: BSD 3-Clause License
2+
pragma solidity ^0.8.24;
3+
4+
import {BaseYnETHScript} from "script/ynETH/BaseYnETHScript.s.sol";
5+
import {WithdrawalsProcessor} from "src/WithdrawalsProcessor.sol";
6+
import {console} from "lib/forge-std/src/console.sol";
7+
8+
contract DeployWithdrawalsProcessor is BaseYnETHScript {
9+
10+
function run() external {
11+
12+
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
13+
14+
address publicKey = vm.addr(deployerPrivateKey);
15+
console.log("Deployer Public Key:", publicKey);
16+
17+
address _broadcaster = vm.addr(deployerPrivateKey);
18+
19+
vm.startBroadcast(deployerPrivateKey);
20+
21+
console.log("Current Block Number:", block.number);
22+
console.log("Current Chain ID:", block.chainid);
23+
24+
WithdrawalsProcessor withdrawalsProcessorImplementation = new WithdrawalsProcessor();
25+
26+
console.log("Withdrawals Processor Implementation:", address(withdrawalsProcessorImplementation));
27+
28+
vm.stopBroadcast();
29+
30+
}
31+
}
32+
33+
// HOLESKY DEPLOYMENT
34+
// Withdrawals Processor Implementation: 0xAbE3b5bF154d6441C63Dc34691E4F51Dbfac3bB0

script/ynETH/VerifyYnETH.s.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,15 @@ contract Verify is BaseYnETHScript {
639639
function veryifySanityChecks() internal view {
640640
// Check that previewDeposit of 1 ETH is less than 1 ether
641641
uint256 previewDepositResult = deployment.ynETH.previewDeposit(1 ether);
642+
console.log("previewDepositResult", previewDepositResult);
642643
require(previewDepositResult < 1 ether, "previewDeposit of 1 ETH should be less than 1 ether");
643644
console.log("\u2705 previewDeposit of 1 ETH is less than 1 ether");
644645

645646
// Check that totalSupply is less than totalAssets
646647
uint256 totalSupply = deployment.ynETH.totalSupply();
647648
uint256 totalAssets = deployment.ynETH.totalAssets();
649+
console.log("totalSupply", totalSupply);
650+
console.log("totalAssets", totalAssets);
648651
require(totalSupply < totalAssets, "totalSupply should be less than totalAssets");
649652
console.log("\u2705 totalSupply is less than totalAssets");
650653

@@ -665,7 +668,8 @@ contract Verify is BaseYnETHScript {
665668
for (uint256 i = 0; i < stakingNodes.length; i++) {
666669
stakingNodesBalance += stakingNodes[i].getETHBalance();
667670
console.log(string.concat("Balance for node ", vm.toString(i), ": ", vm.toString(stakingNodes[i].getETHBalance()), " wei (", vm.toString(stakingNodes[i].getETHBalance() / 1e18), " ETH)"));
668-
671+
console.log(string.concat("Pre ELIP002 queued shares for node ", vm.toString(i), ": ", vm.toString(stakingNodes[i].preELIP002QueuedSharesAmount()), " wei (", vm.toString(stakingNodes[i].preELIP002QueuedSharesAmount() / 1e18), " ETH)"));
672+
console.log(string.concat("Queued shares for node ", vm.toString(i), ": ", vm.toString(stakingNodes[i].queuedSharesAmount()), " wei (", vm.toString(stakingNodes[i].queuedSharesAmount() / 1e18), " ETH)"));
669673
}
670674

671675
uint256 totalCalculatedBalance = ynETHBalance + redemptionVaultBalance + stakingNodesBalance;

src/HoleskyStakingNodesManager.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: BSD 3-Clause License
2+
pragma solidity ^0.8.24;
3+
4+
import {StakingNodesManager} from "./StakingNodesManager.sol";
5+
import {IRewardsCoordinator} from "lib/eigenlayer-contracts/src/contracts/interfaces/IRewardsCoordinator.sol";
6+
7+
contract HoleskyStakingNodesManager is StakingNodesManager {
8+
9+
function initializeV3(
10+
IRewardsCoordinator _rewardsCoordinator
11+
) external override reinitializer(3) {
12+
if (address(_rewardsCoordinator) == address(0)) revert ZeroAddress();
13+
rewardsCoordinator = _rewardsCoordinator;
14+
}
15+
16+
}

0 commit comments

Comments
 (0)