Skip to content
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

deprecated delayedWithdrawalRouter and pendingWithdrawal #9

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/contracts/restaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -233,7 +233,7 @@ contract Restaking is Initializable, AccessControlUpgradeable, ReentrancyGuardUp
sumBalance += podOwner.balance;
}

return pendingWithdrawal + sumBalance;
return sumBalance;
}


Expand Down Expand Up @@ -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);
}

Expand Down