Skip to content

Commit

Permalink
set claimer
Browse files Browse the repository at this point in the history
  • Loading branch information
jtfirek committed Dec 19, 2024
1 parent 9221502 commit 6d815f0
Show file tree
Hide file tree
Showing 4 changed files with 543 additions and 9 deletions.
15 changes: 11 additions & 4 deletions src/EtherFiRestaker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "./LiquidityPool.sol";

import "./eigenlayer-interfaces/IStrategyManager.sol";
import "./eigenlayer-interfaces/IDelegationManager.sol";
import "./eigenlayer-interfaces/IRewardsCoordinator.sol";

contract EtherFiRestaker is Initializable, UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeable {
using SafeERC20 for IERC20;
Expand All @@ -41,6 +42,7 @@ contract EtherFiRestaker is Initializable, UUPSUpgradeable, OwnableUpgradeable,
EnumerableSet.Bytes32Set private withdrawalRootsSet;
mapping(bytes32 => IDelegationManager.Withdrawal) public withdrawalRootToWithdrawal;

IRewardsCoordinator public immutable rewardsCoordinator;

event QueuedStEthWithdrawals(uint256[] _reqIds);
event CompletedStEthQueuedWithdrawals(uint256[] _reqIds);
Expand All @@ -56,7 +58,8 @@ contract EtherFiRestaker is Initializable, UUPSUpgradeable, OwnableUpgradeable,
error IncorrectCaller();

/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
constructor(address _rewardsCoordinator) {
rewardsCoordinator = IRewardsCoordinator(_rewardsCoordinator);
_disableInitializers();
}

Expand Down Expand Up @@ -137,6 +140,11 @@ contract EtherFiRestaker is Initializable, UUPSUpgradeable, OwnableUpgradeable,
// |--------------------------------------------------------------------------------------------|
// | EigenLayer Restaking |
// |--------------------------------------------------------------------------------------------|

/// Set the claimer of the restaking rewards of this contract
function setRewardsClaimer(address _claimer) external onlyAdmin {
rewardsCoordinator.setClaimerFor(_claimer);
}

// delegate to an AVS operator
function delegateTo(address operator, IDelegationManager.SignatureWithExpiry memory approverSignatureAndExpiry, bytes32 approverSalt) external onlyAdmin {
Expand Down Expand Up @@ -288,9 +296,8 @@ contract EtherFiRestaker is Initializable, UUPSUpgradeable, OwnableUpgradeable,
return withdrawalRootsSet.contains(_withdrawalRoot);
}


// |--------------------------------------------------------------------------------------------|
// | VIEW functions |
// | VIEW functions |
// |--------------------------------------------------------------------------------------------|
function getTotalPooledEther() public view returns (uint256 total) {
total = address(this).balance + getTotalPooledEther(address(lido));
Expand Down Expand Up @@ -408,4 +415,4 @@ contract EtherFiRestaker is Initializable, UUPSUpgradeable, OwnableUpgradeable,
_requirePauser();
_;
}
}
}
Loading

0 comments on commit 6d815f0

Please sign in to comment.