Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
EtherFiNode
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 2000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "./interfaces/IEtherFiNode.sol"; import "./interfaces/IEtherFiNodesManager.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./eigenlayer-interfaces/IEigenPodManager.sol"; import "./eigenlayer-interfaces/IDelayedWithdrawalRouter.sol"; import "forge-std/console.sol"; contract EtherFiNode is IEtherFiNode { address public etherFiNodesManager; uint256 public DEPRECATED_localRevenueIndex; uint256 public DEPRECATED_vestedAuctionRewards; string public DEPRECATED_ipfsHashForEncryptedValidatorKey; uint32 public DEPRECATED_exitRequestTimestamp; uint32 public DEPRECATED_exitTimestamp; uint32 public DEPRECATED_stakingStartTimestamp; VALIDATOR_PHASE public DEPRECATED_phase; uint32 public restakingObservedExitBlock; address public eigenPod; bool public isRestakingEnabled; uint16 public version; uint16 private _numAssociatedValidators; uint16 public numExitRequestsByTnft; uint16 public numExitedValidators; // EXITED & but not FULLY_WITHDRAWN // TODO: see if we really need to maintain the validator Ids on-chain mapping(uint256 => uint256) public associatedValidatorIndices; uint256[] public associatedValidatorIds; error CallFailed(bytes data); event EigenPodCreated(address indexed nodeAddress, address indexed podAddress); //-------------------------------------------------------------------------------------- //---------------------------------- CONSTRUCTOR ------------------------------------ //-------------------------------------------------------------------------------------- /// @custom:oz-upgrades-unsafe-allow constructor constructor() {} /// @notice Based on the sources where they come from, the staking rewards are split into /// - those from the execution layer: transaction fees and MEV /// - those from the consensus layer: staking rewards for attesting the state of the chain, /// proposing a new block, or being selected in a validator sync committee /// To receive the rewards from the execution layer, it should have 'receive()' function. receive() external payable {} /// @dev called once immediately after creating a new instance of a EtheriNode beacon proxy function initialize(address _etherFiNodesManager) external { require(DEPRECATED_phase == VALIDATOR_PHASE.NOT_INITIALIZED, "ALREADY_INITIALIZED"); require(etherFiNodesManager == address(0), "ALREADY_INITIALIZED"); require(_etherFiNodesManager != address(0), "NO_ZERO_ADDRESS"); etherFiNodesManager = _etherFiNodesManager; version = 1; } // Update the safe contract from verison 0 to version 1 // if `_validatorId` != 0, the v0 safe contract currently is tied to the validator with its id = `_validatorId` // this function updates it to v1 so that it can be used by multiple validators // else `_validatorId` == 0, this safe is not tied to any validator yet function migrateVersion(uint256 _validatorId, IEtherFiNodesManager.ValidatorInfo memory _info) external onlyEtherFiNodeManagerContract { if (version != 0) return; DEPRECATED_exitRequestTimestamp = 0; DEPRECATED_exitTimestamp = 0; DEPRECATED_stakingStartTimestamp = 0; DEPRECATED_phase = VALIDATOR_PHASE.NOT_INITIALIZED; delete DEPRECATED_ipfsHashForEncryptedValidatorKey; version = 1; if (_validatorId != 0) { require(_numAssociatedValidators == 0, "ALREADY_INITIALIZED"); registerValidator(_validatorId, false); updateNumberOfAssociatedValidators(1, 0); // Meaning that the validator got `sendExitRequest` before the safe version 1 release // EFM._updateExitRequestTimestamp (which updates 'numExitRequestsByTnft') was not called. So, process that here if (_info.exitRequestTimestamp > 0) { updateNumExitRequests(1, 0); } // Meaning that the validator got `processNodeExit` before the safe version 1 release // EFM._setValidatorPhase (which updates 'numExitedValidators') was not called. So, process that here if (_info.exitTimestamp > 0) { updateNumExitedValidators(1, 0); } } } // At version 0, an EtherFiNode contract is associated with only one validator // After version 1, it can be associated with multiple validators having the same (B-nft, T-nft, node operator) function numAssociatedValidators() public view returns (uint256) { if (version == 0) { // For the safe at version 0, `phase` variable is still valid and can be used to check if the validator is still active if (DEPRECATED_phase == VALIDATOR_PHASE.LIVE || DEPRECATED_phase == VALIDATOR_PHASE.BEING_SLASHED || DEPRECATED_phase == VALIDATOR_PHASE.EXITED) { return 1; } else { return 0; } } else { return _numAssociatedValidators; } } function registerValidator(uint256 _validatorId, bool _enableRestaking) public onlyEtherFiNodeManagerContract ensureLatestVersion { require(numAssociatedValidators() == 0 || isRestakingEnabled == _enableRestaking, "restaking status mismatch"); // TODO: see if we really need to maintain the validator Ids on-chain { uint256 index = associatedValidatorIds.length; associatedValidatorIds.push(_validatorId); associatedValidatorIndices[_validatorId] = index; } if (_enableRestaking) { isRestakingEnabled = true; createEigenPod(); // NOOP if already exists } } /// @dev deRegister the validator from the safe /// if there is no more validator associated with this safe, it is recycled to be used again in the withdrawal safe pool function unRegisterValidator( uint256 _validatorId, IEtherFiNodesManager.ValidatorInfo memory _info ) external onlyEtherFiNodeManagerContract ensureLatestVersion returns (bool) { require(_info.phase == VALIDATOR_PHASE.FULLY_WITHDRAWN || _info.phase == VALIDATOR_PHASE.NOT_INITIALIZED, "invalid phase"); // If the phase changed from EXITED to FULLY_WITHDRAWN, decrement the counter if (_info.phase == VALIDATOR_PHASE.FULLY_WITHDRAWN) { numExitedValidators -= 1; } // If there was an exit request, decrement the number of exit requests if (_info.exitRequestTimestamp != 0) { numExitRequestsByTnft -= 1; } // TODO: see if we really need to maintain the validator Ids on-chain { uint256 index = associatedValidatorIndices[_validatorId]; uint256 endIndex = associatedValidatorIds.length - 1; uint256 end = associatedValidatorIds[endIndex]; associatedValidatorIds[index] = associatedValidatorIds[endIndex]; associatedValidatorIndices[end] = index; associatedValidatorIds.pop(); delete associatedValidatorIndices[_validatorId]; } if (numAssociatedValidators() == 0) { restakingObservedExitBlock = 0; isRestakingEnabled = false; return true; } return false; } //-------------------------------------------------------------------------------------- //---------------------------- STATE-CHANGING FUNCTIONS ------------------------------ //-------------------------------------------------------------------------------------- function updateNumberOfAssociatedValidators(uint16 _up, uint16 _down) public onlyEtherFiNodeManagerContract ensureLatestVersion { if (_up > 0) _numAssociatedValidators += _up; if (_down > 0) _numAssociatedValidators -= _down; } function updateNumExitRequests(uint16 _up, uint16 _down) public onlyEtherFiNodeManagerContract ensureLatestVersion { if (_up > 0) numExitRequestsByTnft += _up; if (_down > 0) numExitRequestsByTnft -= _down; } function updateNumExitedValidators(uint16 _up, uint16 _down) public onlyEtherFiNodeManagerContract ensureLatestVersion { if (_up > 0) numExitedValidators += _up; if (_down > 0) numExitedValidators -= _down; } /// @notice process the exit function processNodeExit() external onlyEtherFiNodeManagerContract ensureLatestVersion { if (isRestakingEnabled) { // eigenLayer bookeeping // we need to mark a block from which we know all beaconchain eth has been moved to the eigenPod // so that we can properly calculate exit payouts and ensure queued withdrawals have been resolved // (eigenLayer withdrawals are tied to blocknumber instead of timestamp) restakingObservedExitBlock = uint32(block.number); queueRestakedWithdrawal(); } } /// @dev transfer funds from the withdrawal safe to the 4 associated parties (bNFT, tNFT, treasury, nodeOperator) function withdrawFunds( address _treasury, uint256 _treasuryAmount, address _operator, uint256 _operatorAmount, address _tnftHolder, uint256 _tnftAmount, address _bnftHolder, uint256 _bnftAmount ) external onlyEtherFiNodeManagerContract ensureLatestVersion { // the recipients of the funds must be able to receive the fund // if it is a smart contract, they should implement either receive() or fallback() properly // It's designed to prevent malicious actors from pausing the withdrawals bool sent; if (_operatorAmount > 0) { (sent, ) = payable(_operator).call{value: _operatorAmount, gas: 10000}(""); _treasuryAmount += (!sent) ? _operatorAmount : 0; } if (_bnftAmount > 0) { (sent, ) = payable(_bnftHolder).call{value: _bnftAmount, gas: 12000}(""); _treasuryAmount += (!sent) ? _bnftAmount : 0; } if (_tnftAmount > 0) { (sent, ) = payable(_tnftHolder).call{value: _tnftAmount, gas: 12000}(""); _treasuryAmount += (!sent) ? _tnftAmount : 0; } if (_treasuryAmount > 0) { (sent, ) = _treasury.call{value: _treasuryAmount, gas: 2300}(""); require(sent, "ETH_SEND_FAILED"); } } //-------------------------------------------------------------------------------------- //-------------------------------------- GETTER -------------------------------------- //-------------------------------------------------------------------------------------- /// @notice Fetch the staking rewards accrued in the safe that can be paid out to (toNodeOperator, toTnft, toBnft, toTreasury) /// @param _splits the splits for the staking rewards /// /// @return toNodeOperator the payout to the Node Operator /// @return toTnft the payout to the T-NFT holder /// @return toBnft the payout to the B-NFT holder /// @return toTreasury the payout to the Treasury function getRewardsPayouts( uint32 _exitRequestTimestamp, IEtherFiNodesManager.RewardsSplit memory _splits ) public view returns (uint256, uint256, uint256, uint256) { uint256 _balance = withdrawableBalanceInExecutionLayer(); return _calculateSplits(_balance, _splits); } /// @notice Compute the non exit penalty for the b-nft holder /// @param _tNftExitRequestTimestamp the timestamp when the T-NFT holder asked the B-NFT holder to exit the node /// @param _bNftExitRequestTimestamp the timestamp when the B-NFT holder submitted the exit request to the beacon network function getNonExitPenalty( uint32 _tNftExitRequestTimestamp, uint32 _bNftExitRequestTimestamp ) public view returns (uint256) { if (_tNftExitRequestTimestamp == 0) return 0; uint128 _penaltyPrinciple = IEtherFiNodesManager(etherFiNodesManager).nonExitPenaltyPrincipal(); uint64 _dailyPenalty = IEtherFiNodesManager(etherFiNodesManager).nonExitPenaltyDailyRate(); uint256 daysElapsed = _getDaysPassedSince(_tNftExitRequestTimestamp, _bNftExitRequestTimestamp); if (daysElapsed > 365) { return _penaltyPrinciple; } uint256 remaining = _penaltyPrinciple; while (daysElapsed > 0) { uint256 exponent = Math.min(7, daysElapsed); remaining = (remaining * (10000 - uint256(_dailyPenalty)) ** exponent) / (10000 ** exponent); daysElapsed -= Math.min(7, daysElapsed); } return _penaltyPrinciple - remaining; } /// @notice total balance (in the execution layer) of this withdrawal safe split into its component parts. /// 1. the withdrawal safe balance /// 2. the EigenPod balance /// 3. the withdrawals pending in DelayedWithdrawalRouter function splitBalanceInExecutionLayer() public view returns (uint256 _withdrawalSafe, uint256 _eigenPod, uint256 _delayedWithdrawalRouter) { _withdrawalSafe = address(this).balance; if (isRestakingEnabled) { _eigenPod = eigenPod.balance; IDelayedWithdrawalRouter delayedWithdrawalRouter = IDelayedWithdrawalRouter(IEtherFiNodesManager(etherFiNodesManager).delayedWithdrawalRouter()); IDelayedWithdrawalRouter.DelayedWithdrawal[] memory delayedWithdrawals = delayedWithdrawalRouter.getUserDelayedWithdrawals(address(this)); for (uint256 x = 0; x < delayedWithdrawals.length; x++) { _delayedWithdrawalRouter += delayedWithdrawals[x].amount; } } return (_withdrawalSafe, _eigenPod, _delayedWithdrawalRouter); } /// @notice total balance (wei) of this safe currently in the execution layer. function totalBalanceInExecutionLayer() public view returns (uint256) { (uint256 _safe, uint256 _pod, uint256 _router) = splitBalanceInExecutionLayer(); return _safe + _pod + _router; } /// @notice balance (wei) of this safe that could be immediately withdrawn. /// This only differs from the balance in the safe in the case of restaked validators /// because some funds might not be withdrawable yet due to eigenlayer's queued withdrawal system function withdrawableBalanceInExecutionLayer() public view returns (uint256) { uint256 safeBalance = address(this).balance; uint256 claimableBalance = 0; if (isRestakingEnabled) { IDelayedWithdrawalRouter delayedWithdrawalRouter = IDelayedWithdrawalRouter(IEtherFiNodesManager(etherFiNodesManager).delayedWithdrawalRouter()); IDelayedWithdrawalRouter.DelayedWithdrawal[] memory claimableWithdrawals = delayedWithdrawalRouter.getClaimableUserDelayedWithdrawals(address(this)); for (uint256 x = 0; x < claimableWithdrawals.length; x++) { claimableBalance += claimableWithdrawals[x].amount; } } return safeBalance + claimableBalance; } function moveFundsToManager(uint256 _amount) external onlyEtherFiNodeManagerContract { (bool sent, ) = etherFiNodesManager.call{value: _amount, gas: 6000}(""); require(sent, "ETH_SEND_FAILED"); } function getFullWithdrawalPayouts( IEtherFiNodesManager.ValidatorInfo memory _info, IEtherFiNodesManager.RewardsSplit memory _SRsplits ) public view onlyEtherFiNodeManagerContract returns (uint256 toNodeOperator, uint256 toTnft, uint256 toBnft, uint256 toTreasury) { if (version == 0 || numAssociatedValidators() == 1) { return calculateTVL(0, _info, _SRsplits, true); } else if (version == 1) { // If (version ==1 && numAssociatedValidators() > 1) // the full withdrwal for a validator only considers its principal amount (= 16 ether ~ 32 ether) // the staking rewards remain in the safe contract // Therefore, if a validator is slashed, the accrued staking rewards are used to cover the slashing amount // In the upcoming version, the proof system will be ported so that the penalty amount properly considered for withdrawals uint256[] memory payouts = new uint256[](4); // (toNodeOperator, toTnft, toBnft, toTreasury) uint256 principal = (withdrawableBalanceInExecutionLayer() >= 32 ether) ? 32 ether : withdrawableBalanceInExecutionLayer(); (payouts[2], payouts[1]) = _calculatePrincipals(principal); (payouts[0], payouts[1], payouts[2], payouts[3]) = _applyNonExitPenalty(_info, payouts[0], payouts[1], payouts[2], payouts[3]); return (payouts[0], payouts[1], payouts[2], payouts[3]); } else { require(false, "WRONG_VERSION"); } } /// @notice Given the current (phase, beacon balance) of a validator, compute the TVLs for {node operator, t-nft holder, b-nft holder, treasury} function getTvlSplits( VALIDATOR_PHASE _phase, uint256 _beaconBalance, bool _onlyWithdrawable ) internal view returns (uint256 stakingRewards, uint256 principal) { uint256 numValidators = numAssociatedValidators(); if (numValidators == 0) return (0, 0); // Consider the total balance of the safe in the execution layer uint256 balance = _onlyWithdrawable? withdrawableBalanceInExecutionLayer() : totalBalanceInExecutionLayer(); // Calculate the total principal for the exited validators. // It must be in the range of [16 ether * numExitedValidators, 32 ether * numExitedValidators] // since the maximum slashing amount is 16 ether per validator (without considering the slashing from restaking) // // Here, the accrued rewards in the safe are used to cover the loss from the slashing // For example, say the safe had 1 ether accrued staking rewards, but the validator got slashed till 16 ether // After exiting the validator, the safe balance becomes 17 ether (16 ether from the slashed validator, 1 ether was the accrued rewards), // the accrued rewards are used to cover the slashing amount, thus, being considered as principal. // While this is not the best way to handle it, we acknowledge it as a temporary solution until the more advanced & efficient method is implemented require (balance >= 16 ether * numExitedValidators, "INSUFFICIENT_BALANCE"); uint256 totalPrincipalForExitedValidators = 16 ether * numExitedValidators + Math.min(balance - 16 ether * numExitedValidators, 16 ether * numExitedValidators); // The rewards in the safe are split equally among the associated validators // The rewards in the beacon are considered as the staking rewards of the current validator being considered uint256 stakingRewardsInEL = (balance - totalPrincipalForExitedValidators) / numValidators; uint256 stakingRewardsInBeacon = (_beaconBalance > 32 ether ? _beaconBalance - 32 ether : 0); stakingRewards = stakingRewardsInEL + stakingRewardsInBeacon; // The principal amount is computed if (_phase == VALIDATOR_PHASE.EXITED) { principal = totalPrincipalForExitedValidators / numExitedValidators; require(_beaconBalance == 0, "Exited validator must have zero balanace in the beacon"); } else if (_phase == VALIDATOR_PHASE.LIVE || _phase == VALIDATOR_PHASE.BEING_SLASHED) { principal = _beaconBalance - stakingRewardsInBeacon; } else { require(false, "INVALID_PHASE"); } require(principal <= 32 ether && principal >= 16 ether, "INCORRECT_AMOUNT"); } /// @notice Given /// - the current balance of the validator in Consensus Layer (or Beacon) /// - the current balance of the ether fi node contract, /// Compute the TVLs for {node operator, t-nft holder, b-nft holder, treasury} /// @param _beaconBalance the balance of the validator in Consensus Layer /// @param _SRsplits the splits for the Staking Rewards /// /// @return toNodeOperator the payout to the Node Operator /// @return toTnft the payout to the T-NFT holder /// @return toBnft the payout to the B-NFT holder /// @return toTreasury the payout to the Treasury function calculateTVL( uint256 _beaconBalance, IEtherFiNodesManager.ValidatorInfo memory _info, IEtherFiNodesManager.RewardsSplit memory _SRsplits, bool _onlyWithdrawable ) public view onlyEtherFiNodeManagerContract returns (uint256, uint256, uint256, uint256) { (uint256 stakingRewards, uint256 principal) = getTvlSplits(_info.phase, _beaconBalance, _onlyWithdrawable); if (stakingRewards + principal == 0) return (0, 0, 0, 0); // Compute the payouts for the staking rewards uint256[] memory payouts = new uint256[](4); // (toNodeOperator, toTnft, toBnft, toTreasury) (payouts[0], payouts[1], payouts[2], payouts[3]) = _calculateSplits(stakingRewards, _SRsplits); // Compute the payouts for the principals to {B, T}-NFTs (uint256 toBnftPrincipal, uint256 toTnftPrincipal) = _calculatePrincipals(principal); payouts[1] += toTnftPrincipal; payouts[2] += toBnftPrincipal; // Apply the non-exit penalty to the B-NFT (payouts[0], payouts[1], payouts[2], payouts[3]) = _applyNonExitPenalty(_info, payouts[0], payouts[1], payouts[2], payouts[3]); require(payouts[0] + payouts[1] + payouts[2] + payouts[3] == stakingRewards + principal, "INCORRECT_AMOUNT"); return (payouts[0], payouts[1], payouts[2], payouts[3]); } function callEigenPod(bytes memory data) external onlyEtherFiNodeManagerContract returns (bytes memory) { _verifyEigenPodCall(data); return Address.functionCall(eigenPod, data); } // As an optimization, it skips the call to 'etherFiNodesManager' back again to retrieve the target address function forwardCall(address to, bytes memory data) external onlyEtherFiNodeManagerContract returns (bytes memory) { return Address.functionCall(to, data); } //-------------------------------------------------------------------------------------- //------------------------------- INTERNAL FUNCTIONS --------------------------------- //-------------------------------------------------------------------------------------- function _verifyEigenPodCall(bytes memory data) internal view { bytes4 selector; assembly { selector := mload(add(data, 0x20)) } // withdrawNonBeaconChainETHBalanceWei if (selector == hex"e2c83445") { require(data.length >= 36, "INVALID_DATA_LENGTH"); address recipient; assembly { recipient := mload(add(data, 0x24)) } // No withdrawal to any other address than the safe require (recipient == address(this), "INCORRECT_RECIPIENT"); } // recoverTokens(IERC20[], uint256[], address) if (selector == hex"dda3346c") { revert("NOT_ALLOWED"); } } function _applyNonExitPenalty( IEtherFiNodesManager.ValidatorInfo memory _info, uint256 _toNodeOperator, uint256 _toTnft, uint256 _toBnft, uint256 _toTreasury ) internal view returns (uint256, uint256, uint256, uint256) { // NonExitPenalty grows till 1 ether uint256 bnftNonExitPenalty = getNonExitPenalty(_info.exitRequestTimestamp, _info.exitTimestamp); uint256 appliedPenalty = Math.min(_toBnft, bnftNonExitPenalty); uint256 incentiveToNoToExitValidator = Math.min(appliedPenalty, 0.2 ether); // Cap the incentive to the operator under 0.2 ether. // the rest (= penalty - incentive to NO) goes to the treasury _toNodeOperator += incentiveToNoToExitValidator; _toTreasury += appliedPenalty - incentiveToNoToExitValidator; _toBnft -= appliedPenalty; return (_toNodeOperator, _toTnft, _toBnft, _toTreasury); } /// @notice Calculates values for payouts based on certain parameters /// @param _totalAmount The total amount to split /// @param _splits The splits for the staking rewards /// /// @return toNodeOperator the payout to the Node Operator /// @return toTnft the payout to the T-NFT holder /// @return toBnft the payout to the B-NFT holder /// @return toTreasury the payout to the Treasury function _calculateSplits( uint256 _totalAmount, IEtherFiNodesManager.RewardsSplit memory _splits ) internal pure returns (uint256 toNodeOperator, uint256 toTnft, uint256 toBnft, uint256 toTreasury) { uint256 scale = _splits.treasury + _splits.nodeOperator + _splits.tnft + _splits.bnft; toNodeOperator = (_totalAmount * _splits.nodeOperator) / scale; toTnft = (_totalAmount * _splits.tnft) / scale; toBnft = (_totalAmount * _splits.bnft) / scale; toTreasury = _totalAmount - (toBnft + toTnft + toNodeOperator); return (toNodeOperator, toTnft, toBnft, toTreasury); } /// @notice Calculate the principal for the T-NFT and B-NFT holders based on the balance /// @param _balance The balance of the node /// @return toBnftPrincipal the principal for the B-NFT holder /// @return toTnftPrincipal the principal for the T-NFT holder function _calculatePrincipals( uint256 _balance ) internal pure returns (uint256 , uint256) { // Check if the ETH principal withdrawn (16 ETH ~ 32 ETH) from beacon is within this contract // If not: // - case 1: ETH is still in the EigenPod contract. Need to get that out // - case 2: ETH is withdrawn from the EigenPod contract, but ETH got slashed and the amount is under 16 ETH // Note that the case 2 won't happen until EigenLayer's AVS goes live on mainnet and the slashing mechanism is added // We will need upgrades again once EigenLayer's AVS goes live require(_balance >= 16 ether && _balance <= 32 ether, "INCORRECT_PRINCIPAL_AMOUNT"); uint256 toBnftPrincipal = (_balance >= 31 ether) ? _balance - 30 ether : 1 ether; uint256 toTnftPrincipal = _balance - toBnftPrincipal; return (toBnftPrincipal, toTnftPrincipal); } function _getDaysPassedSince( uint32 _startTimestamp, uint32 _endTimestamp ) public pure returns (uint256) { uint256 timeElapsed = _endTimestamp - Math.min(_startTimestamp, _endTimestamp); return uint256(timeElapsed / (24 * 3_600)); } /// @dev implementation address for beacon proxy. /// https://docs.openzeppelin.com/contracts/3.x/api/proxy#beacon function implementation() external view returns (address) { bytes32 slot = bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1); address implementationVariable; assembly { implementationVariable := sload(slot) } IBeacon beacon = IBeacon(implementationVariable); return beacon.implementation(); } //-------------------------------------------------------------------------------------- //----------------------------------- RESTAKING -------------------------------------- //-------------------------------------------------------------------------------------- /// @notice create a new eigenPod associated with this withdrawal safe /// @dev to take advantage of restaking via eigenlayer the validator associated with this /// withdrawal safe must set their withdrawalCredentials to point to this eigenPod /// and not to the withdrawal safe itself function createEigenPod() public { if (eigenPod != address(0x0)) return; // already have pod IEigenPodManager eigenPodManager = IEigenPodManager(IEtherFiNodesManager(etherFiNodesManager).eigenPodManager()); eigenPodManager.createPod(); eigenPod = address(eigenPodManager.getPod(address(this))); emit EigenPodCreated(address(this), eigenPod); } // Check that all withdrawals initiated before the observed exit of the node have been claimed. // This check ignores withdrawals queued after the observed exit of a node to prevent a denial of serviec // in which an attacker keeps sending small amounts of eth to the eigenPod and queuing more withdrawals // // We don't need to worry about unbounded array length because anyone can call claimQueuedWithdrawals() // with a variable number of withdrawals to process if the queue ever became to large. // This function can go away once we have a proof based withdrawal system. function hasOutstaingEigenPodWithdrawalsQueuedBeforeExit() public view returns (bool) { IDelayedWithdrawalRouter delayedWithdrawalRouter = IDelayedWithdrawalRouter(IEtherFiNodesManager(etherFiNodesManager).delayedWithdrawalRouter()); IDelayedWithdrawalRouter.DelayedWithdrawal[] memory unclaimedWithdrawals = delayedWithdrawalRouter.getUserDelayedWithdrawals(address(this)); for (uint256 i = 0; i < unclaimedWithdrawals.length; i++) { if (unclaimedWithdrawals[i].blockCreated <= restakingObservedExitBlock) { // unclaimed withdrawal from before oracle observed exit return true; } } return false; } /// @notice has enough time passed since the node exit was processed so that all associated funds can be claimed /// @dev this is a simple heuristic that should be correct 99% of the time. Nothing really bad can happen if it reports a false positive function canClaimRestakedFullWithdrawal() external view returns (bool) { // validator not exited yet if (restakingObservedExitBlock == 0) return false; // check if enough time has passed since the exit IDelayedWithdrawalRouter delayedWithdrawalRouter = IDelayedWithdrawalRouter(IEtherFiNodesManager(etherFiNodesManager).delayedWithdrawalRouter()); uint256 delayBlocks = delayedWithdrawalRouter.withdrawalDelayBlocks(); return (block.number - delayBlocks > restakingObservedExitBlock); } /// @notice Queue a withdrawal of the current balance of the eigenPod to this withdrawalSafe. /// @dev You must call claimQueuedWithdrawals at a later time once the time required by EigenLayer's /// DelayedWithdrawalRouter has elapsed. Once queued the funds live in the DelayedWithdrawalRouter function queueRestakedWithdrawal() public { if (!isRestakingEnabled) return; // EigenLayer has not enabled "true" restaking yet so we use this temporary mechanism // TODO: remove this once EigenLayer has a proper proof based withdrawal system IEigenPod(eigenPod).withdrawBeforeRestaking(); } /// @notice claim queued withdrawals from the EigenPod to this withdrawal safe. /// @param maxNumWithdrawals maximum number of queued withdrawals to claim in this tx. /// @dev usually you will want to call with "maxNumWithdrawals == unclaimedWithdrawals.length /// but if this queue grows too large to process in your target tx you can pass less function claimQueuedWithdrawals(uint256 maxNumWithdrawals, bool _checkIfHasOutstandingEigenLayerWithdrawals) public returns (bool) { if (!isRestakingEnabled) return false; // only claim if we have active unclaimed withdrawals IDelayedWithdrawalRouter delayedWithdrawalRouter = IDelayedWithdrawalRouter(IEtherFiNodesManager(etherFiNodesManager).delayedWithdrawalRouter()); if (delayedWithdrawalRouter.getUserDelayedWithdrawals(address(this)).length > 0) { delayedWithdrawalRouter.claimDelayedWithdrawals(address(this), maxNumWithdrawals); } if (_checkIfHasOutstandingEigenLayerWithdrawals) { return hasOutstaingEigenPodWithdrawalsQueuedBeforeExit(); } else { return false; } } function validatePhaseTransition(VALIDATOR_PHASE _currentPhase, VALIDATOR_PHASE _newPhase) public pure returns (bool) { bool pass; // Transition rules if (_currentPhase == VALIDATOR_PHASE.NOT_INITIALIZED) { pass = (_newPhase == VALIDATOR_PHASE.STAKE_DEPOSITED); } else if (_currentPhase == VALIDATOR_PHASE.STAKE_DEPOSITED) { pass = (_newPhase == VALIDATOR_PHASE.LIVE || _newPhase == VALIDATOR_PHASE.NOT_INITIALIZED || _newPhase == VALIDATOR_PHASE.WAITING_FOR_APPROVAL); } else if (_currentPhase == VALIDATOR_PHASE.WAITING_FOR_APPROVAL) { pass = (_newPhase == VALIDATOR_PHASE.LIVE || _newPhase == VALIDATOR_PHASE.NOT_INITIALIZED); } else if (_currentPhase == VALIDATOR_PHASE.LIVE) { pass = (_newPhase == VALIDATOR_PHASE.EXITED || _newPhase == VALIDATOR_PHASE.BEING_SLASHED); } else if (_currentPhase == VALIDATOR_PHASE.BEING_SLASHED) { pass = (_newPhase == VALIDATOR_PHASE.EXITED); } else if (_currentPhase == VALIDATOR_PHASE.EXITED) { pass = (_newPhase == VALIDATOR_PHASE.FULLY_WITHDRAWN); } else { pass = false; } require(pass, "INVALID_PHASE_TRANSITION"); return pass; } function _onlyEtherFiNodeManagerContract() internal view { require(msg.sender == etherFiNodesManager, "INCORRECT_CALLER"); } //-------------------------------------------------------------------------------------- //----------------------------------- MODIFIERS -------------------------------------- //-------------------------------------------------------------------------------------- modifier onlyEtherFiNodeManagerContract() { _onlyEtherFiNodeManagerContract(); _; } modifier ensureLatestVersion() { require(version == 1, "NEED_TO_MIGRATE"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "./IEtherFiNodesManager.sol"; interface IEtherFiNode { // State Transition Diagram for StateMachine contract: // // NOT_INITIALIZED <- // | | // ↓ | // STAKE_DEPOSITED -- // / \ | // ↓ ↓ | // LIVE <- WAITING_FOR_APPROVAL // | \ // | ↓ // | BEING_SLASHED // | / // ↓ ↓ // EXITED // | // ↓ // FULLY_WITHDRAWN // // Transitions are only allowed as directed above. // For instance, a transition from STAKE_DEPOSITED to either LIVE or CANCELLED is allowed, // but a transition from LIVE to NOT_INITIALIZED is not. // // All phase transitions should be made through the setPhase function, // which validates transitions based on these rules. // enum VALIDATOR_PHASE { NOT_INITIALIZED, STAKE_DEPOSITED, LIVE, EXITED, FULLY_WITHDRAWN, DEPRECATED_CANCELLED, BEING_SLASHED, DEPRECATED_EVICTED, WAITING_FOR_APPROVAL, DEPRECATED_READY_FOR_DEPOSIT } // VIEW functions function numAssociatedValidators() external view returns (uint256); function numExitRequestsByTnft() external view returns (uint16); function numExitedValidators() external view returns (uint16); function version() external view returns (uint16); function eigenPod() external view returns (address); function calculateTVL(uint256 _beaconBalance, IEtherFiNodesManager.ValidatorInfo memory _info, IEtherFiNodesManager.RewardsSplit memory _SRsplits, bool _onlyWithdrawable) external view returns (uint256, uint256, uint256, uint256); function getNonExitPenalty(uint32 _tNftExitRequestTimestamp, uint32 _bNftExitRequestTimestamp) external view returns (uint256); function getRewardsPayouts(uint32 _exitRequestTimestamp, IEtherFiNodesManager.RewardsSplit memory _splits) external view returns (uint256, uint256, uint256, uint256); function getFullWithdrawalPayouts(IEtherFiNodesManager.ValidatorInfo memory _info, IEtherFiNodesManager.RewardsSplit memory _SRsplits) external view returns (uint256, uint256, uint256, uint256); function associatedValidatorIds(uint256 _index) external view returns (uint256); function validatePhaseTransition(VALIDATOR_PHASE _currentPhase, VALIDATOR_PHASE _newPhase) external pure returns (bool); function DEPRECATED_exitRequestTimestamp() external view returns (uint32); function DEPRECATED_exitTimestamp() external view returns (uint32); function DEPRECATED_phase() external view returns (VALIDATOR_PHASE); // Non-VIEW functions function initialize(address _etherFiNodesManager) external; function claimQueuedWithdrawals(uint256 maxNumWithdrawals, bool _checkIfHasOutstandingEigenLayerWithdrawals) external returns (bool); function createEigenPod() external; function hasOutstaingEigenPodWithdrawalsQueuedBeforeExit() external view returns (bool); function isRestakingEnabled() external view returns (bool); function processNodeExit() external; function queueRestakedWithdrawal() external; function updateNumberOfAssociatedValidators(uint16 _up, uint16 _down) external; function updateNumExitedValidators(uint16 _up, uint16 _down) external; function registerValidator(uint256 _validatorId, bool _enableRestaking) external; function unRegisterValidator(uint256 _validatorId, IEtherFiNodesManager.ValidatorInfo memory _info) external returns (bool); function splitBalanceInExecutionLayer() external view returns (uint256 _withdrawalSafe, uint256 _eigenPod, uint256 _delayedWithdrawalRouter); function totalBalanceInExecutionLayer() external view returns (uint256); function withdrawableBalanceInExecutionLayer() external view returns (uint256); function updateNumExitRequests(uint16 _up, uint16 _down) external; function migrateVersion(uint256 _validatorId, IEtherFiNodesManager.ValidatorInfo memory _info) external; function callEigenPod(bytes memory data) external returns (bytes memory); function forwardCall(address to, bytes memory data) external returns (bytes memory); function withdrawFunds( address _treasury, uint256 _treasuryAmount, address _operator, uint256 _operatorAmount, address _tnftHolder, uint256 _tnftAmount, address _bnftHolder, uint256 _bnftAmount ) external; function moveFundsToManager(uint256 _amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "./IEtherFiNode.sol"; import "../eigenlayer-interfaces/IEigenPodManager.sol"; import "../eigenlayer-interfaces/IDelegationManager.sol"; import "../eigenlayer-interfaces/IDelayedWithdrawalRouter.sol"; interface IEtherFiNodesManager { struct ValidatorInfo { uint32 validatorIndex; uint32 exitRequestTimestamp; uint32 exitTimestamp; IEtherFiNode.VALIDATOR_PHASE phase; } struct RewardsSplit { uint64 treasury; uint64 nodeOperator; uint64 tnft; uint64 bnft; } // VIEW functions function delayedWithdrawalRouter() external view returns (IDelayedWithdrawalRouter); function eigenPodManager() external view returns (IEigenPodManager); function delegationManager() external view returns (IDelegationManager); function treasuryContract() external view returns (address); function etherfiNodeAddress(uint256 _validatorId) external view returns (address); function calculateTVL(uint256 _validatorId, uint256 _beaconBalance) external view returns (uint256, uint256, uint256, uint256); function getFullWithdrawalPayouts(uint256 _validatorId) external view returns (uint256, uint256, uint256, uint256); function getNonExitPenalty(uint256 _validatorId) external view returns (uint256); function getRewardsPayouts(uint256 _validatorId) external view returns (uint256, uint256, uint256, uint256); function getWithdrawalCredentials(uint256 _validatorId) external view returns (bytes memory); function getValidatorInfo(uint256 _validatorId) external view returns (ValidatorInfo memory); function numAssociatedValidators(uint256 _validatorId) external view returns (uint256); function phase(uint256 _validatorId) external view returns (IEtherFiNode.VALIDATOR_PHASE phase); function generateWithdrawalCredentials(address _address) external view returns (bytes memory); function nonExitPenaltyDailyRate() external view returns (uint64); function nonExitPenaltyPrincipal() external view returns (uint64); function numberOfValidators() external view returns (uint64); function maxEigenlayerWithdrawals() external view returns (uint8); function admins(address _address) external view returns (bool); // Non-VIEW functions function updateEtherFiNode(uint256 _validatorId) external; function batchQueueRestakedWithdrawal(uint256[] calldata _validatorIds) external; function batchSendExitRequest(uint256[] calldata _validatorIds) external; function batchRevertExitRequest(uint256[] calldata _validatorIds) external; function batchFullWithdraw(uint256[] calldata _validatorIds) external; function batchPartialWithdraw(uint256[] calldata _validatorIds) external; function fullWithdraw(uint256 _validatorId) external; function getUnusedWithdrawalSafesLength() external view returns (uint256); function incrementNumberOfValidators(uint64 _count) external; function markBeingSlashed(uint256[] calldata _validatorIds) external; function partialWithdraw(uint256 _validatorId) external; function processNodeExit(uint256[] calldata _validatorIds, uint32[] calldata _exitTimestamp) external; function allocateEtherFiNode(bool _enableRestaking) external returns (address); function registerValidator(uint256 _validatorId, bool _enableRestaking, address _withdrawalSafeAddress) external; function setValidatorPhase(uint256 _validatorId, IEtherFiNode.VALIDATOR_PHASE _phase) external; function setNonExitPenalty(uint64 _nonExitPenaltyDailyRate, uint64 _nonExitPenaltyPrincipal) external; function setStakingRewardsSplit(uint64 _treasury, uint64 _nodeOperator, uint64 _tnft, uint64 _bnf) external; function unregisterValidator(uint256 _validatorId) external; function updateAdmin(address _address, bool _isAdmin) external; function pauseContract() external; function unPauseContract() external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// 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.8.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 * ==== * * [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://diligence.consensys.net/posts/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.5.11/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.5.0; import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; import "./IETHPOSDeposit.sol"; import "./IStrategyManager.sol"; import "./IEigenPod.sol"; import "./IBeaconChainOracle.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 update of the beaconChainOracle address event BeaconOracleUpdated(address indexed newOracleAddress); /// @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 ); event DenebForkTimestampUpdated(uint64 newValue); /** * @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 Updates the oracle contract that provides the beacon chain state root * @param newBeaconChainOracle is the new oracle contract being pointed to * @dev Callable only by the owner of this contract (i.e. governance) */ function updateBeaconChainOracle(IBeaconChainOracle newBeaconChainOracle) 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 Oracle contract that provides updates to the beacon chain's state function beaconChainOracle() external view returns (IBeaconChainOracle); /// @notice Returns the beacon block root at `timestamp`. Reverts if the Beacon block root at `timestamp` has not yet been finalized. function getBlockRootAtTimestamp(uint64 timestamp) external view returns (bytes32); /// @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; /** * @notice the deneb hard fork timestamp used to determine which proof path to use for proving a withdrawal */ function denebForkTimestamp() external view returns (uint64); /** * setting the deneb hard fork timestamp by the eigenPodManager owner * @dev this function is designed to be called twice. Once, it is set to type(uint64).max * prior to the actual deneb fork timestamp being set, and then the second time it is set * to the actual deneb fork timestamp. */ function setDenebForkTimestamp(uint64 newDenebForkTimestamp) external; function owner() external returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; interface IDelayedWithdrawalRouter { // struct used to pack data into a single storage slot struct DelayedWithdrawal { uint224 amount; uint32 blockCreated; } // struct used to store a single users delayedWithdrawal data struct UserDelayedWithdrawals { uint256 delayedWithdrawalsCompleted; DelayedWithdrawal[] delayedWithdrawals; } /// @notice event for delayedWithdrawal creation event DelayedWithdrawalCreated(address podOwner, address recipient, uint256 amount, uint256 index); /// @notice event for the claiming of delayedWithdrawals event DelayedWithdrawalsClaimed(address recipient, uint256 amountClaimed, uint256 delayedWithdrawalsCompleted); /// @notice Emitted when the `withdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`. event WithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue); /** * @notice Creates an delayed withdrawal for `msg.value` to the `recipient`. * @dev Only callable by the `podOwner`'s EigenPod contract. */ function createDelayedWithdrawal(address podOwner, address recipient) external payable; /** * @notice Called in order to withdraw delayed withdrawals made to the `recipient` that have passed the `withdrawalDelayBlocks` period. * @param recipient The address to claim delayedWithdrawals for. * @param maxNumberOfWithdrawalsToClaim Used to limit the maximum number of withdrawals to loop through claiming. */ function claimDelayedWithdrawals(address recipient, uint256 maxNumberOfWithdrawalsToClaim) external; /** * @notice Called in order to withdraw delayed withdrawals made to the caller that have passed the `withdrawalDelayBlocks` period. * @param maxNumberOfWithdrawalsToClaim Used to limit the maximum number of withdrawals to loop through claiming. */ function claimDelayedWithdrawals(uint256 maxNumberOfWithdrawalsToClaim) external; /// @notice Owner-only function for modifying the value of the `withdrawalDelayBlocks` variable. function setWithdrawalDelayBlocks(uint256 newValue) external; /// @notice Getter function for the mapping `_userWithdrawals` function userWithdrawals(address user) external view returns (UserDelayedWithdrawals memory); /// @notice Getter function to get all delayedWithdrawals of the `user` function getUserDelayedWithdrawals(address user) external view returns (DelayedWithdrawal[] memory); /// @notice Getter function to get all delayedWithdrawals that are currently claimable by the `user` function getClaimableUserDelayedWithdrawals(address user) external view returns (DelayedWithdrawal[] memory); /// @notice Getter function for fetching the delayedWithdrawal at the `index`th entry from the `_userWithdrawals[user].delayedWithdrawals` array function userDelayedWithdrawalByIndex(address user, uint256 index) external view returns (DelayedWithdrawal memory); /// @notice Getter function for fetching the length of the delayedWithdrawals array of a specific user function userWithdrawalsLength(address user) external view returns (uint256); /// @notice Convenience function for checking whether or not the delayedWithdrawal at the `index`th entry from the `_userWithdrawals[user].delayedWithdrawals` array is currently claimable function canClaimDelayedWithdrawal(address user, uint256 index) external view returns (bool); /** * @notice Delay enforced by this contract for completing any delayedWithdrawal. 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 withdrawalDelayBlocks() external view returns (uint256); }
// 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)); } }
// 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 { // @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; function pendingWithdrawals(bytes32 withdrawalRoot) external view returns (bool); function beaconChainETHStrategy() external view returns (IStrategy); }
// ┏━━━┓━┏┓━┏┓━━┏━━━┓━━┏━━━┓━━━━┏━━━┓━━━━━━━━━━━━━━━━━━━┏┓━━━━━┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━━┏┓━ // ┃┏━━┛┏┛┗┓┃┃━━┃┏━┓┃━━┃┏━┓┃━━━━┗┓┏┓┃━━━━━━━━━━━━━━━━━━┏┛┗┓━━━━┃┏━┓┃━━━━━━━━┏┛┗┓━━━━━━━━━━━━┏┛┗┓ // ┃┗━━┓┗┓┏┛┃┗━┓┗┛┏┛┃━━┃┃━┃┃━━━━━┃┃┃┃┏━━┓┏━━┓┏━━┓┏━━┓┏┓┗┓┏┛━━━━┃┃━┗┛┏━━┓┏━┓━┗┓┏┛┏━┓┏━━┓━┏━━┓┗┓┏┛ // ┃┏━━┛━┃┃━┃┏┓┃┏━┛┏┛━━┃┃━┃┃━━━━━┃┃┃┃┃┏┓┃┃┏┓┃┃┏┓┃┃━━┫┣┫━┃┃━━━━━┃┃━┏┓┃┏┓┃┃┏┓┓━┃┃━┃┏┛┗━┓┃━┃┏━┛━┃┃━ // ┃┗━━┓━┃┗┓┃┃┃┃┃┃┗━┓┏┓┃┗━┛┃━━━━┏┛┗┛┃┃┃━┫┃┗┛┃┃┗┛┃┣━━┃┃┃━┃┗┓━━━━┃┗━┛┃┃┗┛┃┃┃┃┃━┃┗┓┃┃━┃┗┛┗┓┃┗━┓━┃┗┓ // ┗━━━┛━┗━┛┗┛┗┛┗━━━┛┗┛┗━━━┛━━━━┗━━━┛┗━━┛┃┏━┛┗━━┛┗━━┛┗┛━┗━┛━━━━┗━━━┛┗━━┛┗┛┗┛━┗━┛┗┛━┗━━━┛┗━━┛━┗━┛ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // 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 "./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 { /** * @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); function withdrawalRootPending(bytes32 _withdrawalRoot) external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "src/eigenlayer-libraries/BeaconChainProofs.sol"; import "./IEigenPodManager.sol"; import "./IBeaconChainOracle.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 * @notice The main functionalities are: * - creating new ETH validators with their withdrawal credentials pointed to this contract * - proving from beacon chain state roots that withdrawal credentials are pointed to this contract * - proving from beacon chain state roots the balances of ETH validators with their withdrawal credentials * pointed to this contract * - updating aggregate balances in the EigenPodManager * - withdrawing eth when withdrawals are initiated * @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 { 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 mostRecentBalanceUpdateTimestamp; // status of the validator VALIDATOR_STATUS status; } /** * @notice struct used to store amounts related to proven withdrawals in memory. Used to help * manage stack depth and optimize the number of external calls, when batching withdrawal operations. */ struct VerifiedWithdrawal { // amount to send to a podOwner from a proven withdrawal uint256 amountToSendGwei; // difference in shares to be recorded in the eigenPodManager, as a result of the withdrawal int256 sharesDeltaGwei; } enum PARTIAL_WITHDRAWAL_CLAIM_STATUS { REDEEMED, PENDING, FAILED } /// @notice Emitted when an ETH validator stakes via this eigenPod event EigenPodStaked(bytes pubkey); /// @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 an ETH validator is prove to have withdrawn from the beacon chain event FullWithdrawalRedeemed( uint40 validatorIndex, uint64 withdrawalTimestamp, address indexed recipient, uint64 withdrawalAmountGwei ); /// @notice Emitted when a partial withdrawal claim is successfully redeemed event PartialWithdrawalRedeemed( uint40 validatorIndex, uint64 withdrawalTimestamp, address indexed recipient, uint64 partialWithdrawalAmountGwei ); /// @notice Emitted when restaked beacon chain ETH is withdrawn from the eigenPod. event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount); /// @notice Emitted when podOwner enables restaking event RestakingActivated(address indexed podOwner); /// @notice Emitted when ETH is received via the `receive` fallback event NonBeaconChainETHReceived(uint256 amountReceived); /// @notice Emitted when ETH that was previously received via the `receive` fallback is withdrawn event NonBeaconChainETHWithdrawn(address indexed recipient, uint256 amountWithdrawn); /// @notice The max amount of eth, in gwei, that can be restaked per validator function MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR() external view returns (uint64); /// @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 any ETH deposited into the EigenPod contract via the `receive` fallback function function nonBeaconChainETHBalanceWei() external view returns (uint256); /// @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; /// @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 an indicator of whether or not the podOwner has ever "fully restaked" by successfully calling `verifyCorrectWithdrawalCredentials`. function hasRestaked() external view returns (bool); /** * @notice The latest timestamp at which the pod owner withdrew the balance of the pod, via calling `withdrawBeforeRestaking`. * @dev This variable is only updated when the `withdrawBeforeRestaking` function is called, which can only occur before `hasRestaked` is set to true for this pod. * Proofs for this pod are only valid against Beacon Chain state roots corresponding to timestamps after the stored `mostRecentWithdrawalTimestamp`. */ function mostRecentWithdrawalTimestamp() external view returns (uint64); /// @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 mapping that tracks proven withdrawals function provenWithdrawal(bytes32 validatorPubkeyHash, uint64 slot) external view returns (bool); /// @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 This function verifies that the withdrawal credentials of validator(s) owned by the podOwner are pointed to * this contract. It also verifies the effective balance of the validator. It verifies the provided proof of the ETH validator against the beacon chain state * root, marks the validator as 'active' in EigenLayer, and credits the restaked ETH in Eigenlayer. * @param oracleTimestamp is the Beacon Chain timestamp whose state root the `proof` will be proven against. * @param validatorIndices is the list of indices of the validators being proven, refer to consensus specs * @param withdrawalCredentialProofs is an array of proofs, where each proof proves each ETH validator's balance and withdrawal credentials * against a beacon chain state root * @param validatorFields are the fields of the "Validator Container", refer to consensus specs * for details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator */ function verifyWithdrawalCredentials( uint64 oracleTimestamp, BeaconChainProofs.StateRootProof calldata stateRootProof, uint40[] calldata validatorIndices, bytes[] calldata withdrawalCredentialProofs, bytes32[][] calldata validatorFields ) external; /** * @notice This function records an update (either increase or decrease) in the pod's balance in the StrategyManager. It also verifies a merkle proof of the validator's current beacon chain balance. * @param oracleTimestamp The oracleTimestamp whose state root the `proof` will be proven against. * Must be within `VERIFY_BALANCE_UPDATE_WINDOW_SECONDS` of the current block. * @param validatorIndices is the list of indices of the validators being proven, refer to consensus specs * @param validatorFieldsProofs proofs against the `beaconStateRoot` for each validator in `validatorFields` * @param validatorFields are the fields of the "Validator Container", refer to consensus specs * @dev For more details on the Beacon Chain spec, see: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator */ function verifyBalanceUpdates( uint64 oracleTimestamp, uint40[] calldata validatorIndices, BeaconChainProofs.StateRootProof calldata stateRootProof, bytes[] calldata validatorFieldsProofs, bytes32[][] calldata validatorFields ) external; /** * @notice This function records full and partial withdrawals on behalf of one of the Ethereum validators for this EigenPod * @param oracleTimestamp is the timestamp of the oracle slot that the withdrawal is being proven against * @param withdrawalProofs is the information needed to check the veracity of the block numbers and withdrawals being proven * @param validatorFieldsProofs is the proof of the validator's fields' in the validator tree * @param withdrawalFields are the fields of the withdrawals being proven * @param validatorFields are the fields of the validators being proven */ function verifyAndProcessWithdrawals( uint64 oracleTimestamp, BeaconChainProofs.StateRootProof calldata stateRootProof, BeaconChainProofs.WithdrawalProof[] calldata withdrawalProofs, bytes[] calldata validatorFieldsProofs, bytes32[][] calldata validatorFields, bytes32[][] calldata withdrawalFields ) external; /** * @notice Called by the pod owner to activate restaking by withdrawing * all existing ETH from the pod and preventing further withdrawals via * "withdrawBeforeRestaking()" */ function activateRestaking() external; /// @notice Called by the pod owner to withdraw the balance of the pod when `hasRestaked` is set to false function withdrawBeforeRestaking() external; /// @notice Called by the pod owner to withdraw the nonBeaconChainETHBalanceWei function withdrawNonBeaconChainETHBalanceWei(address recipient, uint256 amountToWithdraw) 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; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; /** * @title Interface for the BeaconStateOracle contract. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service */ interface IBeaconChainOracle { /// @notice The block number to state root mapping. function timestampToBlockRoot(uint256 timestamp) external view returns (bytes32); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "src/eigenlayer-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; 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; /** * @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.8.0; import "./Merkle.sol"; import "./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 { // constants are the number of fields and the heights of the different merkle trees used in merkleizing beacon chain containers uint256 internal constant NUM_BEACON_BLOCK_HEADER_FIELDS = 5; uint256 internal constant BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT = 3; uint256 internal constant NUM_BEACON_BLOCK_BODY_FIELDS = 11; uint256 internal constant BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT = 4; uint256 internal constant NUM_BEACON_STATE_FIELDS = 21; uint256 internal constant BEACON_STATE_FIELD_TREE_HEIGHT = 5; uint256 internal constant NUM_ETH1_DATA_FIELDS = 3; uint256 internal constant ETH1_DATA_FIELD_TREE_HEIGHT = 2; uint256 internal constant NUM_VALIDATOR_FIELDS = 8; uint256 internal constant VALIDATOR_FIELD_TREE_HEIGHT = 3; uint256 internal constant NUM_EXECUTION_PAYLOAD_HEADER_FIELDS = 15; uint256 internal constant EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT = 4; uint256 internal constant NUM_EXECUTION_PAYLOAD_FIELDS = 15; uint256 internal constant EXECUTION_PAYLOAD_FIELD_TREE_HEIGHT = 4; // HISTORICAL_ROOTS_LIMIT = 2**24, so tree height is 24 uint256 internal constant HISTORICAL_ROOTS_TREE_HEIGHT = 24; // HISTORICAL_BATCH is root of state_roots and block_root, so number of leaves = 2^1 uint256 internal constant HISTORICAL_BATCH_TREE_HEIGHT = 1; // SLOTS_PER_HISTORICAL_ROOT = 2**13, so tree height is 13 uint256 internal constant STATE_ROOTS_TREE_HEIGHT = 13; uint256 internal constant BLOCK_ROOTS_TREE_HEIGHT = 13; //HISTORICAL_ROOTS_LIMIT = 2**24, so tree height is 24 uint256 internal constant HISTORICAL_SUMMARIES_TREE_HEIGHT = 24; //Index of block_summary_root in historical_summary container uint256 internal constant BLOCK_SUMMARY_ROOT_INDEX = 0; uint256 internal constant NUM_WITHDRAWAL_FIELDS = 4; // tree height for hash tree of an individual withdrawal container uint256 internal constant WITHDRAWAL_FIELD_TREE_HEIGHT = 2; uint256 internal constant VALIDATOR_TREE_HEIGHT = 40; // MAX_WITHDRAWALS_PER_PAYLOAD = 2**4, making tree height = 4 uint256 internal constant WITHDRAWALS_TREE_HEIGHT = 4; //in beacon block body https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#beaconblockbody uint256 internal constant EXECUTION_PAYLOAD_INDEX = 9; // in beacon block header https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader uint256 internal constant SLOT_INDEX = 0; uint256 internal constant PROPOSER_INDEX_INDEX = 1; uint256 internal constant STATE_ROOT_INDEX = 3; uint256 internal constant BODY_ROOT_INDEX = 4; // in beacon state https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#beaconstate uint256 internal constant HISTORICAL_BATCH_STATE_ROOT_INDEX = 1; uint256 internal constant BEACON_STATE_SLOT_INDEX = 2; uint256 internal constant LATEST_BLOCK_HEADER_ROOT_INDEX = 4; uint256 internal constant BLOCK_ROOTS_INDEX = 5; uint256 internal constant STATE_ROOTS_INDEX = 6; uint256 internal constant HISTORICAL_ROOTS_INDEX = 7; uint256 internal constant ETH_1_ROOT_INDEX = 8; uint256 internal constant VALIDATOR_TREE_ROOT_INDEX = 11; uint256 internal constant EXECUTION_PAYLOAD_HEADER_INDEX = 24; uint256 internal constant HISTORICAL_SUMMARIES_INDEX = 27; // in validator https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator 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_WITHDRAWABLE_EPOCH_INDEX = 7; // in execution payload header uint256 internal constant TIMESTAMP_INDEX = 9; uint256 internal constant WITHDRAWALS_ROOT_INDEX = 14; //in execution payload uint256 internal constant WITHDRAWALS_INDEX = 14; // in withdrawal uint256 internal constant WITHDRAWAL_VALIDATOR_INDEX_INDEX = 1; uint256 internal constant WITHDRAWAL_VALIDATOR_AMOUNT_INDEX = 3; //In historicalBatch uint256 internal constant HISTORICALBATCH_STATEROOTS_INDEX = 1; //Misc Constants /// @notice The number of slots each epoch in the beacon chain uint64 internal constant SLOTS_PER_EPOCH = 32; /// @notice The number of seconds in a slot in the beacon chain uint64 internal constant SECONDS_PER_SLOT = 12; /// @notice Number of seconds per epoch: 384 == 32 slots/epoch * 12 seconds/slot uint64 internal constant SECONDS_PER_EPOCH = SLOTS_PER_EPOCH * SECONDS_PER_SLOT; bytes8 internal constant UINT64_MASK = 0xffffffffffffffff; /// @notice This struct contains the merkle proofs and leaves needed to verify a partial/full withdrawal struct WithdrawalProof { bytes withdrawalProof; bytes slotProof; bytes executionPayloadProof; bytes timestampProof; bytes historicalSummaryBlockRootProof; uint64 blockRootIndex; uint64 historicalSummaryIndex; uint64 withdrawalIndex; bytes32 blockRoot; bytes32 slotRoot; bytes32 timestampRoot; bytes32 executionPayloadRoot; } /// @notice This struct contains the root and proof for verifying the state root against the oracle block root struct StateRootProof { bytes32 beaconStateRoot; bytes proof; } /** * @notice This function verifies merkle proofs of the fields of a certain validator against a beacon chain state root * @param validatorIndex the index of the proven validator * @param beaconStateRoot is the beacon chain state root to be proven against. * @param validatorFieldsProof is the data used in proving the validator's fields * @param validatorFields the claimed fields of the validator */ function verifyValidatorFields( bytes32 beaconStateRoot, bytes32[] calldata validatorFields, bytes calldata validatorFieldsProof, uint40 validatorIndex ) internal view { require( validatorFields.length == 2 ** VALIDATOR_FIELD_TREE_HEIGHT, "BeaconChainProofs.verifyValidatorFields: Validator fields has incorrect length" ); /** * Note: the length of the validator merkle proof is BeaconChainProofs.VALIDATOR_TREE_HEIGHT + 1. * There is an additional layer added by hashing the root with the length of the validator list */ require( validatorFieldsProof.length == 32 * ((VALIDATOR_TREE_HEIGHT + 1) + BEACON_STATE_FIELD_TREE_HEIGHT), "BeaconChainProofs.verifyValidatorFields: Proof has incorrect length" ); uint256 index = (VALIDATOR_TREE_ROOT_INDEX << (VALIDATOR_TREE_HEIGHT + 1)) | uint256(validatorIndex); // merkleize the validatorFields to get the leaf to prove bytes32 validatorRoot = EigenlayerMerkle.merkleizeSha256(validatorFields); // verify the proof of the validatorRoot against the beaconStateRoot require( EigenlayerMerkle.verifyInclusionSha256({ proof: validatorFieldsProof, root: beaconStateRoot, leaf: validatorRoot, index: index }), "BeaconChainProofs.verifyValidatorFields: Invalid merkle proof" ); } /** * @notice This function verifies the latestBlockHeader against the state root. the latestBlockHeader is * a tracked in the beacon state. * @param beaconStateRoot is the beacon chain state root to be proven against. * @param stateRootProof is the provided merkle proof * @param latestBlockRoot is hashtree root of the latest block header in the beacon state */ function verifyStateRootAgainstLatestBlockRoot( bytes32 latestBlockRoot, bytes32 beaconStateRoot, bytes calldata stateRootProof ) internal view { require( stateRootProof.length == 32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT), "BeaconChainProofs.verifyStateRootAgainstLatestBlockRoot: Proof has incorrect length" ); //Next we verify the slot against the blockRoot require( EigenlayerMerkle.verifyInclusionSha256({ proof: stateRootProof, root: latestBlockRoot, leaf: beaconStateRoot, index: STATE_ROOT_INDEX }), "BeaconChainProofs.verifyStateRootAgainstLatestBlockRoot: Invalid latest block header root merkle proof" ); } /** * @notice This function verifies the slot and the withdrawal fields for a given withdrawal * @param withdrawalProof is the provided set of merkle proofs * @param withdrawalFields is the serialized withdrawal container to be proven */ function verifyWithdrawal( bytes32 beaconStateRoot, bytes32[] calldata withdrawalFields, WithdrawalProof calldata withdrawalProof ) internal view { require( withdrawalFields.length == 2 ** WITHDRAWAL_FIELD_TREE_HEIGHT, "BeaconChainProofs.verifyWithdrawal: withdrawalFields has incorrect length" ); require( withdrawalProof.blockRootIndex < 2 ** BLOCK_ROOTS_TREE_HEIGHT, "BeaconChainProofs.verifyWithdrawal: blockRootIndex is too large" ); require( withdrawalProof.withdrawalIndex < 2 ** WITHDRAWALS_TREE_HEIGHT, "BeaconChainProofs.verifyWithdrawal: withdrawalIndex is too large" ); require( withdrawalProof.historicalSummaryIndex < 2 ** HISTORICAL_SUMMARIES_TREE_HEIGHT, "BeaconChainProofs.verifyWithdrawal: historicalSummaryIndex is too large" ); require( withdrawalProof.withdrawalProof.length == 32 * (EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT + WITHDRAWALS_TREE_HEIGHT + 1), "BeaconChainProofs.verifyWithdrawal: withdrawalProof has incorrect length" ); require( withdrawalProof.executionPayloadProof.length == 32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT + BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT), "BeaconChainProofs.verifyWithdrawal: executionPayloadProof has incorrect length" ); require( withdrawalProof.slotProof.length == 32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT), "BeaconChainProofs.verifyWithdrawal: slotProof has incorrect length" ); require( withdrawalProof.timestampProof.length == 32 * (EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT), "BeaconChainProofs.verifyWithdrawal: timestampProof has incorrect length" ); require( withdrawalProof.historicalSummaryBlockRootProof.length == 32 * (BEACON_STATE_FIELD_TREE_HEIGHT + (HISTORICAL_SUMMARIES_TREE_HEIGHT + 1) + 1 + (BLOCK_ROOTS_TREE_HEIGHT)), "BeaconChainProofs.verifyWithdrawal: historicalSummaryBlockRootProof has incorrect length" ); /** * Note: Here, the "1" in "1 + (BLOCK_ROOTS_TREE_HEIGHT)" signifies that extra step of choosing the "block_root_summary" within the individual * "historical_summary". Everywhere else it signifies merkelize_with_mixin, where the length of an array is hashed with the root of the array, * but not here. */ uint256 historicalBlockHeaderIndex = (HISTORICAL_SUMMARIES_INDEX << ((HISTORICAL_SUMMARIES_TREE_HEIGHT + 1) + 1 + (BLOCK_ROOTS_TREE_HEIGHT))) | (uint256(withdrawalProof.historicalSummaryIndex) << (1 + (BLOCK_ROOTS_TREE_HEIGHT))) | (BLOCK_SUMMARY_ROOT_INDEX << (BLOCK_ROOTS_TREE_HEIGHT)) | uint256(withdrawalProof.blockRootIndex); require( EigenlayerMerkle.verifyInclusionSha256({ proof: withdrawalProof.historicalSummaryBlockRootProof, root: beaconStateRoot, leaf: withdrawalProof.blockRoot, index: historicalBlockHeaderIndex }), "BeaconChainProofs.verifyWithdrawal: Invalid historicalsummary merkle proof" ); //Next we verify the slot against the blockRoot require( EigenlayerMerkle.verifyInclusionSha256({ proof: withdrawalProof.slotProof, root: withdrawalProof.blockRoot, leaf: withdrawalProof.slotRoot, index: SLOT_INDEX }), "BeaconChainProofs.verifyWithdrawal: Invalid slot merkle proof" ); { // Next we verify the executionPayloadRoot against the blockRoot uint256 executionPayloadIndex = (BODY_ROOT_INDEX << (BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT)) | EXECUTION_PAYLOAD_INDEX; require( EigenlayerMerkle.verifyInclusionSha256({ proof: withdrawalProof.executionPayloadProof, root: withdrawalProof.blockRoot, leaf: withdrawalProof.executionPayloadRoot, index: executionPayloadIndex }), "BeaconChainProofs.verifyWithdrawal: Invalid executionPayload merkle proof" ); } // Next we verify the timestampRoot against the executionPayload root require( EigenlayerMerkle.verifyInclusionSha256({ proof: withdrawalProof.timestampProof, root: withdrawalProof.executionPayloadRoot, leaf: withdrawalProof.timestampRoot, index: TIMESTAMP_INDEX }), "BeaconChainProofs.verifyWithdrawal: Invalid blockNumber merkle proof" ); { /** * Next we verify the withdrawal fields against the blockRoot: * First we compute the withdrawal_index relative to the blockRoot by concatenating the indexes of all the * intermediate root indexes from the bottom of the sub trees (the withdrawal container) to the top, the blockRoot. * Then we calculate merkleize the withdrawalFields container to calculate the the withdrawalRoot. * Finally we verify the withdrawalRoot against the executionPayloadRoot. * * * Note: EigenlayerMerkleization of the withdrawals root tree uses EigenlayerMerkleizeWithMixin, i.e., the length of the array is hashed with the root of * the array. Thus we shift the WITHDRAWALS_INDEX over by WITHDRAWALS_TREE_HEIGHT + 1 and not just WITHDRAWALS_TREE_HEIGHT. */ uint256 withdrawalIndex = (WITHDRAWALS_INDEX << (WITHDRAWALS_TREE_HEIGHT + 1)) | uint256(withdrawalProof.withdrawalIndex); bytes32 withdrawalRoot = EigenlayerMerkle.merkleizeSha256(withdrawalFields); require( EigenlayerMerkle.verifyInclusionSha256({ proof: withdrawalProof.withdrawalProof, root: withdrawalProof.executionPayloadRoot, leaf: withdrawalRoot, index: withdrawalIndex }), "BeaconChainProofs.verifyWithdrawal: Invalid withdrawal merkle proof" ); } } /** * @notice This function replicates the ssz hashing of a validator's pubkey, outlined below: * hh := ssz.NewHasher() * hh.PutBytes(validatorPubkey[:]) * validatorPubkeyHash := hh.Hash() * hh.Reset() */ function hashValidatorBLSPubkey(bytes memory validatorPubkey) internal pure returns (bytes32 pubkeyHash) { require(validatorPubkey.length == 48, "Input should be 48 bytes in length"); return sha256(abi.encodePacked(validatorPubkey, bytes16(0))); } /** * @dev Retrieve the withdrawal timestamp */ function getWithdrawalTimestamp(WithdrawalProof memory withdrawalProof) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(withdrawalProof.timestampRoot); } /** * @dev Converts the withdrawal's slot to an epoch */ function getWithdrawalEpoch(WithdrawalProof memory withdrawalProof) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(withdrawalProof.slotRoot) / SLOTS_PER_EPOCH; } /** * Indices for validator fields (refer to consensus specs): * 0: pubkey * 1: withdrawal credentials * 2: effective balance * 3: slashed? * 4: activation elligibility epoch * 5: activation epoch * 6: exit epoch * 7: withdrawable epoch */ /** * @dev Retrieves a validator's pubkey hash */ function getPubkeyHash(bytes32[] memory validatorFields) internal pure returns (bytes32) { return validatorFields[VALIDATOR_PUBKEY_INDEX]; } 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 a validator's withdrawable epoch */ function getWithdrawableEpoch(bytes32[] memory validatorFields) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_WITHDRAWABLE_EPOCH_INDEX]); } /** * Indices for withdrawal fields (refer to consensus specs): * 0: withdrawal index * 1: validator index * 2: execution address * 3: withdrawal amount */ /** * @dev Retrieves a withdrawal's validator index */ function getValidatorIndex(bytes32[] memory withdrawalFields) internal pure returns (uint40) { return uint40(Endian.fromLittleEndianUint64(withdrawalFields[WITHDRAWAL_VALIDATOR_INDEX_INDEX])); } /** * @dev Retrieves a withdrawal's withdrawal amount (in gwei) */ function getWithdrawalAmountGwei(bytes32[] memory withdrawalFields) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(withdrawalFields[WITHDRAWAL_VALIDATOR_AMOUNT_INDEX]); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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: 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 // 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 EigenlayerMerkle { /** * @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.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); } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "murky/=lib/murky/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "@uniswap/=lib/", "@eigenlayer/=lib/eigenlayer-contracts/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "v3-core/=lib/v3-core/", "v3-periphery/=lib/v3-periphery/contracts/" ], "optimizer": { "enabled": true, "runs": 2000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"CallFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nodeAddress","type":"address"},{"indexed":true,"internalType":"address","name":"podAddress","type":"address"}],"name":"EigenPodCreated","type":"event"},{"inputs":[],"name":"DEPRECATED_exitRequestTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPRECATED_exitTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPRECATED_ipfsHashForEncryptedValidatorKey","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPRECATED_localRevenueIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPRECATED_phase","outputs":[{"internalType":"enum IEtherFiNode.VALIDATOR_PHASE","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPRECATED_stakingStartTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPRECATED_vestedAuctionRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"_getDaysPassedSince","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"associatedValidatorIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"associatedValidatorIndices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_beaconBalance","type":"uint256"},{"components":[{"internalType":"uint32","name":"validatorIndex","type":"uint32"},{"internalType":"uint32","name":"exitRequestTimestamp","type":"uint32"},{"internalType":"uint32","name":"exitTimestamp","type":"uint32"},{"internalType":"enum IEtherFiNode.VALIDATOR_PHASE","name":"phase","type":"uint8"}],"internalType":"struct IEtherFiNodesManager.ValidatorInfo","name":"_info","type":"tuple"},{"components":[{"internalType":"uint64","name":"treasury","type":"uint64"},{"internalType":"uint64","name":"nodeOperator","type":"uint64"},{"internalType":"uint64","name":"tnft","type":"uint64"},{"internalType":"uint64","name":"bnft","type":"uint64"}],"internalType":"struct IEtherFiNodesManager.RewardsSplit","name":"_SRsplits","type":"tuple"},{"internalType":"bool","name":"_onlyWithdrawable","type":"bool"}],"name":"calculateTVL","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"callEigenPod","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"canClaimRestakedFullWithdrawal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxNumWithdrawals","type":"uint256"},{"internalType":"bool","name":"_checkIfHasOutstandingEigenLayerWithdrawals","type":"bool"}],"name":"claimQueuedWithdrawals","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createEigenPod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eigenPod","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"etherFiNodesManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"forwardCall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"validatorIndex","type":"uint32"},{"internalType":"uint32","name":"exitRequestTimestamp","type":"uint32"},{"internalType":"uint32","name":"exitTimestamp","type":"uint32"},{"internalType":"enum IEtherFiNode.VALIDATOR_PHASE","name":"phase","type":"uint8"}],"internalType":"struct IEtherFiNodesManager.ValidatorInfo","name":"_info","type":"tuple"},{"components":[{"internalType":"uint64","name":"treasury","type":"uint64"},{"internalType":"uint64","name":"nodeOperator","type":"uint64"},{"internalType":"uint64","name":"tnft","type":"uint64"},{"internalType":"uint64","name":"bnft","type":"uint64"}],"internalType":"struct IEtherFiNodesManager.RewardsSplit","name":"_SRsplits","type":"tuple"}],"name":"getFullWithdrawalPayouts","outputs":[{"internalType":"uint256","name":"toNodeOperator","type":"uint256"},{"internalType":"uint256","name":"toTnft","type":"uint256"},{"internalType":"uint256","name":"toBnft","type":"uint256"},{"internalType":"uint256","name":"toTreasury","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_tNftExitRequestTimestamp","type":"uint32"},{"internalType":"uint32","name":"_bNftExitRequestTimestamp","type":"uint32"}],"name":"getNonExitPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_exitRequestTimestamp","type":"uint32"},{"components":[{"internalType":"uint64","name":"treasury","type":"uint64"},{"internalType":"uint64","name":"nodeOperator","type":"uint64"},{"internalType":"uint64","name":"tnft","type":"uint64"},{"internalType":"uint64","name":"bnft","type":"uint64"}],"internalType":"struct IEtherFiNodesManager.RewardsSplit","name":"_splits","type":"tuple"}],"name":"getRewardsPayouts","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasOutstaingEigenPodWithdrawalsQueuedBeforeExit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_etherFiNodesManager","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isRestakingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_validatorId","type":"uint256"},{"components":[{"internalType":"uint32","name":"validatorIndex","type":"uint32"},{"internalType":"uint32","name":"exitRequestTimestamp","type":"uint32"},{"internalType":"uint32","name":"exitTimestamp","type":"uint32"},{"internalType":"enum IEtherFiNode.VALIDATOR_PHASE","name":"phase","type":"uint8"}],"internalType":"struct IEtherFiNodesManager.ValidatorInfo","name":"_info","type":"tuple"}],"name":"migrateVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"moveFundsToManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"numAssociatedValidators","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numExitRequestsByTnft","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numExitedValidators","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"processNodeExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"queueRestakedWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_validatorId","type":"uint256"},{"internalType":"bool","name":"_enableRestaking","type":"bool"}],"name":"registerValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"restakingObservedExitBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"splitBalanceInExecutionLayer","outputs":[{"internalType":"uint256","name":"_withdrawalSafe","type":"uint256"},{"internalType":"uint256","name":"_eigenPod","type":"uint256"},{"internalType":"uint256","name":"_delayedWithdrawalRouter","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBalanceInExecutionLayer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_validatorId","type":"uint256"},{"components":[{"internalType":"uint32","name":"validatorIndex","type":"uint32"},{"internalType":"uint32","name":"exitRequestTimestamp","type":"uint32"},{"internalType":"uint32","name":"exitTimestamp","type":"uint32"},{"internalType":"enum IEtherFiNode.VALIDATOR_PHASE","name":"phase","type":"uint8"}],"internalType":"struct IEtherFiNodesManager.ValidatorInfo","name":"_info","type":"tuple"}],"name":"unRegisterValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_up","type":"uint16"},{"internalType":"uint16","name":"_down","type":"uint16"}],"name":"updateNumExitRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_up","type":"uint16"},{"internalType":"uint16","name":"_down","type":"uint16"}],"name":"updateNumExitedValidators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_up","type":"uint16"},{"internalType":"uint16","name":"_down","type":"uint16"}],"name":"updateNumberOfAssociatedValidators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IEtherFiNode.VALIDATOR_PHASE","name":"_currentPhase","type":"uint8"},{"internalType":"enum IEtherFiNode.VALIDATOR_PHASE","name":"_newPhase","type":"uint8"}],"name":"validatePhaseTransition","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_treasuryAmount","type":"uint256"},{"internalType":"address","name":"_operator","type":"address"},{"internalType":"uint256","name":"_operatorAmount","type":"uint256"},{"internalType":"address","name":"_tnftHolder","type":"address"},{"internalType":"uint256","name":"_tnftAmount","type":"uint256"},{"internalType":"address","name":"_bnftHolder","type":"address"},{"internalType":"uint256","name":"_bnftAmount","type":"uint256"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawableBalanceInExecutionLayer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b50614003806100206000396000f3fe6080604052600436106102eb5760003560e01c8063706354fb11610184578063a6c89f36116100d6578063c994d5af1161008a578063d2c6ae1911610064578063d2c6ae1914610884578063d7e9b9a4146108a4578063e1bba04e146108b957600080fd5b8063c994d5af14610818578063ca2f88991461082d578063cd2c5b5a1461086457600080fd5b8063a9f2803a116100bb578063a9f2803a146107bb578063c4d66de8146107d8578063c95efcaf146107f857600080fd5b8063a6c89f361461077b578063a8a90f371461079b57600080fd5b80638f06a2ff11610138578063992f25a011610112578063992f25a01461071d5780639cdd7f9514610732578063a3aae1361461075b57600080fd5b80638f06a2ff146106bc57806392ac0820146106dc57806393eb3a03146106fc57600080fd5b806383f3b78d1161016957806383f3b78d1461066757806383f884d31461067c57806388100e4d1461069c57600080fd5b8063706354fb1461061957806383644f741461064757600080fd5b80632a7305b21161023d578063459a3ecf116101f15780635c60da1b116101cb5780635c60da1b146105af5780636d2fe263146105c45780636e717d771461060457600080fd5b8063459a3ecf14610548578063471db35c1461057857806354fd4d501461058d57600080fd5b80632cef7b3e116102225780632cef7b3e146104fe5780632e4564b6146105135780633d03eaf21461052857600080fd5b80632a7305b2146104c85780632cab108b146104de57600080fd5b8063145742441161029f5780632143769f116102795780632143769f1461043457806322bee494146104615780632568a6211461048e57600080fd5b806314574244146103bf5780631bc4758e146103df57806320d01076146103ff57600080fd5b80630c2f3276116102d05780630c2f32761461034b5780630c89120c1461036f57806311d8ad5b1461038f57600080fd5b8063089acd98146102f75780630b10b2011461033457600080fd5b366102f257005b600080fd5b34801561030357600080fd5b50600054610317906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561034057600080fd5b506103496108f1565b005b34801561035757600080fd5b5061036160025481565b60405190815260200161032b565b34801561037b57600080fd5b5061034961038a36600461368c565b610ac9565b34801561039b57600080fd5b506103af6103aa36600461368c565b610c15565b604051901515815260200161032b565b3480156103cb57600080fd5b506103616103da3660046136ca565b610dc4565b3480156103eb57600080fd5b506103496103fa366004613715565b610e04565b34801561040b57600080fd5b5060055461042190600160d81b900461ffff1681565b60405161ffff909116815260200161032b565b34801561044057600080fd5b5061036161044f36600461373f565b60066020526000908152604090205481565b34801561046d57600080fd5b5061048161047c366004613870565b610ee6565b60405161032b9190613910565b34801561049a57600080fd5b506004546104b390640100000000900463ffffffff1681565b60405163ffffffff909116815260200161032b565b3480156104d457600080fd5b5061036160015481565b3480156104ea57600080fd5b506103496104f9366004613923565b610f01565b34801561050a57600080fd5b5061036161117f565b34801561051f57600080fd5b506103af611259565b34801561053457600080fd5b506103af6105433660046139b7565b6113be565b34801561055457600080fd5b5061055d61155b565b6040805193845260208401929092529082015260600161032b565b34801561058457600080fd5b506103496116e1565b34801561059957600080fd5b5060055461042190600160a81b900461ffff1681565b3480156105bb57600080fd5b50610317611794565b3480156105d057600080fd5b506105e46105df366004613aba565b61183c565b60408051948552602085019390935291830152606082015260800161032b565b34801561061057600080fd5b50610361611af6565b34801561062557600080fd5b506004546104b3906d0100000000000000000000000000900463ffffffff1681565b34801561065357600080fd5b50610481610662366004613ae7565b611b20565b34801561067357600080fd5b50610481611b51565b34801561068857600080fd5b50610349610697366004613715565b611bdf565b3480156106a857600080fd5b506103af6106b7366004613b1c565b611ca3565b3480156106c857600080fd5b506105e46106d7366004613b40565b611f6b565b3480156106e857600080fd5b506105e46106f7366004613b91565b61230c565b34801561070857600080fd5b506005546103af90600160a01b900460ff1681565b34801561072957600080fd5b506103af612339565b34801561073e57600080fd5b506004546104b39068010000000000000000900463ffffffff1681565b34801561076757600080fd5b50600554610317906001600160a01b031681565b34801561078757600080fd5b50610349610796366004613715565b61246f565b3480156107a757600080fd5b506103616107b636600461373f565b612533565b3480156107c757600080fd5b506004546104b39063ffffffff1681565b3480156107e457600080fd5b506103496107f3366004613bbe565b612554565b34801561080457600080fd5b5061034961081336600461373f565b6126e2565b34801561082457600080fd5b50610349612792565b34801561083957600080fd5b50600454610857906c01000000000000000000000000900460ff1681565b60405161032b9190613bf1565b34801561087057600080fd5b5061036161087f3660046136ca565b61280f565b34801561089057600080fd5b5061034961089f366004613b1c565b612a08565b3480156108b057600080fd5b50610361612b4b565b3480156108c557600080fd5b5060055461042190790100000000000000000000000000000000000000000000000000900461ffff1681565b6005546001600160a01b03161561090457565b60008060009054906101000a90046001600160a01b03166001600160a01b0316634665bcda6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c9190613c19565b9050806001600160a01b03166384d810626040518163ffffffff1660e01b81526004016020604051808303816000875af11580156109be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e29190613c19565b506040517fa38406a30000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0382169063a38406a390602401602060405180830381865afa158015610a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a649190613c19565b600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216918217905560405130907fcdc82cfed67d9b46d3a15dd3b48745fb894a354d554cb5da5fb8c440f85c108e90600090a350565b610ad1612cdb565b600554600160a81b900461ffff16600114610b255760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b60448201526064015b60405180910390fd5b610b2d61117f565b1580610b49575060055460ff600160a01b909104161515811515145b610b955760405162461bcd60e51b815260206004820152601960248201527f72657374616b696e6720737461747573206d69736d61746368000000000000006044820152606401610b1c565b60078054600181019091557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68881018390556000838152600660205260409020558015610c1157600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b179055610c116108f1565b5050565b600554600090600160a01b900460ff16610c3157506000610dbe565b60008060009054906101000a90046001600160a01b03166001600160a01b0316631a5057be6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca99190613c19565b6040516307c3bc0160e31b81523060048201529091506000906001600160a01b03831690633e1de00890602401600060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d1b9190810190613c36565b511115610d9c576040517fe5db06c0000000000000000000000000000000000000000000000000000000008152306004820152602481018590526001600160a01b0382169063e5db06c090604401600060405180830381600087803b158015610d8357600080fd5b505af1158015610d97573d6000803e3d6000fd5b505050505b8215610db257610daa611259565b915050610dbe565b6000915050610dbe565b505b92915050565b600080610ddd8463ffffffff168463ffffffff16612d35565b610ded9063ffffffff8516613d43565b9050610dfc6201518082613d56565b949350505050565b610e0c612cdb565b600554600160a81b900461ffff16600114610e5b5760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b61ffff821615610e9f57816005601b8282829054906101000a900461ffff16610e849190613d78565b92506101000a81548161ffff021916908361ffff1602179055505b61ffff811615610c1157806005601b8282829054906101000a900461ffff16610ec89190613d93565b92506101000a81548161ffff021916908361ffff1602179055505050565b6060610ef0612cdb565b610efa8383612d4b565b9392505050565b610f09612cdb565b600554600160a81b900461ffff16600114610f585760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b60008515610fd4576040516001600160a01b038816906127109088906000818181858888f193505050503d8060008114610fae576040519150601f19603f3d011682016040523d82523d6000602084013e610fb3565b606091505b50909150508015610fc5576000610fc7565b855b610fd19089613dae565b97505b811561104e576040516001600160a01b03841690612ee09084906000818181858888f193505050503d8060008114611028576040519150601f19603f3d011682016040523d82523d6000602084013e61102d565b606091505b5090915050801561103f576000611041565b815b61104b9089613dae565b97505b83156110c8576040516001600160a01b03861690612ee09086906000818181858888f193505050503d80600081146110a2576040519150601f19603f3d011682016040523d82523d6000602084013e6110a7565b606091505b509091505080156110b95760006110bb565b835b6110c59089613dae565b97505b8715611174576040516001600160a01b038a16906108fc908a906000818181858888f193505050503d806000811461111c576040519150601f19603f3d011682016040523d82523d6000602084013e611121565b606091505b505080915050806111745760405162461bcd60e51b815260206004820152600f60248201527f4554485f53454e445f4641494c454400000000000000000000000000000000006044820152606401610b1c565b505050505050505050565b600554600090600160a81b900461ffff1681036112335760026004546c01000000000000000000000000900460ff1660098111156111bf576111bf613bdb565b14806111f1575060066004546c01000000000000000000000000900460ff1660098111156111ef576111ef613bdb565b145b80611222575060036004546c01000000000000000000000000900460ff16600981111561122057611220613bdb565b145b1561122d5750600190565b50600090565b5060055477010000000000000000000000000000000000000000000000900461ffff1690565b60008054604080517f1a5057be000000000000000000000000000000000000000000000000000000008152905183926001600160a01b031691631a5057be9160048083019260209291908290030181865afa1580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190613c19565b6040516307c3bc0160e31b81523060048201529091506000906001600160a01b03831690633e1de00890602401600060405180830381865afa15801561132a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113529190810190613c36565b905060005b81518110156113b4576004600d9054906101000a900463ffffffff1663ffffffff1682828151811061138b5761138b613dc1565b60200260200101516020015163ffffffff16116113ac576001935050505090565b600101611357565b5060009250505090565b600080808460098111156113d4576113d4613bdb565b036113f65760015b8360098111156113ee576113ee613bdb565b14905061150e565b600184600981111561140a5761140a613bdb565b0361145457600283600981111561142357611423613bdb565b14806114405750600083600981111561143e5761143e613bdb565b145b8061144d575060086113dc565b905061150e565b600884600981111561146857611468613bdb565b0361148f57600283600981111561148157611481613bdb565b148061144d575060006113dc565b60028460098111156114a3576114a3613bdb565b036114ca5760038360098111156114bc576114bc613bdb565b148061144d575060066113dc565b60068460098111156114de576114de613bdb565b036114ea5760036113dc565b60038460098111156114fe576114fe613bdb565b0361150a5760046113dc565b5060005b80610efa5760405162461bcd60e51b815260206004820152601860248201527f494e56414c49445f50484153455f5452414e534954494f4e00000000000000006044820152606401610b1c565b60055447906000908190600160a01b900460ff16156116dc5760055460008054604080517f1a5057be00000000000000000000000000000000000000000000000000000000815290516001600160a01b03948516319650929390911691631a5057be916004808201926020929091908290030181865afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190613c19565b6040516307c3bc0160e31b81523060048201529091506000906001600160a01b03831690633e1de00890602401600060405180830381865afa158015611651573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116799190810190613c36565b905060005b81518110156116d85781818151811061169957611699613dc1565b6020026020010151600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16846116ce9190613dae565b935060010161167e565b5050505b909192565b6116e9612cdb565b600554600160a81b900461ffff166001146117385760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b600554600160a01b900460ff161561179257600480547fffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffff166d01000000000000000000000000004363ffffffff1602179055611792612792565b565b6000806117c260017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51613d43565b60001b90506000815490506000819050806001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118349190613c19565b935050505090565b60008060008061184a612cdb565b600554600160a81b900461ffff16158061186b575061186761117f565b6001145b1561188b5761187e600087876001611f6b565b9350935093509350611aed565b600554600160a81b900461ffff16600103611aa55760408051600480825260a082019092526000916020820160808036833701905050905060006801bc16d674ec8000006118d7612b4b565b10156118ea576118e5612b4b565b6118f5565b6801bc16d674ec8000005b905061190081612d8f565b8360028151811061191357611913613dc1565b602002602001018460018151811061192d5761192d613dc1565b60200260200101828152508281525050506119b3888360008151811061195557611955613dc1565b60200260200101518460018151811061197057611970613dc1565b60200260200101518560028151811061198b5761198b613dc1565b6020026020010151866003815181106119a6576119a6613dc1565b6020026020010151612e4d565b856000815181106119c6576119c6613dc1565b60200260200101866001815181106119e0576119e0613dc1565b60200260200101876002815181106119fa576119fa613dc1565b6020026020010188600381518110611a1457611a14613dc1565b6020908102919091010193909352929091529190525281518290600090611a3d57611a3d613dc1565b602002602001015182600181518110611a5857611a58613dc1565b602002602001015183600281518110611a7357611a73613dc1565b602002602001015184600381518110611a8e57611a8e613dc1565b602002602001015195509550955095505050611aed565b60405162461bcd60e51b815260206004820152600d60248201527f57524f4e475f56455253494f4e000000000000000000000000000000000000006044820152606401610b1c565b92959194509250565b600080600080611b0461155b565b9194509250905080611b168385613dae565b6118349190613dae565b6060611b2a612cdb565b611b3382612ecb565b600554611b49906001600160a01b031683612d4b565b90505b919050565b60038054611b5e90613dd7565b80601f0160208091040260200160405190810160405280929190818152602001828054611b8a90613dd7565b8015611bd75780601f10611bac57610100808354040283529160200191611bd7565b820191906000526020600020905b815481529060010190602001808311611bba57829003601f168201915b505050505081565b611be7612cdb565b600554600160a81b900461ffff16600114611c365760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b61ffff821615611c7a5781600560178282829054906101000a900461ffff16611c5f9190613d78565b92506101000a81548161ffff021916908361ffff1602179055505b61ffff811615610c115780600560178282829054906101000a900461ffff16610ec89190613d93565b6000611cad612cdb565b600554600160a81b900461ffff16600114611cfc5760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b600482606001516009811115611d1457611d14613bdb565b1480611d355750600082606001516009811115611d3357611d33613bdb565b145b611d815760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964207068617365000000000000000000000000000000000000006044820152606401610b1c565b600482606001516009811115611d9957611d99613bdb565b03611dd95760016005601b8282829054906101000a900461ffff16611dbe9190613d93565b92506101000a81548161ffff021916908361ffff1602179055505b602082015163ffffffff1615611e24576001600560198282829054906101000a900461ffff16611e099190613d93565b92506101000a81548161ffff021916908361ffff1602179055505b600083815260066020526040812054600754909190611e4590600190613d43565b9050600060078281548110611e5c57611e5c613dc1565b9060005260206000200154905060078281548110611e7c57611e7c613dc1565b906000526020600020015460078481548110611e9a57611e9a613dc1565b60009182526020808320909101929092558281526006909152604090208390556007805480611ecb57611ecb613e11565b600190038181906000526020600020016000905590556006600087815260200190815260200160002060009055505050611f0361117f565b600003611f625750600480547fffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffff169055600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556001610dbe565b50600092915050565b600080600080611f79612cdb565b600080611f8b89606001518b8961305b565b9092509050611f9a8183613dae565b600003611fb65760008060008095509550955095505050612301565b60408051600480825260a0820190925260009160208201608080368337019050509050611fe3838a6133c0565b84600081518110611ff657611ff6613dc1565b602002602001018560018151811061201057612010613dc1565b602002602001018660028151811061202a5761202a613dc1565b602002602001018760038151811061204457612044613dc1565b6020908102919091010193909352929091529190525260008061206684612d8f565b91509150808360018151811061207e5761207e613dc1565b602002602001018181516120929190613dae565b90525082518290849060029081106120ac576120ac613dc1565b602002602001018181516120c09190613dae565b9150818152505061212f8c846000815181106120de576120de613dc1565b6020026020010151856001815181106120f9576120f9613dc1565b60200260200101518660028151811061211457612114613dc1565b6020026020010151876003815181106119a6576119a6613dc1565b8660008151811061214257612142613dc1565b602002602001018760018151811061215c5761215c613dc1565b602002602001018860028151811061217657612176613dc1565b602002602001018960038151811061219057612190613dc1565b602090810291909101019390935292909152919052526121b08486613dae565b836003815181106121c3576121c3613dc1565b6020026020010151846002815181106121de576121de613dc1565b6020026020010151856001815181106121f9576121f9613dc1565b60200260200101518660008151811061221457612214613dc1565b60200260200101516122269190613dae565b6122309190613dae565b61223a9190613dae565b146122875760405162461bcd60e51b815260206004820152601060248201527f494e434f52524543545f414d4f554e54000000000000000000000000000000006044820152606401610b1c565b8260008151811061229a5761229a613dc1565b6020026020010151836001815181106122b5576122b5613dc1565b6020026020010151846002815181106122d0576122d0613dc1565b6020026020010151856003815181106122eb576122eb613dc1565b6020026020010151985098509850985050505050505b945094509450949050565b600080600080600061231c612b4b565b905061232881876133c0565b929a91995097509095509350505050565b6004546000906d0100000000000000000000000000900463ffffffff1681036123625750600090565b60008060009054906101000a90046001600160a01b03166001600160a01b0316631a5057be6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123da9190613c19565b90506000816001600160a01b03166350f73e7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190613e27565b6004549091506d0100000000000000000000000000900463ffffffff166124678243613d43565b119250505090565b612477612cdb565b600554600160a81b900461ffff166001146124c65760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b61ffff82161561250a5781600560198282829054906101000a900461ffff166124ef9190613d78565b92506101000a81548161ffff021916908361ffff1602179055505b61ffff811615610c115780600560198282829054906101000a900461ffff16610ec89190613d93565b6007818154811061254357600080fd5b600091825260209091200154905081565b60006004546c01000000000000000000000000900460ff16600981111561257d5761257d613bdb565b146125ca5760405162461bcd60e51b815260206004820152601360248201527f414c52454144595f494e495449414c495a4544000000000000000000000000006044820152606401610b1c565b6000546001600160a01b0316156126235760405162461bcd60e51b815260206004820152601360248201527f414c52454144595f494e495449414c495a4544000000000000000000000000006044820152606401610b1c565b6001600160a01b0381166126795760405162461bcd60e51b815260206004820152600f60248201527f4e4f5f5a45524f5f4144445245535300000000000000000000000000000000006044820152606401610b1c565b600080546001600160a01b039092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179055600580547fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff16600160a81b179055565b6126ea612cdb565b600080546040516001600160a01b039091169061177090849084818181858888f193505050503d806000811461273c576040519150601f19603f3d011682016040523d82523d6000602084013e612741565b606091505b5050905080610c115760405162461bcd60e51b815260206004820152600f60248201527f4554485f53454e445f4641494c454400000000000000000000000000000000006044820152606401610b1c565b600554600160a01b900460ff166127a557565b600560009054906101000a90046001600160a01b03166001600160a01b031663baa7145a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156127f557600080fd5b505af1158015612809573d6000803e3d6000fd5b50505050565b60008263ffffffff1660000361282757506000610dbe565b60008060009054906101000a90046001600160a01b03166001600160a01b031663bbe78ecd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561287b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289f9190613e40565b67ffffffffffffffff16905060008060009054906101000a90046001600160a01b03166001600160a01b0316637082994b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129239190613e40565b905060006129318686610dc4565b905061016d8111156129585750506fffffffffffffffffffffffffffffffff169050610dbe565b6fffffffffffffffffffffffffffffffff83165b81156129e157600061297f600784612d35565b905061298d81612710613f41565b816129a467ffffffffffffffff8716612710613d43565b6129ae9190613f41565b6129b89084613f4d565b6129c29190613d56565b91506129cf600784612d35565b6129d99084613d43565b92505061296c565b6129fd816fffffffffffffffffffffffffffffffff8616613d43565b979650505050505050565b612a10612cdb565b600554600160a81b900461ffff16600003610c1157600480547fffffffffffffffffffffffffffffffffffffff00000000000000000000000000169055612a5960036000613626565b600580547fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff16600160a81b1790558115610c115760055477010000000000000000000000000000000000000000000000900461ffff1615612afc5760405162461bcd60e51b815260206004820152601360248201527f414c52454144595f494e495449414c495a4544000000000000000000000000006044820152606401610b1c565b612b07826000610ac9565b612b1360016000611bdf565b602081015163ffffffff1615612b2f57612b2f6001600061246f565b604081015163ffffffff1615610c1157610c1160016000610e04565b60055460009047908290600160a01b900460ff1615612cca5760008060009054906101000a90046001600160a01b03166001600160a01b0316631a5057be6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bdc9190613c19565b6040517f1f39d87f0000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b03831690631f39d87f90602401600060405180830381865afa158015612c3f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c679190810190613c36565b905060005b8151811015612cc657818181518110612c8757612c87613dc1565b6020026020010151600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1684612cbc9190613dae565b9350600101612c6c565b5050505b612cd48183613dae565b9250505090565b6000546001600160a01b031633146117925760405162461bcd60e51b815260206004820152601060248201527f494e434f52524543545f43414c4c4552000000000000000000000000000000006044820152606401610b1c565b6000818310612d445781610efa565b5090919050565b6060610efa838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c656400008152506134a6565b60008067de0b6b3a764000008310158015612db357506801bc16d674ec8000008311155b612dff5760405162461bcd60e51b815260206004820152601a60248201527f494e434f52524543545f5052494e434950414c5f414d4f554e540000000000006044820152606401610b1c565b60006801ae361fc1451c0000841015612e2057670de0b6b3a7640000612e33565b612e336801a055690d9db8000085613d43565b90506000612e418286613d43565b91959194509092505050565b6000806000806000612e678a602001518b6040015161280f565b90506000612e758883612d35565b90506000612e8b826702c68af0bb140000612d35565b9050612e97818c613dae565b9a50612ea38183613d43565b612ead9089613dae565b9750612eb9828a613d43565b9a9c999b509698975050505050505050565b60208101517fffffffff0000000000000000000000000000000000000000000000000000000081167fe2c834450000000000000000000000000000000000000000000000000000000003612fca57602482511015612f6b5760405162461bcd60e51b815260206004820152601360248201527f494e56414c49445f444154415f4c454e475448000000000000000000000000006044820152606401610b1c565b60248201516001600160a01b0381163014612fc85760405162461bcd60e51b815260206004820152601360248201527f494e434f52524543545f524543495049454e54000000000000000000000000006044820152606401610b1c565b505b7fffffffff0000000000000000000000000000000000000000000000000000000081167fdda3346c0000000000000000000000000000000000000000000000000000000003610c115760405162461bcd60e51b815260206004820152600b60248201527f4e4f545f414c4c4f5745440000000000000000000000000000000000000000006044820152606401610b1c565b600080600061306861117f565b90508060000361307f5760008092509250506133b8565b6000846130935761308e611af6565b61309b565b61309b612b4b565b6005549091506130be90600160d81b900461ffff1667de0b6b3a76400000613f64565b67ffffffffffffffff168110156131175760405162461bcd60e51b815260206004820152601460248201527f494e53554646494349454e545f42414c414e43450000000000000000000000006044820152606401610b1c565b6005546000906131819061313e90600160d81b900461ffff1667de0b6b3a76400000613f64565b6131529067ffffffffffffffff1684613d43565b60055461317290600160d81b900461ffff1667de0b6b3a76400000613f64565b67ffffffffffffffff16612d35565b6005546131a190600160d81b900461ffff1667de0b6b3a76400000613f64565b67ffffffffffffffff166131b59190613dae565b90506000836131c48385613d43565b6131ce9190613d56565b905060006801bc16d674ec80000089116131e95760006131fc565b6131fc6801bc16d674ec8000008a613d43565b90506132088183613dae565b965060038a600981111561321e5761321e613bdb565b036132b65760055461323b90600160d81b900461ffff1684613d56565b955088156132b15760405162461bcd60e51b815260206004820152603660248201527f4578697465642076616c696461746f72206d7573742068617665207a65726f2060448201527f62616c616e61636520696e2074686520626561636f6e000000000000000000006064820152608401610b1c565b613345565b60028a60098111156132ca576132ca613bdb565b14806132e7575060068a60098111156132e5576132e5613bdb565b145b156132fd576132f6818a613d43565b9550613345565b60405162461bcd60e51b815260206004820152600d60248201527f494e56414c49445f5048415345000000000000000000000000000000000000006044820152606401610b1c565b6801bc16d674ec8000008611158015613366575067de0b6b3a764000008610155b6133b25760405162461bcd60e51b815260206004820152601060248201527f494e434f52524543545f414d4f554e54000000000000000000000000000000006044820152606401610b1c565b50505050505b935093915050565b600080600080600085606001518660400151876020015188600001516133e69190613f90565b6133f09190613f90565b6133fa9190613f90565b67ffffffffffffffff16905080866020015167ffffffffffffffff16886134219190613f4d565b61342b9190613d56565b945080866040015167ffffffffffffffff16886134489190613f4d565b6134529190613d56565b935080866060015167ffffffffffffffff168861346f9190613f4d565b6134799190613d56565b9250846134868585613dae565b6134909190613dae565b61349a9088613d43565b91505092959194509250565b60608247101561351e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b1c565b600080866001600160a01b0316858760405161353a9190613fb1565b60006040518083038185875af1925050503d8060008114613577576040519150601f19603f3d011682016040523d82523d6000602084013e61357c565b606091505b50915091506129fd87838387606083156135f75782516000036135f0576001600160a01b0385163b6135f05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b1c565b5081610dfc565b610dfc838381511561360c5781518083602001fd5b8060405162461bcd60e51b8152600401610b1c9190613910565b50805461363290613dd7565b6000825580601f10613642575050565b601f0160209004906000526020600020908101906136609190613663565b50565b5b808211156136785760008155600101613664565b5090565b80358015158114611b4c57600080fd5b6000806040838503121561369f57600080fd5b823591506136af6020840161367c565b90509250929050565b63ffffffff8116811461366057600080fd5b600080604083850312156136dd57600080fd5b82356136e8816136b8565b915060208301356136f8816136b8565b809150509250929050565b803561ffff81168114611b4c57600080fd5b6000806040838503121561372857600080fd5b61373183613703565b91506136af60208401613703565b60006020828403121561375157600080fd5b5035919050565b6001600160a01b038116811461366057600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156137a6576137a661376d565b60405290565b6040805190810167ffffffffffffffff811182821017156137a6576137a661376d565b604051601f8201601f1916810167ffffffffffffffff811182821017156137f8576137f861376d565b604052919050565b600082601f83011261381157600080fd5b813567ffffffffffffffff81111561382b5761382b61376d565b61383e6020601f19601f840116016137cf565b81815284602083860101111561385357600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561388357600080fd5b823561388e81613758565b9150602083013567ffffffffffffffff8111156138aa57600080fd5b6138b685828601613800565b9150509250929050565b60005b838110156138db5781810151838201526020016138c3565b50506000910152565b600081518084526138fc8160208601602086016138c0565b601f01601f19169290920160200192915050565b602081526000610efa60208301846138e4565b600080600080600080600080610100898b03121561394057600080fd5b883561394b81613758565b975060208901359650604089013561396281613758565b955060608901359450608089013561397981613758565b935060a0890135925060c089013561399081613758565b8092505060e089013590509295985092959890939650565b8035600a8110611b4c57600080fd5b600080604083850312156139ca57600080fd5b6139d3836139a8565b91506136af602084016139a8565b6000608082840312156139f357600080fd5b6139fb613783565b90508135613a08816136b8565b81526020820135613a18816136b8565b60208201526040820135613a2b816136b8565b6040820152613a3c606083016139a8565b606082015292915050565b67ffffffffffffffff8116811461366057600080fd5b600060808284031215613a6f57600080fd5b613a77613783565b90508135613a8481613a47565b81526020820135613a9481613a47565b60208201526040820135613aa781613a47565b60408201526060820135613a3c81613a47565b6000806101008385031215613ace57600080fd5b613ad884846139e1565b91506136af8460808501613a5d565b600060208284031215613af957600080fd5b813567ffffffffffffffff811115613b1057600080fd5b610dfc84828501613800565b60008060a08385031215613b2f57600080fd5b823591506136af84602085016139e1565b6000806000806101408587031215613b5757600080fd5b84359350613b6886602087016139e1565b9250613b778660a08701613a5d565b9150613b86610120860161367c565b905092959194509250565b60008060a08385031215613ba457600080fd5b8235613baf816136b8565b91506136af8460208501613a5d565b600060208284031215613bd057600080fd5b8135610efa81613758565b634e487b7160e01b600052602160045260246000fd5b60208101600a8310613c1357634e487b7160e01b600052602160045260246000fd5b91905290565b600060208284031215613c2b57600080fd5b8151610efa81613758565b60006020808385031215613c4957600080fd5b825167ffffffffffffffff80821115613c6157600080fd5b818501915085601f830112613c7557600080fd5b815181811115613c8757613c8761376d565b613c95848260051b016137cf565b818152848101925060069190911b830184019087821115613cb557600080fd5b928401925b818410156129fd5760408489031215613cd35760008081fd5b613cdb6137ac565b84517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114613d085760008081fd5b815284860151613d17816136b8565b8187015283526040939093019291840191613cba565b634e487b7160e01b600052601160045260246000fd5b81810381811115610dbe57610dbe613d2d565b600082613d7357634e487b7160e01b600052601260045260246000fd5b500490565b61ffff818116838216019080821115610dbc57610dbc613d2d565b61ffff828116828216039080821115610dbc57610dbc613d2d565b80820180821115610dbe57610dbe613d2d565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680613deb57607f821691505b602082108103613e0b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215613e3957600080fd5b5051919050565b600060208284031215613e5257600080fd5b8151610efa81613a47565b600181815b80851115613e98578160001904821115613e7e57613e7e613d2d565b80851615613e8b57918102915b93841c9390800290613e62565b509250929050565b600082613eaf57506001610dbe565b81613ebc57506000610dbe565b8160018114613ed25760028114613edc57613ef8565b6001915050610dbe565b60ff841115613eed57613eed613d2d565b50506001821b610dbe565b5060208310610133831016604e8410600b8410161715613f1b575081810a610dbe565b613f258383613e5d565b8060001904821115613f3957613f39613d2d565b029392505050565b6000610efa8383613ea0565b8082028115828204841417610dbe57610dbe613d2d565b67ffffffffffffffff818116838216028082169190828114613f8857613f88613d2d565b505092915050565b67ffffffffffffffff818116838216019080821115610dbc57610dbc613d2d565b60008251613fc38184602087016138c0565b919091019291505056fea2646970667358221220162de275031c8b45b364d6665d4ac5c3b36cd862dabea93ba704f1e78505244d64736f6c63430008180033
Deployed Bytecode
0x6080604052600436106102eb5760003560e01c8063706354fb11610184578063a6c89f36116100d6578063c994d5af1161008a578063d2c6ae1911610064578063d2c6ae1914610884578063d7e9b9a4146108a4578063e1bba04e146108b957600080fd5b8063c994d5af14610818578063ca2f88991461082d578063cd2c5b5a1461086457600080fd5b8063a9f2803a116100bb578063a9f2803a146107bb578063c4d66de8146107d8578063c95efcaf146107f857600080fd5b8063a6c89f361461077b578063a8a90f371461079b57600080fd5b80638f06a2ff11610138578063992f25a011610112578063992f25a01461071d5780639cdd7f9514610732578063a3aae1361461075b57600080fd5b80638f06a2ff146106bc57806392ac0820146106dc57806393eb3a03146106fc57600080fd5b806383f3b78d1161016957806383f3b78d1461066757806383f884d31461067c57806388100e4d1461069c57600080fd5b8063706354fb1461061957806383644f741461064757600080fd5b80632a7305b21161023d578063459a3ecf116101f15780635c60da1b116101cb5780635c60da1b146105af5780636d2fe263146105c45780636e717d771461060457600080fd5b8063459a3ecf14610548578063471db35c1461057857806354fd4d501461058d57600080fd5b80632cef7b3e116102225780632cef7b3e146104fe5780632e4564b6146105135780633d03eaf21461052857600080fd5b80632a7305b2146104c85780632cab108b146104de57600080fd5b8063145742441161029f5780632143769f116102795780632143769f1461043457806322bee494146104615780632568a6211461048e57600080fd5b806314574244146103bf5780631bc4758e146103df57806320d01076146103ff57600080fd5b80630c2f3276116102d05780630c2f32761461034b5780630c89120c1461036f57806311d8ad5b1461038f57600080fd5b8063089acd98146102f75780630b10b2011461033457600080fd5b366102f257005b600080fd5b34801561030357600080fd5b50600054610317906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561034057600080fd5b506103496108f1565b005b34801561035757600080fd5b5061036160025481565b60405190815260200161032b565b34801561037b57600080fd5b5061034961038a36600461368c565b610ac9565b34801561039b57600080fd5b506103af6103aa36600461368c565b610c15565b604051901515815260200161032b565b3480156103cb57600080fd5b506103616103da3660046136ca565b610dc4565b3480156103eb57600080fd5b506103496103fa366004613715565b610e04565b34801561040b57600080fd5b5060055461042190600160d81b900461ffff1681565b60405161ffff909116815260200161032b565b34801561044057600080fd5b5061036161044f36600461373f565b60066020526000908152604090205481565b34801561046d57600080fd5b5061048161047c366004613870565b610ee6565b60405161032b9190613910565b34801561049a57600080fd5b506004546104b390640100000000900463ffffffff1681565b60405163ffffffff909116815260200161032b565b3480156104d457600080fd5b5061036160015481565b3480156104ea57600080fd5b506103496104f9366004613923565b610f01565b34801561050a57600080fd5b5061036161117f565b34801561051f57600080fd5b506103af611259565b34801561053457600080fd5b506103af6105433660046139b7565b6113be565b34801561055457600080fd5b5061055d61155b565b6040805193845260208401929092529082015260600161032b565b34801561058457600080fd5b506103496116e1565b34801561059957600080fd5b5060055461042190600160a81b900461ffff1681565b3480156105bb57600080fd5b50610317611794565b3480156105d057600080fd5b506105e46105df366004613aba565b61183c565b60408051948552602085019390935291830152606082015260800161032b565b34801561061057600080fd5b50610361611af6565b34801561062557600080fd5b506004546104b3906d0100000000000000000000000000900463ffffffff1681565b34801561065357600080fd5b50610481610662366004613ae7565b611b20565b34801561067357600080fd5b50610481611b51565b34801561068857600080fd5b50610349610697366004613715565b611bdf565b3480156106a857600080fd5b506103af6106b7366004613b1c565b611ca3565b3480156106c857600080fd5b506105e46106d7366004613b40565b611f6b565b3480156106e857600080fd5b506105e46106f7366004613b91565b61230c565b34801561070857600080fd5b506005546103af90600160a01b900460ff1681565b34801561072957600080fd5b506103af612339565b34801561073e57600080fd5b506004546104b39068010000000000000000900463ffffffff1681565b34801561076757600080fd5b50600554610317906001600160a01b031681565b34801561078757600080fd5b50610349610796366004613715565b61246f565b3480156107a757600080fd5b506103616107b636600461373f565b612533565b3480156107c757600080fd5b506004546104b39063ffffffff1681565b3480156107e457600080fd5b506103496107f3366004613bbe565b612554565b34801561080457600080fd5b5061034961081336600461373f565b6126e2565b34801561082457600080fd5b50610349612792565b34801561083957600080fd5b50600454610857906c01000000000000000000000000900460ff1681565b60405161032b9190613bf1565b34801561087057600080fd5b5061036161087f3660046136ca565b61280f565b34801561089057600080fd5b5061034961089f366004613b1c565b612a08565b3480156108b057600080fd5b50610361612b4b565b3480156108c557600080fd5b5060055461042190790100000000000000000000000000000000000000000000000000900461ffff1681565b6005546001600160a01b03161561090457565b60008060009054906101000a90046001600160a01b03166001600160a01b0316634665bcda6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c9190613c19565b9050806001600160a01b03166384d810626040518163ffffffff1660e01b81526004016020604051808303816000875af11580156109be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e29190613c19565b506040517fa38406a30000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0382169063a38406a390602401602060405180830381865afa158015610a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a649190613c19565b600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216918217905560405130907fcdc82cfed67d9b46d3a15dd3b48745fb894a354d554cb5da5fb8c440f85c108e90600090a350565b610ad1612cdb565b600554600160a81b900461ffff16600114610b255760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b60448201526064015b60405180910390fd5b610b2d61117f565b1580610b49575060055460ff600160a01b909104161515811515145b610b955760405162461bcd60e51b815260206004820152601960248201527f72657374616b696e6720737461747573206d69736d61746368000000000000006044820152606401610b1c565b60078054600181019091557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68881018390556000838152600660205260409020558015610c1157600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b179055610c116108f1565b5050565b600554600090600160a01b900460ff16610c3157506000610dbe565b60008060009054906101000a90046001600160a01b03166001600160a01b0316631a5057be6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca99190613c19565b6040516307c3bc0160e31b81523060048201529091506000906001600160a01b03831690633e1de00890602401600060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d1b9190810190613c36565b511115610d9c576040517fe5db06c0000000000000000000000000000000000000000000000000000000008152306004820152602481018590526001600160a01b0382169063e5db06c090604401600060405180830381600087803b158015610d8357600080fd5b505af1158015610d97573d6000803e3d6000fd5b505050505b8215610db257610daa611259565b915050610dbe565b6000915050610dbe565b505b92915050565b600080610ddd8463ffffffff168463ffffffff16612d35565b610ded9063ffffffff8516613d43565b9050610dfc6201518082613d56565b949350505050565b610e0c612cdb565b600554600160a81b900461ffff16600114610e5b5760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b61ffff821615610e9f57816005601b8282829054906101000a900461ffff16610e849190613d78565b92506101000a81548161ffff021916908361ffff1602179055505b61ffff811615610c1157806005601b8282829054906101000a900461ffff16610ec89190613d93565b92506101000a81548161ffff021916908361ffff1602179055505050565b6060610ef0612cdb565b610efa8383612d4b565b9392505050565b610f09612cdb565b600554600160a81b900461ffff16600114610f585760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b60008515610fd4576040516001600160a01b038816906127109088906000818181858888f193505050503d8060008114610fae576040519150601f19603f3d011682016040523d82523d6000602084013e610fb3565b606091505b50909150508015610fc5576000610fc7565b855b610fd19089613dae565b97505b811561104e576040516001600160a01b03841690612ee09084906000818181858888f193505050503d8060008114611028576040519150601f19603f3d011682016040523d82523d6000602084013e61102d565b606091505b5090915050801561103f576000611041565b815b61104b9089613dae565b97505b83156110c8576040516001600160a01b03861690612ee09086906000818181858888f193505050503d80600081146110a2576040519150601f19603f3d011682016040523d82523d6000602084013e6110a7565b606091505b509091505080156110b95760006110bb565b835b6110c59089613dae565b97505b8715611174576040516001600160a01b038a16906108fc908a906000818181858888f193505050503d806000811461111c576040519150601f19603f3d011682016040523d82523d6000602084013e611121565b606091505b505080915050806111745760405162461bcd60e51b815260206004820152600f60248201527f4554485f53454e445f4641494c454400000000000000000000000000000000006044820152606401610b1c565b505050505050505050565b600554600090600160a81b900461ffff1681036112335760026004546c01000000000000000000000000900460ff1660098111156111bf576111bf613bdb565b14806111f1575060066004546c01000000000000000000000000900460ff1660098111156111ef576111ef613bdb565b145b80611222575060036004546c01000000000000000000000000900460ff16600981111561122057611220613bdb565b145b1561122d5750600190565b50600090565b5060055477010000000000000000000000000000000000000000000000900461ffff1690565b60008054604080517f1a5057be000000000000000000000000000000000000000000000000000000008152905183926001600160a01b031691631a5057be9160048083019260209291908290030181865afa1580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190613c19565b6040516307c3bc0160e31b81523060048201529091506000906001600160a01b03831690633e1de00890602401600060405180830381865afa15801561132a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113529190810190613c36565b905060005b81518110156113b4576004600d9054906101000a900463ffffffff1663ffffffff1682828151811061138b5761138b613dc1565b60200260200101516020015163ffffffff16116113ac576001935050505090565b600101611357565b5060009250505090565b600080808460098111156113d4576113d4613bdb565b036113f65760015b8360098111156113ee576113ee613bdb565b14905061150e565b600184600981111561140a5761140a613bdb565b0361145457600283600981111561142357611423613bdb565b14806114405750600083600981111561143e5761143e613bdb565b145b8061144d575060086113dc565b905061150e565b600884600981111561146857611468613bdb565b0361148f57600283600981111561148157611481613bdb565b148061144d575060006113dc565b60028460098111156114a3576114a3613bdb565b036114ca5760038360098111156114bc576114bc613bdb565b148061144d575060066113dc565b60068460098111156114de576114de613bdb565b036114ea5760036113dc565b60038460098111156114fe576114fe613bdb565b0361150a5760046113dc565b5060005b80610efa5760405162461bcd60e51b815260206004820152601860248201527f494e56414c49445f50484153455f5452414e534954494f4e00000000000000006044820152606401610b1c565b60055447906000908190600160a01b900460ff16156116dc5760055460008054604080517f1a5057be00000000000000000000000000000000000000000000000000000000815290516001600160a01b03948516319650929390911691631a5057be916004808201926020929091908290030181865afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190613c19565b6040516307c3bc0160e31b81523060048201529091506000906001600160a01b03831690633e1de00890602401600060405180830381865afa158015611651573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116799190810190613c36565b905060005b81518110156116d85781818151811061169957611699613dc1565b6020026020010151600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16846116ce9190613dae565b935060010161167e565b5050505b909192565b6116e9612cdb565b600554600160a81b900461ffff166001146117385760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b600554600160a01b900460ff161561179257600480547fffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffff166d01000000000000000000000000004363ffffffff1602179055611792612792565b565b6000806117c260017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51613d43565b60001b90506000815490506000819050806001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118349190613c19565b935050505090565b60008060008061184a612cdb565b600554600160a81b900461ffff16158061186b575061186761117f565b6001145b1561188b5761187e600087876001611f6b565b9350935093509350611aed565b600554600160a81b900461ffff16600103611aa55760408051600480825260a082019092526000916020820160808036833701905050905060006801bc16d674ec8000006118d7612b4b565b10156118ea576118e5612b4b565b6118f5565b6801bc16d674ec8000005b905061190081612d8f565b8360028151811061191357611913613dc1565b602002602001018460018151811061192d5761192d613dc1565b60200260200101828152508281525050506119b3888360008151811061195557611955613dc1565b60200260200101518460018151811061197057611970613dc1565b60200260200101518560028151811061198b5761198b613dc1565b6020026020010151866003815181106119a6576119a6613dc1565b6020026020010151612e4d565b856000815181106119c6576119c6613dc1565b60200260200101866001815181106119e0576119e0613dc1565b60200260200101876002815181106119fa576119fa613dc1565b6020026020010188600381518110611a1457611a14613dc1565b6020908102919091010193909352929091529190525281518290600090611a3d57611a3d613dc1565b602002602001015182600181518110611a5857611a58613dc1565b602002602001015183600281518110611a7357611a73613dc1565b602002602001015184600381518110611a8e57611a8e613dc1565b602002602001015195509550955095505050611aed565b60405162461bcd60e51b815260206004820152600d60248201527f57524f4e475f56455253494f4e000000000000000000000000000000000000006044820152606401610b1c565b92959194509250565b600080600080611b0461155b565b9194509250905080611b168385613dae565b6118349190613dae565b6060611b2a612cdb565b611b3382612ecb565b600554611b49906001600160a01b031683612d4b565b90505b919050565b60038054611b5e90613dd7565b80601f0160208091040260200160405190810160405280929190818152602001828054611b8a90613dd7565b8015611bd75780601f10611bac57610100808354040283529160200191611bd7565b820191906000526020600020905b815481529060010190602001808311611bba57829003601f168201915b505050505081565b611be7612cdb565b600554600160a81b900461ffff16600114611c365760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b61ffff821615611c7a5781600560178282829054906101000a900461ffff16611c5f9190613d78565b92506101000a81548161ffff021916908361ffff1602179055505b61ffff811615610c115780600560178282829054906101000a900461ffff16610ec89190613d93565b6000611cad612cdb565b600554600160a81b900461ffff16600114611cfc5760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b600482606001516009811115611d1457611d14613bdb565b1480611d355750600082606001516009811115611d3357611d33613bdb565b145b611d815760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964207068617365000000000000000000000000000000000000006044820152606401610b1c565b600482606001516009811115611d9957611d99613bdb565b03611dd95760016005601b8282829054906101000a900461ffff16611dbe9190613d93565b92506101000a81548161ffff021916908361ffff1602179055505b602082015163ffffffff1615611e24576001600560198282829054906101000a900461ffff16611e099190613d93565b92506101000a81548161ffff021916908361ffff1602179055505b600083815260066020526040812054600754909190611e4590600190613d43565b9050600060078281548110611e5c57611e5c613dc1565b9060005260206000200154905060078281548110611e7c57611e7c613dc1565b906000526020600020015460078481548110611e9a57611e9a613dc1565b60009182526020808320909101929092558281526006909152604090208390556007805480611ecb57611ecb613e11565b600190038181906000526020600020016000905590556006600087815260200190815260200160002060009055505050611f0361117f565b600003611f625750600480547fffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffff169055600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556001610dbe565b50600092915050565b600080600080611f79612cdb565b600080611f8b89606001518b8961305b565b9092509050611f9a8183613dae565b600003611fb65760008060008095509550955095505050612301565b60408051600480825260a0820190925260009160208201608080368337019050509050611fe3838a6133c0565b84600081518110611ff657611ff6613dc1565b602002602001018560018151811061201057612010613dc1565b602002602001018660028151811061202a5761202a613dc1565b602002602001018760038151811061204457612044613dc1565b6020908102919091010193909352929091529190525260008061206684612d8f565b91509150808360018151811061207e5761207e613dc1565b602002602001018181516120929190613dae565b90525082518290849060029081106120ac576120ac613dc1565b602002602001018181516120c09190613dae565b9150818152505061212f8c846000815181106120de576120de613dc1565b6020026020010151856001815181106120f9576120f9613dc1565b60200260200101518660028151811061211457612114613dc1565b6020026020010151876003815181106119a6576119a6613dc1565b8660008151811061214257612142613dc1565b602002602001018760018151811061215c5761215c613dc1565b602002602001018860028151811061217657612176613dc1565b602002602001018960038151811061219057612190613dc1565b602090810291909101019390935292909152919052526121b08486613dae565b836003815181106121c3576121c3613dc1565b6020026020010151846002815181106121de576121de613dc1565b6020026020010151856001815181106121f9576121f9613dc1565b60200260200101518660008151811061221457612214613dc1565b60200260200101516122269190613dae565b6122309190613dae565b61223a9190613dae565b146122875760405162461bcd60e51b815260206004820152601060248201527f494e434f52524543545f414d4f554e54000000000000000000000000000000006044820152606401610b1c565b8260008151811061229a5761229a613dc1565b6020026020010151836001815181106122b5576122b5613dc1565b6020026020010151846002815181106122d0576122d0613dc1565b6020026020010151856003815181106122eb576122eb613dc1565b6020026020010151985098509850985050505050505b945094509450949050565b600080600080600061231c612b4b565b905061232881876133c0565b929a91995097509095509350505050565b6004546000906d0100000000000000000000000000900463ffffffff1681036123625750600090565b60008060009054906101000a90046001600160a01b03166001600160a01b0316631a5057be6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123da9190613c19565b90506000816001600160a01b03166350f73e7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190613e27565b6004549091506d0100000000000000000000000000900463ffffffff166124678243613d43565b119250505090565b612477612cdb565b600554600160a81b900461ffff166001146124c65760405162461bcd60e51b815260206004820152600f60248201526e4e4545445f544f5f4d49475241544560881b6044820152606401610b1c565b61ffff82161561250a5781600560198282829054906101000a900461ffff166124ef9190613d78565b92506101000a81548161ffff021916908361ffff1602179055505b61ffff811615610c115780600560198282829054906101000a900461ffff16610ec89190613d93565b6007818154811061254357600080fd5b600091825260209091200154905081565b60006004546c01000000000000000000000000900460ff16600981111561257d5761257d613bdb565b146125ca5760405162461bcd60e51b815260206004820152601360248201527f414c52454144595f494e495449414c495a4544000000000000000000000000006044820152606401610b1c565b6000546001600160a01b0316156126235760405162461bcd60e51b815260206004820152601360248201527f414c52454144595f494e495449414c495a4544000000000000000000000000006044820152606401610b1c565b6001600160a01b0381166126795760405162461bcd60e51b815260206004820152600f60248201527f4e4f5f5a45524f5f4144445245535300000000000000000000000000000000006044820152606401610b1c565b600080546001600160a01b039092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179055600580547fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff16600160a81b179055565b6126ea612cdb565b600080546040516001600160a01b039091169061177090849084818181858888f193505050503d806000811461273c576040519150601f19603f3d011682016040523d82523d6000602084013e612741565b606091505b5050905080610c115760405162461bcd60e51b815260206004820152600f60248201527f4554485f53454e445f4641494c454400000000000000000000000000000000006044820152606401610b1c565b600554600160a01b900460ff166127a557565b600560009054906101000a90046001600160a01b03166001600160a01b031663baa7145a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156127f557600080fd5b505af1158015612809573d6000803e3d6000fd5b50505050565b60008263ffffffff1660000361282757506000610dbe565b60008060009054906101000a90046001600160a01b03166001600160a01b031663bbe78ecd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561287b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289f9190613e40565b67ffffffffffffffff16905060008060009054906101000a90046001600160a01b03166001600160a01b0316637082994b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129239190613e40565b905060006129318686610dc4565b905061016d8111156129585750506fffffffffffffffffffffffffffffffff169050610dbe565b6fffffffffffffffffffffffffffffffff83165b81156129e157600061297f600784612d35565b905061298d81612710613f41565b816129a467ffffffffffffffff8716612710613d43565b6129ae9190613f41565b6129b89084613f4d565b6129c29190613d56565b91506129cf600784612d35565b6129d99084613d43565b92505061296c565b6129fd816fffffffffffffffffffffffffffffffff8616613d43565b979650505050505050565b612a10612cdb565b600554600160a81b900461ffff16600003610c1157600480547fffffffffffffffffffffffffffffffffffffff00000000000000000000000000169055612a5960036000613626565b600580547fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff16600160a81b1790558115610c115760055477010000000000000000000000000000000000000000000000900461ffff1615612afc5760405162461bcd60e51b815260206004820152601360248201527f414c52454144595f494e495449414c495a4544000000000000000000000000006044820152606401610b1c565b612b07826000610ac9565b612b1360016000611bdf565b602081015163ffffffff1615612b2f57612b2f6001600061246f565b604081015163ffffffff1615610c1157610c1160016000610e04565b60055460009047908290600160a01b900460ff1615612cca5760008060009054906101000a90046001600160a01b03166001600160a01b0316631a5057be6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bdc9190613c19565b6040517f1f39d87f0000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b03831690631f39d87f90602401600060405180830381865afa158015612c3f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c679190810190613c36565b905060005b8151811015612cc657818181518110612c8757612c87613dc1565b6020026020010151600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1684612cbc9190613dae565b9350600101612c6c565b5050505b612cd48183613dae565b9250505090565b6000546001600160a01b031633146117925760405162461bcd60e51b815260206004820152601060248201527f494e434f52524543545f43414c4c4552000000000000000000000000000000006044820152606401610b1c565b6000818310612d445781610efa565b5090919050565b6060610efa838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c656400008152506134a6565b60008067de0b6b3a764000008310158015612db357506801bc16d674ec8000008311155b612dff5760405162461bcd60e51b815260206004820152601a60248201527f494e434f52524543545f5052494e434950414c5f414d4f554e540000000000006044820152606401610b1c565b60006801ae361fc1451c0000841015612e2057670de0b6b3a7640000612e33565b612e336801a055690d9db8000085613d43565b90506000612e418286613d43565b91959194509092505050565b6000806000806000612e678a602001518b6040015161280f565b90506000612e758883612d35565b90506000612e8b826702c68af0bb140000612d35565b9050612e97818c613dae565b9a50612ea38183613d43565b612ead9089613dae565b9750612eb9828a613d43565b9a9c999b509698975050505050505050565b60208101517fffffffff0000000000000000000000000000000000000000000000000000000081167fe2c834450000000000000000000000000000000000000000000000000000000003612fca57602482511015612f6b5760405162461bcd60e51b815260206004820152601360248201527f494e56414c49445f444154415f4c454e475448000000000000000000000000006044820152606401610b1c565b60248201516001600160a01b0381163014612fc85760405162461bcd60e51b815260206004820152601360248201527f494e434f52524543545f524543495049454e54000000000000000000000000006044820152606401610b1c565b505b7fffffffff0000000000000000000000000000000000000000000000000000000081167fdda3346c0000000000000000000000000000000000000000000000000000000003610c115760405162461bcd60e51b815260206004820152600b60248201527f4e4f545f414c4c4f5745440000000000000000000000000000000000000000006044820152606401610b1c565b600080600061306861117f565b90508060000361307f5760008092509250506133b8565b6000846130935761308e611af6565b61309b565b61309b612b4b565b6005549091506130be90600160d81b900461ffff1667de0b6b3a76400000613f64565b67ffffffffffffffff168110156131175760405162461bcd60e51b815260206004820152601460248201527f494e53554646494349454e545f42414c414e43450000000000000000000000006044820152606401610b1c565b6005546000906131819061313e90600160d81b900461ffff1667de0b6b3a76400000613f64565b6131529067ffffffffffffffff1684613d43565b60055461317290600160d81b900461ffff1667de0b6b3a76400000613f64565b67ffffffffffffffff16612d35565b6005546131a190600160d81b900461ffff1667de0b6b3a76400000613f64565b67ffffffffffffffff166131b59190613dae565b90506000836131c48385613d43565b6131ce9190613d56565b905060006801bc16d674ec80000089116131e95760006131fc565b6131fc6801bc16d674ec8000008a613d43565b90506132088183613dae565b965060038a600981111561321e5761321e613bdb565b036132b65760055461323b90600160d81b900461ffff1684613d56565b955088156132b15760405162461bcd60e51b815260206004820152603660248201527f4578697465642076616c696461746f72206d7573742068617665207a65726f2060448201527f62616c616e61636520696e2074686520626561636f6e000000000000000000006064820152608401610b1c565b613345565b60028a60098111156132ca576132ca613bdb565b14806132e7575060068a60098111156132e5576132e5613bdb565b145b156132fd576132f6818a613d43565b9550613345565b60405162461bcd60e51b815260206004820152600d60248201527f494e56414c49445f5048415345000000000000000000000000000000000000006044820152606401610b1c565b6801bc16d674ec8000008611158015613366575067de0b6b3a764000008610155b6133b25760405162461bcd60e51b815260206004820152601060248201527f494e434f52524543545f414d4f554e54000000000000000000000000000000006044820152606401610b1c565b50505050505b935093915050565b600080600080600085606001518660400151876020015188600001516133e69190613f90565b6133f09190613f90565b6133fa9190613f90565b67ffffffffffffffff16905080866020015167ffffffffffffffff16886134219190613f4d565b61342b9190613d56565b945080866040015167ffffffffffffffff16886134489190613f4d565b6134529190613d56565b935080866060015167ffffffffffffffff168861346f9190613f4d565b6134799190613d56565b9250846134868585613dae565b6134909190613dae565b61349a9088613d43565b91505092959194509250565b60608247101561351e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b1c565b600080866001600160a01b0316858760405161353a9190613fb1565b60006040518083038185875af1925050503d8060008114613577576040519150601f19603f3d011682016040523d82523d6000602084013e61357c565b606091505b50915091506129fd87838387606083156135f75782516000036135f0576001600160a01b0385163b6135f05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b1c565b5081610dfc565b610dfc838381511561360c5781518083602001fd5b8060405162461bcd60e51b8152600401610b1c9190613910565b50805461363290613dd7565b6000825580601f10613642575050565b601f0160209004906000526020600020908101906136609190613663565b50565b5b808211156136785760008155600101613664565b5090565b80358015158114611b4c57600080fd5b6000806040838503121561369f57600080fd5b823591506136af6020840161367c565b90509250929050565b63ffffffff8116811461366057600080fd5b600080604083850312156136dd57600080fd5b82356136e8816136b8565b915060208301356136f8816136b8565b809150509250929050565b803561ffff81168114611b4c57600080fd5b6000806040838503121561372857600080fd5b61373183613703565b91506136af60208401613703565b60006020828403121561375157600080fd5b5035919050565b6001600160a01b038116811461366057600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156137a6576137a661376d565b60405290565b6040805190810167ffffffffffffffff811182821017156137a6576137a661376d565b604051601f8201601f1916810167ffffffffffffffff811182821017156137f8576137f861376d565b604052919050565b600082601f83011261381157600080fd5b813567ffffffffffffffff81111561382b5761382b61376d565b61383e6020601f19601f840116016137cf565b81815284602083860101111561385357600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561388357600080fd5b823561388e81613758565b9150602083013567ffffffffffffffff8111156138aa57600080fd5b6138b685828601613800565b9150509250929050565b60005b838110156138db5781810151838201526020016138c3565b50506000910152565b600081518084526138fc8160208601602086016138c0565b601f01601f19169290920160200192915050565b602081526000610efa60208301846138e4565b600080600080600080600080610100898b03121561394057600080fd5b883561394b81613758565b975060208901359650604089013561396281613758565b955060608901359450608089013561397981613758565b935060a0890135925060c089013561399081613758565b8092505060e089013590509295985092959890939650565b8035600a8110611b4c57600080fd5b600080604083850312156139ca57600080fd5b6139d3836139a8565b91506136af602084016139a8565b6000608082840312156139f357600080fd5b6139fb613783565b90508135613a08816136b8565b81526020820135613a18816136b8565b60208201526040820135613a2b816136b8565b6040820152613a3c606083016139a8565b606082015292915050565b67ffffffffffffffff8116811461366057600080fd5b600060808284031215613a6f57600080fd5b613a77613783565b90508135613a8481613a47565b81526020820135613a9481613a47565b60208201526040820135613aa781613a47565b60408201526060820135613a3c81613a47565b6000806101008385031215613ace57600080fd5b613ad884846139e1565b91506136af8460808501613a5d565b600060208284031215613af957600080fd5b813567ffffffffffffffff811115613b1057600080fd5b610dfc84828501613800565b60008060a08385031215613b2f57600080fd5b823591506136af84602085016139e1565b6000806000806101408587031215613b5757600080fd5b84359350613b6886602087016139e1565b9250613b778660a08701613a5d565b9150613b86610120860161367c565b905092959194509250565b60008060a08385031215613ba457600080fd5b8235613baf816136b8565b91506136af8460208501613a5d565b600060208284031215613bd057600080fd5b8135610efa81613758565b634e487b7160e01b600052602160045260246000fd5b60208101600a8310613c1357634e487b7160e01b600052602160045260246000fd5b91905290565b600060208284031215613c2b57600080fd5b8151610efa81613758565b60006020808385031215613c4957600080fd5b825167ffffffffffffffff80821115613c6157600080fd5b818501915085601f830112613c7557600080fd5b815181811115613c8757613c8761376d565b613c95848260051b016137cf565b818152848101925060069190911b830184019087821115613cb557600080fd5b928401925b818410156129fd5760408489031215613cd35760008081fd5b613cdb6137ac565b84517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114613d085760008081fd5b815284860151613d17816136b8565b8187015283526040939093019291840191613cba565b634e487b7160e01b600052601160045260246000fd5b81810381811115610dbe57610dbe613d2d565b600082613d7357634e487b7160e01b600052601260045260246000fd5b500490565b61ffff818116838216019080821115610dbc57610dbc613d2d565b61ffff828116828216039080821115610dbc57610dbc613d2d565b80820180821115610dbe57610dbe613d2d565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680613deb57607f821691505b602082108103613e0b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215613e3957600080fd5b5051919050565b600060208284031215613e5257600080fd5b8151610efa81613a47565b600181815b80851115613e98578160001904821115613e7e57613e7e613d2d565b80851615613e8b57918102915b93841c9390800290613e62565b509250929050565b600082613eaf57506001610dbe565b81613ebc57506000610dbe565b8160018114613ed25760028114613edc57613ef8565b6001915050610dbe565b60ff841115613eed57613eed613d2d565b50506001821b610dbe565b5060208310610133831016604e8410600b8410161715613f1b575081810a610dbe565b613f258383613e5d565b8060001904821115613f3957613f39613d2d565b029392505050565b6000610efa8383613ea0565b8082028115828204841417610dbe57610dbe613d2d565b67ffffffffffffffff818116838216028082169190828114613f8857613f88613d2d565b505092915050565b67ffffffffffffffff818116838216019080821115610dbc57610dbc613d2d565b60008251613fc38184602087016138c0565b919091019291505056fea2646970667358221220162de275031c8b45b364d6665d4ac5c3b36cd862dabea93ba704f1e78505244d64736f6c63430008180033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.