From 10cee60c1b97605af6e01882e5a7c813ae059812 Mon Sep 17 00:00:00 2001 From: danoctavian Date: Thu, 14 Mar 2024 04:46:04 +0200 Subject: [PATCH 1/3] fix compilation issues with YN deployment script --- scripts/forge/DeployYieldNest.s.sol | 59 +++++++++++------------------ 1 file changed, 22 insertions(+), 37 deletions(-) diff --git a/scripts/forge/DeployYieldNest.s.sol b/scripts/forge/DeployYieldNest.s.sol index cf658628b..eb8f178fe 100644 --- a/scripts/forge/DeployYieldNest.s.sol +++ b/scripts/forge/DeployYieldNest.s.sol @@ -58,20 +58,7 @@ contract DeployYieldNest is BaseScript { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); // ynETH.sol ROLES - ActorAddresses.Actors memory actors = ActorAddresses.Actors({ - DEFAULT_SIGNER: address(0), // Placeholder, not used in this context - PROXY_ADMIN_OWNER: vm.envAddress("PROXY_OWNER"), - TRANSFER_ENABLED_EOA: address(0), // Placeholder, not used in this context - ADMIN: vm.envAddress("YNETH_ADMIN_ADDRESS"), - STAKING_ADMIN: vm.envAddress("STAKING_ADMIN_ADDRESS"), - STAKING_NODES_ADMIN: vm.envAddress("STAKING_NODES_ADMIN_ADDRESS"), - VALIDATOR_MANAGER: vm.envAddress("VALIDATOR_MANAGER_ADDRESS"), - FEE_RECEIVER: address(0), // Placeholder, not used in this context - PAUSE_ADMIN: vm.envAddress("PAUSER_ADDRESS"), - LSD_RESTAKING_MANAGER: vm.envAddress("LSD_RESTAKING_MANAGER_ADDRESS"), - STAKING_NODE_CREATOR: vm.envAddress("LSD_RESTAKING_MANAGER_ADDRESS"), - ORACLE_MANAGER: address(0) // Placeholder, not used in this context - }); + ActorAddresses.Actors memory actors = getActors(); address _broadcaster = vm.addr(deployerPrivateKey); @@ -90,13 +77,12 @@ contract DeployYieldNest is BaseScript { ContractAddresses contractAddresses = new ContractAddresses(); ContractAddresses.ChainAddresses memory chainAddresses = contractAddresses.getChainAddresses(block.chainid); - eigenPodManager = IEigenPodManager(chainAddresses.EIGENLAYER_EIGENPOD_MANAGER_ADDRESS); - delegationManager = IDelegationManager(chainAddresses.EIGENLAYER_DELEGATION_MANAGER_ADDRESS); - delayedWithdrawalRouter = IDelayedWithdrawalRouter(chainAddresses.EIGENLAYER_DELAYED_WITHDRAWAL_ROUTER_ADDRESS); // Assuming DEPOSIT_2_ADDRESS is used for DelayedWithdrawalRouter - strategyManager = IStrategyManager(chainAddresses.EIGENLAYER_STRATEGY_MANAGER_ADDRESS); - depositContract = IDepositContract(chainAddresses.DEPOSIT_2_ADDRESS); - weth = IWETH(chainAddresses.WETH_ADDRESS); - + eigenPodManager = IEigenPodManager(chainAddresses.eigenlayer.EIGENPOD_MANAGER_ADDRESS); + delegationManager = IDelegationManager(chainAddresses.eigenlayer.DELEGATION_MANAGER_ADDRESS); + delayedWithdrawalRouter = IDelayedWithdrawalRouter(chainAddresses.eigenlayer.DELAYED_WITHDRAWAL_ROUTER_ADDRESS); + strategyManager = IStrategyManager(chainAddresses.eigenlayer.STRATEGY_MANAGER_ADDRESS); + depositContract = IDepositContract(chainAddresses.ethereum.DEPOSIT_2_ADDRESS); + weth = IWETH(chainAddresses.ethereum.WETH_ADDRESS); // Deploy implementations yneth = new ynETH(); stakingNodesManager = new StakingNodesManager(); @@ -107,31 +93,31 @@ contract DeployYieldNest is BaseScript { ynlsd = new ynLSD(); RewardsDistributor rewardsDistributorImplementation = new RewardsDistributor(); - rewardsDistributorProxy = new TransparentUpgradeableProxy(address(rewardsDistributorImplementation), proxyOwnerAddress, ""); + rewardsDistributorProxy = new TransparentUpgradeableProxy(address(rewardsDistributorImplementation), actors.PROXY_ADMIN_OWNER, ""); rewardsDistributor = RewardsDistributor(payable(rewardsDistributorProxy)); YieldNestOracle yieldNestOracleImplementation = new YieldNestOracle(); - yieldNestOracleProxy = new TransparentUpgradeableProxy(address(yieldNestOracleImplementation), proxyOwnerAddress, ""); + yieldNestOracleProxy = new TransparentUpgradeableProxy(address(yieldNestOracleImplementation), actors.PROXY_ADMIN_OWNER, ""); yieldNestOracle = YieldNestOracle(address(yieldNestOracleProxy)); ynLSD ynLSDImplementation = new ynLSD(); - ynLSDProxy = new TransparentUpgradeableProxy(address(ynLSDImplementation), proxyOwnerAddress, ""); + ynLSDProxy = new TransparentUpgradeableProxy(address(ynLSDImplementation), actors.PROXY_ADMIN_OWNER, ""); ynlsd = ynLSD(address(ynLSDProxy)); // Deploy proxies - ynethProxy = new TransparentUpgradeableProxy(address(yneth), proxyOwnerAddress, ""); - stakingNodesManagerProxy = new TransparentUpgradeableProxy(address(stakingNodesManager), proxyOwnerAddress, ""); + ynethProxy = new TransparentUpgradeableProxy(address(yneth), actors.PROXY_ADMIN_OWNER, ""); + stakingNodesManagerProxy = new TransparentUpgradeableProxy(address(stakingNodesManager), actors.PROXY_ADMIN_OWNER, ""); yneth = ynETH(payable(ynethProxy)); stakingNodesManager = StakingNodesManager(payable(stakingNodesManagerProxy)); // Initialize ynETH with example parameters address[] memory pauseWhitelist = new address[](1); - pauseWhitelist[0] = pauserAddress; + pauseWhitelist[0] = actors.PAUSE_ADMIN; ynETH.Init memory ynethInit = ynETH.Init({ - admin: ynethAdminAddress, - pauser: pauserAddress, + admin: actors.ADMIN, + pauser: actors.PAUSE_ADMIN, stakingNodesManager: IStakingNodesManager(address(stakingNodesManager)), rewardsDistributor: IRewardsDistributor(address(rewardsDistributor)), exchangeAdjustmentRate: startingExchangeAdjustmentRate, @@ -142,10 +128,11 @@ contract DeployYieldNest is BaseScript { // Initialize StakingNodesManager with example parameters StakingNodesManager.Init memory stakingNodesManagerInit = StakingNodesManager.Init({ - admin: stakingNodesManagerAdminAddress, - stakingAdmin: stakingAdminAddress, - stakingNodesAdmin: stakingNodesAdminAddress, - validatorManager: validatorManagerAddress, + admin: actors.ADMIN, + stakingAdmin: actors.STAKING_ADMIN, + stakingNodesAdmin: actors.STAKING_NODES_ADMIN, + validatorManager: actors.VALIDATOR_MANAGER, + stakingNodeCreatorRole: actors.STAKING_NODE_CREATOR, maxNodeCount: 10, depositContract: depositContract, ynETH: IynETH(address(yneth)), @@ -160,7 +147,7 @@ contract DeployYieldNest is BaseScript { stakingNodesManager.registerStakingNodeImplementationContract(address(stakingNodeImplementation)); RewardsDistributor.Init memory rewardsDistributorInit = RewardsDistributor.Init({ - admin: rewardsDistributorAdminAddress, + admin: actors.ADMIN, executionLayerReceiver: executionLayerReceiver, consensusLayerReceiver: consensusLayerReceiver, // Adding consensusLayerReceiver to the initialization feesReceiver: feeReceiver, // Assuming the contract itself will receive the fees @@ -170,7 +157,7 @@ contract DeployYieldNest is BaseScript { // Initialize RewardsReceiver with example parameters RewardsReceiver.Init memory rewardsReceiverInit = RewardsReceiver.Init({ - admin: rewardsDistributorAdminAddress, + admin: actors.ADMIN, withdrawer: address(rewardsDistributor) }); executionLayerReceiver.initialize(rewardsReceiverInit); @@ -191,5 +178,3 @@ contract DeployYieldNest is BaseScript { } } - - From 09473a0236d1c27482b5111663878fa3d7305e4c Mon Sep 17 00:00:00 2001 From: danoctavian Date: Thu, 14 Mar 2024 06:52:00 +0200 Subject: [PATCH 2/3] update holesky addreses --- test/foundry/ContractAddresses.sol | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/foundry/ContractAddresses.sol b/test/foundry/ContractAddresses.sol index 556cc7ecc..f663745ec 100644 --- a/test/foundry/ContractAddresses.sol +++ b/test/foundry/ContractAddresses.sol @@ -80,6 +80,32 @@ contract ContractAddresses { STETH_STRATEGY_ADDRESS: 0xB613E78E2068d7489bb66419fB1cfa11275d14da }) }); + + // In absence of Eigenlayer a placeholder address is used for all Eigenlayer addresses + address placeholderAddress = address(1); + + addresses[17000] = ChainAddresses({ + ethereum: EthereumAddresses({ + WETH_ADDRESS: placeholderAddress, // Placeholder address, replaced with address(1) for holesky + DEPOSIT_2_ADDRESS: 0x4242424242424242424242424242424242424242 + }), + eigenlayer: EigenlayerAddresses({ + EIGENPOD_MANAGER_ADDRESS: placeholderAddress, // Placeholder address, replaced with address(1) for holesky + DELEGATION_MANAGER_ADDRESS: placeholderAddress, // Placeholder address, replaced with address(1) for holesky + DELEGATION_PAUSER_ADDRESS: placeholderAddress, // Placeholder address, replaced with address(1) for holesky + STRATEGY_MANAGER_ADDRESS: placeholderAddress, // Placeholder address, replaced with address(1) for holesky + DELAYED_WITHDRAWAL_ROUTER_ADDRESS: placeholderAddress // Placeholder address, replaced with address(1) for holesky + }), + lsd: LSDAddresses({ + SFRXETH_ADDRESS: placeholderAddress, // Placeholder address, replaced with address(1) for holesky + RETH_ADDRESS: 0x7322c24752f79c05FFD1E2a6FCB97020C1C264F1, // source: https://docs.rocketpool.net/guides/staking/via-rp + STETH_ADDRESS: 0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034, // source: https://docs.lido.fi/deployed-contracts/holesky/ + RETH_FEED_ADDRESS: 0xe1e444A5Df450E7640323a21073bF01E0af054fA, // Self-created aggregator + STETH_FEED_ADDRESS: 0xe1e444A5Df450E7640323a21073bF01E0af054fA, // Self-created aggregator + RETH_STRATEGY_ADDRESS: placeholderAddress, // Placeholder address, replaced with address(1) for holesky + STETH_STRATEGY_ADDRESS: placeholderAddress // Placeholder address, replaced with address(1) for holesky + }) + }); } function getChainAddresses(uint256 chainId) external view returns (ChainAddresses memory) { From 7714412767870b08320dfdec200a49b86a225351 Mon Sep 17 00:00:00 2001 From: danoctavian Date: Thu, 14 Mar 2024 06:54:38 +0200 Subject: [PATCH 3/3] add example file to deployments --- deployments/example.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 deployments/example.json diff --git a/deployments/example.json b/deployments/example.json new file mode 100644 index 000000000..c16d3c7de --- /dev/null +++ b/deployments/example.json @@ -0,0 +1,8 @@ +{ + "executionLayerReceiver": "0x0000000000000000000000000000000000000002", + "object": "dummy", + "rewardsDistributor": "0x0000000000000000000000000000000000000003", + "stakingNodeImplementation": "0x0000000000000000000000000000000000000004", + "stakingNodesManager": "0x0000000000000000000000000000000000000001", + "ynETH": "0x0000000000000000000000000000000000000000" +} \ No newline at end of file