diff --git a/script/ynEigen/DeployWithdrawalsProcessor.s.sol b/script/ynEigen/DeployWithdrawalsProcessor.s.sol index 9c5f36784..2da440d6f 100644 --- a/script/ynEigen/DeployWithdrawalsProcessor.s.sol +++ b/script/ynEigen/DeployWithdrawalsProcessor.s.sol @@ -14,10 +14,12 @@ import {WithdrawalsProcessor} from "src/ynEIGEN/WithdrawalsProcessor.sol"; import {YnEigenDeployer} from "./YnEigenDeployer.s.sol"; +import {console} from "lib/forge-std/src/console.sol"; + // ---- Usage ---- // deploy: -// forge script script/DeployWithdrawalsProcessor.s.sol:DeployWithdrawalsProcessor --verify --slow --legacy --etherscan-api-key $KEY --rpc-url $RPC_URL --broadcast +// forge script script/ynEigen/DeployWithdrawalsProcessor.s.sol:DeployWithdrawalsProcessor --verify --slow --legacy --etherscan-api-key $KEY --rpc-url $RPC_URL --broadcast contract DeployWithdrawalsProcessor is YnEigenDeployer { @@ -38,8 +40,9 @@ contract DeployWithdrawalsProcessor is YnEigenDeployer { } // deploy withdrawalsProcessor + WithdrawalsProcessor withdrawalsProcessor; { - WithdrawalsProcessor withdrawalsProcessor = new WithdrawalsProcessor( + withdrawalsProcessor = new WithdrawalsProcessor( chainAddresses.ynEigen.WITHDRAWAL_QUEUE_MANAGER_ADDRESS, // address(withdrawalQueueManager) chainAddresses.ynEigen.TOKEN_STAKING_NODES_MANAGER_ADDRESS, // address(tokenStakingNodesManager) chainAddresses.ynEigen.ASSET_REGISTRY_ADDRESS, // address(assetRegistry) @@ -47,7 +50,11 @@ contract DeployWithdrawalsProcessor is YnEigenDeployer { chainAddresses.eigenlayer.DELEGATION_MANAGER_ADDRESS, // address(delegationManager) chainAddresses.ynEigen.YNEIGEN_ADDRESS, // address(yneigen) chainAddresses.ynEigen.REDEMPTION_ASSETS_VAULT_ADDRESS, // address(redemptionAssetsVault) - chainAddresses.ynEigen.WRAPPER // address(wrapper) + chainAddresses.ynEigen.WRAPPER, // address(wrapper) + chainAddresses.lsd.STETH_ADDRESS, + chainAddresses.lsd.WSTETH_ADDRESS, + chainAddresses.lsd.OETH_ADDRESS, + chainAddresses.lsd.WOETH_ADDRESS ); withdrawalsProcessor = WithdrawalsProcessor( @@ -61,21 +68,27 @@ contract DeployWithdrawalsProcessor is YnEigenDeployer { WithdrawalsProcessor(address(withdrawalsProcessor)).initialize(owner, keeper); } - // @todo - queue manually? - // // grant roles to withdrawalsProcessor - // { - // vm.startPrank(actors.wallets.YNSecurityCouncil); - // eigenStrategyManager.grantRole( - // eigenStrategyManager.STAKING_NODES_WITHDRAWER_ROLE(), address(withdrawalsProcessor) - // ); - // eigenStrategyManager.grantRole( - // eigenStrategyManager.WITHDRAWAL_MANAGER_ROLE(), address(withdrawalsProcessor) - // ); - // withdrawalQueueManager.grantRole( - // withdrawalQueueManager.REQUEST_FINALIZER_ROLE(), address(withdrawalsProcessor) - // ); - // vm.stopPrank(); - // } + // grant roles to withdrawalsProcessor + { + // vm.startPrank(actors.wallets.YNSecurityCouncil); + // eigenStrategyManager.grantRole( + // eigenStrategyManager.STAKING_NODES_WITHDRAWER_ROLE(), address(withdrawalsProcessor) + // ); + // eigenStrategyManager.grantRole( + // eigenStrategyManager.WITHDRAWAL_MANAGER_ROLE(), address(withdrawalsProcessor) + // ); + // withdrawalQueueManager.grantRole( + // withdrawalQueueManager.REQUEST_FINALIZER_ROLE(), address(withdrawalsProcessor) + // ); + // vm.stopPrank(); + console.log("----------------------------------"); + console.log("Grant roles to WithdrawalsProcessor:"); + console.log("YNSecurityCouncil: ", actors.wallets.YNSecurityCouncil); + console.log("WithdrawalsProcessor: ", address(withdrawalsProcessor)); + console.log("EigenStrategyManager: ", chainAddresses.ynEigen.EIGEN_STRATEGY_MANAGER_ADDRESS); + console.log("withdrawalQueueManager: ", chainAddresses.ynEigen.WITHDRAWAL_QUEUE_MANAGER_ADDRESS); + console.log("----------------------------------"); + } } function _isOngoingWithdrawals() private returns (bool) { @@ -90,7 +103,11 @@ contract DeployWithdrawalsProcessor is YnEigenDeployer { _assets[i] ) ) > 0 - ) return true; + ) { + console.log("Ongoing withdrawals - asset: ", address(_assets[i])); + console.log("Ongoing withdrawals - node: ", address(_nodes[j])); + return true; + } } } return false; diff --git a/src/ynEIGEN/WithdrawalsProcessor.sol b/src/ynEIGEN/WithdrawalsProcessor.sol index b145e7044..6b40445a2 100644 --- a/src/ynEIGEN/WithdrawalsProcessor.sol +++ b/src/ynEIGEN/WithdrawalsProcessor.sol @@ -46,10 +46,10 @@ contract WithdrawalsProcessor is IWithdrawalsProcessor, Initializable, AccessCon IDelegationManager public immutable delegationManager; // assets - IERC20 private constant STETH = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); - IwstETH private constant WSTETH = IwstETH(0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0); - IERC4626 private constant WOETH = IERC4626(0xDcEe70654261AF21C44c093C300eD3Bb97b78192); - IERC20 private constant OETH = IERC20(0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3); + IERC20 private immutable STETH = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); + IwstETH private immutable WSTETH = IwstETH(0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0); + IERC20 private immutable OETH = IERC20(0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3); + IERC4626 private immutable WOETH = IERC4626(0xDcEe70654261AF21C44c093C300eD3Bb97b78192); // used to prevent rounding errors uint256 private constant MIN_DELTA = 1000; @@ -68,7 +68,11 @@ contract WithdrawalsProcessor is IWithdrawalsProcessor, Initializable, AccessCon address _delegationManager, address _yneigen, address _redemptionAssetsVault, - address _wrapper + address _wrapper, + address _steth, + address _wsteth, + address _oeth, + address _woeth ) { if ( _withdrawalQueueManager == address(0) || _tokenStakingNodesManager == address(0) @@ -84,6 +88,11 @@ contract WithdrawalsProcessor is IWithdrawalsProcessor, Initializable, AccessCon yneigen = IynEigen(_yneigen); redemptionAssetsVault = IRedemptionAssetsVault(_redemptionAssetsVault); wrapper = IWrapper(_wrapper); + + STETH = IERC20(_steth); + WSTETH = IwstETH(_wsteth); + OETH = IERC20(_oeth); + WOETH = IERC4626(_woeth); } function initialize(address _owner, address _keeper) public initializer { diff --git a/test/integration/ynEIGEN/WithdrawalsProcessor.t.sol b/test/integration/ynEIGEN/WithdrawalsProcessor.t.sol index a0f303309..1f6c9d4f5 100644 --- a/test/integration/ynEIGEN/WithdrawalsProcessor.t.sol +++ b/test/integration/ynEIGEN/WithdrawalsProcessor.t.sol @@ -58,7 +58,11 @@ contract WithdrawalsProcessorTest is ynEigenIntegrationBaseTest { address(eigenLayer.delegationManager), address(ynEigenToken), address(redemptionAssetsVault), - address(wrapper) + address(wrapper), + chainAddresses.lsd.STETH_ADDRESS, + chainAddresses.lsd.WSTETH_ADDRESS, + chainAddresses.lsd.OETH_ADDRESS, + chainAddresses.lsd.WOETH_ADDRESS ); withdrawalsProcessor = WithdrawalsProcessor(address(new TransparentUpgradeableProxy(address(withdrawalsProcessor), actors.admin.PROXY_ADMIN_OWNER, ""))); diff --git a/test/scenarios/ynEIGEN/WithdrawalsProcessor.t.sol b/test/scenarios/ynEIGEN/WithdrawalsProcessor.t.sol index 96c3aa4b5..ba8d22fa2 100644 --- a/test/scenarios/ynEIGEN/WithdrawalsProcessor.t.sol +++ b/test/scenarios/ynEIGEN/WithdrawalsProcessor.t.sol @@ -49,7 +49,11 @@ contract WithdrawalsProcessorForkTest is ynLSDeScenarioBaseTest { address(delegationManager), address(yneigen), address(redemptionAssetsVault), - address(wrapper) + address(wrapper), + chainAddresses.lsd.STETH_ADDRESS, + chainAddresses.lsd.WSTETH_ADDRESS, + chainAddresses.lsd.OETH_ADDRESS, + chainAddresses.lsd.WOETH_ADDRESS ); withdrawalsProcessor = WithdrawalsProcessor(