in this contract i// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import…
- User
in this contract i// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "./RestakeManagerStorage.sol"; import "./EigenLayer/interfaces/IStrategy.sol"; import "./EigenLayer/interfaces/IStrategyManager.sol"; import "./EigenLayer/interfaces/IDelegationManager.sol"; import "./token/IEzEthToken.sol"; import "./IRestakeManager.sol"; import "./Errors/Errors.sol";
/**
-
@author Renzo
-
@title RestakeManager
-
@dev This contract is the main entrypoint for external users into the protocol Users will interact with this contract to deposit and withdraw value into and from EigenLayer Ownership of deposited funds will be tracked via the ezETh token */ contract RestakeManager is Initializable, ReentrancyGuardUpgradeable, RestakeManagerStorageV2 { using SafeERC20 for IERC20; using SafeERC20Upgradeable for IEzEthToken;
event OperatorDelegatorAdded(IOperatorDelegator od); event OperatorDelegatorRemoved(IOperatorDelegator od); event OperatorDelegatorAllocationUpdated(IOperatorDelegator od, uint256 allocation);
event CollateralTokenAdded(IERC20 token); event CollateralTokenRemoved(IERC20 token);
/// @dev Basis points used for percentages (100 basis points equals 1%) uint256 constant BASIS_POINTS = 100;
/// @dev Event emitted when a new deposit occurs event Deposit( address depositor, IERC20 token, uint256 amount, uint256 ezETHMinted, uint256 referralId );
/// @dev Event emitted when a new withdraw is started event UserWithdrawStarted( bytes32 withdrawalRoot, address withdrawer, IERC20 token, uint256 amount, uint256 ezETHToBurn );
/// @dev Event emitted when a new withdraw is completed event UserWithdrawCompleted( bytes32 withdrawalRoot, address withdrawer, IERC20 token, uint256 amount, uint256 ezETHBurned );
/// @dev Event emitted when a token TVL Limit is updated event CollateralTokenTvlUpdated(IERC20 token, uint256 tvl);
/// @dev Allows only a whitelisted address to configure the contract modifier onlyRestakeManagerAdmin() { if (!roleManager.isRestakeManagerAdmin(msg.sender)) revert NotRestakeManagerAdmin(); _; }
/// @dev Allows only a whitelisted address to set pause state modifier onlyDepositWithdrawPauserAdmin() { if (!roleManager.isDepositWithdrawPauser(msg.sender)) revert NotDepositWithdrawPauser(); _; }
/// @dev Allows only the deposit queue to call functions modifier onlyDepositQueue() { if (msg.sender != address(depositQueue)) revert NotDepositQueue(); _; }
-
- Assistant