From 337754a386dab2cdca71cdcb2380395f1c1c5610 Mon Sep 17 00:00:00 2001 From: "eben.xie" Date: Wed, 14 Aug 2024 10:44:22 +0800 Subject: [PATCH 1/2] [Describe]: opt m4 support --- src/contracts/restaking.sol | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/contracts/restaking.sol b/src/contracts/restaking.sol index 2267645..928354c 100644 --- a/src/contracts/restaking.sol +++ b/src/contracts/restaking.sol @@ -233,7 +233,7 @@ contract Restaking is Initializable, AccessControlUpgradeable, ReentrancyGuardUp sumBalance += podOwner.balance; } - return pendingWithdrawal + sumBalance; + return sumBalance; } @@ -279,17 +279,11 @@ contract Restaking is Initializable, AccessControlUpgradeable, ReentrancyGuardUp function _withdrawEthers() internal { uint256 totalDiff; - for (uint256 i=0;i< podOwners.length;i++) { IPodOwner podOwner = podOwners[i]; - - uint256 balanceBefore = address(podOwner).balance; + totalDiff += address(podOwner).balance; podOwner.transfer(stakingAddress, address(podOwner).balance); - uint256 diff = address(podOwner).balance - balanceBefore; - totalDiff += diff; } - - pendingWithdrawal -= totalDiff; emit Claimed(totalDiff); } From b4e52a7f3eb341b01e557d7ce2629e2c0ca65e07 Mon Sep 17 00:00:00 2001 From: Trisome-Bedrock Date: Wed, 14 Aug 2024 18:22:23 +0800 Subject: [PATCH 2/2] deprecated delayedWithdrawalRouter and pendingWithdrawal --- src/contracts/restaking.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contracts/restaking.sol b/src/contracts/restaking.sol index 928354c..760bb81 100644 --- a/src/contracts/restaking.sol +++ b/src/contracts/restaking.sol @@ -63,9 +63,9 @@ contract Restaking is Initializable, AccessControlUpgradeable, ReentrancyGuardUp /// @dev the StrategyManager contract address public strategyManager; /// @dev the DelayedWithdrawalRouter contract - address public delayedWithdrawalRouter; + address public _DEPRECATED_delayedWithdrawalRouter; /// @dev record pending withdrawal amount from EigenPod to DelayedWithdrawalRouter - uint256 private pendingWithdrawal; + uint256 private _DEPRECATED_pendingWithdrawal; // @dev staking contract address address public stakingAddress; @@ -222,7 +222,7 @@ contract Restaking is Initializable, AccessControlUpgradeable, ReentrancyGuardUp */ /** - * @dev get unrealized profits that either stays on eigenpods, or locked in router. + * @dev get unrealized profits that stays on eigenpods. */ function getPendingWithdrawalAmount() external view returns (uint256) { uint256 sumBalance;