Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
WithdrawQueue
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "./WithdrawQueueStorage.sol"; import "../Errors/Errors.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "forge-std/console.sol"; contract WithdrawQueue is Initializable, PausableUpgradeable, ReentrancyGuardUpgradeable, WithdrawQueueStorageV3 { using SafeERC20 for IERC20; event WithdrawBufferTargetUpdated(uint256 oldBufferTarget, uint256 newBufferTarget); event CoolDownPeriodUpdated(uint256 oldCoolDownPeriod, uint256 newCoolDownPeriod); event EthBufferFilled(uint256 amount); event ERC20BufferFilled(address asset, uint256 amount); event WithdrawRequestCreated( uint256 indexed withdrawRequestID, address user, address claimToken, uint256 amountToRedeem, uint256 ezETHAmountLocked, uint256 withdrawRequestIndex, bool queued, uint256 queueFilled ); event WithdrawRequestClaimed(WithdrawRequest withdrawRequest); event QueueFilled(uint256 amount, address asset); event WithdrawQueueEnabled(address asset); event WithdrawQueueDisabled(address asset); /// @dev Allows only Withdraw Queue Admin to configure the contract modifier onlyWithdrawQueueAdmin() { if (!roleManager.isWithdrawQueueAdmin(msg.sender)) revert NotWithdrawQueueAdmin(); _; } /// @dev Allows only a whitelisted address to set pause state modifier onlyDepositWithdrawPauserAdmin() { if (!roleManager.isDepositWithdrawPauser(msg.sender)) revert NotDepositWithdrawPauser(); _; } /// @dev Allows only RestakeManager to call the functions modifier onlyRestakeManager() { if (msg.sender != address(restakeManager)) revert NotRestakeManager(); _; } modifier onlyDepositQueue() { if (msg.sender != address(restakeManager.depositQueue())) revert NotDepositQueue(); _; } /// @dev Prevents implementation contract from being initialized. /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } /** * @notice Initializes the contract with initial vars */ function initialize( IRoleManager _roleManager, IRestakeManager _restakeManager, IEzEthToken _ezETH, IRenzoOracle _renzoOracle, uint256 _coolDownPeriod, TokenWithdrawBuffer[] calldata _withdrawalBufferTarget ) external initializer { if ( address(_roleManager) == address(0) || address(_ezETH) == address(0) || address(_renzoOracle) == address(0) || address(_restakeManager) == address(0) || _withdrawalBufferTarget.length == 0 || _coolDownPeriod == 0 ) revert InvalidZeroInput(); __Pausable_init(); roleManager = _roleManager; restakeManager = _restakeManager; ezETH = _ezETH; renzoOracle = _renzoOracle; coolDownPeriod = _coolDownPeriod; for (uint256 i = 0; i < _withdrawalBufferTarget.length; ) { if ( _withdrawalBufferTarget[i].asset == address(0) || _withdrawalBufferTarget[i].bufferAmount == 0 ) revert InvalidZeroInput(); withdrawalBufferTarget[_withdrawalBufferTarget[i].asset] = _withdrawalBufferTarget[i] .bufferAmount; unchecked { ++i; } } // Deploy WithdrawQueue with paused state _pause(); } /** * @notice Updates the WithdrawBufferTarget for max withdraw available * @dev Permissioned call (onlyWithdrawQueueAdmin) * @param _newBufferTarget new max buffer target available to withdraw */ function updateWithdrawBufferTarget( TokenWithdrawBuffer[] calldata _newBufferTarget ) external onlyWithdrawQueueAdmin { if (_newBufferTarget.length == 0) revert InvalidZeroInput(); for (uint256 i = 0; i < _newBufferTarget.length; ) { if (_newBufferTarget[i].asset == address(0) || _newBufferTarget[i].bufferAmount == 0) revert InvalidZeroInput(); emit WithdrawBufferTargetUpdated( withdrawalBufferTarget[_newBufferTarget[i].asset], _newBufferTarget[i].bufferAmount ); withdrawalBufferTarget[_newBufferTarget[i].asset] = _newBufferTarget[i].bufferAmount; unchecked { ++i; } } } /** * @notice Updates the coolDownPeriod for withdrawal requests * @dev It is a permissioned call (onlyWithdrawQueueAdmin) * @param _newCoolDownPeriod new coolDownPeriod in seconds */ function updateCoolDownPeriod(uint256 _newCoolDownPeriod) external onlyWithdrawQueueAdmin { if (_newCoolDownPeriod == 0) revert InvalidZeroInput(); emit CoolDownPeriodUpdated(coolDownPeriod, _newCoolDownPeriod); coolDownPeriod = _newCoolDownPeriod; } /** * @notice Enables Withdraw Queue for specified ERC20 asset * @dev It is a permissioned call (onlyWithdrawQueueAdmin) * @param _asset collateral asset address to enable withdraw queue for */ function enableERC20WithdrawQueue(address _asset) external onlyWithdrawQueueAdmin { if (_asset == address(0)) revert InvalidZeroInput(); if (_asset == IS_NATIVE) revert IsNativeAddressNotAllowed(); // check if _asset is collateral Token. call will revert if not collateral asset restakeManager.getCollateralTokenIndex(IERC20(_asset)); erc20WithdrawQueueEnabled[_asset] = true; emit WithdrawQueueEnabled(_asset); } /** * @notice disables Withdraw Queue for specified ERC20 asset * @dev It is a permissioned call (onlyWithdrawQueueAdmin) * @param _asset collateral asset address to disable withdraw queue for */ function disableERC20WithdrawQueue(address _asset) external onlyWithdrawQueueAdmin { if (_asset == address(0)) revert InvalidZeroInput(); // check if withdraw queue enabled for asset if (!erc20WithdrawQueueEnabled[_asset]) revert WithdrawQueueNotEnabled(); erc20WithdrawQueueEnabled[_asset] = false; emit WithdrawQueueDisabled(_asset); } /** * @notice Pause the contract * @dev Permissioned call (onlyDepositWithdrawPauserAdmin) */ function pause() external onlyDepositWithdrawPauserAdmin { _pause(); } /** * @notice Unpause the contract * @dev Permissioned call (onlyDepositWithdrawPauserAdmin) */ function unpause() external onlyDepositWithdrawPauserAdmin { _unpause(); } /** * @notice returns available to withdraw for particular asset * @param _asset address of asset. for ETH _asset = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE * @return uint256 amount available to withdraw from buffer */ function getAvailableToWithdraw(address _asset) public view returns (uint256) { if (_asset != IS_NATIVE) { return IERC20(_asset).balanceOf(address(this)) - claimReserve[_asset]; } else { return address(this).balance - claimReserve[_asset]; } } /** * @notice returns empty withdraw buffer for particular asset * @dev returns 0 is buffer is full * @param _asset address of asset. for ETH _asset = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE * @return uint256 amount of buffer to be filled */ function getWithdrawDeficit(address _asset) public view returns (uint256) { uint256 availableToWithdraw = getAvailableToWithdraw(_asset); uint256 bufferDeficit = withdrawalBufferTarget[_asset] > availableToWithdraw ? withdrawalBufferTarget[_asset] - availableToWithdraw : 0; // Only allow queueDeficit for ETH or queue enabled erc20 asset if (_asset == IS_NATIVE) { uint256 queueDeficit = (ethWithdrawQueue.queuedWithdrawToFill > ethWithdrawQueue.queuedWithdrawFilled) ? (ethWithdrawQueue.queuedWithdrawToFill - ethWithdrawQueue.queuedWithdrawFilled) : 0; return bufferDeficit + queueDeficit; } else if (erc20WithdrawQueueEnabled[_asset]) { uint256 queueDeficit = (erc20WithdrawQueue[_asset].queuedWithdrawToFill > erc20WithdrawQueue[_asset].queuedWithdrawFilled) ? (erc20WithdrawQueue[_asset].queuedWithdrawToFill - erc20WithdrawQueue[_asset].queuedWithdrawFilled) : 0; return bufferDeficit + queueDeficit; } else { return bufferDeficit; } } /** * @notice fill Eth WithdrawBuffer from RestakeManager deposits * @dev permissioned call (onlyDepositQueue) */ function fillEthWithdrawBuffer() external payable nonReentrant onlyDepositQueue { uint256 queueFilled = _checkAndFillWithdrawQueue(IS_NATIVE, msg.value); emit EthBufferFilled(msg.value - queueFilled); } /** * @notice Fill ERC20 token withdraw buffer from RestakeManager deposits * @dev permissioned call (onlyDepositQueue) * @param _asset address of ERC20 asset to fill up the buffer * @param _amount amount of ERC20 asset to fill up the buffer */ function fillERC20WithdrawBuffer( address _asset, uint256 _amount ) external nonReentrant onlyDepositQueue { if (_asset == address(0) || _amount == 0) revert InvalidZeroInput(); // check if provided assetOut is supported if (withdrawalBufferTarget[_asset] == 0) revert UnsupportedWithdrawAsset(); uint256 queueFilled = 0; if (erc20WithdrawQueueEnabled[_asset]) { queueFilled = _checkAndFillWithdrawQueue(_asset, _amount); } IERC20(_asset).safeTransferFrom(msg.sender, address(this), _amount); emit ERC20BufferFilled(_asset, _amount - queueFilled); } /** * @notice Creates a withdraw request for user * @param _amount amount of ezETH to withdraw * @param _assetOut output token to receive on claim */ function withdraw(uint256 _amount, address _assetOut) external nonReentrant whenNotPaused { // check for 0 values if (_amount == 0 || _assetOut == address(0)) revert InvalidZeroInput(); // check if provided assetOut is supported if (withdrawalBufferTarget[_assetOut] == 0) revert UnsupportedWithdrawAsset(); // transfer ezETH tokens to this address IERC20(address(ezETH)).safeTransferFrom(msg.sender, address(this), _amount); ( uint256[][] memory _operatorDelegatorTokenTVLs, uint256 amountToRedeem ) = _calculateAmountToRedeem(_amount, _assetOut); // increment the withdrawRequestNonce withdrawRequestNonce++; WithdrawRequest memory withdrawRequest = WithdrawRequest( _assetOut, withdrawRequestNonce, amountToRedeem, _amount, block.timestamp ); uint256 availableToWithdraw = getAvailableToWithdraw(_assetOut); bool queued = false; // If amountToRedeem is greater than available to withdraw if (amountToRedeem > availableToWithdraw) { // check if enough collateral available in protocol _checkAvailableCollateralValue(amountToRedeem, _assetOut, _operatorDelegatorTokenTVLs); if (_assetOut == IS_NATIVE) { // fill the queue with availableToWithdraw ethWithdrawQueue.queuedWithdrawFilled += availableToWithdraw; // update the queue to fill ethWithdrawQueue.queuedWithdrawToFill += amountToRedeem; } else if (erc20WithdrawQueueEnabled[_assetOut]) { // fill the queue with availableToWithdraw erc20WithdrawQueue[_assetOut].queuedWithdrawFilled += availableToWithdraw; // update the queue to fill erc20WithdrawQueue[_assetOut].queuedWithdrawToFill += amountToRedeem; } else { // Revert if assetOut is not ETH or queue enabled asset revert NotEnoughWithdrawBuffer(); } // increase the claim reserve to partially fill withdrawRequest with max available in buffer claimReserve[_assetOut] += availableToWithdraw; // calculate withdrawRequest hash bytes32 withdrawHash = keccak256(abi.encode(withdrawRequest, msg.sender)); // mark withdraw as queued and track fillAt with current queue top withdrawQueued[withdrawHash].queued = true; withdrawQueued[withdrawHash].fillAt = _assetOut == IS_NATIVE ? ethWithdrawQueue.queuedWithdrawToFill : erc20WithdrawQueue[_assetOut].queuedWithdrawToFill; // mark queued to true queued = true; } else { // add redeem amount to claimReserve of claim asset claimReserve[_assetOut] += amountToRedeem; } // add withdraw request for msg.sender withdrawRequests[msg.sender].push(withdrawRequest); emit WithdrawRequestCreated( withdrawRequestNonce, msg.sender, _assetOut, amountToRedeem, _amount, withdrawRequests[msg.sender].length - 1, queued, availableToWithdraw ); } /** * @notice Returns the number of outstanding withdrawal requests of the specified user * @param user address of the user * @return uint256 number of outstanding withdrawal requests */ function getOutstandingWithdrawRequests(address user) public view returns (uint256) { return withdrawRequests[user].length; } /** * @notice Claim user withdraw request * @dev revert on claim before cooldown period * @param withdrawRequestIndex Index of the Withdraw Request user wants to claim * @param user address of the user to claim withdrawRequest for */ function claim(uint256 withdrawRequestIndex, address user) external nonReentrant whenNotPaused { // check if provided withdrawRequest Index is valid if (withdrawRequestIndex >= withdrawRequests[user].length) revert InvalidWithdrawIndex(); WithdrawRequest memory _withdrawRequest = withdrawRequests[user][withdrawRequestIndex]; if (block.timestamp - _withdrawRequest.createdAt < coolDownPeriod) revert EarlyClaim(); // calculate the amount to redeem (, uint256 claimAmountToRedeem) = _calculateAmountToRedeem( _withdrawRequest.ezETHLocked, _withdrawRequest.collateralToken ); // check if collateral asset is ETH and queued if (_withdrawRequest.collateralToken == IS_NATIVE) { bytes32 _withdrawHash = keccak256(abi.encode(_withdrawRequest, user)); // Revert if withdrawal is queued and not filled completely if ( withdrawQueued[_withdrawHash].queued && withdrawQueued[_withdrawHash].fillAt > ethWithdrawQueue.queuedWithdrawFilled ) revert QueuedWithdrawalNotFilled(); } // reduce initial amountToRedeem from claim reserve claimReserve[_withdrawRequest.collateralToken] -= _withdrawRequest.amountToRedeem; // update withdraw request amount to redeem if lower at claim time. if (claimAmountToRedeem < _withdrawRequest.amountToRedeem) { _withdrawRequest.amountToRedeem = claimAmountToRedeem; } // delete the withdraw request withdrawRequests[user][withdrawRequestIndex] = withdrawRequests[user][ withdrawRequests[user].length - 1 ]; withdrawRequests[user].pop(); // burn ezETH locked for withdraw request ezETH.burn(address(this), _withdrawRequest.ezETHLocked); // send selected redeem asset to user if (_withdrawRequest.collateralToken == IS_NATIVE) { (bool success, ) = payable(user).call{ value: _withdrawRequest.amountToRedeem }(""); if (!success) revert TransferFailed(); } else { IERC20(_withdrawRequest.collateralToken).transfer( user, _withdrawRequest.amountToRedeem ); } // emit the event emit WithdrawRequestClaimed(_withdrawRequest); } function _calculateAmountToRedeem( uint256 _amount, address _assetOut ) internal view returns (uint256[][] memory operatorDelegatorTokenTVLs, uint256 _amountToRedeem) { uint256 totalTVL = 0; // calculate totalTVL (operatorDelegatorTokenTVLs, , totalTVL) = restakeManager.calculateTVLs(); // Calculate amount to Redeem in ETH _amountToRedeem = renzoOracle.calculateRedeemAmount(_amount, ezETH.totalSupply(), totalTVL); // update amount in claim asset, if claim asset is not ETH if (_assetOut != IS_NATIVE) { // Get ERC20 asset equivalent amount _amountToRedeem = renzoOracle.lookupTokenAmountFromValue( IERC20(_assetOut), _amountToRedeem ); } } function _checkAndFillWithdrawQueue(address _asset, uint256 amount) internal returns (uint256) { uint256 queueDeficit = 0; if (_asset == IS_NATIVE) { queueDeficit = (ethWithdrawQueue.queuedWithdrawToFill > ethWithdrawQueue.queuedWithdrawFilled) ? (ethWithdrawQueue.queuedWithdrawToFill - ethWithdrawQueue.queuedWithdrawFilled) : 0; } else if (erc20WithdrawQueueEnabled[_asset]) { queueDeficit = (erc20WithdrawQueue[_asset].queuedWithdrawToFill > erc20WithdrawQueue[_asset].queuedWithdrawFilled) ? (erc20WithdrawQueue[_asset].queuedWithdrawToFill - erc20WithdrawQueue[_asset].queuedWithdrawFilled) : 0; } uint256 queueFilled = 0; if (queueDeficit > 0) { queueFilled = queueDeficit > amount ? amount : queueDeficit; // Increase claimReserve claimReserve[_asset] += queueFilled; // Increase the queueFilled if (_asset == IS_NATIVE) { ethWithdrawQueue.queuedWithdrawFilled += queueFilled; } else if (erc20WithdrawQueueEnabled[_asset]) { erc20WithdrawQueue[_asset].queuedWithdrawFilled += queueFilled; } emit QueueFilled(queueFilled, _asset); } return queueFilled; } function _checkAvailableCollateralValue( uint256 _amount, address _asset, uint256[][] memory _operatorDelegatorTokenTVLs ) internal view { uint256 collateralIndex; uint256 totalCollateralValue; if (_asset != IS_NATIVE) { // if asset is ERC20 get the collateral index and token value _amount = renzoOracle.lookupTokenValue(IERC20(_asset), _amount); totalCollateralValue = renzoOracle.lookupTokenValue( IERC20(_asset), getAvailableToWithdraw(_asset) ); collateralIndex = restakeManager.getCollateralTokenIndex(IERC20(_asset)); } else { // collateral index for ETH is last index in calculate TVL collateralIndex = _operatorDelegatorTokenTVLs[0].length - 1; totalCollateralValue = address(restakeManager.depositQueue()).balance + getAvailableToWithdraw(_asset); } // calculate total Collateral Value in protocol for (uint256 i = 0; i < _operatorDelegatorTokenTVLs.length; ) { totalCollateralValue += _operatorDelegatorTokenTVLs[i][collateralIndex]; unchecked { ++i; } } if (totalCollateralValue < _amount) revert NotEnoughCollateralValue(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../EigenLayer/interfaces/IStrategyManager.sol"; import "../EigenLayer/interfaces/IDelegationManager.sol"; import "../EigenLayer/interfaces/IEigenPod.sol"; interface IOperatorDelegator { function getTokenBalanceFromStrategy(IERC20 token) external view returns (uint256); function deposit(IERC20 _token, uint256 _tokenAmount) external returns (uint256 shares); // Note: Withdraws disabled for this release // function startWithdrawal(IERC20 _token, uint256 _tokenAmount) external returns (bytes32); // function completeWithdrawal( // IStrategyManager.DeprecatedStruct_QueuedWithdrawal calldata _withdrawal, // IERC20 _token, // uint256 _middlewareTimesIndex, // address _sendToAddress // ) external; function getStakedETHBalance() external view returns (uint256); function stakeEth( bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot ) external payable; function eigenPod() external view returns (IEigenPod); function pendingUnstakedDelayedWithdrawalAmount() external view returns (uint256); function delegateAddress() external view returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "../Withdraw/IWithdrawQueue.sol"; interface IDepositQueue { function depositETHFromProtocol() external payable; function totalEarned(address tokenAddress) external view returns (uint256); function forwardFullWithdrawalETH() external payable; function withdrawQueue() external view returns (IWithdrawQueue); function fillERC20withdrawBuffer(address _asset, uint256 _amount) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "./IStrategy.sol"; import "./ISignatureUtils.sol"; import "./IStrategyManager.sol"; /** * @title DelegationManager * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service * @notice This is the contract for delegation in EigenLayer. The main functionalities of this contract are * - enabling anyone to register as an operator in EigenLayer * - allowing operators to specify parameters related to stakers who delegate to them * - enabling any staker to delegate its stake to the operator of its choice (a given staker can only delegate to a single operator at a time) * - enabling a staker to undelegate its assets from the operator it is delegated to (performed as part of the withdrawal process, initiated through the StrategyManager) */ interface IDelegationManager is ISignatureUtils { // Access to public vars - hack locally function beaconChainETHStrategy() external returns (IStrategy); function pendingWithdrawals(bytes32 withdrawalRoot) external view returns (bool); function getDelegatableShares( address staker ) external view returns (IStrategy[] memory, uint256[] memory); // @notice Struct used for storing information about a single operator who has registered with EigenLayer struct OperatorDetails { // @notice address to receive the rewards that the operator earns via serving applications built on EigenLayer. address earningsReceiver; /** * @notice Address to verify signatures when a staker wishes to delegate to the operator, as well as controlling "forced undelegations". * @dev Signature verification follows these rules: * 1) If this address is left as address(0), then any staker will be free to delegate to the operator, i.e. no signature verification will be performed. * 2) If this address is an EOA (i.e. it has no code), then we follow standard ECDSA signature verification for delegations to the operator. * 3) If this address is a contract (i.e. it has code) then we forward a call to the contract and verify that it returns the correct EIP-1271 "magic value". */ address delegationApprover; /** * @notice A minimum delay -- measured in blocks -- enforced between: * 1) the operator signalling their intent to register for a service, via calling `Slasher.optIntoSlashing` * and * 2) the operator completing registration for the service, via the service ultimately calling `Slasher.recordFirstStakeUpdate` * @dev note that for a specific operator, this value *cannot decrease*, i.e. if the operator wishes to modify their OperatorDetails, * then they are only allowed to either increase this value or keep it the same. */ uint32 stakerOptOutWindowBlocks; } /** * @notice Abstract struct used in calculating an EIP712 signature for a staker to approve that they (the staker themselves) delegate to a specific operator. * @dev Used in computing the `STAKER_DELEGATION_TYPEHASH` and as a reference in the computation of the stakerDigestHash in the `delegateToBySignature` function. */ struct StakerDelegation { // the staker who is delegating address staker; // the operator being delegated to address operator; // the staker's nonce uint256 nonce; // the expiration timestamp (UTC) of the signature uint256 expiry; } /** * @notice Abstract struct used in calculating an EIP712 signature for an operator's delegationApprover to approve that a specific staker delegate to the operator. * @dev Used in computing the `DELEGATION_APPROVAL_TYPEHASH` and as a reference in the computation of the approverDigestHash in the `_delegate` function. */ struct DelegationApproval { // the staker who is delegating address staker; // the operator being delegated to address operator; // the operator's provided salt bytes32 salt; // the expiration timestamp (UTC) of the signature uint256 expiry; } /** * Struct type used to specify an existing queued withdrawal. Rather than storing the entire struct, only a hash is stored. * In functions that operate on existing queued withdrawals -- e.g. completeQueuedWithdrawal`, the data is resubmitted and the hash of the submitted * data is computed by `calculateWithdrawalRoot` and checked against the stored hash in order to confirm the integrity of the submitted data. */ struct Withdrawal { // The address that originated the Withdrawal address staker; // The address that the staker was delegated to at the time that the Withdrawal was created address delegatedTo; // The address that can complete the Withdrawal + will receive funds when completing the withdrawal address withdrawer; // Nonce used to guarantee that otherwise identical withdrawals have unique hashes uint256 nonce; // Block number when the Withdrawal was created uint32 startBlock; // Array of strategies that the Withdrawal contains IStrategy[] strategies; // Array containing the amount of shares in each Strategy in the `strategies` array uint256[] shares; } struct QueuedWithdrawalParams { // Array of strategies that the QueuedWithdrawal contains IStrategy[] strategies; // Array containing the amount of shares in each Strategy in the `strategies` array uint256[] shares; // The address of the withdrawer address withdrawer; } // @notice Emitted when a new operator registers in EigenLayer and provides their OperatorDetails. event OperatorRegistered(address indexed operator, OperatorDetails operatorDetails); /// @notice Emitted when an operator updates their OperatorDetails to @param newOperatorDetails event OperatorDetailsModified(address indexed operator, OperatorDetails newOperatorDetails); /** * @notice Emitted when @param operator indicates that they are updating their MetadataURI string * @dev Note that these strings are *never stored in storage* and are instead purely emitted in events for off-chain indexing */ event OperatorMetadataURIUpdated(address indexed operator, string metadataURI); /// @notice Emitted whenever an operator's shares are increased for a given strategy. Note that shares is the delta in the operator's shares. event OperatorSharesIncreased( address indexed operator, address staker, IStrategy strategy, uint256 shares ); /// @notice Emitted whenever an operator's shares are decreased for a given strategy. Note that shares is the delta in the operator's shares. event OperatorSharesDecreased( address indexed operator, address staker, IStrategy strategy, uint256 shares ); /// @notice Emitted when @param staker delegates to @param operator. event StakerDelegated(address indexed staker, address indexed operator); /// @notice Emitted when @param staker undelegates from @param operator. event StakerUndelegated(address indexed staker, address indexed operator); /// @notice Emitted when @param staker is undelegated via a call not originating from the staker themself event StakerForceUndelegated(address indexed staker, address indexed operator); /** * @notice Emitted when a new withdrawal is queued. * @param withdrawalRoot Is the hash of the `withdrawal`. * @param withdrawal Is the withdrawal itself. */ event WithdrawalQueued(bytes32 withdrawalRoot, Withdrawal withdrawal); /// @notice Emitted when a queued withdrawal is completed event WithdrawalCompleted(bytes32 withdrawalRoot); /// @notice Emitted when a queued withdrawal is *migrated* from the StrategyManager to the DelegationManager event WithdrawalMigrated(bytes32 oldWithdrawalRoot, bytes32 newWithdrawalRoot); /// @notice Emitted when the `minWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`. event MinWithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue); /// @notice Emitted when the `strategyWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`. event StrategyWithdrawalDelayBlocksSet( IStrategy strategy, uint256 previousValue, uint256 newValue ); /** * @notice Registers the caller as an operator in EigenLayer. * @param registeringOperatorDetails is the `OperatorDetails` for the operator. * @param metadataURI is a URI for the operator's metadata, i.e. a link providing more details on the operator. * * @dev Once an operator is registered, they cannot 'deregister' as an operator, and they will forever be considered "delegated to themself". * @dev This function will revert if the caller attempts to set their `earningsReceiver` to address(0). * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `OperatorMetadataURIUpdated` event */ function registerAsOperator( OperatorDetails calldata registeringOperatorDetails, string calldata metadataURI ) external; /** * @notice Updates an operator's stored `OperatorDetails`. * @param newOperatorDetails is the updated `OperatorDetails` for the operator, to replace their current OperatorDetails`. * * @dev The caller must have previously registered as an operator in EigenLayer. * @dev This function will revert if the caller attempts to set their `earningsReceiver` to address(0). */ function modifyOperatorDetails(OperatorDetails calldata newOperatorDetails) external; /** * @notice Called by an operator to emit an `OperatorMetadataURIUpdated` event indicating the information has updated. * @param metadataURI The URI for metadata associated with an operator * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `OperatorMetadataURIUpdated` event */ function updateOperatorMetadataURI(string calldata metadataURI) external; /** * @notice Caller delegates their stake to an operator. * @param operator The account (`msg.sender`) is delegating its assets to for use in serving applications built on EigenLayer. * @param approverSignatureAndExpiry Verifies the operator approves of this delegation * @param approverSalt A unique single use value tied to an individual signature. * @dev The approverSignatureAndExpiry is used in the event that: * 1) the operator's `delegationApprover` address is set to a non-zero value. * AND * 2) neither the operator nor their `delegationApprover` is the `msg.sender`, since in the event that the operator * or their delegationApprover is the `msg.sender`, then approval is assumed. * @dev In the event that `approverSignatureAndExpiry` is not checked, its content is ignored entirely; it's recommended to use an empty input * in this case to save on complexity + gas costs */ function delegateTo( address operator, SignatureWithExpiry memory approverSignatureAndExpiry, bytes32 approverSalt ) external; /** * @notice Caller delegates a staker's stake to an operator with valid signatures from both parties. * @param staker The account delegating stake to an `operator` account * @param operator The account (`staker`) is delegating its assets to for use in serving applications built on EigenLayer. * @param stakerSignatureAndExpiry Signed data from the staker authorizing delegating stake to an operator * @param approverSignatureAndExpiry is a parameter that will be used for verifying that the operator approves of this delegation action in the event that: * @param approverSalt Is a salt used to help guarantee signature uniqueness. Each salt can only be used once by a given approver. * * @dev If `staker` is an EOA, then `stakerSignature` is verified to be a valid ECDSA stakerSignature from `staker`, indicating their intention for this action. * @dev If `staker` is a contract, then `stakerSignature` will be checked according to EIP-1271. * @dev the operator's `delegationApprover` address is set to a non-zero value. * @dev neither the operator nor their `delegationApprover` is the `msg.sender`, since in the event that the operator or their delegationApprover * is the `msg.sender`, then approval is assumed. * @dev This function will revert if the current `block.timestamp` is equal to or exceeds the expiry * @dev In the case that `approverSignatureAndExpiry` is not checked, its content is ignored entirely; it's recommended to use an empty input * in this case to save on complexity + gas costs */ function delegateToBySignature( address staker, address operator, SignatureWithExpiry memory stakerSignatureAndExpiry, SignatureWithExpiry memory approverSignatureAndExpiry, bytes32 approverSalt ) external; /** * @notice Undelegates the staker from the operator who they are delegated to. Puts the staker into the "undelegation limbo" mode of the EigenPodManager * and queues a withdrawal of all of the staker's shares in the StrategyManager (to the staker), if necessary. * @param staker The account to be undelegated. * @return withdrawalRoot The root of the newly queued withdrawal, if a withdrawal was queued. Otherwise just bytes32(0). * * @dev Reverts if the `staker` is also an operator, since operators are not allowed to undelegate from themselves. * @dev Reverts if the caller is not the staker, nor the operator who the staker is delegated to, nor the operator's specified "delegationApprover" * @dev Reverts if the `staker` is already undelegated. */ function undelegate(address staker) external returns (bytes32[] memory withdrawalRoot); /** * Allows a staker to withdraw some shares. Withdrawn shares/strategies are immediately removed * from the staker. If the staker is delegated, withdrawn shares/strategies are also removed from * their operator. * * All withdrawn shares/strategies are placed in a queue and can be fully withdrawn after a delay. */ function queueWithdrawals( QueuedWithdrawalParams[] calldata queuedWithdrawalParams ) external returns (bytes32[] memory); /** * @notice Used to complete the specified `withdrawal`. The caller must match `withdrawal.withdrawer` * @param withdrawal The Withdrawal to complete. * @param tokens Array in which the i-th entry specifies the `token` input to the 'withdraw' function of the i-th Strategy in the `withdrawal.strategies` array. * This input can be provided with zero length if `receiveAsTokens` is set to 'false' (since in that case, this input will be unused) * @param middlewareTimesIndex is the index in the operator that the staker who triggered the withdrawal was delegated to's middleware times array * @param receiveAsTokens If true, the shares specified in the withdrawal will be withdrawn from the specified strategies themselves * and sent to the caller, through calls to `withdrawal.strategies[i].withdraw`. If false, then the shares in the specified strategies * will simply be transferred to the caller directly. * @dev middlewareTimesIndex should be calculated off chain before calling this function by finding the first index that satisfies `slasher.canWithdraw` * @dev beaconChainETHStrategy shares are non-transferrable, so if `receiveAsTokens = false` and `withdrawal.withdrawer != withdrawal.staker`, note that * any beaconChainETHStrategy shares in the `withdrawal` will be _returned to the staker_, rather than transferred to the withdrawer, unlike shares in * any other strategies, which will be transferred to the withdrawer. */ function completeQueuedWithdrawal( Withdrawal calldata withdrawal, IERC20[] calldata tokens, uint256 middlewareTimesIndex, bool receiveAsTokens ) external; /** * @notice Array-ified version of `completeQueuedWithdrawal`. * Used to complete the specified `withdrawals`. The function caller must match `withdrawals[...].withdrawer` * @param withdrawals The Withdrawals to complete. * @param tokens Array of tokens for each Withdrawal. See `completeQueuedWithdrawal` for the usage of a single array. * @param middlewareTimesIndexes One index to reference per Withdrawal. See `completeQueuedWithdrawal` for the usage of a single index. * @param receiveAsTokens Whether or not to complete each withdrawal as tokens. See `completeQueuedWithdrawal` for the usage of a single boolean. * @dev See `completeQueuedWithdrawal` for relevant dev tags */ function completeQueuedWithdrawals( Withdrawal[] calldata withdrawals, IERC20[][] calldata tokens, uint256[] calldata middlewareTimesIndexes, bool[] calldata receiveAsTokens ) external; /** * @notice Increases a staker's delegated share balance in a strategy. * @param staker The address to increase the delegated shares for their operator. * @param strategy The strategy in which to increase the delegated shares. * @param shares The number of shares to increase. * * @dev *If the staker is actively delegated*, then increases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing. * @dev Callable only by the StrategyManager or EigenPodManager. */ function increaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external; /** * @notice Decreases a staker's delegated share balance in a strategy. * @param staker The address to increase the delegated shares for their operator. * @param strategy The strategy in which to decrease the delegated shares. * @param shares The number of shares to decrease. * * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing. * @dev Callable only by the StrategyManager or EigenPodManager. */ function decreaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external; /** * @notice returns the address of the operator that `staker` is delegated to. * @notice Mapping: staker => operator whom the staker is currently delegated to. * @dev Note that returning address(0) indicates that the staker is not actively delegated to any operator. */ function delegatedTo(address staker) external view returns (address); /** * @notice Returns the OperatorDetails struct associated with an `operator`. */ function operatorDetails(address operator) external view returns (OperatorDetails memory); /* * @notice Returns the earnings receiver address for an operator */ function earningsReceiver(address operator) external view returns (address); /** * @notice Returns the delegationApprover account for an operator */ function delegationApprover(address operator) external view returns (address); /** * @notice Returns the stakerOptOutWindowBlocks for an operator */ function stakerOptOutWindowBlocks(address operator) external view returns (uint256); /** * @notice Given array of strategies, returns array of shares for the operator */ function getOperatorShares( address operator, IStrategy[] memory strategies ) external view returns (uint256[] memory); /** * @notice Given a list of strategies, return the minimum number of blocks that must pass to withdraw * from all the inputted strategies. Return value is >= minWithdrawalDelayBlocks as this is the global min withdrawal delay. * @param strategies The strategies to check withdrawal delays for */ function getWithdrawalDelay(IStrategy[] calldata strategies) external view returns (uint256); /** * @notice returns the total number of shares in `strategy` that are delegated to `operator`. * @notice Mapping: operator => strategy => total number of shares in the strategy delegated to the operator. * @dev By design, the following invariant should hold for each Strategy: * (operator's shares in delegation manager) = sum (shares above zero of all stakers delegated to operator) * = sum (delegateable shares of all stakers delegated to the operator) */ function operatorShares(address operator, IStrategy strategy) external view returns (uint256); /** * @notice Returns 'true' if `staker` *is* actively delegated, and 'false' otherwise. */ function isDelegated(address staker) external view returns (bool); /** * @notice Returns true is an operator has previously registered for delegation. */ function isOperator(address operator) external view returns (bool); /// @notice Mapping: staker => number of signed delegation nonces (used in `delegateToBySignature`) from the staker that the contract has already checked function stakerNonce(address staker) external view returns (uint256); /** * @notice Mapping: delegationApprover => 32-byte salt => whether or not the salt has already been used by the delegationApprover. * @dev Salts are used in the `delegateTo` and `delegateToBySignature` functions. Note that these functions only process the delegationApprover's * signature + the provided salt if the operator being delegated to has specified a nonzero address as their `delegationApprover`. */ function delegationApproverSaltIsSpent( address _delegationApprover, bytes32 salt ) external view returns (bool); /** * @notice Minimum delay enforced by this contract for completing queued withdrawals. Measured in blocks, and adjustable by this contract's owner, * up to a maximum of `MAX_WITHDRAWAL_DELAY_BLOCKS`. Minimum value is 0 (i.e. no delay enforced). * Note that strategies each have a separate withdrawal delay, which can be greater than this value. So the minimum number of blocks that must pass * to withdraw a strategy is MAX(minWithdrawalDelayBlocks, strategyWithdrawalDelayBlocks[strategy]) */ function minWithdrawalDelayBlocks() external view returns (uint256); /** * @notice Minimum delay enforced by this contract per Strategy for completing queued withdrawals. Measured in blocks, and adjustable by this contract's owner, * up to a maximum of `MAX_WITHDRAWAL_DELAY_BLOCKS`. Minimum value is 0 (i.e. no delay enforced). */ function strategyWithdrawalDelayBlocks(IStrategy strategy) external view returns (uint256); /** * @notice Calculates the digestHash for a `staker` to sign to delegate to an `operator` * @param staker The signing staker * @param operator The operator who is being delegated to * @param expiry The desired expiry time of the staker's signature */ function calculateCurrentStakerDelegationDigestHash( address staker, address operator, uint256 expiry ) external view returns (bytes32); /** * @notice Calculates the digest hash to be signed and used in the `delegateToBySignature` function * @param staker The signing staker * @param _stakerNonce The nonce of the staker. In practice we use the staker's current nonce, stored at `stakerNonce[staker]` * @param operator The operator who is being delegated to * @param expiry The desired expiry time of the staker's signature */ function calculateStakerDelegationDigestHash( address staker, uint256 _stakerNonce, address operator, uint256 expiry ) external view returns (bytes32); /** * @notice Calculates the digest hash to be signed by the operator's delegationApprove and used in the `delegateTo` and `delegateToBySignature` functions. * @param staker The account delegating their stake * @param operator The account receiving delegated stake * @param _delegationApprover the operator's `delegationApprover` who will be signing the delegationHash (in general) * @param approverSalt A unique and single use value associated with the approver signature. * @param expiry Time after which the approver's signature becomes invalid */ function calculateDelegationApprovalDigestHash( address staker, address operator, address _delegationApprover, bytes32 approverSalt, uint256 expiry ) external view returns (bytes32); /// @notice The EIP-712 typehash for the contract's domain function DOMAIN_TYPEHASH() external view returns (bytes32); /// @notice The EIP-712 typehash for the StakerDelegation struct used by the contract function STAKER_DELEGATION_TYPEHASH() external view returns (bytes32); /// @notice The EIP-712 typehash for the DelegationApproval struct used by the contract function DELEGATION_APPROVAL_TYPEHASH() external view returns (bytes32); /** * @notice Getter function for the current EIP-712 domain separator for this contract. * * @dev The domain separator will change in the event of a fork that changes the ChainID. * @dev By introducing a domain separator the DApp developers are guaranteed that there can be no signature collision. * for more detailed information please read EIP-712. */ function domainSeparator() external view returns (bytes32); /// @notice Mapping: staker => cumulative number of queued withdrawals they have ever initiated. /// @dev This only increments (doesn't decrement), and is used to help ensure that otherwise identical withdrawals have unique hashes. function cumulativeWithdrawalsQueued(address staker) external view returns (uint256); /// @notice Returns the keccak256 hash of `withdrawal`. function calculateWithdrawalRoot(Withdrawal memory withdrawal) external pure returns (bytes32); function migrateQueuedWithdrawals( IStrategyManager.DeprecatedStruct_QueuedWithdrawal[] memory withdrawalsToQueue ) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "../libraries/BeaconChainProofs.sol"; import "./IEigenPodManager.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title The implementation contract used for restaking beacon chain ETH on EigenLayer * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service * @dev Note that all beacon chain balances are stored as gwei within the beacon chain datastructures. We choose * to account balances in terms of gwei in the EigenPod contract and convert to wei when making calls to other contracts */ interface IEigenPod { /******************************************************************************* STRUCTS / ENUMS *******************************************************************************/ enum VALIDATOR_STATUS { INACTIVE, // doesnt exist ACTIVE, // staked on ethpos and withdrawal credentials are pointed to the EigenPod WITHDRAWN // withdrawn from the Beacon Chain } struct ValidatorInfo { // index of the validator in the beacon chain uint64 validatorIndex; // amount of beacon chain ETH restaked on EigenLayer in gwei uint64 restakedBalanceGwei; //timestamp of the validator's most recent balance update uint64 lastCheckpointedAt; // status of the validator VALIDATOR_STATUS status; } struct Checkpoint { bytes32 beaconBlockRoot; uint24 proofsRemaining; uint64 podBalanceGwei; int128 balanceDeltasGwei; } /******************************************************************************* EVENTS *******************************************************************************/ /// @notice Emitted when an ETH validator stakes via this eigenPod event EigenPodStaked(bytes pubkey); /// @notice Emitted when a pod owner updates the proof submitter address event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter); /// @notice Emitted when an ETH validator's withdrawal credentials are successfully verified to be pointed to this eigenPod event ValidatorRestaked(uint40 validatorIndex); /// @notice Emitted when an ETH validator's balance is proven to be updated. Here newValidatorBalanceGwei // is the validator's balance that is credited on EigenLayer. event ValidatorBalanceUpdated( uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei ); /// @notice Emitted when restaked beacon chain ETH is withdrawn from the eigenPod. event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount); /// @notice Emitted when ETH is received via the `receive` fallback event NonBeaconChainETHReceived(uint256 amountReceived); /// @notice Emitted when a checkpoint is created event CheckpointCreated( uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount ); /// @notice Emitted when a checkpoint is finalized event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei); /// @notice Emitted when a validator is proven for a given checkpoint event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex); /// @notice Emitted when a validaor is proven to have 0 balance at a given checkpoint event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex); /******************************************************************************* EXTERNAL STATE-CHANGING METHODS *******************************************************************************/ /// @notice Used to initialize the pointers to contracts crucial to the pod's functionality, in beacon proxy construction from EigenPodManager function initialize(address owner) external; /// @notice Called by EigenPodManager when the owner wants to create another ETH validator. function stake( bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot ) external payable; /** * @notice Transfers `amountWei` in ether from this contract to the specified `recipient` address * @notice Called by EigenPodManager to withdrawBeaconChainETH that has been added to the EigenPod's balance due to a withdrawal from the beacon chain. * @dev The podOwner must have already proved sufficient withdrawals, so that this pod's `withdrawableRestakedExecutionLayerGwei` exceeds the * `amountWei` input (when converted to GWEI). * @dev Reverts if `amountWei` is not a whole Gwei amount */ function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) external; /** * @dev Create a checkpoint used to prove this pod's active validator set. Checkpoints are completed * by submitting one checkpoint proof per ACTIVE validator. During the checkpoint process, the total * change in ACTIVE validator balance is tracked, and any validators with 0 balance are marked `WITHDRAWN`. * @dev Once finalized, the pod owner is awarded shares corresponding to: * - the total change in their ACTIVE validator balances * - any ETH in the pod not already awarded shares * @dev A checkpoint cannot be created if the pod already has an outstanding checkpoint. If * this is the case, the pod owner MUST complete the existing checkpoint before starting a new one. * @param revertIfNoBalance Forces a revert if the pod ETH balance is 0. This allows the pod owner * to prevent accidentally starting a checkpoint that will not increase their shares */ function startCheckpoint(bool revertIfNoBalance) external; /** * @dev Progress the current checkpoint towards completion by submitting one or more validator * checkpoint proofs. Anyone can call this method to submit proofs towards the current checkpoint. * For each validator proven, the current checkpoint's `proofsRemaining` decreases. * @dev If the checkpoint's `proofsRemaining` reaches 0, the checkpoint is finalized. * (see `_updateCheckpoint` for more details) * @dev This method can only be called when there is a currently-active checkpoint. * @param balanceContainerProof proves the beacon's current balance container root against a checkpoint's `beaconBlockRoot` * @param proofs Proofs for one or more validator current balances against the `balanceContainerRoot` */ function verifyCheckpointProofs( BeaconChainProofs.BalanceContainerProof calldata balanceContainerProof, BeaconChainProofs.BalanceProof[] calldata proofs ) external; /** * @dev Verify one or more validators have their withdrawal credentials pointed at this EigenPod, and award * shares based on their effective balance. Proven validators are marked `ACTIVE` within the EigenPod, and * future checkpoint proofs will need to include them. * @dev Withdrawal credential proofs MUST NOT be older than `currentCheckpointTimestamp`. * @dev Validators proven via this method MUST NOT have an exit epoch set already. * @param beaconTimestamp the beacon chain timestamp sent to the 4788 oracle contract. Corresponds * to the parent beacon block root against which the proof is verified. * @param stateRootProof proves a beacon state root against a beacon block root * @param validatorIndices a list of validator indices being proven * @param validatorFieldsProofs proofs of each validator's `validatorFields` against the beacon state root * @param validatorFields the fields of the beacon chain "Validator" container. See consensus specs for * details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator */ function verifyWithdrawalCredentials( uint64 beaconTimestamp, BeaconChainProofs.StateRootProof calldata stateRootProof, uint40[] calldata validatorIndices, bytes[] calldata validatorFieldsProofs, bytes32[][] calldata validatorFields ) external; /** * @dev Prove that one of this pod's active validators was slashed on the beacon chain. A successful * staleness proof allows the caller to start a checkpoint. * * @dev Note that in order to start a checkpoint, any existing checkpoint must already be completed! * (See `_startCheckpoint` for details) * * @dev Note that this method allows anyone to start a checkpoint as soon as a slashing occurs on the beacon * chain. This is intended to make it easier to external watchers to keep a pod's balance up to date. * * @dev Note too that beacon chain slashings are not instant. There is a delay between the initial slashing event * and the validator's final exit back to the execution layer. During this time, the validator's balance may or * may not drop further due to a correlation penalty. This method allows proof of a slashed validator * to initiate a checkpoint for as long as the validator remains on the beacon chain. Once the validator * has exited and been checkpointed at 0 balance, they are no longer "checkpoint-able" and cannot be proven * "stale" via this method. * See https://eth2book.info/capella/part3/transition/epoch/#slashings for more info. * * @param beaconTimestamp the beacon chain timestamp sent to the 4788 oracle contract. Corresponds * to the parent beacon block root against which the proof is verified. * @param stateRootProof proves a beacon state root against a beacon block root * @param proof the fields of the beacon chain "Validator" container, along with a merkle proof against * the beacon state root. See the consensus specs for more details: * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator * * @dev Staleness conditions: * - Validator's last checkpoint is older than `beaconTimestamp` * - Validator MUST be in `ACTIVE` status in the pod * - Validator MUST be slashed on the beacon chain */ function verifyStaleBalance( uint64 beaconTimestamp, BeaconChainProofs.StateRootProof calldata stateRootProof, BeaconChainProofs.ValidatorProof calldata proof ) external; /// @notice called by owner of a pod to remove any ERC20s deposited in the pod function recoverTokens( IERC20[] memory tokenList, uint256[] memory amountsToWithdraw, address recipient ) external; /// @notice Allows the owner of a pod to update the proof submitter, a permissioned /// address that can call `startCheckpoint` and `verifyWithdrawalCredentials`. /// @dev Note that EITHER the podOwner OR proofSubmitter can access these methods, /// so it's fine to set your proofSubmitter to 0 if you want the podOwner to be the /// only address that can call these methods. /// @param newProofSubmitter The new proof submitter address. If set to 0, only the /// pod owner will be able to call `startCheckpoint` and `verifyWithdrawalCredentials` function setProofSubmitter(address newProofSubmitter) external; /******************************************************************************* VIEW METHODS *******************************************************************************/ /// @notice An address with permissions to call `startCheckpoint` and `verifyWithdrawalCredentials`, set /// by the podOwner. This role exists to allow a podOwner to designate a hot wallet that can call /// these methods, allowing the podOwner to remain a cold wallet that is only used to manage funds. /// @dev If this address is NOT set, only the podOwner can call `startCheckpoint` and `verifyWithdrawalCredentials` function proofSubmitter() external view returns (address); /// @notice the amount of execution layer ETH in this contract that is staked in EigenLayer (i.e. withdrawn from beaconchain but not EigenLayer), function withdrawableRestakedExecutionLayerGwei() external view returns (uint64); /// @notice The single EigenPodManager for EigenLayer function eigenPodManager() external view returns (IEigenPodManager); /// @notice The owner of this EigenPod function podOwner() external view returns (address); /// @notice Returns the validatorInfo struct for the provided pubkeyHash function validatorPubkeyHashToInfo( bytes32 validatorPubkeyHash ) external view returns (ValidatorInfo memory); /// @notice Returns the validatorInfo struct for the provided pubkey function validatorPubkeyToInfo( bytes calldata validatorPubkey ) external view returns (ValidatorInfo memory); /// @notice This returns the status of a given validator function validatorStatus(bytes32 pubkeyHash) external view returns (VALIDATOR_STATUS); /// @notice This returns the status of a given validator pubkey function validatorStatus( bytes calldata validatorPubkey ) external view returns (VALIDATOR_STATUS); /// @notice Number of validators with proven withdrawal credentials, who do not have proven full withdrawals function activeValidatorCount() external view returns (uint256); /// @notice The timestamp of the last checkpoint finalized function lastCheckpointTimestamp() external view returns (uint64); /// @notice The timestamp of the currently-active checkpoint. Will be 0 if there is not active checkpoint function currentCheckpointTimestamp() external view returns (uint64); /// @notice Returns the currently-active checkpoint function currentCheckpoint() external view returns (Checkpoint memory); /// @notice For each checkpoint, the total balance attributed to exited validators, in gwei /// /// NOTE that the values added to this mapping are NOT guaranteed to capture the entirety of a validator's /// exit - rather, they capture the total change in a validator's balance when a checkpoint shows their /// balance change from nonzero to zero. While a change from nonzero to zero DOES guarantee that a validator /// has been fully exited, it is possible that the magnitude of this change does not capture what is /// typically thought of as a "full exit." /// /// For example: /// 1. Consider a validator was last checkpointed at 32 ETH before exiting. Once the exit has been processed, /// it is expected that the validator's exited balance is calculated to be `32 ETH`. /// 2. However, before `startCheckpoint` is called, a deposit is made to the validator for 1 ETH. The beacon /// chain will automatically withdraw this ETH, but not until the withdrawal sweep passes over the validator /// again. Until this occurs, the validator's current balance (used for checkpointing) is 1 ETH. /// 3. If `startCheckpoint` is called at this point, the balance delta calculated for this validator will be /// `-31 ETH`, and because the validator has a nonzero balance, it is not marked WITHDRAWN. /// 4. After the exit is processed by the beacon chain, a subsequent `startCheckpoint` and checkpoint proof /// will calculate a balance delta of `-1 ETH` and attribute a 1 ETH exit to the validator. /// /// If this edge case impacts your usecase, it should be possible to mitigate this by monitoring for deposits /// to your exited validators, and waiting to call `startCheckpoint` until those deposits have been automatically /// exited. /// /// Additional edge cases this mapping does not cover: /// - If a validator is slashed, their balance exited will reflect their original balance rather than the slashed amount /// - The final partial withdrawal for an exited validator will be likely be included in this mapping. /// i.e. if a validator was last checkpointed at 32.1 ETH before exiting, the next checkpoint will calculate their /// "exited" amount to be 32.1 ETH rather than 32 ETH. function checkpointBalanceExitedGwei(uint64) external view returns (uint64); /// @notice Query the 4788 oracle to get the parent block root of the slot with the given `timestamp` /// @param timestamp of the block for which the parent block root will be returned. MUST correspond /// to an existing slot within the last 24 hours. If the slot at `timestamp` was skipped, this method /// will revert. function getParentBlockRoot(uint64 timestamp) external view returns (bytes32); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; import "./IETHPOSDeposit.sol"; import "./IStrategyManager.sol"; import "./IEigenPod.sol"; import "./IPausable.sol"; import "./ISlasher.sol"; import "./IStrategy.sol"; /** * @title Interface for factory that creates and manages solo staking pods that have their withdrawal credentials pointed to EigenLayer. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service */ interface IEigenPodManager is IPausable { /// @notice Emitted to notify the deployment of an EigenPod event PodDeployed(address indexed eigenPod, address indexed podOwner); /// @notice Emitted to notify a deposit of beacon chain ETH recorded in the strategy manager event BeaconChainETHDeposited(address indexed podOwner, uint256 amount); /// @notice Emitted when the balance of an EigenPod is updated event PodSharesUpdated(address indexed podOwner, int256 sharesDelta); /// @notice Emitted when a withdrawal of beacon chain ETH is completed event BeaconChainETHWithdrawalCompleted( address indexed podOwner, uint256 shares, uint96 nonce, address delegatedAddress, address withdrawer, bytes32 withdrawalRoot ); /** * @notice Creates an EigenPod for the sender. * @dev Function will revert if the `msg.sender` already has an EigenPod. * @dev Returns EigenPod address */ function createPod() external returns (address); /** * @notice Stakes for a new beacon chain validator on the sender's EigenPod. * Also creates an EigenPod for the sender if they don't have one already. * @param pubkey The 48 bytes public key of the beacon chain validator. * @param signature The validator's signature of the deposit data. * @param depositDataRoot The root/hash of the deposit data for the validator's deposit. */ function stake( bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot ) external payable; /** * @notice Changes the `podOwner`'s shares by `sharesDelta` and performs a call to the DelegationManager * to ensure that delegated shares are also tracked correctly * @param podOwner is the pod owner whose balance is being updated. * @param sharesDelta is the change in podOwner's beaconChainETHStrategy shares * @dev Callable only by the podOwner's EigenPod contract. * @dev Reverts if `sharesDelta` is not a whole Gwei amount */ function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) external; /// @notice Returns the address of the `podOwner`'s EigenPod if it has been deployed. function ownerToPod(address podOwner) external view returns (IEigenPod); /// @notice Returns the address of the `podOwner`'s EigenPod (whether it is deployed yet or not). function getPod(address podOwner) external view returns (IEigenPod); /// @notice The ETH2 Deposit Contract function ethPOS() external view returns (IETHPOSDeposit); /// @notice Beacon proxy to which the EigenPods point function eigenPodBeacon() external view returns (IBeacon); /// @notice EigenLayer's StrategyManager contract function strategyManager() external view returns (IStrategyManager); /// @notice EigenLayer's Slasher contract function slasher() external view returns (ISlasher); /// @notice Returns 'true' if the `podOwner` has created an EigenPod, and 'false' otherwise. function hasPod(address podOwner) external view returns (bool); /// @notice Returns the number of EigenPods that have been created function numPods() external view returns (uint256); /** * @notice Mapping from Pod owner owner to the number of shares they have in the virtual beacon chain ETH strategy. * @dev The share amount can become negative. This is necessary to accommodate the fact that a pod owner's virtual beacon chain ETH shares can * decrease between the pod owner queuing and completing a withdrawal. * When the pod owner's shares would otherwise increase, this "deficit" is decreased first _instead_. * Likewise, when a withdrawal is completed, this "deficit" is decreased and the withdrawal amount is decreased; We can think of this * as the withdrawal "paying off the deficit". */ function podOwnerShares(address podOwner) external view returns (int256); /// @notice returns canonical, virtual beaconChainETH strategy function beaconChainETHStrategy() external view returns (IStrategy); /** * @notice Used by the DelegationManager to remove a pod owner's shares while they're in the withdrawal queue. * Simply decreases the `podOwner`'s shares by `shares`, down to a minimum of zero. * @dev This function reverts if it would result in `podOwnerShares[podOwner]` being less than zero, i.e. it is forbidden for this function to * result in the `podOwner` incurring a "share deficit". This behavior prevents a Staker from queuing a withdrawal which improperly removes excessive * shares from the operator to whom the staker is delegated. * @dev Reverts if `shares` is not a whole Gwei amount */ function removeShares(address podOwner, uint256 shares) external; /** * @notice Increases the `podOwner`'s shares by `shares`, paying off deficit if possible. * Used by the DelegationManager to award a pod owner shares on exiting the withdrawal queue * @dev Returns the number of shares added to `podOwnerShares[podOwner]` above zero, which will be less than the `shares` input * in the event that the podOwner has an existing shares deficit (i.e. `podOwnerShares[podOwner]` starts below zero) * @dev Reverts if `shares` is not a whole Gwei amount */ function addShares(address podOwner, uint256 shares) external returns (uint256); /** * @notice Used by the DelegationManager to complete a withdrawal, sending tokens to some destination address * @dev Prioritizes decreasing the podOwner's share deficit, if they have one * @dev Reverts if `shares` is not a whole Gwei amount */ function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) external; }
// ┏━━━┓━┏┓━┏┓━━┏━━━┓━━┏━━━┓━━━━┏━━━┓━━━━━━━━━━━━━━━━━━━┏┓━━━━━┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━━┏┓━ // ┃┏━━┛┏┛┗┓┃┃━━┃┏━┓┃━━┃┏━┓┃━━━━┗┓┏┓┃━━━━━━━━━━━━━━━━━━┏┛┗┓━━━━┃┏━┓┃━━━━━━━━┏┛┗┓━━━━━━━━━━━━┏┛┗┓ // ┃┗━━┓┗┓┏┛┃┗━┓┗┛┏┛┃━━┃┃━┃┃━━━━━┃┃┃┃┏━━┓┏━━┓┏━━┓┏━━┓┏┓┗┓┏┛━━━━┃┃━┗┛┏━━┓┏━┓━┗┓┏┛┏━┓┏━━┓━┏━━┓┗┓┏┛ // ┃┏━━┛━┃┃━┃┏┓┃┏━┛┏┛━━┃┃━┃┃━━━━━┃┃┃┃┃┏┓┃┃┏┓┃┃┏┓┃┃━━┫┣┫━┃┃━━━━━┃┃━┏┓┃┏┓┃┃┏┓┓━┃┃━┃┏┛┗━┓┃━┃┏━┛━┃┃━ // ┃┗━━┓━┃┗┓┃┃┃┃┃┃┗━┓┏┓┃┗━┛┃━━━━┏┛┗┛┃┃┃━┫┃┗┛┃┃┗┛┃┣━━┃┃┃━┃┗┓━━━━┃┗━┛┃┃┗┛┃┃┃┃┃━┃┗┓┃┃━┃┗┛┗┓┃┗━┓━┃┗┓ // ┗━━━┛━┗━┛┗┛┗┛┗━━━┛┗┛┗━━━┛━━━━┗━━━┛┗━━┛┃┏━┛┗━━┛┗━━┛┗┛━┗━┛━━━━┗━━━┛┗━━┛┗┛┗┛━┗━┛┗┛━┗━━━┛┗━━┛━┗━┛ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // SPDX-License-Identifier: CC0-1.0 pragma solidity >=0.5.0; // This interface is designed to be compatible with the Vyper version. /// @notice This is the Ethereum 2.0 deposit contract interface. /// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs interface IETHPOSDeposit { /// @notice A processed deposit event. event DepositEvent( bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index ); /// @notice Submit a Phase 0 DepositData object. /// @param pubkey A BLS12-381 public key. /// @param withdrawal_credentials Commitment to a public key for withdrawals. /// @param signature A BLS12-381 signature. /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object. /// Used as a protection against malformed input. function deposit( bytes calldata pubkey, bytes calldata withdrawal_credentials, bytes calldata signature, bytes32 deposit_data_root ) external payable; /// @notice Query the current deposit root hash. /// @return The deposit root hash. function get_deposit_root() external view returns (bytes32); /// @notice Query the current deposit count. /// @return The deposit count encoded as a little endian 64-bit number. function get_deposit_count() external view returns (bytes memory); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "../interfaces/IPauserRegistry.sol"; /** * @title Adds pausability to a contract, with pausing & unpausing controlled by the `pauser` and `unpauser` of a PauserRegistry contract. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service * @notice Contracts that inherit from this contract may define their own `pause` and `unpause` (and/or related) functions. * These functions should be permissioned as "onlyPauser" which defers to a `PauserRegistry` for determining access control. * @dev Pausability is implemented using a uint256, which allows up to 256 different single bit-flags; each bit can potentially pause different functionality. * Inspiration for this was taken from the NearBridge design here https://etherscan.io/address/0x3FEFc5A4B1c02f21cBc8D3613643ba0635b9a873#code. * For the `pause` and `unpause` functions we've implemented, if you pause, you can only flip (any number of) switches to on/1 (aka "paused"), and if you unpause, * you can only flip (any number of) switches to off/0 (aka "paused"). * If you want a pauseXYZ function that just flips a single bit / "pausing flag", it will: * 1) 'bit-wise and' (aka `&`) a flag with the current paused state (as a uint256) * 2) update the paused state to this new value * @dev We note as well that we have chosen to identify flags by their *bit index* as opposed to their numerical value, so, e.g. defining `DEPOSITS_PAUSED = 3` * indicates specifically that if the *third bit* of `_paused` is flipped -- i.e. it is a '1' -- then deposits should be paused */ interface IPausable { /// @notice Emitted when the `pauserRegistry` is set to `newPauserRegistry`. event PauserRegistrySet(IPauserRegistry pauserRegistry, IPauserRegistry newPauserRegistry); /// @notice Emitted when the pause is triggered by `account`, and changed to `newPausedStatus`. event Paused(address indexed account, uint256 newPausedStatus); /// @notice Emitted when the pause is lifted by `account`, and changed to `newPausedStatus`. event Unpaused(address indexed account, uint256 newPausedStatus); /// @notice Address of the `PauserRegistry` contract that this contract defers to for determining access control (for pausing). function pauserRegistry() external view returns (IPauserRegistry); /** * @notice This function is used to pause an EigenLayer contract's functionality. * It is permissioned to the `pauser` address, which is expected to be a low threshold multisig. * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once. * @dev This function can only pause functionality, and thus cannot 'unflip' any bit in `_paused` from 1 to 0. */ function pause(uint256 newPausedStatus) external; /** * @notice Alias for `pause(type(uint256).max)`. */ function pauseAll() external; /** * @notice This function is used to unpause an EigenLayer contract's functionality. * It is permissioned to the `unpauser` address, which is expected to be a high threshold multisig or governance contract. * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once. * @dev This function can only unpause functionality, and thus cannot 'flip' any bit in `_paused` from 0 to 1. */ function unpause(uint256 newPausedStatus) external; /// @notice Returns the current paused status as a uint256. function paused() external view returns (uint256); /// @notice Returns 'true' if the `indexed`th bit of `_paused` is 1, and 'false' otherwise function paused(uint8 index) external view returns (bool); /// @notice Allows the unpauser to set a new pauser registry function setPauserRegistry(IPauserRegistry newPauserRegistry) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; /** * @title Interface for the `PauserRegistry` contract. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service */ interface IPauserRegistry { event PauserStatusChanged(address pauser, bool canPause); event UnpauserChanged(address previousUnpauser, address newUnpauser); /// @notice Mapping of addresses to whether they hold the pauser role. function isPauser(address pauser) external view returns (bool); /// @notice Unique address that holds the unpauser role. Capable of changing *both* the pauser and unpauser addresses. function unpauser() external view returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; /** * @title The interface for common signature utilities. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service */ interface ISignatureUtils { // @notice Struct that bundles together a signature and an expiration time for the signature. Used primarily for stack management. struct SignatureWithExpiry { // the signature itself, formatted as a single bytes object bytes signature; // the expiration timestamp (UTC) of the signature uint256 expiry; } // @notice Struct that bundles together a signature, a salt for uniqueness, and an expiration time for the signature. Used primarily for stack management. struct SignatureWithSaltAndExpiry { // the signature itself, formatted as a single bytes object bytes signature; // the salt used to generate the signature bytes32 salt; // the expiration timestamp (UTC) of the signature uint256 expiry; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "./IStrategyManager.sol"; import "./IDelegationManager.sol"; /** * @title Interface for the primary 'slashing' contract for EigenLayer. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service * @notice See the `Slasher` contract itself for implementation details. */ interface ISlasher { // struct used to store information about the current state of an operator's obligations to middlewares they are serving struct MiddlewareTimes { // The update block for the middleware whose most recent update was earliest, i.e. the 'stalest' update out of all middlewares the operator is serving uint32 stalestUpdateBlock; // The latest 'serveUntilBlock' from all of the middleware that the operator is serving uint32 latestServeUntilBlock; } // struct used to store details relevant to a single middleware that an operator has opted-in to serving struct MiddlewareDetails { // the block at which the contract begins being able to finalize the operator's registration with the service via calling `recordFirstStakeUpdate` uint32 registrationMayBeginAtBlock; // the block before which the contract is allowed to slash the user uint32 contractCanSlashOperatorUntilBlock; // the block at which the middleware's view of the operator's stake was most recently updated uint32 latestUpdateBlock; } /// @notice Emitted when a middleware times is added to `operator`'s array. event MiddlewareTimesAdded( address operator, uint256 index, uint32 stalestUpdateBlock, uint32 latestServeUntilBlock ); /// @notice Emitted when `operator` begins to allow `contractAddress` to slash them. event OptedIntoSlashing(address indexed operator, address indexed contractAddress); /// @notice Emitted when `contractAddress` signals that it will no longer be able to slash `operator` after the `contractCanSlashOperatorUntilBlock`. event SlashingAbilityRevoked( address indexed operator, address indexed contractAddress, uint32 contractCanSlashOperatorUntilBlock ); /** * @notice Emitted when `slashingContract` 'freezes' the `slashedOperator`. * @dev The `slashingContract` must have permission to slash the `slashedOperator`, i.e. `canSlash(slasherOperator, slashingContract)` must return 'true'. */ event OperatorFrozen(address indexed slashedOperator, address indexed slashingContract); /// @notice Emitted when `previouslySlashedAddress` is 'unfrozen', allowing them to again move deposited funds within EigenLayer. event FrozenStatusReset(address indexed previouslySlashedAddress); /** * @notice Gives the `contractAddress` permission to slash the funds of the caller. * @dev Typically, this function must be called prior to registering for a middleware. */ function optIntoSlashing(address contractAddress) external; /** * @notice Used for 'slashing' a certain operator. * @param toBeFrozen The operator to be frozen. * @dev Technically the operator is 'frozen' (hence the name of this function), and then subject to slashing pending a decision by a human-in-the-loop. * @dev The operator must have previously given the caller (which should be a contract) the ability to slash them, through a call to `optIntoSlashing`. */ function freezeOperator(address toBeFrozen) external; /** * @notice Removes the 'frozen' status from each of the `frozenAddresses` * @dev Callable only by the contract owner (i.e. governance). */ function resetFrozenStatus(address[] calldata frozenAddresses) external; /** * @notice this function is a called by middlewares during an operator's registration to make sure the operator's stake at registration * is slashable until serveUntil * @param operator the operator whose stake update is being recorded * @param serveUntilBlock the block until which the operator's stake at the current block is slashable * @dev adds the middleware's slashing contract to the operator's linked list */ function recordFirstStakeUpdate(address operator, uint32 serveUntilBlock) external; /** * @notice this function is a called by middlewares during a stake update for an operator (perhaps to free pending withdrawals) * to make sure the operator's stake at updateBlock is slashable until serveUntil * @param operator the operator whose stake update is being recorded * @param updateBlock the block for which the stake update is being recorded * @param serveUntilBlock the block until which the operator's stake at updateBlock is slashable * @param insertAfter the element of the operators linked list that the currently updating middleware should be inserted after * @dev insertAfter should be calculated offchain before making the transaction that calls this. this is subject to race conditions, * but it is anticipated to be rare and not detrimental. */ function recordStakeUpdate( address operator, uint32 updateBlock, uint32 serveUntilBlock, uint256 insertAfter ) external; /** * @notice this function is a called by middlewares during an operator's deregistration to make sure the operator's stake at deregistration * is slashable until serveUntil * @param operator the operator whose stake update is being recorded * @param serveUntilBlock the block until which the operator's stake at the current block is slashable * @dev removes the middleware's slashing contract to the operator's linked list and revokes the middleware's (i.e. caller's) ability to * slash `operator` once `serveUntil` is reached */ function recordLastStakeUpdateAndRevokeSlashingAbility( address operator, uint32 serveUntilBlock ) external; /// @notice The StrategyManager contract of EigenLayer function strategyManager() external view returns (IStrategyManager); /// @notice The DelegationManager contract of EigenLayer function delegation() external view returns (IDelegationManager); /** * @notice Used to determine whether `staker` is actively 'frozen'. If a staker is frozen, then they are potentially subject to * slashing of their funds, and cannot cannot deposit or withdraw from the strategyManager until the slashing process is completed * and the staker's status is reset (to 'unfrozen'). * @param staker The staker of interest. * @return Returns 'true' if `staker` themselves has their status set to frozen, OR if the staker is delegated * to an operator who has their status set to frozen. Otherwise returns 'false'. */ function isFrozen(address staker) external view returns (bool); /// @notice Returns true if `slashingContract` is currently allowed to slash `toBeSlashed`. function canSlash(address toBeSlashed, address slashingContract) external view returns (bool); /// @notice Returns the block until which `serviceContract` is allowed to slash the `operator`. function contractCanSlashOperatorUntilBlock( address operator, address serviceContract ) external view returns (uint32); /// @notice Returns the block at which the `serviceContract` last updated its view of the `operator`'s stake function latestUpdateBlock( address operator, address serviceContract ) external view returns (uint32); /// @notice A search routine for finding the correct input value of `insertAfter` to `recordStakeUpdate` / `_updateMiddlewareList`. function getCorrectValueForInsertAfter( address operator, uint32 updateBlock ) external view returns (uint256); /** * @notice Returns 'true' if `operator` can currently complete a withdrawal started at the `withdrawalStartBlock`, with `middlewareTimesIndex` used * to specify the index of a `MiddlewareTimes` struct in the operator's list (i.e. an index in `operatorToMiddlewareTimes[operator]`). The specified * struct is consulted as proof of the `operator`'s ability (or lack thereof) to complete the withdrawal. * This function will return 'false' if the operator cannot currently complete a withdrawal started at the `withdrawalStartBlock`, *or* in the event * that an incorrect `middlewareTimesIndex` is supplied, even if one or more correct inputs exist. * @param operator Either the operator who queued the withdrawal themselves, or if the withdrawing party is a staker who delegated to an operator, * this address is the operator *who the staker was delegated to* at the time of the `withdrawalStartBlock`. * @param withdrawalStartBlock The block number at which the withdrawal was initiated. * @param middlewareTimesIndex Indicates an index in `operatorToMiddlewareTimes[operator]` to consult as proof of the `operator`'s ability to withdraw * @dev The correct `middlewareTimesIndex` input should be computable off-chain. */ function canWithdraw( address operator, uint32 withdrawalStartBlock, uint256 middlewareTimesIndex ) external returns (bool); /** * operator => * [ * ( * the least recent update block of all of the middlewares it's serving/served, * latest time that the stake bonded at that update needed to serve until * ) * ] */ function operatorToMiddlewareTimes( address operator, uint256 arrayIndex ) external view returns (MiddlewareTimes memory); /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator].length` function middlewareTimesLength(address operator) external view returns (uint256); /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator][index].stalestUpdateBlock`. function getMiddlewareTimesIndexStalestUpdateBlock( address operator, uint32 index ) external view returns (uint32); /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator][index].latestServeUntil`. function getMiddlewareTimesIndexServeUntilBlock( address operator, uint32 index ) external view returns (uint32); /// @notice Getter function for fetching `_operatorToWhitelistedContractsByUpdate[operator].size`. function operatorWhitelistedContractsLinkedListSize( address operator ) external view returns (uint256); /// @notice Getter function for fetching a single node in the operator's linked list (`_operatorToWhitelistedContractsByUpdate[operator]`). function operatorWhitelistedContractsLinkedListEntry( address operator, address node ) external view returns (bool, uint256, uint256); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title Minimal interface for an `Strategy` contract. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service * @notice Custom `Strategy` implementations may expand extensively on this interface. */ interface IStrategy { /** * @notice Used to deposit tokens into this Strategy * @param token is the ERC20 token being deposited * @param amount is the amount of token being deposited * @dev This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's * `depositIntoStrategy` function, and individual share balances are recorded in the strategyManager as well. * @return newShares is the number of new shares issued at the current exchange ratio. */ function deposit(IERC20 token, uint256 amount) external returns (uint256); /** * @notice Used to withdraw tokens from this Strategy, to the `recipient`'s address * @param recipient is the address to receive the withdrawn funds * @param token is the ERC20 token being transferred out * @param amountShares is the amount of shares being withdrawn * @dev This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's * other functions, and individual share balances are recorded in the strategyManager as well. */ function withdraw(address recipient, IERC20 token, uint256 amountShares) external; /** * @notice Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy. * @notice In contrast to `sharesToUnderlyingView`, this function **may** make state modifications * @param amountShares is the amount of shares to calculate its conversion into the underlying token * @return The amount of underlying tokens corresponding to the input `amountShares` * @dev Implementation for these functions in particular may vary significantly for different strategies */ function sharesToUnderlying(uint256 amountShares) external returns (uint256); /** * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy. * @notice In contrast to `underlyingToSharesView`, this function **may** make state modifications * @param amountUnderlying is the amount of `underlyingToken` to calculate its conversion into strategy shares * @return The amount of underlying tokens corresponding to the input `amountShares` * @dev Implementation for these functions in particular may vary significantly for different strategies */ function underlyingToShares(uint256 amountUnderlying) external returns (uint256); /** * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in * this strategy. In contrast to `userUnderlyingView`, this function **may** make state modifications */ function userUnderlying(address user) external returns (uint256); /** * @notice convenience function for fetching the current total shares of `user` in this strategy, by * querying the `strategyManager` contract */ function shares(address user) external view returns (uint256); /** * @notice Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy. * @notice In contrast to `sharesToUnderlying`, this function guarantees no state modifications * @param amountShares is the amount of shares to calculate its conversion into the underlying token * @return The amount of shares corresponding to the input `amountUnderlying` * @dev Implementation for these functions in particular may vary significantly for different strategies */ function sharesToUnderlyingView(uint256 amountShares) external view returns (uint256); /** * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy. * @notice In contrast to `underlyingToShares`, this function guarantees no state modifications * @param amountUnderlying is the amount of `underlyingToken` to calculate its conversion into strategy shares * @return The amount of shares corresponding to the input `amountUnderlying` * @dev Implementation for these functions in particular may vary significantly for different strategies */ function underlyingToSharesView(uint256 amountUnderlying) external view returns (uint256); /** * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in * this strategy. In contrast to `userUnderlying`, this function guarantees no state modifications */ function userUnderlyingView(address user) external view returns (uint256); /// @notice The underlying token for shares in this Strategy function underlyingToken() external view returns (IERC20); /// @notice The total number of extant shares in this Strategy function totalShares() external view returns (uint256); /// @notice Returns either a brief string explaining the strategy's goal & purpose, or a link to metadata that explains in more detail. function explanation() external view returns (string memory); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "./IStrategy.sol"; import "./ISlasher.sol"; import "./IDelegationManager.sol"; import "./IEigenPodManager.sol"; /** * @title Interface for the primary entrypoint for funds into EigenLayer. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service * @notice See the `StrategyManager` contract itself for implementation details. */ interface IStrategyManager { // Access to public vars - hack locally function stakerStrategyList(address staker, uint256 index) external view returns (IStrategy); function strategyIsWhitelistedForDeposit(IStrategy _strategy) external view returns (bool); /** * @notice Emitted when a new deposit occurs on behalf of `staker`. * @param staker Is the staker who is depositing funds into EigenLayer. * @param strategy Is the strategy that `staker` has deposited into. * @param token Is the token that `staker` deposited. * @param shares Is the number of new shares `staker` has been granted in `strategy`. */ event Deposit(address staker, IERC20 token, IStrategy strategy, uint256 shares); /// @notice Emitted when `thirdPartyTransfersForbidden` is updated for a strategy and value by the owner event UpdatedThirdPartyTransfersForbidden(IStrategy strategy, bool value); /// @notice Emitted when the `strategyWhitelister` is changed event StrategyWhitelisterChanged(address previousAddress, address newAddress); /// @notice Emitted when a strategy is added to the approved list of strategies for deposit event StrategyAddedToDepositWhitelist(IStrategy strategy); /// @notice Emitted when a strategy is removed from the approved list of strategies for deposit event StrategyRemovedFromDepositWhitelist(IStrategy strategy); /** * @notice Deposits `amount` of `token` into the specified `strategy`, with the resultant shares credited to `msg.sender` * @param strategy is the specified strategy where deposit is to be made, * @param token is the denomination in which the deposit is to be made, * @param amount is the amount of token to be deposited in the strategy by the staker * @return shares The amount of new shares in the `strategy` created as part of the action. * @dev The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf. * @dev Cannot be called by an address that is 'frozen' (this function will revert if the `msg.sender` is frozen). * * WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended. This can lead to attack vectors * where the token balance and corresponding strategy shares are not in sync upon reentrancy. */ function depositIntoStrategy( IStrategy strategy, IERC20 token, uint256 amount ) external returns (uint256 shares); /** * @notice Used for depositing an asset into the specified strategy with the resultant shares credited to `staker`, * who must sign off on the action. * Note that the assets are transferred out/from the `msg.sender`, not from the `staker`; this function is explicitly designed * purely to help one address deposit 'for' another. * @param strategy is the specified strategy where deposit is to be made, * @param token is the denomination in which the deposit is to be made, * @param amount is the amount of token to be deposited in the strategy by the staker * @param staker the staker that the deposited assets will be credited to * @param expiry the timestamp at which the signature expires * @param signature is a valid signature from the `staker`. either an ECDSA signature if the `staker` is an EOA, or data to forward * following EIP-1271 if the `staker` is a contract * @return shares The amount of new shares in the `strategy` created as part of the action. * @dev The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf. * @dev A signature is required for this function to eliminate the possibility of griefing attacks, specifically those * targeting stakers who may be attempting to undelegate. * @dev Cannot be called if thirdPartyTransfersForbidden is set to true for this strategy * * WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended. This can lead to attack vectors * where the token balance and corresponding strategy shares are not in sync upon reentrancy */ function depositIntoStrategyWithSignature( IStrategy strategy, IERC20 token, uint256 amount, address staker, uint256 expiry, bytes memory signature ) external returns (uint256 shares); /// @notice Used by the DelegationManager to remove a Staker's shares from a particular strategy when entering the withdrawal queue function removeShares(address staker, IStrategy strategy, uint256 shares) external; /// @notice Used by the DelegationManager to award a Staker some shares that have passed through the withdrawal queue function addShares(address staker, IERC20 token, IStrategy strategy, uint256 shares) external; /// @notice Used by the DelegationManager to convert withdrawn shares to tokens and send them to a recipient function withdrawSharesAsTokens( address recipient, IStrategy strategy, uint256 shares, IERC20 token ) external; /// @notice Returns the current shares of `user` in `strategy` function stakerStrategyShares( address user, IStrategy strategy ) external view returns (uint256 shares); /** * @notice Get all details on the staker's deposits and corresponding shares * @return (staker's strategies, shares in these strategies) */ function getDeposits( address staker ) external view returns (IStrategy[] memory, uint256[] memory); /// @notice Simple getter function that returns `stakerStrategyList[staker].length`. function stakerStrategyListLength(address staker) external view returns (uint256); /** * @notice Owner-only function that adds the provided Strategies to the 'whitelist' of strategies that stakers can deposit into * @param strategiesToWhitelist Strategies that will be added to the `strategyIsWhitelistedForDeposit` mapping (if they aren't in it already) * @param thirdPartyTransfersForbiddenValues bool values to set `thirdPartyTransfersForbidden` to for each strategy */ function addStrategiesToDepositWhitelist( IStrategy[] calldata strategiesToWhitelist, bool[] calldata thirdPartyTransfersForbiddenValues ) external; /** * @notice Owner-only function that removes the provided Strategies from the 'whitelist' of strategies that stakers can deposit into * @param strategiesToRemoveFromWhitelist Strategies that will be removed to the `strategyIsWhitelistedForDeposit` mapping (if they are in it) */ function removeStrategiesFromDepositWhitelist( IStrategy[] calldata strategiesToRemoveFromWhitelist ) external; /// @notice Returns the single, central Delegation contract of EigenLayer function delegation() external view returns (IDelegationManager); /// @notice Returns the single, central Slasher contract of EigenLayer function slasher() external view returns (ISlasher); /// @notice Returns the EigenPodManager contract of EigenLayer function eigenPodManager() external view returns (IEigenPodManager); /// @notice Returns the address of the `strategyWhitelister` function strategyWhitelister() external view returns (address); /** * @notice Returns bool for whether or not `strategy` enables credit transfers. i.e enabling * depositIntoStrategyWithSignature calls or queueing withdrawals to a different address than the staker. */ function thirdPartyTransfersForbidden(IStrategy strategy) external view returns (bool); // LIMITED BACKWARDS-COMPATIBILITY FOR DEPRECATED FUNCTIONALITY // packed struct for queued withdrawals; helps deal with stack-too-deep errors struct DeprecatedStruct_WithdrawerAndNonce { address withdrawer; uint96 nonce; } /** * Struct type used to specify an existing queued withdrawal. Rather than storing the entire struct, only a hash is stored. * In functions that operate on existing queued withdrawals -- e.g. `startQueuedWithdrawalWaitingPeriod` or `completeQueuedWithdrawal`, * the data is resubmitted and the hash of the submitted data is computed by `calculateWithdrawalRoot` and checked against the * stored hash in order to confirm the integrity of the submitted data. */ struct DeprecatedStruct_QueuedWithdrawal { IStrategy[] strategies; uint256[] shares; address staker; DeprecatedStruct_WithdrawerAndNonce withdrawerAndNonce; uint32 withdrawalStartBlock; address delegatedAddress; } function migrateQueuedWithdrawal( DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal ) external returns (bool, bytes32); function calculateWithdrawalRoot( DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal ) external pure returns (bytes32); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "./Merkle.sol"; import "../libraries/Endian.sol"; //Utility library for parsing and PHASE0 beacon chain block headers //SSZ Spec: https://github.com/ethereum/consensus-specs/blob/dev/ssz/simple-serialize.md#merkleization //BeaconBlockHeader Spec: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader //BeaconState Spec: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconstate library BeaconChainProofs { /// @notice Heights of various merkle trees in the beacon chain /// - beaconBlockRoot /// | HEIGHT: BEACON_BLOCK_HEADER_TREE_HEIGHT /// -- beaconStateRoot /// | HEIGHT: BEACON_STATE_TREE_HEIGHT /// validatorContainerRoot, balanceContainerRoot /// | | HEIGHT: BALANCE_TREE_HEIGHT /// | individual balances /// | HEIGHT: VALIDATOR_TREE_HEIGHT /// individual validators uint256 internal constant BEACON_BLOCK_HEADER_TREE_HEIGHT = 3; uint256 internal constant BEACON_STATE_TREE_HEIGHT = 5; uint256 internal constant BALANCE_TREE_HEIGHT = 38; uint256 internal constant VALIDATOR_TREE_HEIGHT = 40; /// @notice Index of the beaconStateRoot in the `BeaconBlockHeader` container /// /// BeaconBlockHeader = [..., state_root, ...] /// 0... 3 /// /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader) uint256 internal constant STATE_ROOT_INDEX = 3; /// @notice Indices for fields in the `BeaconState` container /// /// BeaconState = [..., validators, balances, ...] /// 0... 11 12 /// /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#beaconstate) uint256 internal constant VALIDATOR_CONTAINER_INDEX = 11; uint256 internal constant BALANCE_CONTAINER_INDEX = 12; /// @notice Number of fields in the `Validator` container /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator) uint256 internal constant VALIDATOR_FIELDS_LENGTH = 8; /// @notice Indices for fields in the `Validator` container uint256 internal constant VALIDATOR_PUBKEY_INDEX = 0; uint256 internal constant VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX = 1; uint256 internal constant VALIDATOR_BALANCE_INDEX = 2; uint256 internal constant VALIDATOR_SLASHED_INDEX = 3; uint256 internal constant VALIDATOR_EXIT_EPOCH_INDEX = 6; /// @notice Slot/Epoch timings uint64 internal constant SECONDS_PER_SLOT = 12; uint64 internal constant SLOTS_PER_EPOCH = 32; uint64 internal constant SECONDS_PER_EPOCH = SLOTS_PER_EPOCH * SECONDS_PER_SLOT; /// @notice `FAR_FUTURE_EPOCH` is used as the default value for certain `Validator` /// fields when a `Validator` is first created on the beacon chain uint64 internal constant FAR_FUTURE_EPOCH = type(uint64).max; bytes8 internal constant UINT64_MASK = 0xffffffffffffffff; /// @notice Contains a beacon state root and a merkle proof verifying its inclusion under a beacon block root struct StateRootProof { bytes32 beaconStateRoot; bytes proof; } /// @notice Contains a validator's fields and a merkle proof of their inclusion under a beacon state root struct ValidatorProof { bytes32[] validatorFields; bytes proof; } /// @notice Contains a beacon balance container root and a proof of this root under a beacon block root struct BalanceContainerProof { bytes32 balanceContainerRoot; bytes proof; } /// @notice Contains a validator balance root and a proof of its inclusion under a balance container root struct BalanceProof { bytes32 pubkeyHash; bytes32 balanceRoot; bytes proof; } /******************************************************************************* VALIDATOR FIELDS -> BEACON STATE ROOT -> BEACON BLOCK ROOT *******************************************************************************/ /// @notice Verify a merkle proof of the beacon state root against a beacon block root /// @param beaconBlockRoot merkle root of the beacon block /// @param proof the beacon state root and merkle proof of its inclusion under `beaconBlockRoot` function verifyStateRoot(bytes32 beaconBlockRoot, StateRootProof calldata proof) internal view { require( proof.proof.length == 32 * (BEACON_BLOCK_HEADER_TREE_HEIGHT), "BeaconChainProofs.verifyStateRoot: Proof has incorrect length" ); /// This merkle proof verifies the `beaconStateRoot` under the `beaconBlockRoot` /// - beaconBlockRoot /// | HEIGHT: BEACON_BLOCK_HEADER_TREE_HEIGHT /// -- beaconStateRoot require( Merkle.verifyInclusionSha256({ proof: proof.proof, root: beaconBlockRoot, leaf: proof.beaconStateRoot, index: STATE_ROOT_INDEX }), "BeaconChainProofs.verifyStateRoot: Invalid state root merkle proof" ); } /// @notice Verify a merkle proof of a validator container against a `beaconStateRoot` /// @dev This proof starts at a validator's container root, proves through the validator container root, /// and continues proving to the root of the `BeaconState` /// @dev See https://eth2book.info/capella/part3/containers/dependencies/#validator for info on `Validator` containers /// @dev See https://eth2book.info/capella/part3/containers/state/#beaconstate for info on `BeaconState` containers /// @param beaconStateRoot merkle root of the `BeaconState` container /// @param validatorFields an individual validator's fields. These are merklized to form a `validatorRoot`, /// which is used as the leaf to prove against `beaconStateRoot` /// @param validatorFieldsProof a merkle proof of inclusion of `validatorFields` under `beaconStateRoot` /// @param validatorIndex the validator's unique index function verifyValidatorFields( bytes32 beaconStateRoot, bytes32[] calldata validatorFields, bytes calldata validatorFieldsProof, uint40 validatorIndex ) internal view { require( validatorFields.length == VALIDATOR_FIELDS_LENGTH, "BeaconChainProofs.verifyValidatorFields: Validator fields has incorrect length" ); /// Note: the reason we use `VALIDATOR_TREE_HEIGHT + 1` here is because the merklization process for /// this container includes hashing the root of the validator tree with the length of the validator list require( validatorFieldsProof.length == 32 * ((VALIDATOR_TREE_HEIGHT + 1) + BEACON_STATE_TREE_HEIGHT), "BeaconChainProofs.verifyValidatorFields: Proof has incorrect length" ); // Merkleize `validatorFields` to get the leaf to prove bytes32 validatorRoot = Merkle.merkleizeSha256(validatorFields); /// This proof combines two proofs, so its index accounts for the relative position of leaves in two trees: /// - beaconStateRoot /// | HEIGHT: BEACON_STATE_TREE_HEIGHT /// -- validatorContainerRoot /// | HEIGHT: VALIDATOR_TREE_HEIGHT + 1 /// ---- validatorRoot uint256 index = (VALIDATOR_CONTAINER_INDEX << (VALIDATOR_TREE_HEIGHT + 1)) | uint256(validatorIndex); require( Merkle.verifyInclusionSha256({ proof: validatorFieldsProof, root: beaconStateRoot, leaf: validatorRoot, index: index }), "BeaconChainProofs.verifyValidatorFields: Invalid merkle proof" ); } /******************************************************************************* VALIDATOR BALANCE -> BALANCE CONTAINER ROOT -> BEACON BLOCK ROOT *******************************************************************************/ /// @notice Verify a merkle proof of the beacon state's balances container against the beacon block root /// @dev This proof starts at the balance container root, proves through the beacon state root, and /// continues proving through the beacon block root. As a result, this proof will contain elements /// of a `StateRootProof` under the same block root, with the addition of proving the balances field /// within the beacon state. /// @dev This is used to make checkpoint proofs more efficient, as a checkpoint will verify multiple balances /// against the same balance container root. /// @param beaconBlockRoot merkle root of the beacon block /// @param proof a beacon balance container root and merkle proof of its inclusion under `beaconBlockRoot` function verifyBalanceContainer( bytes32 beaconBlockRoot, BalanceContainerProof calldata proof ) internal view { require( proof.proof.length == 32 * (BEACON_BLOCK_HEADER_TREE_HEIGHT + BEACON_STATE_TREE_HEIGHT), "BeaconChainProofs.verifyBalanceContainer: Proof has incorrect length" ); /// This proof combines two proofs, so its index accounts for the relative position of leaves in two trees: /// - beaconBlockRoot /// | HEIGHT: BEACON_BLOCK_HEADER_TREE_HEIGHT /// -- beaconStateRoot /// | HEIGHT: BEACON_STATE_TREE_HEIGHT /// ---- balancesContainerRoot uint256 index = (STATE_ROOT_INDEX << (BEACON_STATE_TREE_HEIGHT)) | BALANCE_CONTAINER_INDEX; require( Merkle.verifyInclusionSha256({ proof: proof.proof, root: beaconBlockRoot, leaf: proof.balanceContainerRoot, index: index }), "BeaconChainProofs.verifyBalanceContainer: invalid balance container proof" ); } /// @notice Verify a merkle proof of a validator's balance against the beacon state's `balanceContainerRoot` /// @param balanceContainerRoot the merkle root of all validators' current balances /// @param validatorIndex the index of the validator whose balance we are proving /// @param proof the validator's associated balance root and a merkle proof of inclusion under `balanceContainerRoot` /// @return validatorBalanceGwei the validator's current balance (in gwei) function verifyValidatorBalance( bytes32 balanceContainerRoot, uint40 validatorIndex, BalanceProof calldata proof ) internal view returns (uint64 validatorBalanceGwei) { /// Note: the reason we use `BALANCE_TREE_HEIGHT + 1` here is because the merklization process for /// this container includes hashing the root of the balances tree with the length of the balances list require( proof.proof.length == 32 * (BALANCE_TREE_HEIGHT + 1), "BeaconChainProofs.verifyValidatorBalance: Proof has incorrect length" ); /// When merkleized, beacon chain balances are combined into groups of 4 called a `balanceRoot`. The merkle /// proof here verifies that this validator's `balanceRoot` is included in the `balanceContainerRoot` /// - balanceContainerRoot /// | HEIGHT: BALANCE_TREE_HEIGHT /// -- balanceRoot uint256 balanceIndex = uint256(validatorIndex / 4); require( Merkle.verifyInclusionSha256({ proof: proof.proof, root: balanceContainerRoot, leaf: proof.balanceRoot, index: balanceIndex }), "BeaconChainProofs.verifyValidatorBalance: Invalid merkle proof" ); /// Extract the individual validator's balance from the `balanceRoot` return getBalanceAtIndex(proof.balanceRoot, validatorIndex); } /** * @notice Parses a balanceRoot to get the uint64 balance of a validator. * @dev During merkleization of the beacon state balance tree, four uint64 values are treated as a single * leaf in the merkle tree. We use validatorIndex % 4 to determine which of the four uint64 values to * extract from the balanceRoot. * @param balanceRoot is the combination of 4 validator balances being proven for * @param validatorIndex is the index of the validator being proven for * @return The validator's balance, in Gwei */ function getBalanceAtIndex( bytes32 balanceRoot, uint40 validatorIndex ) internal pure returns (uint64) { uint256 bitShiftAmount = (validatorIndex % 4) * 64; return Endian.fromLittleEndianUint64(bytes32((uint256(balanceRoot) << bitShiftAmount))); } /// @notice Indices for fields in the `Validator` container: /// 0: pubkey /// 1: withdrawal credentials /// 2: effective balance /// 3: slashed? /// 4: activation elligibility epoch /// 5: activation epoch /// 6: exit epoch /// 7: withdrawable epoch /// /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator) /// @dev Retrieves a validator's pubkey hash function getPubkeyHash(bytes32[] memory validatorFields) internal pure returns (bytes32) { return validatorFields[VALIDATOR_PUBKEY_INDEX]; } /// @dev Retrieves a validator's withdrawal credentials function getWithdrawalCredentials( bytes32[] memory validatorFields ) internal pure returns (bytes32) { return validatorFields[VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX]; } /// @dev Retrieves a validator's effective balance (in gwei) function getEffectiveBalanceGwei( bytes32[] memory validatorFields ) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_BALANCE_INDEX]); } /// @dev Retrieves true IFF a validator is marked slashed function isValidatorSlashed(bytes32[] memory validatorFields) internal pure returns (bool) { return validatorFields[VALIDATOR_SLASHED_INDEX] != 0; } /// @dev Retrieves a validator's exit epoch function getExitEpoch(bytes32[] memory validatorFields) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_EXIT_EPOCH_INDEX]); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; library Endian { /** * @notice Converts a little endian-formatted uint64 to a big endian-formatted uint64 * @param lenum little endian-formatted uint64 input, provided as 'bytes32' type * @return n The big endian-formatted uint64 * @dev Note that the input is formatted as a 'bytes32' type (i.e. 256 bits), but it is immediately truncated to a uint64 (i.e. 64 bits) * through a right-shift/shr operation. */ function fromLittleEndianUint64(bytes32 lenum) internal pure returns (uint64 n) { // the number needs to be stored in little-endian encoding (ie in bytes 0-8) n = uint64(uint256(lenum >> 192)); return (n >> 56) | ((0x00FF000000000000 & n) >> 40) | ((0x0000FF0000000000 & n) >> 24) | ((0x000000FF00000000 & n) >> 8) | ((0x00000000FF000000 & n) << 8) | ((0x0000000000FF0000 & n) << 24) | ((0x000000000000FF00 & n) << 40) | ((0x00000000000000FF & n) << 56); } }
// SPDX-License-Identifier: MIT // Adapted from OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library Merkle { /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. The tree is built assuming `leaf` is * the 0 indexed `index`'th leaf from the bottom left of the tree. * * Note this is for a Merkle tree using the keccak/sha3 hash function */ function verifyInclusionKeccak( bytes memory proof, bytes32 root, bytes32 leaf, uint256 index ) internal pure returns (bool) { return processInclusionProofKeccak(proof, leaf, index) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. The tree is built assuming `leaf` is * the 0 indexed `index`'th leaf from the bottom left of the tree. * * _Available since v4.4._ * * Note this is for a Merkle tree using the keccak/sha3 hash function */ function processInclusionProofKeccak( bytes memory proof, bytes32 leaf, uint256 index ) internal pure returns (bytes32) { require( proof.length != 0 && proof.length % 32 == 0, "Merkle.processInclusionProofKeccak: proof length should be a non-zero multiple of 32" ); bytes32 computedHash = leaf; for (uint256 i = 32; i <= proof.length; i += 32) { if (index % 2 == 0) { // if ith bit of index is 0, then computedHash is a left sibling assembly { mstore(0x00, computedHash) mstore(0x20, mload(add(proof, i))) computedHash := keccak256(0x00, 0x40) index := div(index, 2) } } else { // if ith bit of index is 1, then computedHash is a right sibling assembly { mstore(0x00, mload(add(proof, i))) mstore(0x20, computedHash) computedHash := keccak256(0x00, 0x40) index := div(index, 2) } } } return computedHash; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. The tree is built assuming `leaf` is * the 0 indexed `index`'th leaf from the bottom left of the tree. * * Note this is for a Merkle tree using the sha256 hash function */ function verifyInclusionSha256( bytes memory proof, bytes32 root, bytes32 leaf, uint256 index ) internal view returns (bool) { return processInclusionProofSha256(proof, leaf, index) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. The tree is built assuming `leaf` is * the 0 indexed `index`'th leaf from the bottom left of the tree. * * _Available since v4.4._ * * Note this is for a Merkle tree using the sha256 hash function */ function processInclusionProofSha256( bytes memory proof, bytes32 leaf, uint256 index ) internal view returns (bytes32) { require( proof.length != 0 && proof.length % 32 == 0, "Merkle.processInclusionProofSha256: proof length should be a non-zero multiple of 32" ); bytes32[1] memory computedHash = [leaf]; for (uint256 i = 32; i <= proof.length; i += 32) { if (index % 2 == 0) { // if ith bit of index is 0, then computedHash is a left sibling assembly { mstore(0x00, mload(computedHash)) mstore(0x20, mload(add(proof, i))) if iszero(staticcall(sub(gas(), 2000), 2, 0x00, 0x40, computedHash, 0x20)) { revert(0, 0) } index := div(index, 2) } } else { // if ith bit of index is 1, then computedHash is a right sibling assembly { mstore(0x00, mload(add(proof, i))) mstore(0x20, mload(computedHash)) if iszero(staticcall(sub(gas(), 2000), 2, 0x00, 0x40, computedHash, 0x20)) { revert(0, 0) } index := div(index, 2) } } } return computedHash[0]; } /** @notice this function returns the merkle root of a tree created from a set of leaves using sha256 as its hash function @param leaves the leaves of the merkle tree @return The computed Merkle root of the tree. @dev A pre-condition to this function is that leaves.length is a power of two. If not, the function will merkleize the inputs incorrectly. */ function merkleizeSha256(bytes32[] memory leaves) internal pure returns (bytes32) { //there are half as many nodes in the layer above the leaves uint256 numNodesInLayer = leaves.length / 2; //create a layer to store the internal nodes bytes32[] memory layer = new bytes32[](numNodesInLayer); //fill the layer with the pairwise hashes of the leaves for (uint256 i = 0; i < numNodesInLayer; i++) { layer[i] = sha256(abi.encodePacked(leaves[2 * i], leaves[2 * i + 1])); } //the next layer above has half as many nodes numNodesInLayer /= 2; //while we haven't computed the root while (numNodesInLayer != 0) { //overwrite the first numNodesInLayer nodes in layer with the pairwise hashes of their children for (uint256 i = 0; i < numNodesInLayer; i++) { layer[i] = sha256(abi.encodePacked(layer[2 * i], layer[2 * i + 1])); } //the next layer above has half as many nodes numNodesInLayer /= 2; } //the first node in the layer is the root return layer[0]; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; /// @dev Error for 0x0 address inputs error InvalidZeroInput(); /// @dev Error for already added items to a list error AlreadyAdded(); /// @dev Error for not found items in a list error NotFound(); /// @dev Error for hitting max TVL error MaxTVLReached(); /// @dev Error for caller not having permissions error NotRestakeManagerAdmin(); /// @dev Error for call not coming from deposit queue contract error NotDepositQueue(); /// @dev Error for contract being paused error ContractPaused(); /// @dev Error for exceeding max basis points (100%) error OverMaxBasisPoints(); /// @dev Error for invalid token decimals for collateral tokens (must be 18) error InvalidTokenDecimals(uint8 expected, uint8 actual); /// @dev Error when withdraw is already completed error WithdrawAlreadyCompleted(); /// @dev Error when a different address tries to complete withdraw error NotOriginalWithdrawCaller(address expectedCaller); /// @dev Error when caller does not have OD admin role error NotOperatorDelegatorAdmin(); /// @dev Error when caller does not have Oracle Admin role error NotOracleAdmin(); /// @dev Error when caller is not RestakeManager contract error NotRestakeManager(); /// @dev Errror when caller does not have ETH Restake Admin role error NotNativeEthRestakeAdmin(); /// @dev Error when delegation address was already set - cannot be set again error DelegateAddressAlreadySet(); /// @dev Error when caller does not have ERC20 Rewards Admin role error NotERC20RewardsAdmin(); /// @dev Error when sending ETH fails error TransferFailed(); /// @dev Error when caller does not have ETH Minter Burner Admin role error NotEzETHMinterBurner(); /// @dev Error when caller does not have Token Admin role error NotTokenAdmin(); /// @dev Error when price oracle is not configured error OracleNotFound(); /// @dev Error when price oracle data is stale error OraclePriceExpired(); /// @dev Error when array lengths do not match error MismatchedArrayLengths(); /// @dev Error when caller does not have Deposit Withdraw Pauser role error NotDepositWithdrawPauser(); /// @dev Error when an individual token TVL is over the max error MaxTokenTVLReached(); /// @dev Error when Oracle price is invalid error InvalidOraclePrice(); /// @dev Error when calling an invalid function error NotImplemented(); /// @dev Error when calculating token amounts is invalid error InvalidTokenAmount(); /// @dev Error when timestamp is invalid - likely in the past error InvalidTimestamp(uint256 timestamp); /// @dev Error when trade does not meet minimum output amount error InsufficientOutputAmount(); /// @dev Error when the token received over the bridge is not the one expected error InvalidTokenReceived(); /// @dev Error when the origin address is not whitelisted error InvalidOrigin(); /// @dev Error when the sender is not expected error InvalidSender(address expectedSender, address actualSender); /// @dev error when function returns 0 amount error InvalidZeroOutput(); /// @dev error when xRenzoBridge does not have enough balance to pay for fee error NotEnoughBalance(uint256 currentBalance, uint256 calculatedFees); /// @dev error when source chain is not expected error InvalidSourceChain(uint64 expectedCCIPChainSelector, uint64 actualCCIPChainSelector); /// @dev Error when an unauthorized address tries to call the bridge function on the L2 error UnauthorizedBridgeSweeper(); /// @dev Error when caller does not have BRIDGE_ADMIN role error NotBridgeAdmin(); /// @dev Error when caller does not have PRICE_FEED_SENDER role error NotPriceFeedSender(); /// @dev Error for connext price Feed unauthorised call error UnAuthorisedCall(); /// @dev Error for no price feed configured on L2 error PriceFeedNotAvailable(); /// @dev Error for invalid bridge fee share configuration error InvalidBridgeFeeShare(uint256 bridgeFee); /// @dev Error for invalid sweep batch size error InvalidSweepBatchSize(uint256 batchSize); /// @dev Error when caller does not have Withdraw Queue admin role error NotWithdrawQueueAdmin(); /// @dev Error when caller try to withdraw more than Buffer error NotEnoughWithdrawBuffer(); /// @dev Error when caller try to claim withdraw before cooldown period error EarlyClaim(); /// @dev Error when caller try to withdraw for unsupported asset error UnsupportedWithdrawAsset(); /// @dev Error when caller try to claim invalidWithdrawIndex error InvalidWithdrawIndex(); /// @dev Error when TVL was expected to be 0 error InvalidTVL(); /// @dev Error when incorrect BeaconChainStrategy is set for LST in completeQueuedWithdrawal error IncorrectStrategy(); /// @dev Error when adding new OperatorDelegator which is not delegated error OperatoDelegatorNotDelegated(); /// @dev Error when emergency tracking already tracked withdrawal error WithdrawalAlreadyTracked(); /// @dev Error when emergency tracking already completed withdrawal error WithdrawalAlreadyCompleted(); /// @dev Error when caller does not have Emergency Withdraw Tracking Admin role error NotEmergencyWithdrawTrackingAdmin(); /// @dev Error when strategy does not have specified underlying error InvalidStrategy(); /// @dev Error when strategy already set and hold non zero token balance error NonZeroUnderlyingStrategyExist(); /// @dev Error when caller tried to claim queued withdrawal when not filled error QueuedWithdrawalNotFilled(); /// @dev Error when caller does not have EigenLayerRewardsAdmin role error NotEigenLayerRewardsAdmin(); /// @dev Error when rewardsDestination is not configured while trying to claim error RewardsDestinationNotConfigured(); /// @dev Error when WETHUnwrapper is not configured while trying to claim WETH restaking rewards error WETHUnwrapperNotConfigured(); /// @dev Error when currentCheckpoint is not accounted by OperatorDelegator error CheckpointAlreadyActive(); /// @dev Error when specified checkpoint is already recorded error CheckpointAlreadyRecorded(); /// @dev Error when caller does not have Emergency Checkpoint Tracking admin role error NotEmergencyCheckpointTrackingAdmin(); /// @dev Error when last completed checkpoint on EigenPod is not recorded in OperatorDelegator error CheckpointNotRecorded(); /// @dev Error when non pauser tries to change pause state error NotPauser(); /// @dev Error when user tried to withdraw asset more than available in protocol collateral error NotEnoughCollateralValue(); /// @dev Error when admin tries to disable asset withdraw queue which is not enabled error WithdrawQueueNotEnabled(); /// @dev Error when admin tries to enable erc20 withdraw queue for IS_NATIVE address error IsNativeAddressNotAllowed();
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "./Delegation/IOperatorDelegator.sol"; import "./Deposits/IDepositQueue.sol"; interface IRestakeManager { function stakeEthInOperatorDelegator( IOperatorDelegator operatorDelegator, bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot ) external payable; function depositTokenRewardsFromProtocol(IERC20 _token, uint256 _amount) external; function depositQueue() external view returns (IDepositQueue); function calculateTVLs() external view returns (uint256[][] memory, uint256[] memory, uint256); function depositETH() external payable; function getCollateralTokenIndex(IERC20 _collateralToken) external view returns (uint256); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IRenzoOracle { function lookupTokenValue(IERC20 _token, uint256 _balance) external view returns (uint256); function lookupTokenAmountFromValue( IERC20 _token, uint256 _value ) external view returns (uint256); function lookupTokenValues( IERC20[] memory _tokens, uint256[] memory _balances ) external view returns (uint256); function calculateMintAmount( uint256 _currentValueInProtocol, uint256 _newValueAdded, uint256 _existingEzETHSupply ) external pure returns (uint256); function calculateRedeemAmount( uint256 _ezETHBeingBurned, uint256 _existingEzETHSupply, uint256 _currentValueInProtocol ) external pure returns (uint256); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; interface IRoleManager { /// @dev Determines if the specified address has permissions to manage RoleManager /// @param potentialAddress Address to check function isRoleManagerAdmin(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to mint or burn ezETH tokens /// @param potentialAddress Address to check function isEzETHMinterBurner(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to update config on the OperatorDelgator Contracts /// @param potentialAddress Address to check function isOperatorDelegatorAdmin(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to update config on the Oracle Contract config /// @param potentialAddress Address to check function isOracleAdmin(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to update config on the Restake Manager /// @param potentialAddress Address to check function isRestakeManagerAdmin(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to update config on the Token Contract /// @param potentialAddress Address to check function isTokenAdmin(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to trigger restaking of native ETH /// @param potentialAddress Address to check function isNativeEthRestakeAdmin(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to sweep and deposit ERC20 Rewards /// @param potentialAddress Address to check function isERC20RewardsAdmin(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to pause deposits and withdraws /// @param potentialAddress Address to check function isDepositWithdrawPauser(address potentialAddress) external view returns (bool); /// @dev Determines if the specified address has permission to set whitelisted origin in xRenzoBridge /// @param potentialAddress Address to check function isBridgeAdmin(address potentialAddress) external view returns (bool); /// @dev Determined if the specified address has permission to send price feed of ezETH to L2 /// @param potentialAddress Address to check function isPriceFeedSender(address potentialAddress) external view returns (bool); /// @dev Determine if the specified address haas permission to update Withdraw Queue params /// @param potentialAddress Address to check function isWithdrawQueueAdmin(address potentialAddress) external view returns (bool); /// @dev Determine if the specified address has permission to track emergency pending queued withdrawals /// @param potentialAddress Address to check function isEmergencyWithdrawTrackingAdmin( address potentialAddress ) external view returns (bool); /// @dev Determine if the specified address has permission to process EigenLayer rewards /// @param potentialAddress Address to check function isEigenLayerRewardsAdmin(address potentialAddress) external view returns (bool); /// @dev Determin if the specified address has permission to track missed Checkpoints Exit Balance /// @param potentialAddress Address to check function isEmergencyCheckpointTrackingAdmin( address potentialAddress ) external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; interface IEzEthToken is IERC20Upgradeable { function mint(address to, uint256 amount) external; function burn(address from, uint256 amount) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; interface IWithdrawQueue { /// @dev To get available value to withdraw from buffer /// @param _asset address of token function getAvailableToWithdraw(address _asset) external view returns (uint256); /// @dev To get the withdraw buffer target of given asset /// @param _asset address of token function withdrawalBufferTarget(address _asset) external view returns (uint256); /// @dev To get the current Target Buffer Deficit /// @param _asset address of token function getWithdrawDeficit(address _asset) external view returns (uint256); /// @dev Fill ERC20 Withdraw Buffer /// @param _asset the token address to fill the respective buffer /// @param _amount amount of token to fill with function fillERC20WithdrawBuffer(address _asset, uint256 _amount) external; /// @dev to get the withdrawRequests for particular user /// @param _user address of the user function withdrawRequests(address _user) external view returns (uint256[] memory); /// @dev Fill ETH Withdraw buffer function fillEthWithdrawBuffer() external payable; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "../Permissions/IRoleManager.sol"; import "../Oracle/IRenzoOracle.sol"; import "../IRestakeManager.sol"; import "../token/IEzEthToken.sol"; abstract contract WithdrawQueueStorageV1 { address public constant IS_NATIVE = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; struct TokenWithdrawBuffer { address asset; uint256 bufferAmount; } struct WithdrawRequest { address collateralToken; uint256 withdrawRequestID; uint256 amountToRedeem; uint256 ezETHLocked; uint256 createdAt; } /// @dev reference to the RenzoOracle contract IRenzoOracle public renzoOracle; /// @dev reference to the ezETH token contract IEzEthToken public ezETH; /// @dev reference to the RoleManager contract IRoleManager public roleManager; /// @dev reference to the RestakeManager contract IRestakeManager public restakeManager; /// @dev cooldown period for user to claim their withdrawal uint256 public coolDownPeriod; /// @dev nonce for tracking withdraw requests, This only increments (doesn't decrement) uint256 public withdrawRequestNonce; /// @dev mapping of withdrawalBufferTarget, indexed by token address mapping(address => uint256) public withdrawalBufferTarget; /// @dev mapping of claimReserve (already withdraw requested), indexed by token address mapping(address => uint256) public claimReserve; /// @dev mapiing of withdraw requests array, indexed by user address mapping(address => WithdrawRequest[]) public withdrawRequests; } abstract contract WithdrawQueueStorageV2 is WithdrawQueueStorageV1 { /// @dev Struct for the withdrawQueue struct WithdrawQueue { uint256 queuedWithdrawToFill; uint256 queuedWithdrawFilled; } /// @dev Struct for WithdrawRequest queue status with expected to be filled struct WithdrawQueueStatus { bool queued; uint256 fillAt; } /// @dev mapping of queued withdrawRequest, indexed by withdrawRequest hash mapping(bytes32 => WithdrawQueueStatus) public withdrawQueued; /// @dev mapping for asset withdrawQueue /// @dev WithdrawQueue is a sliding window WithdrawQueue public ethWithdrawQueue; } abstract contract WithdrawQueueStorageV3 is WithdrawQueueStorageV2 { /// @dev Tracks if Withdraw Queue enable for collateral asset mapping(address => bool) public erc20WithdrawQueueEnabled; /// @dev WithdrawQueue for ERC20 assets mapping(address => WithdrawQueue) public erc20WithdrawQueue; }
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); function _sendLogPayload(bytes memory payload) private view { uint256 payloadLength = payload.length; address consoleAddress = CONSOLE_ADDRESS; /// @solidity memory-safe-assembly assembly { let payloadStart := add(payload, 32) let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) } } function log() internal view { _sendLogPayload(abi.encodeWithSignature("log()")); } function logInt(int p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); } function logUint(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function logString(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function logBool(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function logAddress(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function logBytes(bytes memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); } function logBytes1(bytes1 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); } function logBytes2(bytes2 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); } function logBytes3(bytes3 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); } function logBytes4(bytes4 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); } function logBytes5(bytes5 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); } function logBytes6(bytes6 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); } function logBytes7(bytes7 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); } function logBytes8(bytes8 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); } function logBytes9(bytes9 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); } function logBytes10(bytes10 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); } function logBytes11(bytes11 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); } function logBytes12(bytes12 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); } function logBytes13(bytes13 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); } function logBytes14(bytes14 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); } function logBytes15(bytes15 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); } function logBytes16(bytes16 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); } function logBytes17(bytes17 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); } function logBytes18(bytes18 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); } function logBytes19(bytes19 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); } function logBytes20(bytes20 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); } function logBytes21(bytes21 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); } function logBytes22(bytes22 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); } function logBytes23(bytes23 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); } function logBytes24(bytes24 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); } function logBytes25(bytes25 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); } function logBytes26(bytes26 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); } function logBytes27(bytes27 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); } function logBytes28(bytes28 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); } function logBytes29(bytes29 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); } function logBytes30(bytes30 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); } function logBytes31(bytes31 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); } function logBytes32(bytes32 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); } function log(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function log(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function log(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function log(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function log(uint p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); } function log(uint p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); } function log(uint p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); } function log(uint p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); } function log(string memory p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); } function log(string memory p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); } function log(string memory p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); } function log(string memory p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); } function log(bool p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); } function log(bool p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); } function log(bool p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); } function log(bool p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); } function log(address p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); } function log(address p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); } function log(address p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); } function log(address p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); } function log(uint p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); } function log(uint p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); } function log(uint p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); } function log(uint p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); } function log(uint p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); } function log(uint p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); } function log(uint p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); } function log(uint p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); } function log(uint p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); } function log(uint p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); } function log(uint p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); } function log(uint p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); } function log(uint p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); } function log(uint p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); } function log(uint p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); } function log(uint p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); } function log(string memory p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); } function log(string memory p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); } function log(string memory p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); } function log(string memory p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); } function log(string memory p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); } function log(string memory p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); } function log(string memory p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); } function log(string memory p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); } function log(string memory p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); } function log(string memory p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); } function log(string memory p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); } function log(string memory p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); } function log(string memory p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); } function log(string memory p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); } function log(string memory p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); } function log(string memory p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); } function log(bool p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); } function log(bool p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); } function log(bool p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); } function log(bool p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); } function log(bool p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); } function log(bool p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); } function log(bool p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); } function log(bool p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); } function log(bool p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); } function log(bool p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); } function log(bool p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); } function log(bool p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); } function log(bool p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); } function log(bool p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); } function log(bool p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); } function log(bool p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); } function log(address p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); } function log(address p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); } function log(address p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); } function log(address p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); } function log(address p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); } function log(address p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); } function log(address p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); } function log(address p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); } function log(address p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); } function log(address p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); } function log(address p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); } function log(address p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); } function log(address p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); } function log(address p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); } function log(address p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); } function log(address p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); } function log(uint p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EarlyClaim","type":"error"},{"inputs":[],"name":"InvalidWithdrawIndex","type":"error"},{"inputs":[],"name":"InvalidZeroInput","type":"error"},{"inputs":[],"name":"IsNativeAddressNotAllowed","type":"error"},{"inputs":[],"name":"NotDepositQueue","type":"error"},{"inputs":[],"name":"NotDepositWithdrawPauser","type":"error"},{"inputs":[],"name":"NotEnoughCollateralValue","type":"error"},{"inputs":[],"name":"NotEnoughWithdrawBuffer","type":"error"},{"inputs":[],"name":"NotWithdrawQueueAdmin","type":"error"},{"inputs":[],"name":"QueuedWithdrawalNotFilled","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"UnsupportedWithdrawAsset","type":"error"},{"inputs":[],"name":"WithdrawQueueNotEnabled","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldCoolDownPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newCoolDownPeriod","type":"uint256"}],"name":"CoolDownPeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20BufferFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EthBufferFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"asset","type":"address"}],"name":"QueueFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldBufferTarget","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBufferTarget","type":"uint256"}],"name":"WithdrawBufferTargetUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"}],"name":"WithdrawQueueDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"}],"name":"WithdrawQueueEnabled","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"uint256","name":"withdrawRequestID","type":"uint256"},{"internalType":"uint256","name":"amountToRedeem","type":"uint256"},{"internalType":"uint256","name":"ezETHLocked","type":"uint256"},{"internalType":"uint256","name":"createdAt","type":"uint256"}],"indexed":false,"internalType":"struct WithdrawQueueStorageV1.WithdrawRequest","name":"withdrawRequest","type":"tuple"}],"name":"WithdrawRequestClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"withdrawRequestID","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"claimToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountToRedeem","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ezETHAmountLocked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawRequestIndex","type":"uint256"},{"indexed":false,"internalType":"bool","name":"queued","type":"bool"},{"indexed":false,"internalType":"uint256","name":"queueFilled","type":"uint256"}],"name":"WithdrawRequestCreated","type":"event"},{"inputs":[],"name":"IS_NATIVE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"withdrawRequestIndex","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"coolDownPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"disableERC20WithdrawQueue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"enableERC20WithdrawQueue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"erc20WithdrawQueue","outputs":[{"internalType":"uint256","name":"queuedWithdrawToFill","type":"uint256"},{"internalType":"uint256","name":"queuedWithdrawFilled","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"erc20WithdrawQueueEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethWithdrawQueue","outputs":[{"internalType":"uint256","name":"queuedWithdrawToFill","type":"uint256"},{"internalType":"uint256","name":"queuedWithdrawFilled","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ezETH","outputs":[{"internalType":"contract IEzEthToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fillERC20WithdrawBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fillEthWithdrawBuffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"getAvailableToWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getOutstandingWithdrawRequests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"getWithdrawDeficit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IRoleManager","name":"_roleManager","type":"address"},{"internalType":"contract IRestakeManager","name":"_restakeManager","type":"address"},{"internalType":"contract IEzEthToken","name":"_ezETH","type":"address"},{"internalType":"contract IRenzoOracle","name":"_renzoOracle","type":"address"},{"internalType":"uint256","name":"_coolDownPeriod","type":"uint256"},{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"bufferAmount","type":"uint256"}],"internalType":"struct WithdrawQueueStorageV1.TokenWithdrawBuffer[]","name":"_withdrawalBufferTarget","type":"tuple[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renzoOracle","outputs":[{"internalType":"contract IRenzoOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"restakeManager","outputs":[{"internalType":"contract IRestakeManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roleManager","outputs":[{"internalType":"contract IRoleManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCoolDownPeriod","type":"uint256"}],"name":"updateCoolDownPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"bufferAmount","type":"uint256"}],"internalType":"struct WithdrawQueueStorageV1.TokenWithdrawBuffer[]","name":"_newBufferTarget","type":"tuple[]"}],"name":"updateWithdrawBufferTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_assetOut","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"withdrawQueued","outputs":[{"internalType":"bool","name":"queued","type":"bool"},{"internalType":"uint256","name":"fillAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawRequestNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawRequests","outputs":[{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"uint256","name":"withdrawRequestID","type":"uint256"},{"internalType":"uint256","name":"amountToRedeem","type":"uint256"},{"internalType":"uint256","name":"ezETHLocked","type":"uint256"},{"internalType":"uint256","name":"createdAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawalBufferTarget","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000e3565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e1576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b612f7380620000f36000396000f3fe6080604052600436106101c05760003560e01c80636a6015ba116100f7578063ac02e41a11610095578063f1f2c2a111610064578063f1f2c2a114610599578063f682d572146105b9578063fa8d7b97146105cf578063ff0996b51461060357600080fd5b8063ac02e41a146104fc578063ddd5e1b214610529578063ded5ad4c14610549578063e5cd7e101461057957600080fd5b80637be71216116100d15780637be7121614610487578063824a6290146104a75780638456cb59146104c7578063892866a4146104dc57600080fd5b80636a6015ba146104005780636d6ca319146104085780636fe553851461045a57600080fd5b80632c5867c9116101645780633a2bcc211161013e5780633a2bcc211461037f5780633f4ba83a1461039f578063479d3976146103b45780635c975abb146103dc57600080fd5b80632c5867c9146102f557806330f1ebb91461032557806339d07ef21461034957600080fd5b806313a73c78116101a057806313a73c781461027557806315ee8e54146102955780631731fc18146102b557806324c8ede8146102d557600080fd5b8062435da5146101c5578062f714ce14610202578063102108e614610224575b600080fd5b3480156101d157600080fd5b506099546101e5906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561020e57600080fd5b5061022261021d3660046129b3565b610623565b005b34801561023057600080fd5b5061025e61023f3660046129e3565b60a0602052600090815260409020805460019091015460ff9091169082565b6040805192151583526020830191909152016101f9565b34801561028157600080fd5b506098546101e5906001600160a01b031681565b3480156102a157600080fd5b506102226102b03660046129fc565b610a2c565b3480156102c157600080fd5b506102226102d03660046129fc565b610b6d565b3480156102e157600080fd5b506102226102f0366004612a65565b610d1e565b34801561030157600080fd5b5060a15460a254610310919082565b604080519283526020830191909152016101f9565b34801561033157600080fd5b5061033b609b5481565b6040519081526020016101f9565b34801561035557600080fd5b5061033b6103643660046129fc565b6001600160a01b03166000908152609f602052604090205490565b34801561038b57600080fd5b5061022261039a366004612afd565b610ff1565b3480156103ab57600080fd5b50610222611237565b3480156103c057600080fd5b506101e573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156103e857600080fd5b5060335460ff165b60405190151581526020016101f9565b6102226112c9565b34801561041457600080fd5b50610428610423366004612b3f565b6113e2565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a0016101f9565b34801561046657600080fd5b5061033b6104753660046129fc565b609d6020526000908152604090205481565b34801561049357600080fd5b5061033b6104a23660046129fc565b61143a565b3480156104b357600080fd5b5061033b6104c23660046129fc565b611571565b3480156104d357600080fd5b50610222611644565b3480156104e857600080fd5b506097546101e5906001600160a01b031681565b34801561050857600080fd5b5061033b6105173660046129fc565b609e6020526000908152604090205481565b34801561053557600080fd5b506102226105443660046129b3565b6116d4565b34801561055557600080fd5b506103f06105643660046129fc565b60a36020526000908152604090205460ff1681565b34801561058557600080fd5b506102226105943660046129e3565b611bdf565b3480156105a557600080fd5b506102226105b4366004612b3f565b611cca565b3480156105c557600080fd5b5061033b609c5481565b3480156105db57600080fd5b506103106105ea3660046129fc565b60a4602052600090815260409020805460019091015482565b34801561060f57600080fd5b50609a546101e5906001600160a01b031681565b61062b611e80565b610633611ed9565b81158061064757506001600160a01b038116155b156106655760405163862a606760e01b815260040160405180910390fd5b6001600160a01b0381166000908152609d6020526040812054900361069d57604051638ddadd6560e01b815260040160405180910390fd5b6098546106b5906001600160a01b0316333085611f1f565b6000806106c28484611f7f565b609c805492945090925060006106d783612b81565b90915550506040805160a0810182526001600160a01b0385168152609c54602082015290810182905260608101859052426080820152600061071885611571565b90506000818411156108f95761072f848787612199565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0387160161078e578160a160010160008282546107699190612b9a565b909155505060a18054859190600090610783908490612b9a565b909155506108209050565b6001600160a01b038616600090815260a3602052604090205460ff1615610807576001600160a01b038616600090815260a46020526040812060010180548492906107da908490612b9a565b90915550506001600160a01b038616600090815260a4602052604081208054869290610783908490612b9a565b604051633ddebb1760e21b815260040160405180910390fd5b6001600160a01b0386166000908152609e602052604081208054849290610848908490612b9a565b90915550506040516000906108639085903390602001612bad565b60408051601f198184030181529181528151602092830120600081815260a09093529120805460ff1916600117905590506001600160a01b03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146108d6576001600160a01b038716600090815260a460205260409020546108da565b60a1545b600091825260a060205260409091206001908101919091559050610927565b6001600160a01b0386166000908152609e602052604081208054869290610921908490612b9a565b90915550505b336000818152609f602090815260408083208054600180820183558286528486208a5160059093020180546001600160a01b0319166001600160a01b039093169290921782559389015181850155918801516002830155606088015160038301556080880151600490920191909155609c54928490525491927f600d09550c74d261afbd034c96f1df11e6239324809d812023bfc80ba852d7179290918a9189918d916109d49190612bf4565b604080516001600160a01b039687168152959094166020860152928401919091526060830152608082015283151560a082015260c0810185905260e00160405180910390a25050505050610a286001606555565b5050565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015610a74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a989190612c07565b610ab5576040516303ecb8cd60e51b815260040160405180910390fd5b6001600160a01b038116610adc5760405163862a606760e01b815260040160405180910390fd5b6001600160a01b038116600090815260a3602052604090205460ff16610b15576040516338f59b2360e21b815260040160405180910390fd5b6001600160a01b038116600081815260a36020908152604091829020805460ff1916905590519182527f98cfac80c8750de90f3f237766cbda80d11487df430613d6e8fdfec273e31e1a91015b60405180910390a150565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd99190612c07565b610bf6576040516303ecb8cd60e51b815260040160405180910390fd5b6001600160a01b038116610c1d5760405163862a606760e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610c5b5760405163635cb26360e01b815260040160405180910390fd5b609a54604051631a461deb60e01b81526001600160a01b03838116600483015290911690631a461deb90602401602060405180830381865afa158015610ca5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc99190612c29565b506001600160a01b038116600081815260a36020908152604091829020805460ff1916600117905590519182527f555f8e5072ea46aedcb6bb2bfe59d59009c25340225a7e01191b2260460b89429101610b62565b600054610100900460ff1615808015610d3e5750600054600160ff909116105b80610d585750303b158015610d58575060005460ff166001145b610dc05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610de3576000805461ff0019166101001790555b6001600160a01b0388161580610e0057506001600160a01b038616155b80610e1257506001600160a01b038516155b80610e2457506001600160a01b038716155b80610e2d575081155b80610e36575083155b15610e545760405163862a606760e01b815260040160405180910390fd5b610e5c612472565b609980546001600160a01b03808b166001600160a01b031992831617909255609a80548a8416908316179055609880548984169083161790556097805492881692909116919091179055609b84905560005b82811015610f98576000848483818110610eca57610eca612c42565b610ee092602060409092020190810191506129fc565b6001600160a01b03161480610f105750838382818110610f0257610f02612c42565b905060400201602001356000145b15610f2e5760405163862a606760e01b815260040160405180910390fd5b838382818110610f4057610f40612c42565b90506040020160200135609d6000868685818110610f6057610f60612c42565b610f7692602060409092020190810191506129fc565b6001600160a01b03168152602081019190915260400160002055600101610eae565b50610fa16124a1565b8015610fe7576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015611039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105d9190612c07565b61107a576040516303ecb8cd60e51b815260040160405180910390fd5b600081900361109c5760405163862a606760e01b815260040160405180910390fd5b60005b818110156112325760008383838181106110bb576110bb612c42565b6110d192602060409092020190810191506129fc565b6001600160a01b0316148061110157508282828181106110f3576110f3612c42565b905060400201602001356000145b1561111f5760405163862a606760e01b815260040160405180910390fd5b7f0884f0006f038c6e064ae7dcb5c147db5430e3152ecae73e6d72ab913e4d6d58609d600085858581811061115657611156612c42565b61116c92602060409092020190810191506129fc565b6001600160a01b03166001600160a01b031681526020019081526020016000205484848481811061119f5761119f612c42565b905060400201602001356040516111c0929190918252602082015260400190565b60405180910390a18282828181106111da576111da612c42565b90506040020160200135609d60008585858181106111fa576111fa612c42565b61121092602060409092020190810191506129fc565b6001600160a01b0316815260208101919091526040016000205560010161109f565b505050565b6099546040516285fdd360e31b81523360048201526001600160a01b039091169063042fee9890602401602060405180830381865afa15801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a29190612c07565b6112bf5760405163c2952d6b60e01b815260040160405180910390fd5b6112c76124fb565b565b6112d1611e80565b609a60009054906101000a90046001600160a01b03166001600160a01b031663f617eecc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611324573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113489190612c58565b6001600160a01b0316336001600160a01b03161461137957604051630a5e382360e11b815260040160405180910390fd5b600061139973eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee34612534565b90507fdaaff7644a104b05650ed8d2c1c7b17d856e8f2fc89e4c159a1b0700d96d7b306113c68234612bf4565b60405190815260200160405180910390a1506112c76001606555565b609f60205281600052604060002081815481106113fe57600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b039093169550909350919085565b60008061144683611571565b6001600160a01b0384166000908152609d6020526040812054919250908210611470576000611494565b6001600160a01b0384166000908152609d6020526040902054611494908390612bf4565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038516016114f55760a25460a154600091106114d05760006114e0565b60a25460a1546114e09190612bf4565b90506114ec8183612b9a565b95945050505050565b6001600160a01b038416600090815260a3602052604090205460ff161561156a576001600160a01b038416600090815260a46020526040812060018101549054116115415760006114e0565b6001600160a01b038516600090815260a460205260409020600181015490546114e09190612bf4565b9392505050565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611621576001600160a01b0382166000818152609e6020526040908190205490516370a0823160e01b81523060048201529091906370a0823190602401602060405180830381865afa1580156115ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116119190612c29565b61161b9190612bf4565b92915050565b6001600160a01b0382166000908152609e602052604090205461161b9047612bf4565b6099546040516285fdd360e31b81523360048201526001600160a01b039091169063042fee9890602401602060405180830381865afa15801561168b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116af9190612c07565b6116cc5760405163c2952d6b60e01b815260040160405180910390fd5b6112c76124a1565b6116dc611e80565b6116e4611ed9565b6001600160a01b0381166000908152609f6020526040902054821061171c5760405163ebba854160e01b815260040160405180910390fd5b6001600160a01b0381166000908152609f6020526040812080548490811061174657611746612c42565b60009182526020918290206040805160a081018252600590930290910180546001600160a01b031683526001810154938301939093526002830154908201526003820154606082015260049091015460808201819052609b549192506117ac9042612bf4565b10156117cb576040516315844b9560e11b815260040160405180910390fd5b60006117df82606001518360000151611f7f565b91505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031682600001516001600160a01b0316036118915760008284604051602001611828929190612bad565b60408051601f198184030181529181528151602092830120600081815260a090935291205490915060ff168015611871575060a254600082815260a06020526040902060010154115b1561188f5760405163071e0d8f60e31b815260040160405180910390fd5b505b60408083015183516001600160a01b03166000908152609e6020529182208054919290916118c0908490612bf4565b909155505060408201518110156118d957604082018190525b6001600160a01b0383166000908152609f6020526040902080546118ff90600190612bf4565b8154811061190f5761190f612c42565b9060005260206000209060050201609f6000856001600160a01b03166001600160a01b03168152602001908152602001600020858154811061195357611953612c42565b60009182526020808320845460059093020180546001600160a01b0319166001600160a01b0393841617815560018086015490820155600280860154908201556003808601549082015560049485015494019390935585168152609f909152604090208054806119c5576119c5612c75565b6000828152602081206005600019939093019283020180546001600160a01b031916815560018101829055600281018290556003810182905560049081019190915591556098546060840151604051632770a7eb60e21b8152309381019390935260248301526001600160a01b031690639dc29fac90604401600060405180830381600087803b158015611a5857600080fd5b505af1158015611a6c573d6000803e3d6000fd5b5050505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031682600001516001600160a01b031603611b1f576000836001600160a01b0316836040015160405160006040518083038185875af1925050503d8060008114611af2576040519150601f19603f3d011682016040523d82523d6000602084013e611af7565b606091505b5050905080611b19576040516312171d8360e31b815260040160405180910390fd5b50611b9c565b8151604080840151905163a9059cbb60e01b81526001600160a01b038681166004830152602482019290925291169063a9059cbb906044016020604051808303816000875af1158015611b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9a9190612c07565b505b7f59557aa2024e953d94077c5e8323a7be3cfc4c508f3c6120136d03017096ed3982604051611bcb9190612c8b565b60405180910390a15050610a286001606555565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015611c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4b9190612c07565b611c68576040516303ecb8cd60e51b815260040160405180910390fd5b80600003611c895760405163862a606760e01b815260040160405180910390fd5b609b5460408051918252602082018390527ff3a7366102150471f446aa61dbf08b9b9d9dae162453a9b76fc6266b1fee04e0910160405180910390a1609b55565b611cd2611e80565b609a60009054906101000a90046001600160a01b03166001600160a01b031663f617eecc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d499190612c58565b6001600160a01b0316336001600160a01b031614611d7a57604051630a5e382360e11b815260040160405180910390fd5b6001600160a01b0382161580611d8e575080155b15611dac5760405163862a606760e01b815260040160405180910390fd5b6001600160a01b0382166000908152609d60205260408120549003611de457604051638ddadd6560e01b815260040160405180910390fd5b6001600160a01b038216600090815260a3602052604081205460ff1615611e1257611e0f8383612534565b90505b611e276001600160a01b038416333085611f1f565b7f7a77f45b5cb7774db3dbf600bc1fb51330051605acc9d5817ecce3c26407325483611e538385612bf4565b604080516001600160a01b03909316835260208301919091520160405180910390a150610a286001606555565b600260655403611ed25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610db7565b6002606555565b60335460ff16156112c75760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610db7565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611f79908590612727565b50505050565b606060008060009050609a60009054906101000a90046001600160a01b03166001600160a01b031663ff9969cd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015611fdb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120039190810190612d9f565b609754609854604080516318160ddd60e01b815290519598509295506001600160a01b039182169463c5c83cb094508a9392909116916318160ddd9160048083019260209291908290030181865afa158015612063573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120879190612c29565b6040516001600160e01b031960e085901b1681526004810192909252602482015260448101849052606401602060405180830381865afa1580156120cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120f39190612c29565b91506001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461219157609754604051633793362560e01b81526001600160a01b0386811660048301526024820185905290911690633793362590604401602060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e9190612c29565b91505b509250929050565b6000806001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14612334576097546040516252e3fd60e01b81526001600160a01b03868116600483015260248201889052909116906252e3fd90604401602060405180830381865afa15801561220f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122339190612c29565b6097549095506001600160a01b03166252e3fd8561225081611571565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015612299573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122bd9190612c29565b609a54604051631a461deb60e01b81526001600160a01b038781166004830152929350911690631a461deb90602401602060405180830381865afa158015612309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061232d9190612c29565b91506123f5565b60018360008151811061234957612349612c42565b60200260200101515161235c9190612bf4565b915061236784611571565b609a60009054906101000a90046001600160a01b03166001600160a01b031663f617eecc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123de9190612c58565b6001600160a01b0316316123f29190612b9a565b90505b60005b83518110156124495783818151811061241357612413612c42565b6020026020010151838151811061242c5761242c612c42565b60200260200101518261243f9190612b9a565b91506001016123f8565b508481101561246b57604051632783124560e11b815260040160405180910390fd5b5050505050565b600054610100900460ff166124995760405162461bcd60e51b8152600401610db790612e7f565b6112c76127fc565b6124a9611ed9565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586124de3390565b6040516001600160a01b03909116815260200160405180910390a1565b61250361282f565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336124de565b60008073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038516016125855760a25460a1541161256e57600061257e565b60a25460a15461257e9190612bf4565b90506125fd565b6001600160a01b038416600090815260a3602052604090205460ff16156125fd576001600160a01b038416600090815260a46020526040902060018101549054116125d15760006125fa565b6001600160a01b038416600090815260a460205260409020600181015490546125fa9190612bf4565b90505b6000811561271f578382116126125781612614565b835b6001600160a01b0386166000908152609e6020526040812080549293508392909190612641908490612b9a565b909155505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0386160161268b578060a160010160008282546126809190612b9a565b909155506126dd9050565b6001600160a01b038516600090815260a3602052604090205460ff16156126dd576001600160a01b038516600090815260a46020526040812060010180548392906126d7908490612b9a565b90915550505b604080518281526001600160a01b03871660208201527fe58c4cce7527014b5d0a844d7d3066720af0dad3bb06c8410e27c4afc25ada7e910160405180910390a15b949350505050565b600061277c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128789092919063ffffffff16565b905080516000148061279d57508080602001905181019061279d9190612c07565b6112325760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610db7565b600054610100900460ff166128235760405162461bcd60e51b8152600401610db790612e7f565b6033805460ff19169055565b60335460ff166112c75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610db7565b606061271f848460008585600080866001600160a01b0316858760405161289f9190612eee565b60006040518083038185875af1925050503d80600081146128dc576040519150601f19603f3d011682016040523d82523d6000602084013e6128e1565b606091505b50915091506128f2878383876128fd565b979650505050505050565b6060831561296c578251600003612965576001600160a01b0385163b6129655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610db7565b508161271f565b61271f83838151156129815781518083602001fd5b8060405162461bcd60e51b8152600401610db79190612f0a565b6001600160a01b03811681146129b057600080fd5b50565b600080604083850312156129c657600080fd5b8235915060208301356129d88161299b565b809150509250929050565b6000602082840312156129f557600080fd5b5035919050565b600060208284031215612a0e57600080fd5b813561156a8161299b565b60008083601f840112612a2b57600080fd5b50813567ffffffffffffffff811115612a4357600080fd5b6020830191508360208260061b8501011115612a5e57600080fd5b9250929050565b600080600080600080600060c0888a031215612a8057600080fd5b8735612a8b8161299b565b96506020880135612a9b8161299b565b95506040880135612aab8161299b565b94506060880135612abb8161299b565b93506080880135925060a088013567ffffffffffffffff811115612ade57600080fd5b612aea8a828b01612a19565b989b979a50959850939692959293505050565b60008060208385031215612b1057600080fd5b823567ffffffffffffffff811115612b2757600080fd5b612b3385828601612a19565b90969095509350505050565b60008060408385031215612b5257600080fd5b8235612b5d8161299b565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b600060018201612b9357612b93612b6b565b5060010190565b8082018082111561161b5761161b612b6b565b82516001600160a01b03908116825260208085015190830152604080850151908301526060808501519083015260809384015193820193909352911660a082015260c00190565b8181038181111561161b5761161b612b6b565b600060208284031215612c1957600080fd5b8151801515811461156a57600080fd5b600060208284031215612c3b57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612c6a57600080fd5b815161156a8161299b565b634e487b7160e01b600052603160045260246000fd5b81516001600160a01b031681526020808301519082015260408083015190820152606080830151908201526080808301519082015260a0810161161b565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612d0857612d08612cc9565b604052919050565b600067ffffffffffffffff821115612d2a57612d2a612cc9565b5060051b60200190565b600082601f830112612d4557600080fd5b81516020612d5a612d5583612d10565b612cdf565b82815260059290921b84018101918181019086841115612d7957600080fd5b8286015b84811015612d945780518352918301918301612d7d565b509695505050505050565b600080600060608486031215612db457600080fd5b835167ffffffffffffffff80821115612dcc57600080fd5b818601915086601f830112612de057600080fd5b81516020612df0612d5583612d10565b82815260059290921b8401810191818101908a841115612e0f57600080fd5b8286015b84811015612e4757805186811115612e2b5760008081fd5b612e398d86838b0101612d34565b845250918301918301612e13565b5091890151919750909350505080821115612e6157600080fd5b50612e6e86828701612d34565b925050604084015190509250925092565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015612ee5578181015183820152602001612ecd565b50506000910152565b60008251612f00818460208701612eca565b9190910192915050565b6020815260008251806020840152612f29816040850160208701612eca565b601f01601f1916919091016040019291505056fea264697066735822122099b5e09b53c630fd8968d48703cd74bdc0b79883fbb941140f9cd88140a69c3f64736f6c63430008130033
Deployed Bytecode
0x6080604052600436106101c05760003560e01c80636a6015ba116100f7578063ac02e41a11610095578063f1f2c2a111610064578063f1f2c2a114610599578063f682d572146105b9578063fa8d7b97146105cf578063ff0996b51461060357600080fd5b8063ac02e41a146104fc578063ddd5e1b214610529578063ded5ad4c14610549578063e5cd7e101461057957600080fd5b80637be71216116100d15780637be7121614610487578063824a6290146104a75780638456cb59146104c7578063892866a4146104dc57600080fd5b80636a6015ba146104005780636d6ca319146104085780636fe553851461045a57600080fd5b80632c5867c9116101645780633a2bcc211161013e5780633a2bcc211461037f5780633f4ba83a1461039f578063479d3976146103b45780635c975abb146103dc57600080fd5b80632c5867c9146102f557806330f1ebb91461032557806339d07ef21461034957600080fd5b806313a73c78116101a057806313a73c781461027557806315ee8e54146102955780631731fc18146102b557806324c8ede8146102d557600080fd5b8062435da5146101c5578062f714ce14610202578063102108e614610224575b600080fd5b3480156101d157600080fd5b506099546101e5906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561020e57600080fd5b5061022261021d3660046129b3565b610623565b005b34801561023057600080fd5b5061025e61023f3660046129e3565b60a0602052600090815260409020805460019091015460ff9091169082565b6040805192151583526020830191909152016101f9565b34801561028157600080fd5b506098546101e5906001600160a01b031681565b3480156102a157600080fd5b506102226102b03660046129fc565b610a2c565b3480156102c157600080fd5b506102226102d03660046129fc565b610b6d565b3480156102e157600080fd5b506102226102f0366004612a65565b610d1e565b34801561030157600080fd5b5060a15460a254610310919082565b604080519283526020830191909152016101f9565b34801561033157600080fd5b5061033b609b5481565b6040519081526020016101f9565b34801561035557600080fd5b5061033b6103643660046129fc565b6001600160a01b03166000908152609f602052604090205490565b34801561038b57600080fd5b5061022261039a366004612afd565b610ff1565b3480156103ab57600080fd5b50610222611237565b3480156103c057600080fd5b506101e573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156103e857600080fd5b5060335460ff165b60405190151581526020016101f9565b6102226112c9565b34801561041457600080fd5b50610428610423366004612b3f565b6113e2565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a0016101f9565b34801561046657600080fd5b5061033b6104753660046129fc565b609d6020526000908152604090205481565b34801561049357600080fd5b5061033b6104a23660046129fc565b61143a565b3480156104b357600080fd5b5061033b6104c23660046129fc565b611571565b3480156104d357600080fd5b50610222611644565b3480156104e857600080fd5b506097546101e5906001600160a01b031681565b34801561050857600080fd5b5061033b6105173660046129fc565b609e6020526000908152604090205481565b34801561053557600080fd5b506102226105443660046129b3565b6116d4565b34801561055557600080fd5b506103f06105643660046129fc565b60a36020526000908152604090205460ff1681565b34801561058557600080fd5b506102226105943660046129e3565b611bdf565b3480156105a557600080fd5b506102226105b4366004612b3f565b611cca565b3480156105c557600080fd5b5061033b609c5481565b3480156105db57600080fd5b506103106105ea3660046129fc565b60a4602052600090815260409020805460019091015482565b34801561060f57600080fd5b50609a546101e5906001600160a01b031681565b61062b611e80565b610633611ed9565b81158061064757506001600160a01b038116155b156106655760405163862a606760e01b815260040160405180910390fd5b6001600160a01b0381166000908152609d6020526040812054900361069d57604051638ddadd6560e01b815260040160405180910390fd5b6098546106b5906001600160a01b0316333085611f1f565b6000806106c28484611f7f565b609c805492945090925060006106d783612b81565b90915550506040805160a0810182526001600160a01b0385168152609c54602082015290810182905260608101859052426080820152600061071885611571565b90506000818411156108f95761072f848787612199565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0387160161078e578160a160010160008282546107699190612b9a565b909155505060a18054859190600090610783908490612b9a565b909155506108209050565b6001600160a01b038616600090815260a3602052604090205460ff1615610807576001600160a01b038616600090815260a46020526040812060010180548492906107da908490612b9a565b90915550506001600160a01b038616600090815260a4602052604081208054869290610783908490612b9a565b604051633ddebb1760e21b815260040160405180910390fd5b6001600160a01b0386166000908152609e602052604081208054849290610848908490612b9a565b90915550506040516000906108639085903390602001612bad565b60408051601f198184030181529181528151602092830120600081815260a09093529120805460ff1916600117905590506001600160a01b03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146108d6576001600160a01b038716600090815260a460205260409020546108da565b60a1545b600091825260a060205260409091206001908101919091559050610927565b6001600160a01b0386166000908152609e602052604081208054869290610921908490612b9a565b90915550505b336000818152609f602090815260408083208054600180820183558286528486208a5160059093020180546001600160a01b0319166001600160a01b039093169290921782559389015181850155918801516002830155606088015160038301556080880151600490920191909155609c54928490525491927f600d09550c74d261afbd034c96f1df11e6239324809d812023bfc80ba852d7179290918a9189918d916109d49190612bf4565b604080516001600160a01b039687168152959094166020860152928401919091526060830152608082015283151560a082015260c0810185905260e00160405180910390a25050505050610a286001606555565b5050565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015610a74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a989190612c07565b610ab5576040516303ecb8cd60e51b815260040160405180910390fd5b6001600160a01b038116610adc5760405163862a606760e01b815260040160405180910390fd5b6001600160a01b038116600090815260a3602052604090205460ff16610b15576040516338f59b2360e21b815260040160405180910390fd5b6001600160a01b038116600081815260a36020908152604091829020805460ff1916905590519182527f98cfac80c8750de90f3f237766cbda80d11487df430613d6e8fdfec273e31e1a91015b60405180910390a150565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd99190612c07565b610bf6576040516303ecb8cd60e51b815260040160405180910390fd5b6001600160a01b038116610c1d5760405163862a606760e01b815260040160405180910390fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610c5b5760405163635cb26360e01b815260040160405180910390fd5b609a54604051631a461deb60e01b81526001600160a01b03838116600483015290911690631a461deb90602401602060405180830381865afa158015610ca5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc99190612c29565b506001600160a01b038116600081815260a36020908152604091829020805460ff1916600117905590519182527f555f8e5072ea46aedcb6bb2bfe59d59009c25340225a7e01191b2260460b89429101610b62565b600054610100900460ff1615808015610d3e5750600054600160ff909116105b80610d585750303b158015610d58575060005460ff166001145b610dc05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610de3576000805461ff0019166101001790555b6001600160a01b0388161580610e0057506001600160a01b038616155b80610e1257506001600160a01b038516155b80610e2457506001600160a01b038716155b80610e2d575081155b80610e36575083155b15610e545760405163862a606760e01b815260040160405180910390fd5b610e5c612472565b609980546001600160a01b03808b166001600160a01b031992831617909255609a80548a8416908316179055609880548984169083161790556097805492881692909116919091179055609b84905560005b82811015610f98576000848483818110610eca57610eca612c42565b610ee092602060409092020190810191506129fc565b6001600160a01b03161480610f105750838382818110610f0257610f02612c42565b905060400201602001356000145b15610f2e5760405163862a606760e01b815260040160405180910390fd5b838382818110610f4057610f40612c42565b90506040020160200135609d6000868685818110610f6057610f60612c42565b610f7692602060409092020190810191506129fc565b6001600160a01b03168152602081019190915260400160002055600101610eae565b50610fa16124a1565b8015610fe7576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015611039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105d9190612c07565b61107a576040516303ecb8cd60e51b815260040160405180910390fd5b600081900361109c5760405163862a606760e01b815260040160405180910390fd5b60005b818110156112325760008383838181106110bb576110bb612c42565b6110d192602060409092020190810191506129fc565b6001600160a01b0316148061110157508282828181106110f3576110f3612c42565b905060400201602001356000145b1561111f5760405163862a606760e01b815260040160405180910390fd5b7f0884f0006f038c6e064ae7dcb5c147db5430e3152ecae73e6d72ab913e4d6d58609d600085858581811061115657611156612c42565b61116c92602060409092020190810191506129fc565b6001600160a01b03166001600160a01b031681526020019081526020016000205484848481811061119f5761119f612c42565b905060400201602001356040516111c0929190918252602082015260400190565b60405180910390a18282828181106111da576111da612c42565b90506040020160200135609d60008585858181106111fa576111fa612c42565b61121092602060409092020190810191506129fc565b6001600160a01b0316815260208101919091526040016000205560010161109f565b505050565b6099546040516285fdd360e31b81523360048201526001600160a01b039091169063042fee9890602401602060405180830381865afa15801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a29190612c07565b6112bf5760405163c2952d6b60e01b815260040160405180910390fd5b6112c76124fb565b565b6112d1611e80565b609a60009054906101000a90046001600160a01b03166001600160a01b031663f617eecc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611324573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113489190612c58565b6001600160a01b0316336001600160a01b03161461137957604051630a5e382360e11b815260040160405180910390fd5b600061139973eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee34612534565b90507fdaaff7644a104b05650ed8d2c1c7b17d856e8f2fc89e4c159a1b0700d96d7b306113c68234612bf4565b60405190815260200160405180910390a1506112c76001606555565b609f60205281600052604060002081815481106113fe57600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b039093169550909350919085565b60008061144683611571565b6001600160a01b0384166000908152609d6020526040812054919250908210611470576000611494565b6001600160a01b0384166000908152609d6020526040902054611494908390612bf4565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038516016114f55760a25460a154600091106114d05760006114e0565b60a25460a1546114e09190612bf4565b90506114ec8183612b9a565b95945050505050565b6001600160a01b038416600090815260a3602052604090205460ff161561156a576001600160a01b038416600090815260a46020526040812060018101549054116115415760006114e0565b6001600160a01b038516600090815260a460205260409020600181015490546114e09190612bf4565b9392505050565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611621576001600160a01b0382166000818152609e6020526040908190205490516370a0823160e01b81523060048201529091906370a0823190602401602060405180830381865afa1580156115ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116119190612c29565b61161b9190612bf4565b92915050565b6001600160a01b0382166000908152609e602052604090205461161b9047612bf4565b6099546040516285fdd360e31b81523360048201526001600160a01b039091169063042fee9890602401602060405180830381865afa15801561168b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116af9190612c07565b6116cc5760405163c2952d6b60e01b815260040160405180910390fd5b6112c76124a1565b6116dc611e80565b6116e4611ed9565b6001600160a01b0381166000908152609f6020526040902054821061171c5760405163ebba854160e01b815260040160405180910390fd5b6001600160a01b0381166000908152609f6020526040812080548490811061174657611746612c42565b60009182526020918290206040805160a081018252600590930290910180546001600160a01b031683526001810154938301939093526002830154908201526003820154606082015260049091015460808201819052609b549192506117ac9042612bf4565b10156117cb576040516315844b9560e11b815260040160405180910390fd5b60006117df82606001518360000151611f7f565b91505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031682600001516001600160a01b0316036118915760008284604051602001611828929190612bad565b60408051601f198184030181529181528151602092830120600081815260a090935291205490915060ff168015611871575060a254600082815260a06020526040902060010154115b1561188f5760405163071e0d8f60e31b815260040160405180910390fd5b505b60408083015183516001600160a01b03166000908152609e6020529182208054919290916118c0908490612bf4565b909155505060408201518110156118d957604082018190525b6001600160a01b0383166000908152609f6020526040902080546118ff90600190612bf4565b8154811061190f5761190f612c42565b9060005260206000209060050201609f6000856001600160a01b03166001600160a01b03168152602001908152602001600020858154811061195357611953612c42565b60009182526020808320845460059093020180546001600160a01b0319166001600160a01b0393841617815560018086015490820155600280860154908201556003808601549082015560049485015494019390935585168152609f909152604090208054806119c5576119c5612c75565b6000828152602081206005600019939093019283020180546001600160a01b031916815560018101829055600281018290556003810182905560049081019190915591556098546060840151604051632770a7eb60e21b8152309381019390935260248301526001600160a01b031690639dc29fac90604401600060405180830381600087803b158015611a5857600080fd5b505af1158015611a6c573d6000803e3d6000fd5b5050505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031682600001516001600160a01b031603611b1f576000836001600160a01b0316836040015160405160006040518083038185875af1925050503d8060008114611af2576040519150601f19603f3d011682016040523d82523d6000602084013e611af7565b606091505b5050905080611b19576040516312171d8360e31b815260040160405180910390fd5b50611b9c565b8151604080840151905163a9059cbb60e01b81526001600160a01b038681166004830152602482019290925291169063a9059cbb906044016020604051808303816000875af1158015611b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9a9190612c07565b505b7f59557aa2024e953d94077c5e8323a7be3cfc4c508f3c6120136d03017096ed3982604051611bcb9190612c8b565b60405180910390a15050610a286001606555565b609954604051633bdd6c3360e21b81523360048201526001600160a01b039091169063ef75b0cc90602401602060405180830381865afa158015611c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4b9190612c07565b611c68576040516303ecb8cd60e51b815260040160405180910390fd5b80600003611c895760405163862a606760e01b815260040160405180910390fd5b609b5460408051918252602082018390527ff3a7366102150471f446aa61dbf08b9b9d9dae162453a9b76fc6266b1fee04e0910160405180910390a1609b55565b611cd2611e80565b609a60009054906101000a90046001600160a01b03166001600160a01b031663f617eecc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d499190612c58565b6001600160a01b0316336001600160a01b031614611d7a57604051630a5e382360e11b815260040160405180910390fd5b6001600160a01b0382161580611d8e575080155b15611dac5760405163862a606760e01b815260040160405180910390fd5b6001600160a01b0382166000908152609d60205260408120549003611de457604051638ddadd6560e01b815260040160405180910390fd5b6001600160a01b038216600090815260a3602052604081205460ff1615611e1257611e0f8383612534565b90505b611e276001600160a01b038416333085611f1f565b7f7a77f45b5cb7774db3dbf600bc1fb51330051605acc9d5817ecce3c26407325483611e538385612bf4565b604080516001600160a01b03909316835260208301919091520160405180910390a150610a286001606555565b600260655403611ed25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610db7565b6002606555565b60335460ff16156112c75760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610db7565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611f79908590612727565b50505050565b606060008060009050609a60009054906101000a90046001600160a01b03166001600160a01b031663ff9969cd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015611fdb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120039190810190612d9f565b609754609854604080516318160ddd60e01b815290519598509295506001600160a01b039182169463c5c83cb094508a9392909116916318160ddd9160048083019260209291908290030181865afa158015612063573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120879190612c29565b6040516001600160e01b031960e085901b1681526004810192909252602482015260448101849052606401602060405180830381865afa1580156120cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120f39190612c29565b91506001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461219157609754604051633793362560e01b81526001600160a01b0386811660048301526024820185905290911690633793362590604401602060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e9190612c29565b91505b509250929050565b6000806001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14612334576097546040516252e3fd60e01b81526001600160a01b03868116600483015260248201889052909116906252e3fd90604401602060405180830381865afa15801561220f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122339190612c29565b6097549095506001600160a01b03166252e3fd8561225081611571565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015612299573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122bd9190612c29565b609a54604051631a461deb60e01b81526001600160a01b038781166004830152929350911690631a461deb90602401602060405180830381865afa158015612309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061232d9190612c29565b91506123f5565b60018360008151811061234957612349612c42565b60200260200101515161235c9190612bf4565b915061236784611571565b609a60009054906101000a90046001600160a01b03166001600160a01b031663f617eecc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123de9190612c58565b6001600160a01b0316316123f29190612b9a565b90505b60005b83518110156124495783818151811061241357612413612c42565b6020026020010151838151811061242c5761242c612c42565b60200260200101518261243f9190612b9a565b91506001016123f8565b508481101561246b57604051632783124560e11b815260040160405180910390fd5b5050505050565b600054610100900460ff166124995760405162461bcd60e51b8152600401610db790612e7f565b6112c76127fc565b6124a9611ed9565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586124de3390565b6040516001600160a01b03909116815260200160405180910390a1565b61250361282f565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336124de565b60008073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038516016125855760a25460a1541161256e57600061257e565b60a25460a15461257e9190612bf4565b90506125fd565b6001600160a01b038416600090815260a3602052604090205460ff16156125fd576001600160a01b038416600090815260a46020526040902060018101549054116125d15760006125fa565b6001600160a01b038416600090815260a460205260409020600181015490546125fa9190612bf4565b90505b6000811561271f578382116126125781612614565b835b6001600160a01b0386166000908152609e6020526040812080549293508392909190612641908490612b9a565b909155505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0386160161268b578060a160010160008282546126809190612b9a565b909155506126dd9050565b6001600160a01b038516600090815260a3602052604090205460ff16156126dd576001600160a01b038516600090815260a46020526040812060010180548392906126d7908490612b9a565b90915550505b604080518281526001600160a01b03871660208201527fe58c4cce7527014b5d0a844d7d3066720af0dad3bb06c8410e27c4afc25ada7e910160405180910390a15b949350505050565b600061277c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128789092919063ffffffff16565b905080516000148061279d57508080602001905181019061279d9190612c07565b6112325760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610db7565b600054610100900460ff166128235760405162461bcd60e51b8152600401610db790612e7f565b6033805460ff19169055565b60335460ff166112c75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610db7565b606061271f848460008585600080866001600160a01b0316858760405161289f9190612eee565b60006040518083038185875af1925050503d80600081146128dc576040519150601f19603f3d011682016040523d82523d6000602084013e6128e1565b606091505b50915091506128f2878383876128fd565b979650505050505050565b6060831561296c578251600003612965576001600160a01b0385163b6129655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610db7565b508161271f565b61271f83838151156129815781518083602001fd5b8060405162461bcd60e51b8152600401610db79190612f0a565b6001600160a01b03811681146129b057600080fd5b50565b600080604083850312156129c657600080fd5b8235915060208301356129d88161299b565b809150509250929050565b6000602082840312156129f557600080fd5b5035919050565b600060208284031215612a0e57600080fd5b813561156a8161299b565b60008083601f840112612a2b57600080fd5b50813567ffffffffffffffff811115612a4357600080fd5b6020830191508360208260061b8501011115612a5e57600080fd5b9250929050565b600080600080600080600060c0888a031215612a8057600080fd5b8735612a8b8161299b565b96506020880135612a9b8161299b565b95506040880135612aab8161299b565b94506060880135612abb8161299b565b93506080880135925060a088013567ffffffffffffffff811115612ade57600080fd5b612aea8a828b01612a19565b989b979a50959850939692959293505050565b60008060208385031215612b1057600080fd5b823567ffffffffffffffff811115612b2757600080fd5b612b3385828601612a19565b90969095509350505050565b60008060408385031215612b5257600080fd5b8235612b5d8161299b565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b600060018201612b9357612b93612b6b565b5060010190565b8082018082111561161b5761161b612b6b565b82516001600160a01b03908116825260208085015190830152604080850151908301526060808501519083015260809384015193820193909352911660a082015260c00190565b8181038181111561161b5761161b612b6b565b600060208284031215612c1957600080fd5b8151801515811461156a57600080fd5b600060208284031215612c3b57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612c6a57600080fd5b815161156a8161299b565b634e487b7160e01b600052603160045260246000fd5b81516001600160a01b031681526020808301519082015260408083015190820152606080830151908201526080808301519082015260a0810161161b565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612d0857612d08612cc9565b604052919050565b600067ffffffffffffffff821115612d2a57612d2a612cc9565b5060051b60200190565b600082601f830112612d4557600080fd5b81516020612d5a612d5583612d10565b612cdf565b82815260059290921b84018101918181019086841115612d7957600080fd5b8286015b84811015612d945780518352918301918301612d7d565b509695505050505050565b600080600060608486031215612db457600080fd5b835167ffffffffffffffff80821115612dcc57600080fd5b818601915086601f830112612de057600080fd5b81516020612df0612d5583612d10565b82815260059290921b8401810191818101908a841115612e0f57600080fd5b8286015b84811015612e4757805186811115612e2b5760008081fd5b612e398d86838b0101612d34565b845250918301918301612e13565b5091890151919750909350505080821115612e6157600080fd5b50612e6e86828701612d34565b925050604084015190509250925092565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015612ee5578181015183820152602001612ecd565b50506000910152565b60008251612f00818460208701612eca565b9190910192915050565b6020815260008251806020840152612f29816040850160208701612eca565b601f01601f1916919091016040019291505056fea264697066735822122099b5e09b53c630fd8968d48703cd74bdc0b79883fbb941140f9cd88140a69c3f64736f6c63430008130033
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.