{"constructor_args":null,"is_partially_verified":true,"is_changed_bytecode":false,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"AmbiguousFee","type":"error"},{"inputs":[],"name":"InconsistentData","type":"error"},{"inputs":[{"internalType":"uint256","name":"capacity","type":"uint256"}],"name":"InsufficientCapacity","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"OnlyGovernanceAllowed","type":"error"},{"inputs":[],"name":"OnlyOperatorAllowed","type":"error"},{"inputs":[],"name":"OnlyRestakingPoolAllowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"param","type":"uint256"}],"name":"ParameterExceedsLimits","type":"error"},{"inputs":[{"internalType":"uint64","name":"max","type":"uint64"}],"name":"PoolDistributeGasLimitNotInRange","type":"error"},{"inputs":[],"name":"PoolFailedInnerCall","type":"error"},{"inputs":[],"name":"PoolInsufficientBalance","type":"error"},{"inputs":[],"name":"PoolRestakerExists","type":"error"},{"inputs":[],"name":"PoolRestakerNotExists","type":"error"},{"inputs":[],"name":"PoolStakeAmGreaterThanAvailable","type":"error"},{"inputs":[],"name":"PoolStakeAmLessThanMin","type":"error"},{"inputs":[],"name":"PoolUnstakeAmLessThanMin","type":"error"},{"inputs":[],"name":"PoolWrongInputLength","type":"error"},{"inputs":[],"name":"PoolZeroAddress","type":"error"},{"inputs":[],"name":"PoolZeroAmount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"TargetCapacityNotSet","type":"error"},{"inputs":[],"name":"TimelineNotOver","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimer","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"ClaimExpected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"provider","type":"string"},{"indexed":false,"internalType":"bytes[]","name":"pubkeys","type":"bytes[]"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"prevValue","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"newValue","type":"uint32"}],"name":"DistributeGasLimitChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"restaker","type":"address"},{"indexed":true,"internalType":"address","name":"treasury","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalClaimed","type":"uint256"}],"name":"FeeClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"FlashUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prevValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"MaxTVLChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prevValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"MinStakeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prevValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"MinUnstakeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ownerAddress","type":"address"},{"indexed":true,"internalType":"address","name":"receiverAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PendingUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prevValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"ProtocolFeeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Received","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"code","type":"bytes32"}],"name":"ReferralStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"provider","type":"string"},{"indexed":false,"internalType":"address","name":"restaker","type":"address"}],"name":"RestakerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTimeline","type":"uint256"}],"name":"RewardsAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardsTimeline","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTimelineInSeconds","type":"uint256"}],"name":"RewardsTimelineChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StakeBonus","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxBonusRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newOptimalBonusRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDepositUtilizationKink","type":"uint256"}],"name":"StakeBonusParamsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prevValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"TargetCapacityChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimer","type":"address"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"UnstakeClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxFlashFeeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newOptimalWithdrawalRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newWithdrawUtilizationKink","type":"uint256"}],"name":"UnstakeFeeParamsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Unstaked","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct IRestakingPool.Unstake[]","name":"unstakes","type":"tuple[]"}],"name":"UnstakesDistributed","type":"event"},{"inputs":[],"name":"CALL_GAS_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PERCENT","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"}],"name":"addRestaker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"addRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"availableToStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"internalType":"bytes[]","name":"pubkeys","type":"bytes[]"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"},{"internalType":"bytes32[]","name":"deposit_data_roots","type":"bytes32[]"}],"name":"batchDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateFlashUnstakeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateStakeBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"claimRestaker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"claimer","type":"address"}],"name":"claimUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"claimer","type":"address"}],"name":"claimableOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"components":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"address","name":"delegatedTo","type":"address"},{"internalType":"address","name":"withdrawer","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint32","name":"startBlock","type":"uint32"},{"internalType":"contract IStrategy[]","name":"strategies","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"}],"internalType":"struct IDelegationManager.Withdrawal[]","name":"withdrawals","type":"tuple[]"},{"internalType":"contract IERC20[][]","name":"tokens","type":"address[][]"},{"internalType":"uint256[]","name":"middlewareTimesIndexes","type":"uint256[]"},{"internalType":"bool[]","name":"receiveAsTokens","type":"bool[]"}],"name":"completeWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"contract IProtocolConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"internalType":"address","name":"elOperator","type":"address"},{"components":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"internalType":"struct ISignatureUtils.SignatureWithExpiry","name":"approverSignatureAndExpiry","type":"tuple"},{"internalType":"bytes32","name":"approverSalt","type":"bytes32"}],"name":"delegateTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributeUnstakes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"flashUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFlashCapacity","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFreeBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinStake","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinUnstake","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPending","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"}],"name":"getRestaker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalPendingUnstakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"getTotalUnstakesOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUnstakes","outputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IRestakingPool.Unstake[]","name":"unstakes","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"getUnstakesOf","outputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IRestakingPool.Unstake[]","name":"unstakes","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"claimer","type":"address"}],"name":"hasClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IProtocolConfig","name":"config","type":"address"},{"internalType":"uint32","name":"distributeGasLimit","type":"uint32"},{"internalType":"uint256","name":"newMaxTVL","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxBonusRate","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxFlashFeeRate","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTVL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"optimalBonusRate","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"optimalUnstakeRate","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"components":[{"internalType":"contract IStrategy[]","name":"strategies","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"address","name":"withdrawer","type":"address"}],"internalType":"struct IDelegationManager.QueuedWithdrawalParams[]","name":"withdrawals","type":"tuple[]"}],"name":"queueWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"internalType":"contract IERC20[]","name":"tokenList","type":"address[]"},{"internalType":"uint256[]","name":"amountsToWithdraw","type":"uint256[]"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsTimeline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"newValue","type":"uint32"}],"name":"setDistributeGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"newMaxFlashFeeRate","type":"uint64"},{"internalType":"uint64","name":"newOptimalUnstakeRate","type":"uint64"},{"internalType":"uint64","name":"newUnstakeUtilizationKink","type":"uint64"}],"name":"setFlashUnstakeFeeParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setMaxTVL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setMinStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setMinUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"newProtocolFee","type":"uint64"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"internalType":"address","name":"newCoordinator","type":"address"},{"internalType":"address","name":"claimer","type":"address"}],"name":"setRewardsCoordinator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTimelineInSeconds","type":"uint256"}],"name":"setRewardsTimeline","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"newMaxBonusRate","type":"uint64"},{"internalType":"uint64","name":"newOptimalBonusRate","type":"uint64"},{"internalType":"uint64","name":"newStakeUtilizationKink","type":"uint64"}],"name":"setStakeBonusParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"newTargetCapacity","type":"uint64"}],"name":"setTargetFlashCapacity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"code","type":"bytes32"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"stakeBonusAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakeUtilizationKink","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimeline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"internalType":"bool","name":"revertIfNoBalance","type":"bool"}],"name":"startWithdrawalCheckpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"targetCapacity","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"}],"name":"undelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstakeUtilizationKink","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"provider","type":"string"},{"internalType":"uint64","name":"oracleTimestamp","type":"uint64"},{"components":[{"internalType":"bytes32","name":"beaconStateRoot","type":"bytes32"},{"internalType":"bytes","name":"proof","type":"bytes"}],"internalType":"struct BeaconChainProofs.StateRootProof","name":"stateRootProof","type":"tuple"},{"internalType":"uint40[]","name":"validatorIndices","type":"uint40[]"},{"internalType":"bytes[]","name":"validatorFieldsProofs","type":"bytes[]"},{"internalType":"bytes32[][]","name":"validatorFields","type":"bytes32[][]"}],"name":"verifyWithdrawalCredentials","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}],"conflicting_implementations":null,"certified":false,"additional_sources":[{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard\n    struct ReentrancyGuardStorage {\n        uint256 _status;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ReentrancyGuard\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;\n\n    function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {\n        assembly {\n            $.slot := ReentrancyGuardStorageLocation\n        }\n    }\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    function __ReentrancyGuard_init() internal onlyInitializing {\n        __ReentrancyGuard_init_unchained();\n    }\n\n    function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        if ($._status == ENTERED) {\n            revert ReentrancyGuardReentrantCall();\n        }\n\n        // Any calls to nonReentrant after this point will fail\n        $._status = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        return $._status == ENTERED;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/proxy/beacon/IBeacon.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"},{"file_path":"contracts/Configurable.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\";\nimport \"./interfaces/IProtocolConfig.sol\";\n\n/**\n * @title Basic layout with common variables and modifiers from config\n * @author InceptionLRT V2\n */\nabstract contract Configurable is Initializable, ContextUpgradeable {\n    error OnlyGovernanceAllowed();\n    error OnlyOperatorAllowed();\n    error OnlyRestakingPoolAllowed();\n\n    IProtocolConfig private _config;\n    uint256[50 - 1] private __reserved;\n\n    modifier onlyGovernance() virtual {\n        if (_msgSender() != _config.getGovernance()) {\n            revert OnlyGovernanceAllowed();\n        }\n        _;\n    }\n\n    modifier onlyOperator() virtual {\n        if (_msgSender() != _config.getOperator()) {\n            revert OnlyOperatorAllowed();\n        }\n        _;\n    }\n\n    modifier onlyRestakingPool() virtual {\n        if (_msgSender() != address(_config.getRestakingPool())) {\n            revert OnlyRestakingPoolAllowed();\n        }\n        _;\n    }\n\n    function __Configurable_init(\n        IProtocolConfig config_\n    ) internal onlyInitializing {\n        _config = config_;\n    }\n\n    function config() public view virtual returns (IProtocolConfig) {\n        return _config;\n    }\n}\n"},{"file_path":"contracts/interfaces/IBeaconChainOracle.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\n/**\n * @title Interface for the BeaconStateOracle contract.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n */\ninterface IBeaconChainOracle {\n    /// @notice The block number to state root mapping.\n    function timestampToBlockRoot(\n        uint256 timestamp\n    ) external view returns (bytes32);\n}\n"},{"file_path":"contracts/interfaces/ICToken.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @dev Interface of the cToken.\n */\ninterface ICToken is IERC20 {\n    /* errors */\n\n    /* functions */\n\n    function convertToShares(\n        uint256 amount\n    ) external view returns (uint256 shares);\n\n    function convertToAmount(\n        uint256 shares\n    ) external view returns (uint256 amount);\n\n    function mint(address account, uint256 amount) external;\n\n    function burn(address account, uint256 amount) external;\n\n    function ratio() external view returns (uint256);\n\n    function totalAssets() external view returns (uint256 totalManagedEth);\n}\n"},{"file_path":"contracts/interfaces/IDelegationManager.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IStrategy.sol\";\nimport \"./ISignatureUtils.sol\";\n\n/**\n * @title DelegationManager\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice  This is the contract for delegation in EigenLayer. The main functionalities of this contract are\n * - enabling anyone to register as an operator in EigenLayer\n * - allowing operators to specify parameters related to stakers who delegate to them\n * - 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)\n * - 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)\n */\ninterface IDelegationManager is ISignatureUtils {\n    // @notice Struct used for storing information about a single operator who has registered with EigenLayer\n    struct OperatorDetails {\n        /// @notice DEPRECATED -- this field is no longer used, payments are handled in PaymentCoordinator.sol\n        address __deprecated_earningsReceiver;\n        /**\n         * @notice Address to verify signatures when a staker wishes to delegate to the operator, as well as controlling \"forced undelegations\".\n         * @dev Signature verification follows these rules:\n         * 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.\n         * 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.\n         * 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\".\n         */\n        address delegationApprover;\n        /**\n         * @notice A minimum delay -- measured in blocks -- enforced between:\n         * 1) the operator signalling their intent to register for a service, via calling `Slasher.optIntoSlashing`\n         * and\n         * 2) the operator completing registration for the service, via the service ultimately calling `Slasher.recordFirstStakeUpdate`\n         * @dev note that for a specific operator, this value *cannot decrease*, i.e. if the operator wishes to modify their OperatorDetails,\n         * then they are only allowed to either increase this value or keep it the same.\n         */\n        uint32 stakerOptOutWindowBlocks;\n    }\n\n    /**\n     * @notice Abstract struct used in calculating an EIP712 signature for a staker to approve that they (the staker themselves) delegate to a specific operator.\n     * @dev Used in computing the `STAKER_DELEGATION_TYPEHASH` and as a reference in the computation of the stakerDigestHash in the `delegateToBySignature` function.\n     */\n    struct StakerDelegation {\n        // the staker who is delegating\n        address staker;\n        // the operator being delegated to\n        address operator;\n        // the staker's nonce\n        uint256 nonce;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n\n    /**\n     * @notice Abstract struct used in calculating an EIP712 signature for an operator's delegationApprover to approve that a specific staker delegate to the operator.\n     * @dev Used in computing the `DELEGATION_APPROVAL_TYPEHASH` and as a reference in the computation of the approverDigestHash in the `_delegate` function.\n     */\n    struct DelegationApproval {\n        // the staker who is delegating\n        address staker;\n        // the operator being delegated to\n        address operator;\n        // the operator's provided salt\n        bytes32 salt;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n\n    /**\n     * Struct type used to specify an existing queued withdrawal. Rather than storing the entire struct, only a hash is stored.\n     * In functions that operate on existing queued withdrawals -- e.g. completeQueuedWithdrawal`, the data is resubmitted and the hash of the submitted\n     * data is computed by `calculateWithdrawalRoot` and checked against the stored hash in order to confirm the integrity of the submitted data.\n     */\n    struct Withdrawal {\n        // The address that originated the Withdrawal\n        address staker;\n        // The address that the staker was delegated to at the time that the Withdrawal was created\n        address delegatedTo;\n        // The address that can complete the Withdrawal + will receive funds when completing the withdrawal\n        address withdrawer;\n        // Nonce used to guarantee that otherwise identical withdrawals have unique hashes\n        uint256 nonce;\n        // Block number when the Withdrawal was created\n        uint32 startBlock;\n        // Array of strategies that the Withdrawal contains\n        IStrategy[] strategies;\n        // Array containing the amount of shares in each Strategy in the `strategies` array\n        uint256[] shares;\n    }\n\n    struct QueuedWithdrawalParams {\n        // Array of strategies that the QueuedWithdrawal contains\n        IStrategy[] strategies;\n        // Array containing the amount of shares in each Strategy in the `strategies` array\n        uint256[] shares;\n        // The address of the withdrawer\n        address withdrawer;\n    }\n\n    // @notice Emitted when a new operator registers in EigenLayer and provides their OperatorDetails.\n    event OperatorRegistered(address indexed operator, OperatorDetails operatorDetails);\n\n    /// @notice Emitted when an operator updates their OperatorDetails to @param newOperatorDetails\n    event OperatorDetailsModified(address indexed operator, OperatorDetails newOperatorDetails);\n\n    /**\n     * @notice Emitted when @param operator indicates that they are updating their MetadataURI string\n     * @dev Note that these strings are *never stored in storage* and are instead purely emitted in events for off-chain indexing\n     */\n    event OperatorMetadataURIUpdated(address indexed operator, string metadataURI);\n\n    /// @notice Emitted whenever an operator's shares are increased for a given strategy. Note that shares is the delta in the operator's shares.\n    event OperatorSharesIncreased(address indexed operator, address staker, IStrategy strategy, uint256 shares);\n\n    /// @notice Emitted whenever an operator's shares are decreased for a given strategy. Note that shares is the delta in the operator's shares.\n    event OperatorSharesDecreased(address indexed operator, address staker, IStrategy strategy, uint256 shares);\n\n    /// @notice Emitted when @param staker delegates to @param operator.\n    event StakerDelegated(address indexed staker, address indexed operator);\n\n    /// @notice Emitted when @param staker undelegates from @param operator.\n    event StakerUndelegated(address indexed staker, address indexed operator);\n\n    /// @notice Emitted when @param staker is undelegated via a call not originating from the staker themself\n    event StakerForceUndelegated(address indexed staker, address indexed operator);\n\n    /**\n     * @notice Emitted when a new withdrawal is queued.\n     * @param withdrawalRoot Is the hash of the `withdrawal`.\n     * @param withdrawal Is the withdrawal itself.\n     */\n    event WithdrawalQueued(bytes32 withdrawalRoot, Withdrawal withdrawal);\n\n    /// @notice Emitted when a queued withdrawal is completed\n    event WithdrawalCompleted(bytes32 withdrawalRoot);\n\n    /// @notice Emitted when the `minWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`.\n    event MinWithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue);\n\n    /// @notice Emitted when the `strategyWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`.\n    event StrategyWithdrawalDelayBlocksSet(IStrategy strategy, uint256 previousValue, uint256 newValue);\n\n    /**\n     * @notice Registers the caller as an operator in EigenLayer.\n     * @param registeringOperatorDetails is the `OperatorDetails` for the operator.\n     * @param metadataURI is a URI for the operator's metadata, i.e. a link providing more details on the operator.\n     *\n     * @dev Once an operator is registered, they cannot 'deregister' as an operator, and they will forever be considered \"delegated to themself\".\n     * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `OperatorMetadataURIUpdated` event\n     */\n    function registerAsOperator(\n        OperatorDetails calldata registeringOperatorDetails,\n        string calldata metadataURI\n    ) external;\n\n    /**\n     * @notice Updates an operator's stored `OperatorDetails`.\n     * @param newOperatorDetails is the updated `OperatorDetails` for the operator, to replace their current OperatorDetails`.\n     *\n     * @dev The caller must have previously registered as an operator in EigenLayer.\n     */\n    function modifyOperatorDetails(OperatorDetails calldata newOperatorDetails) external;\n\n    /**\n     * @notice Called by an operator to emit an `OperatorMetadataURIUpdated` event indicating the information has updated.\n     * @param metadataURI The URI for metadata associated with an operator\n     * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `OperatorMetadataURIUpdated` event\n     */\n    function updateOperatorMetadataURI(string calldata metadataURI) external;\n\n    /**\n     * @notice Caller delegates their stake to an operator.\n     * @param operator The account (`msg.sender`) is delegating its assets to for use in serving applications built on EigenLayer.\n     * @param approverSignatureAndExpiry Verifies the operator approves of this delegation\n     * @param approverSalt A unique single use value tied to an individual signature.\n     * @dev The approverSignatureAndExpiry is used in the event that:\n     *          1) the operator's `delegationApprover` address is set to a non-zero value.\n     *                  AND\n     *          2) neither the operator nor their `delegationApprover` is the `msg.sender`, since in the event that the operator\n     *             or their delegationApprover is the `msg.sender`, then approval is assumed.\n     * @dev In the event that `approverSignatureAndExpiry` is not checked, its content is ignored entirely; it's recommended to use an empty input\n     * in this case to save on complexity + gas costs\n     */\n    function delegateTo(\n        address operator,\n        SignatureWithExpiry memory approverSignatureAndExpiry,\n        bytes32 approverSalt\n    ) external;\n\n    /**\n     * @notice Caller delegates a staker's stake to an operator with valid signatures from both parties.\n     * @param staker The account delegating stake to an `operator` account\n     * @param operator The account (`staker`) is delegating its assets to for use in serving applications built on EigenLayer.\n     * @param stakerSignatureAndExpiry Signed data from the staker authorizing delegating stake to an operator\n     * @param approverSignatureAndExpiry is a parameter that will be used for verifying that the operator approves of this delegation action in the event that:\n     * @param approverSalt Is a salt used to help guarantee signature uniqueness. Each salt can only be used once by a given approver.\n     *\n     * @dev If `staker` is an EOA, then `stakerSignature` is verified to be a valid ECDSA stakerSignature from `staker`, indicating their intention for this action.\n     * @dev If `staker` is a contract, then `stakerSignature` will be checked according to EIP-1271.\n     * @dev the operator's `delegationApprover` address is set to a non-zero value.\n     * @dev neither the operator nor their `delegationApprover` is the `msg.sender`, since in the event that the operator or their delegationApprover\n     * is the `msg.sender`, then approval is assumed.\n     * @dev This function will revert if the current `block.timestamp` is equal to or exceeds the expiry\n     * @dev In the case that `approverSignatureAndExpiry` is not checked, its content is ignored entirely; it's recommended to use an empty input\n     * in this case to save on complexity + gas costs\n     */\n    function delegateToBySignature(\n        address staker,\n        address operator,\n        SignatureWithExpiry memory stakerSignatureAndExpiry,\n        SignatureWithExpiry memory approverSignatureAndExpiry,\n        bytes32 approverSalt\n    ) external;\n\n    /**\n     * @notice Undelegates the staker from the operator who they are delegated to. Puts the staker into the \"undelegation limbo\" mode of the EigenPodManager\n     * and queues a withdrawal of all of the staker's shares in the StrategyManager (to the staker), if necessary.\n     * @param staker The account to be undelegated.\n     * @return withdrawalRoot The root of the newly queued withdrawal, if a withdrawal was queued. Otherwise just bytes32(0).\n     *\n     * @dev Reverts if the `staker` is also an operator, since operators are not allowed to undelegate from themselves.\n     * @dev Reverts if the caller is not the staker, nor the operator who the staker is delegated to, nor the operator's specified \"delegationApprover\"\n     * @dev Reverts if the `staker` is already undelegated.\n     */\n    function undelegate(address staker) external returns (bytes32[] memory withdrawalRoot);\n\n    /**\n     * Allows a staker to withdraw some shares. Withdrawn shares/strategies are immediately removed\n     * from the staker. If the staker is delegated, withdrawn shares/strategies are also removed from\n     * their operator.\n     *\n     * All withdrawn shares/strategies are placed in a queue and can be fully withdrawn after a delay.\n     */\n    function queueWithdrawals(QueuedWithdrawalParams[] calldata queuedWithdrawalParams)\n        external\n        returns (bytes32[] memory);\n\n    /**\n     * @notice Used to complete the specified `withdrawal`. The caller must match `withdrawal.withdrawer`\n     * @param withdrawal The Withdrawal to complete.\n     * @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.\n     * This input can be provided with zero length if `receiveAsTokens` is set to 'false' (since in that case, this input will be unused)\n     * @param middlewareTimesIndex is the index in the operator that the staker who triggered the withdrawal was delegated to's middleware times array\n     * @param receiveAsTokens If true, the shares specified in the withdrawal will be withdrawn from the specified strategies themselves\n     * and sent to the caller, through calls to `withdrawal.strategies[i].withdraw`. If false, then the shares in the specified strategies\n     * will simply be transferred to the caller directly.\n     * @dev middlewareTimesIndex should be calculated off chain before calling this function by finding the first index that satisfies `slasher.canWithdraw`\n     * @dev beaconChainETHStrategy shares are non-transferrable, so if `receiveAsTokens = false` and `withdrawal.withdrawer != withdrawal.staker`, note that\n     * any beaconChainETHStrategy shares in the `withdrawal` will be _returned to the staker_, rather than transferred to the withdrawer, unlike shares in\n     * any other strategies, which will be transferred to the withdrawer.\n     */\n    function completeQueuedWithdrawal(\n        Withdrawal calldata withdrawal,\n        IERC20[] calldata tokens,\n        uint256 middlewareTimesIndex,\n        bool receiveAsTokens\n    ) external;\n\n    /**\n     * @notice Array-ified version of `completeQueuedWithdrawal`.\n     * Used to complete the specified `withdrawals`. The function caller must match `withdrawals[...].withdrawer`\n     * @param withdrawals The Withdrawals to complete.\n     * @param tokens Array of tokens for each Withdrawal. See `completeQueuedWithdrawal` for the usage of a single array.\n     * @param middlewareTimesIndexes One index to reference per Withdrawal. See `completeQueuedWithdrawal` for the usage of a single index.\n     * @param receiveAsTokens Whether or not to complete each withdrawal as tokens. See `completeQueuedWithdrawal` for the usage of a single boolean.\n     * @dev See `completeQueuedWithdrawal` for relevant dev tags\n     */\n    function completeQueuedWithdrawals(\n        Withdrawal[] calldata withdrawals,\n        IERC20[][] calldata tokens,\n        uint256[] calldata middlewareTimesIndexes,\n        bool[] calldata receiveAsTokens\n    ) external;\n\n    /**\n     * @notice Increases a staker's delegated share balance in a strategy.\n     * @param staker The address to increase the delegated shares for their operator.\n     * @param strategy The strategy in which to increase the delegated shares.\n     * @param shares The number of shares to increase.\n     *\n     * @dev *If the staker is actively delegated*, then increases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing.\n     * @dev Callable only by the StrategyManager or EigenPodManager.\n     */\n    function increaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external;\n\n    /**\n     * @notice Decreases a staker's delegated share balance in a strategy.\n     * @param staker The address to increase the delegated shares for their operator.\n     * @param strategy The strategy in which to decrease the delegated shares.\n     * @param shares The number of shares to decrease.\n     *\n     * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing.\n     * @dev Callable only by the StrategyManager or EigenPodManager.\n     */\n    function decreaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external;\n\n    /**\n     * @notice returns the address of the operator that `staker` is delegated to.\n     * @notice Mapping: staker => operator whom the staker is currently delegated to.\n     * @dev Note that returning address(0) indicates that the staker is not actively delegated to any operator.\n     */\n    function delegatedTo(address staker) external view returns (address);\n\n    /**\n     * @notice Returns the OperatorDetails struct associated with an `operator`.\n     */\n    function operatorDetails(address operator) external view returns (OperatorDetails memory);\n\n    /**\n     * @notice Returns the delegationApprover account for an operator\n     */\n    function delegationApprover(address operator) external view returns (address);\n\n    /**\n     * @notice Returns the stakerOptOutWindowBlocks for an operator\n     */\n    function stakerOptOutWindowBlocks(address operator) external view returns (uint256);\n\n    /**\n     * @notice Given array of strategies, returns array of shares for the operator\n     */\n    function getOperatorShares(\n        address operator,\n        IStrategy[] memory strategies\n    ) external view returns (uint256[] memory);\n\n    /**\n     * @notice Given a list of strategies, return the minimum number of blocks that must pass to withdraw\n     * from all the inputted strategies. Return value is >= minWithdrawalDelayBlocks as this is the global min withdrawal delay.\n     * @param strategies The strategies to check withdrawal delays for\n     */\n    function getWithdrawalDelay(IStrategy[] calldata strategies) external view returns (uint256);\n\n    /**\n     * @notice returns the total number of shares in `strategy` that are delegated to `operator`.\n     * @notice Mapping: operator => strategy => total number of shares in the strategy delegated to the operator.\n     * @dev By design, the following invariant should hold for each Strategy:\n     * (operator's shares in delegation manager) = sum (shares above zero of all stakers delegated to operator)\n     * = sum (delegateable shares of all stakers delegated to the operator)\n     */\n    function operatorShares(address operator, IStrategy strategy) external view returns (uint256);\n\n    /**\n     * @notice Returns 'true' if `staker` *is* actively delegated, and 'false' otherwise.\n     */\n    function isDelegated(address staker) external view returns (bool);\n\n    /**\n     * @notice Returns true is an operator has previously registered for delegation.\n     */\n    function isOperator(address operator) external view returns (bool);\n\n    /// @notice Mapping: staker => number of signed delegation nonces (used in `delegateToBySignature`) from the staker that the contract has already checked\n    function stakerNonce(address staker) external view returns (uint256);\n\n    /**\n     * @notice Mapping: delegationApprover => 32-byte salt => whether or not the salt has already been used by the delegationApprover.\n     * @dev Salts are used in the `delegateTo` and `delegateToBySignature` functions. Note that these functions only process the delegationApprover's\n     * signature + the provided salt if the operator being delegated to has specified a nonzero address as their `delegationApprover`.\n     */\n    function delegationApproverSaltIsSpent(address _delegationApprover, bytes32 salt) external view returns (bool);\n\n    /**\n     * @notice Minimum delay enforced by this contract for completing queued withdrawals. Measured in blocks, and adjustable by this contract's owner,\n     * up to a maximum of `MAX_WITHDRAWAL_DELAY_BLOCKS`. Minimum value is 0 (i.e. no delay enforced).\n     * 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\n     * to withdraw a strategy is MAX(minWithdrawalDelayBlocks, strategyWithdrawalDelayBlocks[strategy])\n     */\n    function minWithdrawalDelayBlocks() external view returns (uint256);\n\n    /**\n     * @notice Minimum delay enforced by this contract per Strategy for completing queued withdrawals. Measured in blocks, and adjustable by this contract's owner,\n     * up to a maximum of `MAX_WITHDRAWAL_DELAY_BLOCKS`. Minimum value is 0 (i.e. no delay enforced).\n     */\n    function strategyWithdrawalDelayBlocks(IStrategy strategy) external view returns (uint256);\n\n    /// @notice return address of the beaconChainETHStrategy\n    function beaconChainETHStrategy() external view returns (IStrategy);\n\n    /**\n     * @notice Calculates the digestHash for a `staker` to sign to delegate to an `operator`\n     * @param staker The signing staker\n     * @param operator The operator who is being delegated to\n     * @param expiry The desired expiry time of the staker's signature\n     */\n    function calculateCurrentStakerDelegationDigestHash(\n        address staker,\n        address operator,\n        uint256 expiry\n    ) external view returns (bytes32);\n\n    /**\n     * @notice Calculates the digest hash to be signed and used in the `delegateToBySignature` function\n     * @param staker The signing staker\n     * @param _stakerNonce The nonce of the staker. In practice we use the staker's current nonce, stored at `stakerNonce[staker]`\n     * @param operator The operator who is being delegated to\n     * @param expiry The desired expiry time of the staker's signature\n     */\n    function calculateStakerDelegationDigestHash(\n        address staker,\n        uint256 _stakerNonce,\n        address operator,\n        uint256 expiry\n    ) external view returns (bytes32);\n\n    /**\n     * @notice Calculates the digest hash to be signed by the operator's delegationApprove and used in the `delegateTo` and `delegateToBySignature` functions.\n     * @param staker The account delegating their stake\n     * @param operator The account receiving delegated stake\n     * @param _delegationApprover the operator's `delegationApprover` who will be signing the delegationHash (in general)\n     * @param approverSalt A unique and single use value associated with the approver signature.\n     * @param expiry Time after which the approver's signature becomes invalid\n     */\n    function calculateDelegationApprovalDigestHash(\n        address staker,\n        address operator,\n        address _delegationApprover,\n        bytes32 approverSalt,\n        uint256 expiry\n    ) external view returns (bytes32);\n\n    /// @notice The EIP-712 typehash for the contract's domain\n    function DOMAIN_TYPEHASH() external view returns (bytes32);\n\n    /// @notice The EIP-712 typehash for the StakerDelegation struct used by the contract\n    function STAKER_DELEGATION_TYPEHASH() external view returns (bytes32);\n\n    /// @notice The EIP-712 typehash for the DelegationApproval struct used by the contract\n    function DELEGATION_APPROVAL_TYPEHASH() external view returns (bytes32);\n\n    /**\n     * @notice Getter function for the current EIP-712 domain separator for this contract.\n     *\n     * @dev The domain separator will change in the event of a fork that changes the ChainID.\n     * @dev By introducing a domain separator the DApp developers are guaranteed that there can be no signature collision.\n     * for more detailed information please read EIP-712.\n     */\n    function domainSeparator() external view returns (bytes32);\n\n    /// @notice Mapping: staker => cumulative number of queued withdrawals they have ever initiated.\n    /// @dev This only increments (doesn't decrement), and is used to help ensure that otherwise identical withdrawals have unique hashes.\n    function cumulativeWithdrawalsQueued(address staker) external view returns (uint256);\n\n    /// @notice Returns the keccak256 hash of `withdrawal`.\n    function calculateWithdrawalRoot(Withdrawal memory withdrawal) external pure returns (bytes32);\n}\n"},{"file_path":"contracts/interfaces/IETHPOSDeposit.sol","source_code":"// ┏━━━┓━┏┓━┏┓━━┏━━━┓━━┏━━━┓━━━━┏━━━┓━━━━━━━━━━━━━━━━━━━┏┓━━━━━┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━━┏┓━\n// ┃┏━━┛┏┛┗┓┃┃━━┃┏━┓┃━━┃┏━┓┃━━━━┗┓┏┓┃━━━━━━━━━━━━━━━━━━┏┛┗┓━━━━┃┏━┓┃━━━━━━━━┏┛┗┓━━━━━━━━━━━━┏┛┗┓\n// ┃┗━━┓┗┓┏┛┃┗━┓┗┛┏┛┃━━┃┃━┃┃━━━━━┃┃┃┃┏━━┓┏━━┓┏━━┓┏━━┓┏┓┗┓┏┛━━━━┃┃━┗┛┏━━┓┏━┓━┗┓┏┛┏━┓┏━━┓━┏━━┓┗┓┏┛\n// ┃┏━━┛━┃┃━┃┏┓┃┏━┛┏┛━━┃┃━┃┃━━━━━┃┃┃┃┃┏┓┃┃┏┓┃┃┏┓┃┃━━┫┣┫━┃┃━━━━━┃┃━┏┓┃┏┓┃┃┏┓┓━┃┃━┃┏┛┗━┓┃━┃┏━┛━┃┃━\n// ┃┗━━┓━┃┗┓┃┃┃┃┃┃┗━┓┏┓┃┗━┛┃━━━━┏┛┗┛┃┃┃━┫┃┗┛┃┃┗┛┃┣━━┃┃┃━┃┗┓━━━━┃┗━┛┃┃┗┛┃┃┃┃┃━┃┗┓┃┃━┃┗┛┗┓┃┗━┓━┃┗┓\n// ┗━━━┛━┗━┛┗┛┗┛┗━━━┛┗┛┗━━━┛━━━━┗━━━┛┗━━┛┃┏━┛┗━━┛┗━━┛┗┛━┗━┛━━━━┗━━━┛┗━━┛┗┛┗┛━┗━┛┗┛━┗━━━┛┗━━┛━┗━┛\n// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n// SPDX-License-Identifier: CC0-1.0\n\npragma solidity >=0.5.0;\n\n// This interface is designed to be compatible with the Vyper version.\n/// @notice This is the Ethereum 2.0 deposit contract interface.\n/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs\ninterface IETHPOSDeposit {\n    /// @notice A processed deposit event.\n    event DepositEvent(\n        bytes pubkey,\n        bytes withdrawal_credentials,\n        bytes amount,\n        bytes signature,\n        bytes index\n    );\n\n    /// @notice Submit a Phase 0 DepositData object.\n    /// @param pubkey A BLS12-381 public key.\n    /// @param withdrawal_credentials Commitment to a public key for withdrawals.\n    /// @param signature A BLS12-381 signature.\n    /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.\n    /// Used as a protection against malformed input.\n    function deposit(\n        bytes calldata pubkey,\n        bytes calldata withdrawal_credentials,\n        bytes calldata signature,\n        bytes32 deposit_data_root\n    ) external payable;\n\n    /// @notice Query the current deposit root hash.\n    /// @return The deposit root hash.\n    function get_deposit_root() external view returns (bytes32);\n\n    /// @notice Query the current deposit count.\n    /// @return The deposit count encoded as a little endian 64-bit number.\n    function get_deposit_count() external view returns (bytes memory);\n}\n"},{"file_path":"contracts/interfaces/IEigenPod.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"../libraries/BeaconChainProofs.sol\";\nimport \"./IEigenPodManager.sol\";\nimport \"./IBeaconChainOracle.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @title The implementation contract used for restaking beacon chain ETH on EigenLayer\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @dev Note that all beacon chain balances are stored as gwei within the beacon chain datastructures. We choose\n *   to account balances in terms of gwei in the EigenPod contract and convert to wei when making calls to other contracts\n */\ninterface IEigenPod {\n\n    /*******************************************************************************\n                                   STRUCTS / ENUMS\n    *******************************************************************************/\n\n    enum VALIDATOR_STATUS {\n        INACTIVE, // doesnt exist\n        ACTIVE, // staked on ethpos and withdrawal credentials are pointed to the EigenPod\n        WITHDRAWN // withdrawn from the Beacon Chain\n    }\n\n    struct ValidatorInfo {\n        // index of the validator in the beacon chain\n        uint64 validatorIndex;\n        // amount of beacon chain ETH restaked on EigenLayer in gwei\n        uint64 restakedBalanceGwei;\n        //timestamp of the validator's most recent balance update\n        uint64 lastCheckpointedAt;\n        // status of the validator\n        VALIDATOR_STATUS status;\n    }\n\n    struct Checkpoint {\n        bytes32 beaconBlockRoot;\n        uint24 proofsRemaining;\n        uint64 podBalanceGwei;\n        int128 balanceDeltasGwei;\n    }\n\n    /*******************************************************************************\n                                       EVENTS\n    *******************************************************************************/\n\n    /// @notice Emitted when an ETH validator stakes via this eigenPod\n    event EigenPodStaked(bytes pubkey);\n\n    /// @notice Emitted when a pod owner updates the proof submitter address\n    event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter);\n\n    /// @notice Emitted when an ETH validator's withdrawal credentials are successfully verified to be pointed to this eigenPod\n    event ValidatorRestaked(uint40 validatorIndex);\n\n    /// @notice Emitted when an ETH validator's  balance is proven to be updated.  Here newValidatorBalanceGwei\n    //  is the validator's balance that is credited on EigenLayer.\n    event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei);\n\n    /// @notice Emitted when restaked beacon chain ETH is withdrawn from the eigenPod.\n    event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount);\n\n    /// @notice Emitted when ETH is received via the `receive` fallback\n    event NonBeaconChainETHReceived(uint256 amountReceived);\n\n    /// @notice Emitted when a checkpoint is created\n    event CheckpointCreated(uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount);\n\n    /// @notice Emitted when a checkpoint is finalized\n    event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei);\n\n    /// @notice Emitted when a validator is proven for a given checkpoint\n    event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex);\n\n    /// @notice Emitted when a validaor is proven to have 0 balance at a given checkpoint\n    event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex);\n\n    /*******************************************************************************\n                          EXTERNAL STATE-CHANGING METHODS\n    *******************************************************************************/\n\n    /// @notice Used to initialize the pointers to contracts crucial to the pod's functionality, in beacon proxy construction from EigenPodManager\n    function initialize(address owner) external;\n\n    /// @notice Called by EigenPodManager when the owner wants to create another ETH validator.\n    function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable;\n\n    /**\n     * @notice Transfers `amountWei` in ether from this contract to the specified `recipient` address\n     * @notice Called by EigenPodManager to withdrawBeaconChainETH that has been added to the EigenPod's balance due to a withdrawal from the beacon chain.\n     * @dev The podOwner must have already proved sufficient withdrawals, so that this pod's `withdrawableRestakedExecutionLayerGwei` exceeds the\n     * `amountWei` input (when converted to GWEI).\n     * @dev Reverts if `amountWei` is not a whole Gwei amount\n     */\n    function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) external;\n\n    /**\n     * @dev Create a checkpoint used to prove this pod's active validator set. Checkpoints are completed \n     * by submitting one checkpoint proof per ACTIVE validator. During the checkpoint process, the total \n     * change in ACTIVE validator balance is tracked, and any validators with 0 balance are marked `WITHDRAWN`.\n     * @dev Once finalized, the pod owner is awarded shares corresponding to:\n     * - the total change in their ACTIVE validator balances\n     * - any ETH in the pod not already awarded shares\n     * @dev A checkpoint cannot be created if the pod already has an outstanding checkpoint. If\n     * this is the case, the pod owner MUST complete the existing checkpoint before starting a new one.\n     * @param revertIfNoBalance Forces a revert if the pod ETH balance is 0. This allows the pod owner\n     * to prevent accidentally starting a checkpoint that will not increase their shares\n     */\n    function startCheckpoint(bool revertIfNoBalance) external;\n\n    /**\n     * @dev Progress the current checkpoint towards completion by submitting one or more validator\n     * checkpoint proofs. Anyone can call this method to submit proofs towards the current checkpoint.\n     * For each validator proven, the current checkpoint's `proofsRemaining` decreases.\n     * @dev If the checkpoint's `proofsRemaining` reaches 0, the checkpoint is finalized.\n     * (see `_updateCheckpoint` for more details)\n     * @dev This method can only be called when there is a currently-active checkpoint.\n     * @param balanceContainerProof proves the beacon's current balance container root against a checkpoint's `beaconBlockRoot`\n     * @param proofs Proofs for one or more validator current balances against the `balanceContainerRoot`\n     */\n    function verifyCheckpointProofs(\n        BeaconChainProofs.BalanceContainerProof calldata balanceContainerProof,\n        BeaconChainProofs.BalanceProof[] calldata proofs\n    ) \n        external;\n \n    /**\n     * @dev Verify one or more validators have their withdrawal credentials pointed at this EigenPod, and award\n     * shares based on their effective balance. Proven validators are marked `ACTIVE` within the EigenPod, and\n     * future checkpoint proofs will need to include them.\n     * @dev Withdrawal credential proofs MUST NOT be older than `currentCheckpointTimestamp`.\n     * @dev Validators proven via this method MUST NOT have an exit epoch set already.\n     * @param beaconTimestamp the beacon chain timestamp sent to the 4788 oracle contract. Corresponds\n     * to the parent beacon block root against which the proof is verified.\n     * @param stateRootProof proves a beacon state root against a beacon block root\n     * @param validatorIndices a list of validator indices being proven\n     * @param validatorFieldsProofs proofs of each validator's `validatorFields` against the beacon state root\n     * @param validatorFields the fields of the beacon chain \"Validator\" container. See consensus specs for\n     * details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator\n     */\n    function verifyWithdrawalCredentials(\n        uint64 beaconTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        uint40[] calldata validatorIndices,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields\n    )\n        external;\n \n    /**\n     * @dev Prove that one of this pod's active validators was slashed on the beacon chain. A successful\n     * staleness proof allows the caller to start a checkpoint.\n     * \n     * @dev Note that in order to start a checkpoint, any existing checkpoint must already be completed!\n     * (See `_startCheckpoint` for details)\n     * \n     * @dev Note that this method allows anyone to start a checkpoint as soon as a slashing occurs on the beacon\n     * chain. This is intended to make it easier to external watchers to keep a pod's balance up to date.\n     * \n     * @dev Note too that beacon chain slashings are not instant. There is a delay between the initial slashing event\n     * and the validator's final exit back to the execution layer. During this time, the validator's balance may or\n     * may not drop further due to a correlation penalty. This method allows proof of a slashed validator\n     * to initiate a checkpoint for as long as the validator remains on the beacon chain. Once the validator\n     * has exited and been checkpointed at 0 balance, they are no longer \"checkpoint-able\" and cannot be proven\n     * \"stale\" via this method.\n     * See https://eth2book.info/capella/part3/transition/epoch/#slashings for more info.\n     * \n     * @param beaconTimestamp the beacon chain timestamp sent to the 4788 oracle contract. Corresponds\n     * to the parent beacon block root against which the proof is verified.\n     * @param stateRootProof proves a beacon state root against a beacon block root\n     * @param proof the fields of the beacon chain \"Validator\" container, along with a merkle proof against\n     * the beacon state root. See the consensus specs for more details:\n     * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator\n     *\n     * @dev Staleness conditions:\n     * - Validator's last checkpoint is older than `beaconTimestamp`\n     * - Validator MUST be in `ACTIVE` status in the pod\n     * - Validator MUST be slashed on the beacon chain\n     */\n    function verifyStaleBalance(\n        uint64 beaconTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        BeaconChainProofs.ValidatorProof calldata proof\n    )\n        external;\n \n    /// @notice called by owner of a pod to remove any ERC20s deposited in the pod\n    function recoverTokens(IERC20[] memory tokenList, uint256[] memory amountsToWithdraw, address recipient) external;\n\n    /// @notice Allows the owner of a pod to update the proof submitter, a permissioned\n    /// address that can call `startCheckpoint` and `verifyWithdrawalCredentials`.\n    /// @dev Note that EITHER the podOwner OR proofSubmitter can access these methods,\n    /// so it's fine to set your proofSubmitter to 0 if you want the podOwner to be the\n    /// only address that can call these methods.\n    /// @param newProofSubmitter The new proof submitter address. If set to 0, only the\n    /// pod owner will be able to call `startCheckpoint` and `verifyWithdrawalCredentials`\n    function setProofSubmitter(address newProofSubmitter) external;\n\n    /*******************************************************************************\n                                   VIEW METHODS\n    *******************************************************************************/\n\n    /// @notice An address with permissions to call `startCheckpoint` and `verifyWithdrawalCredentials`, set\n    /// by the podOwner. This role exists to allow a podOwner to designate a hot wallet that can call\n    /// these methods, allowing the podOwner to remain a cold wallet that is only used to manage funds.\n    /// @dev If this address is NOT set, only the podOwner can call `startCheckpoint` and `verifyWithdrawalCredentials`\n    function proofSubmitter() external view returns (address);\n\n    /// @notice the amount of execution layer ETH in this contract that is staked in EigenLayer (i.e. withdrawn from beaconchain but not EigenLayer),\n    function withdrawableRestakedExecutionLayerGwei() external view returns (uint64);\n\n    /// @notice The single EigenPodManager for EigenLayer\n    function eigenPodManager() external view returns (IEigenPodManager);\n\n    /// @notice The owner of this EigenPod\n    function podOwner() external view returns (address);\n\n    /// @notice Returns the validatorInfo struct for the provided pubkeyHash\n    function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external view returns (ValidatorInfo memory);\n\n    /// @notice Returns the validatorInfo struct for the provided pubkey\n    function validatorPubkeyToInfo(bytes calldata validatorPubkey) external view returns (ValidatorInfo memory);\n\n    /// @notice This returns the status of a given validator\n    function validatorStatus(bytes32 pubkeyHash) external view returns (VALIDATOR_STATUS);\n\n    /// @notice This returns the status of a given validator pubkey\n    function validatorStatus(bytes calldata validatorPubkey) external view returns (VALIDATOR_STATUS);\n\n    /// @notice Number of validators with proven withdrawal credentials, who do not have proven full withdrawals\n    function activeValidatorCount() external view returns (uint256);\n\n    /// @notice The timestamp of the last checkpoint finalized\n    function lastCheckpointTimestamp() external view returns (uint64);\n\n    /// @notice The timestamp of the currently-active checkpoint. Will be 0 if there is not active checkpoint\n    function currentCheckpointTimestamp() external view returns (uint64);\n\n    /// @notice Returns the currently-active checkpoint\n    function currentCheckpoint() external view returns (Checkpoint memory);\n\n    /// @notice For each checkpoint, the total balance attributed to exited validators, in gwei\n    ///\n    /// NOTE that the values added to this mapping are NOT guaranteed to capture the entirety of a validator's\n    /// exit - rather, they capture the total change in a validator's balance when a checkpoint shows their\n    /// balance change from nonzero to zero. While a change from nonzero to zero DOES guarantee that a validator\n    /// has been fully exited, it is possible that the magnitude of this change does not capture what is \n    /// typically thought of as a \"full exit.\"\n    /// \n    /// For example:\n    /// 1. Consider a validator was last checkpointed at 32 ETH before exiting. Once the exit has been processed, \n    /// it is expected that the validator's exited balance is calculated to be `32 ETH`.\n    /// 2. However, before `startCheckpoint` is called, a deposit is made to the validator for 1 ETH. The beacon\n    /// chain will automatically withdraw this ETH, but not until the withdrawal sweep passes over the validator\n    /// again. Until this occurs, the validator's current balance (used for checkpointing) is 1 ETH.\n    /// 3. If `startCheckpoint` is called at this point, the balance delta calculated for this validator will be\n    /// `-31 ETH`, and because the validator has a nonzero balance, it is not marked WITHDRAWN.\n    /// 4. After the exit is processed by the beacon chain, a subsequent `startCheckpoint` and checkpoint proof\n    /// will calculate a balance delta of `-1 ETH` and attribute a 1 ETH exit to the validator.\n    /// \n    /// If this edge case impacts your usecase, it should be possible to mitigate this by monitoring for deposits\n    /// to your exited validators, and waiting to call `startCheckpoint` until those deposits have been automatically\n    /// exited.\n    /// \n    /// Additional edge cases this mapping does not cover:\n    /// - If a validator is slashed, their balance exited will reflect their original balance rather than the slashed amount\n    /// - The final partial withdrawal for an exited validator will be likely be included in this mapping.\n    ///   i.e. if a validator was last checkpointed at 32.1 ETH before exiting, the next checkpoint will calculate their\n    ///   \"exited\" amount to be 32.1 ETH rather than 32 ETH.\n    function checkpointBalanceExitedGwei(uint64) external view returns (uint64);\n\n    /// @notice Query the 4788 oracle to get the parent block root of the slot with the given `timestamp`\n    /// @param timestamp of the block for which the parent block root will be returned. MUST correspond\n    /// to an existing slot within the last 24 hours. If the slot at `timestamp` was skipped, this method\n    /// will revert.\n    function getParentBlockRoot(uint64 timestamp) external view returns (bytes32);\n}\n"},{"file_path":"contracts/interfaces/IEigenPodManager.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\";\nimport \"./IETHPOSDeposit.sol\";\nimport \"./IStrategyManager.sol\";\nimport \"./IEigenPod.sol\";\nimport \"./IBeaconChainOracle.sol\";\nimport \"./ISlasher.sol\";\nimport \"./IStrategy.sol\";\n\n/**\n * @title Interface for factory that creates and manages solo staking pods that have their withdrawal credentials pointed to EigenLayer.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n */\n\ninterface IEigenPodManager {\n    /// @notice Emitted to notify the update of the beaconChainOracle address\n    event BeaconOracleUpdated(address indexed newOracleAddress);\n\n    /// @notice Emitted to notify the deployment of an EigenPod\n    event PodDeployed(address indexed eigenPod, address indexed podOwner);\n\n    /// @notice Emitted to notify a deposit of beacon chain ETH recorded in the strategy manager\n    event BeaconChainETHDeposited(address indexed podOwner, uint256 amount);\n\n    /// @notice Emitted when the balance of an EigenPod is updated\n    event PodSharesUpdated(address indexed podOwner, int256 sharesDelta);\n\n    /// @notice Emitted when a withdrawal of beacon chain ETH is completed\n    event BeaconChainETHWithdrawalCompleted(\n        address indexed podOwner,\n        uint256 shares,\n        uint96 nonce,\n        address delegatedAddress,\n        address withdrawer,\n        bytes32 withdrawalRoot\n    );\n\n    event DenebForkTimestampUpdated(uint64 newValue);\n\n    /**\n     * @notice Creates an EigenPod for the sender.\n     * @dev Function will revert if the `msg.sender` already has an EigenPod.\n     * @dev Returns EigenPod address\n     */\n    function createPod() external returns (address);\n\n    /**\n     * @notice Stakes for a new beacon chain validator on the sender's EigenPod.\n     * Also creates an EigenPod for the sender if they don't have one already.\n     * @param pubkey The 48 bytes public key of the beacon chain validator.\n     * @param signature The validator's signature of the deposit data.\n     * @param depositDataRoot The root/hash of the deposit data for the validator's deposit.\n     */\n    function stake(\n        bytes calldata pubkey,\n        bytes calldata signature,\n        bytes32 depositDataRoot\n    ) external payable;\n\n    /**\n     * @notice Changes the `podOwner`'s shares by `sharesDelta` and performs a call to the DelegationManager\n     * to ensure that delegated shares are also tracked correctly\n     * @param podOwner is the pod owner whose balance is being updated.\n     * @param sharesDelta is the change in podOwner's beaconChainETHStrategy shares\n     * @dev Callable only by the podOwner's EigenPod contract.\n     * @dev Reverts if `sharesDelta` is not a whole Gwei amount\n     */\n    function recordBeaconChainETHBalanceUpdate(\n        address podOwner,\n        int256 sharesDelta\n    ) external;\n\n    /**\n     * @notice Updates the oracle contract that provides the beacon chain state root\n     * @param newBeaconChainOracle is the new oracle contract being pointed to\n     * @dev Callable only by the owner of this contract (i.e. governance)\n     */\n    function updateBeaconChainOracle(\n        IBeaconChainOracle newBeaconChainOracle\n    ) external;\n\n    /// @notice Returns the address of the `podOwner`'s EigenPod if it has been deployed.\n    function ownerToPod(address podOwner) external view returns (IEigenPod);\n\n    /// @notice Returns the address of the `podOwner`'s EigenPod (whether it is deployed yet or not).\n    function getPod(address podOwner) external view returns (IEigenPod);\n\n    /// @notice The ETH2 Deposit Contract\n    function ethPOS() external view returns (IETHPOSDeposit);\n\n    /// @notice Beacon proxy to which the EigenPods point\n    function eigenPodBeacon() external view returns (IBeacon);\n\n    /// @notice Oracle contract that provides updates to the beacon chain's state\n    function beaconChainOracle() external view returns (IBeaconChainOracle);\n\n    /// @notice Returns the beacon block root at `timestamp`. Reverts if the Beacon block root at `timestamp` has not yet been finalized.\n    function getBlockRootAtTimestamp(\n        uint64 timestamp\n    ) external view returns (bytes32);\n\n    /// @notice EigenLayer's StrategyManager contract\n    function strategyManager() external view returns (IStrategyManager);\n\n    /// @notice EigenLayer's Slasher contract\n    function slasher() external view returns (ISlasher);\n\n    /// @notice Returns 'true' if the `podOwner` has created an EigenPod, and 'false' otherwise.\n    function hasPod(address podOwner) external view returns (bool);\n\n    /// @notice Returns the number of EigenPods that have been created\n    function numPods() external view returns (uint256);\n\n    /**\n     * @notice Mapping from Pod owner owner to the number of shares they have in the virtual beacon chain ETH strategy.\n     * @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\n     * decrease between the pod owner queuing and completing a withdrawal.\n     * When the pod owner's shares would otherwise increase, this \"deficit\" is decreased first _instead_.\n     * Likewise, when a withdrawal is completed, this \"deficit\" is decreased and the withdrawal amount is decreased; We can think of this\n     * as the withdrawal \"paying off the deficit\".\n     */\n    function podOwnerShares(address podOwner) external view returns (int256);\n\n    /// @notice returns canonical, virtual beaconChainETH strategy\n    function beaconChainETHStrategy() external view returns (IStrategy);\n\n    /**\n     * @notice Used by the DelegationManager to remove a pod owner's shares while they're in the withdrawal queue.\n     * Simply decreases the `podOwner`'s shares by `shares`, down to a minimum of zero.\n     * @dev This function reverts if it would result in `podOwnerShares[podOwner]` being less than zero, i.e. it is forbidden for this function to\n     * result in the `podOwner` incurring a \"share deficit\". This behavior prevents a Staker from queuing a withdrawal which improperly removes excessive\n     * shares from the operator to whom the staker is delegated.\n     * @dev Reverts if `shares` is not a whole Gwei amount\n     */\n    function removeShares(address podOwner, uint256 shares) external;\n\n    /**\n     * @notice Increases the `podOwner`'s shares by `shares`, paying off deficit if possible.\n     * Used by the DelegationManager to award a pod owner shares on exiting the withdrawal queue\n     * @dev Returns the number of shares added to `podOwnerShares[podOwner]` above zero, which will be less than the `shares` input\n     * in the event that the podOwner has an existing shares deficit (i.e. `podOwnerShares[podOwner]` starts below zero)\n     * @dev Reverts if `shares` is not a whole Gwei amount\n     */\n    function addShares(\n        address podOwner,\n        uint256 shares\n    ) external returns (uint256);\n\n    /**\n     * @notice Used by the DelegationManager to complete a withdrawal, sending tokens to some destination address\n     * @dev Prioritizes decreasing the podOwner's share deficit, if they have one\n     * @dev Reverts if `shares` is not a whole Gwei amount\n     */\n    function withdrawSharesAsTokens(\n        address podOwner,\n        address destination,\n        uint256 shares\n    ) external;\n\n    /**\n     * @notice the deneb hard fork timestamp used to determine which proof path to use for proving a withdrawal\n     */\n    function denebForkTimestamp() external view returns (uint64);\n\n    /**\n     * setting the deneb hard fork timestamp by the eigenPodManager owner\n     * @dev this function is designed to be called twice.  Once, it is set to type(uint64).max\n     * prior to the actual deneb fork timestamp being set, and then the second time it is set\n     * to the actual deneb fork timestamp.\n     */\n    function setDenebForkTimestamp(uint64 newDenebForkTimestamp) external;\n}\n"},{"file_path":"contracts/interfaces/IProtocolConfig.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"./IRatioFeed.sol\";\nimport \"./ICToken.sol\";\nimport \"./IRestakingPool.sol\";\nimport \"./IEigenPodManager.sol\";\nimport \"../restaker/IRestakerDeployer.sol\";\n\ninterface IProtocolConfig {\n    /* errors */\n\n    error OnlyGovernanceAllowed();\n    error ZeroAddress();\n\n    /* events */\n    event OperatorChanged(address prevValue, address newValue);\n    event GovernanceChanged(address prevValue, address newValue);\n    event TreasuryChanged(address prevValue, address newValue);\n    event RatioFeedChanged(IRatioFeed prevValue, IRatioFeed newValue);\n    event CTokenChanged(ICToken prevValue, ICToken newValue);\n    event RestakingPoolChanged(\n        IRestakingPool prevValue,\n        IRestakingPool newValue\n    );\n    event EigenManagerChanged(\n        IEigenPodManager prevValue,\n        IEigenPodManager newValue\n    );\n    event RestakerDeployerChanged(\n        IRestakerDeployer prevValue,\n        IRestakerDeployer newValue\n    );\n\n    /* functions */\n\n    function getGovernance() external view returns (address governance);\n\n    function getTreasury() external view returns (address treasury);\n\n    function getOperator() external view returns (address operator);\n\n    function getCToken() external view returns (ICToken token);\n\n    function getRatioFeed() external view returns (IRatioFeed feed);\n\n    function getRestakingPool() external view returns (IRestakingPool pool);\n\n    function getRestakerDeployer()\n        external\n        view\n        returns (IRestakerDeployer deployer);\n}\n"},{"file_path":"contracts/interfaces/IRatioFeed.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IRatioFeed {\n    enum RatioError {\n        NoError,\n        TooOften, // ratio was updated less than 12 hours ago\n        GreaterThanPrevious, // new ratio cannot be greater than old\n        NotInThreshold, // new ratio too low, not in threshold range\n        GreaterThanInitial // new ratio is greater than {INITIAL_RATIO}\n    }\n\n    struct HistoricalRatios {\n        uint64[9] historicalRatios;\n        uint40 lastUpdate;\n    }\n\n    /* errors */\n\n    error RatioNotUpdated(RatioError);\n    error RatioThresholdNotInRange();\n\n    /* events */\n\n    event RatioThresholdChanged(uint256 oldValue, uint256 newValue);\n    event RatioUpdated(\n        address indexed tokenAddress,\n        uint256 oldRatio,\n        uint256 newRatio\n    );\n\n    /* functions */\n\n    function updateRatio(address token, uint256 ratio) external;\n    function getRatio(address token) external view returns (uint256 ratio);\n}\n"},{"file_path":"contracts/interfaces/IRestakingPool.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IRestakingPool {\n    /* structs */\n\n    struct Unstake {\n        address recipient;\n        uint256 amount;\n    }\n\n    /* errors */\n\n    error PoolZeroAmount();\n    error PoolZeroAddress();\n    error PoolRestakerExists();\n    error PoolRestakerNotExists();\n    error PoolInsufficientBalance();\n    error PoolWrongInputLength();\n    error AmbiguousFee(uint256 claimed, uint256 fee);\n    error InsufficientCapacity(uint256 capacity);\n    error TargetCapacityNotSet();\n    error TimelineNotOver();\n    error InconsistentData();\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error PoolFailedInnerCall();\n\n    error PoolDistributeGasLimitNotInRange(uint64 max);\n\n    error PoolStakeAmLessThanMin();\n    error PoolStakeAmGreaterThanAvailable();\n    error PoolUnstakeAmLessThanMin();\n\n    error ParameterExceedsLimits(uint256 param);\n\n    /* events */\n\n    event Received(address indexed sender, uint256 amount);\n\n    event Staked(address indexed staker, uint256 amount, uint256 shares);\n\n    event Unstaked(\n        address indexed from,\n        address indexed to,\n        uint256 amount,\n        uint256 shares\n    );\n\n    event Deposited(string indexed provider, bytes[] pubkeys);\n\n    event DistributeGasLimitChanged(uint32 prevValue, uint32 newValue);\n\n    event MinStakeChanged(uint256 prevValue, uint256 newValue);\n\n    event MinUnstakeChanged(uint256 prevValue, uint256 newValue);\n\n    event MaxTVLChanged(uint256 prevValue, uint256 newValue);\n\n    event PendingUnstake(\n        address indexed ownerAddress,\n        address indexed receiverAddress,\n        uint256 amount,\n        uint256 shares\n    );\n\n    /**\n     *\n     * @dev Deprecated.\n     */\n    event UnstakesDistributed(Unstake[] unstakes);\n\n    event ClaimExpected(address indexed claimer, uint256 value);\n\n    event UnstakeClaimed(\n        address indexed claimer,\n        address indexed caller,\n        uint256 value\n    );\n\n    event FlashUnstaked(\n        address indexed sender,\n        address indexed receiver,\n        address indexed owner,\n        uint256 amount,\n        uint256 shares,\n        uint256 fee\n    );\n\n    event FeeClaimed(\n        address indexed restaker,\n        address indexed treasury,\n        uint256 fee,\n        uint256 totalClaimed\n    );\n\n    event RestakerAdded(string indexed provider, address restaker);\n\n    event ReferralStake(bytes32 indexed code);\n\n    event StakeBonus(uint256 amount);\n\n    event StakeBonusParamsChanged(\n        uint256 newMaxBonusRate,\n        uint256 newOptimalBonusRate,\n        uint256 newDepositUtilizationKink\n    );\n\n    event UnstakeFeeParamsChanged(\n        uint256 newMaxFlashFeeRate,\n        uint256 newOptimalWithdrawalRate,\n        uint256 newWithdrawUtilizationKink\n    );\n\n    event ProtocolFeeChanged(uint256 prevValue, uint256 newValue);\n\n    event TargetCapacityChanged(uint256 prevValue, uint256 newValue);\n\n    event RewardsAdded(uint256 amount, uint256 startTimeline);\n\n    event RewardsTimelineChanged(\n        uint256 rewardsTimeline,\n        uint256 newTimelineInSeconds\n    );\n\n    /* functions */\n\n    function getMinStake() external view returns (uint256);\n\n    function getMinUnstake() external view returns (uint256);\n\n    function startWithdrawalCheckpoint(\n        string memory provider,\n        bool revertIfNoBalance\n    ) external;\n}\n"},{"file_path":"contracts/interfaces/ISignatureUtils.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\n/**\n * @title The interface for common signature utilities.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n */\ninterface ISignatureUtils {\n    // @notice Struct that bundles together a signature and an expiration time for the signature. Used primarily for stack management.\n    struct SignatureWithExpiry {\n        // the signature itself, formatted as a single bytes object\n        bytes signature;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n\n    // @notice Struct that bundles together a signature, a salt for uniqueness, and an expiration time for the signature. Used primarily for stack management.\n    struct SignatureWithSaltAndExpiry {\n        // the signature itself, formatted as a single bytes object\n        bytes signature;\n        // the salt used to generate the signature\n        bytes32 salt;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n}\n"},{"file_path":"contracts/interfaces/ISlasher.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IStrategyManager.sol\";\nimport \"./IDelegationManager.sol\";\n\n/**\n * @title Interface for the primary 'slashing' contract for EigenLayer.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice See the `Slasher` contract itself for implementation details.\n */\ninterface ISlasher {\n    // struct used to store information about the current state of an operator's obligations to middlewares they are serving\n    struct MiddlewareTimes {\n        // 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\n        uint32 stalestUpdateBlock;\n        // The latest 'serveUntilBlock' from all of the middleware that the operator is serving\n        uint32 latestServeUntilBlock;\n    }\n\n    // struct used to store details relevant to a single middleware that an operator has opted-in to serving\n    struct MiddlewareDetails {\n        // the block at which the contract begins being able to finalize the operator's registration with the service via calling `recordFirstStakeUpdate`\n        uint32 registrationMayBeginAtBlock;\n        // the block before which the contract is allowed to slash the user\n        uint32 contractCanSlashOperatorUntilBlock;\n        // the block at which the middleware's view of the operator's stake was most recently updated\n        uint32 latestUpdateBlock;\n    }\n\n    /// @notice Emitted when a middleware times is added to `operator`'s array.\n    event MiddlewareTimesAdded(\n        address operator,\n        uint256 index,\n        uint32 stalestUpdateBlock,\n        uint32 latestServeUntilBlock\n    );\n\n    /// @notice Emitted when `operator` begins to allow `contractAddress` to slash them.\n    event OptedIntoSlashing(\n        address indexed operator,\n        address indexed contractAddress\n    );\n\n    /// @notice Emitted when `contractAddress` signals that it will no longer be able to slash `operator` after the `contractCanSlashOperatorUntilBlock`.\n    event SlashingAbilityRevoked(\n        address indexed operator,\n        address indexed contractAddress,\n        uint32 contractCanSlashOperatorUntilBlock\n    );\n\n    /**\n     * @notice Emitted when `slashingContract` 'freezes' the `slashedOperator`.\n     * @dev The `slashingContract` must have permission to slash the `slashedOperator`, i.e. `canSlash(slasherOperator, slashingContract)` must return 'true'.\n     */\n    event OperatorFrozen(\n        address indexed slashedOperator,\n        address indexed slashingContract\n    );\n\n    /// @notice Emitted when `previouslySlashedAddress` is 'unfrozen', allowing them to again move deposited funds within EigenLayer.\n    event FrozenStatusReset(address indexed previouslySlashedAddress);\n\n    /**\n     * @notice Gives the `contractAddress` permission to slash the funds of the caller.\n     * @dev Typically, this function must be called prior to registering for a middleware.\n     */\n    function optIntoSlashing(address contractAddress) external;\n\n    /**\n     * @notice Used for 'slashing' a certain operator.\n     * @param toBeFrozen The operator to be frozen.\n     * @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.\n     * @dev The operator must have previously given the caller (which should be a contract) the ability to slash them, through a call to `optIntoSlashing`.\n     */\n    function freezeOperator(address toBeFrozen) external;\n\n    /**\n     * @notice Removes the 'frozen' status from each of the `frozenAddresses`\n     * @dev Callable only by the contract owner (i.e. governance).\n     */\n    function resetFrozenStatus(address[] calldata frozenAddresses) external;\n\n    /**\n     * @notice this function is a called by middlewares during an operator's registration to make sure the operator's stake at registration\n     *         is slashable until serveUntil\n     * @param operator the operator whose stake update is being recorded\n     * @param serveUntilBlock the block until which the operator's stake at the current block is slashable\n     * @dev adds the middleware's slashing contract to the operator's linked list\n     */\n    function recordFirstStakeUpdate(\n        address operator,\n        uint32 serveUntilBlock\n    ) external;\n\n    /**\n     * @notice this function is a called by middlewares during a stake update for an operator (perhaps to free pending withdrawals)\n     *         to make sure the operator's stake at updateBlock is slashable until serveUntil\n     * @param operator the operator whose stake update is being recorded\n     * @param updateBlock the block for which the stake update is being recorded\n     * @param serveUntilBlock the block until which the operator's stake at updateBlock is slashable\n     * @param insertAfter the element of the operators linked list that the currently updating middleware should be inserted after\n     * @dev insertAfter should be calculated offchain before making the transaction that calls this. this is subject to race conditions,\n     *      but it is anticipated to be rare and not detrimental.\n     */\n    function recordStakeUpdate(\n        address operator,\n        uint32 updateBlock,\n        uint32 serveUntilBlock,\n        uint256 insertAfter\n    ) external;\n\n    /**\n     * @notice this function is a called by middlewares during an operator's deregistration to make sure the operator's stake at deregistration\n     *         is slashable until serveUntil\n     * @param operator the operator whose stake update is being recorded\n     * @param serveUntilBlock the block until which the operator's stake at the current block is slashable\n     * @dev removes the middleware's slashing contract to the operator's linked list and revokes the middleware's (i.e. caller's) ability to\n     * slash `operator` once `serveUntil` is reached\n     */\n    function recordLastStakeUpdateAndRevokeSlashingAbility(\n        address operator,\n        uint32 serveUntilBlock\n    ) external;\n\n    /// @notice The StrategyManager contract of EigenLayer\n    function strategyManager() external view returns (IStrategyManager);\n\n    /// @notice The DelegationManager contract of EigenLayer\n    function delegation() external view returns (IDelegationManager);\n\n    /**\n     * @notice Used to determine whether `staker` is actively 'frozen'. If a staker is frozen, then they are potentially subject to\n     * slashing of their funds, and cannot cannot deposit or withdraw from the strategyManager until the slashing process is completed\n     * and the staker's status is reset (to 'unfrozen').\n     * @param staker The staker of interest.\n     * @return Returns 'true' if `staker` themselves has their status set to frozen, OR if the staker is delegated\n     * to an operator who has their status set to frozen. Otherwise returns 'false'.\n     */\n    function isFrozen(address staker) external view returns (bool);\n\n    /// @notice Returns true if `slashingContract` is currently allowed to slash `toBeSlashed`.\n    function canSlash(\n        address toBeSlashed,\n        address slashingContract\n    ) external view returns (bool);\n\n    /// @notice Returns the block until which `serviceContract` is allowed to slash the `operator`.\n    function contractCanSlashOperatorUntilBlock(\n        address operator,\n        address serviceContract\n    ) external view returns (uint32);\n\n    /// @notice Returns the block at which the `serviceContract` last updated its view of the `operator`'s stake\n    function latestUpdateBlock(\n        address operator,\n        address serviceContract\n    ) external view returns (uint32);\n\n    /// @notice A search routine for finding the correct input value of `insertAfter` to `recordStakeUpdate` / `_updateMiddlewareList`.\n    function getCorrectValueForInsertAfter(\n        address operator,\n        uint32 updateBlock\n    ) external view returns (uint256);\n\n    /**\n     * @notice Returns 'true' if `operator` can currently complete a withdrawal started at the `withdrawalStartBlock`, with `middlewareTimesIndex` used\n     * to specify the index of a `MiddlewareTimes` struct in the operator's list (i.e. an index in `operatorToMiddlewareTimes[operator]`). The specified\n     * struct is consulted as proof of the `operator`'s ability (or lack thereof) to complete the withdrawal.\n     * This function will return 'false' if the operator cannot currently complete a withdrawal started at the `withdrawalStartBlock`, *or* in the event\n     * that an incorrect `middlewareTimesIndex` is supplied, even if one or more correct inputs exist.\n     * @param operator Either the operator who queued the withdrawal themselves, or if the withdrawing party is a staker who delegated to an operator,\n     * this address is the operator *who the staker was delegated to* at the time of the `withdrawalStartBlock`.\n     * @param withdrawalStartBlock The block number at which the withdrawal was initiated.\n     * @param middlewareTimesIndex Indicates an index in `operatorToMiddlewareTimes[operator]` to consult as proof of the `operator`'s ability to withdraw\n     * @dev The correct `middlewareTimesIndex` input should be computable off-chain.\n     */\n    function canWithdraw(\n        address operator,\n        uint32 withdrawalStartBlock,\n        uint256 middlewareTimesIndex\n    ) external returns (bool);\n\n    /**\n     * operator =>\n     *  [\n     *      (\n     *          the least recent update block of all of the middlewares it's serving/served,\n     *          latest time that the stake bonded at that update needed to serve until\n     *      )\n     *  ]\n     */\n    function operatorToMiddlewareTimes(\n        address operator,\n        uint256 arrayIndex\n    ) external view returns (MiddlewareTimes memory);\n\n    /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator].length`\n    function middlewareTimesLength(\n        address operator\n    ) external view returns (uint256);\n\n    /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator][index].stalestUpdateBlock`.\n    function getMiddlewareTimesIndexStalestUpdateBlock(\n        address operator,\n        uint32 index\n    ) external view returns (uint32);\n\n    /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator][index].latestServeUntil`.\n    function getMiddlewareTimesIndexServeUntilBlock(\n        address operator,\n        uint32 index\n    ) external view returns (uint32);\n\n    /// @notice Getter function for fetching `_operatorToWhitelistedContractsByUpdate[operator].size`.\n    function operatorWhitelistedContractsLinkedListSize(\n        address operator\n    ) external view returns (uint256);\n\n    /// @notice Getter function for fetching a single node in the operator's linked list (`_operatorToWhitelistedContractsByUpdate[operator]`).\n    function operatorWhitelistedContractsLinkedListEntry(\n        address operator,\n        address node\n    ) external view returns (bool, uint256, uint256);\n}\n"},{"file_path":"contracts/interfaces/IStrategy.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @title Minimal interface for an `Strategy` contract.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice Custom `Strategy` implementations may expand extensively on this interface.\n */\ninterface IStrategy {\n    /**\n     * @notice Used to deposit tokens into this Strategy\n     * @param token is the ERC20 token being deposited\n     * @param amount is the amount of token being deposited\n     * @dev This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's\n     * `depositIntoStrategy` function, and individual share balances are recorded in the strategyManager as well.\n     * @return newShares is the number of new shares issued at the current exchange ratio.\n     */\n    function deposit(IERC20 token, uint256 amount) external returns (uint256);\n\n    /**\n     * @notice Used to withdraw tokens from this Strategy, to the `recipient`'s address\n     * @param recipient is the address to receive the withdrawn funds\n     * @param token is the ERC20 token being transferred out\n     * @param amountShares is the amount of shares being withdrawn\n     * @dev This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's\n     * other functions, and individual share balances are recorded in the strategyManager as well.\n     */\n    function withdraw(\n        address recipient,\n        IERC20 token,\n        uint256 amountShares\n    ) external;\n\n    /**\n     * @notice Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy.\n     * @notice In contrast to `sharesToUnderlyingView`, this function **may** make state modifications\n     * @param amountShares is the amount of shares to calculate its conversion into the underlying token\n     * @return The amount of underlying tokens corresponding to the input `amountShares`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function sharesToUnderlying(\n        uint256 amountShares\n    ) external returns (uint256);\n\n    /**\n     * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy.\n     * @notice In contrast to `underlyingToSharesView`, this function **may** make state modifications\n     * @param amountUnderlying is the amount of `underlyingToken` to calculate its conversion into strategy shares\n     * @return The amount of underlying tokens corresponding to the input `amountShares`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function underlyingToShares(\n        uint256 amountUnderlying\n    ) external returns (uint256);\n\n    /**\n     * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in\n     * this strategy. In contrast to `userUnderlyingView`, this function **may** make state modifications\n     */\n    function userUnderlying(address user) external returns (uint256);\n\n    /**\n     * @notice convenience function for fetching the current total shares of `user` in this strategy, by\n     * querying the `strategyManager` contract\n     */\n    function shares(address user) external view returns (uint256);\n\n    /**\n     * @notice Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy.\n     * @notice In contrast to `sharesToUnderlying`, this function guarantees no state modifications\n     * @param amountShares is the amount of shares to calculate its conversion into the underlying token\n     * @return The amount of shares corresponding to the input `amountUnderlying`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function sharesToUnderlyingView(\n        uint256 amountShares\n    ) external view returns (uint256);\n\n    /**\n     * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy.\n     * @notice In contrast to `underlyingToShares`, this function guarantees no state modifications\n     * @param amountUnderlying is the amount of `underlyingToken` to calculate its conversion into strategy shares\n     * @return The amount of shares corresponding to the input `amountUnderlying`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function underlyingToSharesView(\n        uint256 amountUnderlying\n    ) external view returns (uint256);\n\n    /**\n     * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in\n     * this strategy. In contrast to `userUnderlying`, this function guarantees no state modifications\n     */\n    function userUnderlyingView(address user) external view returns (uint256);\n\n    /// @notice The underlying token for shares in this Strategy\n    function underlyingToken() external view returns (IERC20);\n\n    /// @notice The total number of extant shares in this Strategy\n    function totalShares() external view returns (uint256);\n\n    /// @notice Returns either a brief string explaining the strategy's goal & purpose, or a link to metadata that explains in more detail.\n    function explanation() external view returns (string memory);\n}\n"},{"file_path":"contracts/interfaces/IStrategyManager.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IStrategy.sol\";\nimport \"./ISlasher.sol\";\nimport \"./IDelegationManager.sol\";\nimport \"./IEigenPodManager.sol\";\n\n/**\n * @title Interface for the primary entrypoint for funds into EigenLayer.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice See the `StrategyManager` contract itself for implementation details.\n */\ninterface IStrategyManager {\n    /**\n     * @notice Emitted when a new deposit occurs on behalf of `staker`.\n     * @param staker Is the staker who is depositing funds into EigenLayer.\n     * @param strategy Is the strategy that `staker` has deposited into.\n     * @param token Is the token that `staker` deposited.\n     * @param shares Is the number of new shares `staker` has been granted in `strategy`.\n     */\n    event Deposit(\n        address staker,\n        IERC20 token,\n        IStrategy strategy,\n        uint256 shares\n    );\n\n    /// @notice Emitted when `thirdPartyTransfersForbidden` is updated for a strategy and value by the owner\n    event UpdatedThirdPartyTransfersForbidden(IStrategy strategy, bool value);\n\n    /// @notice Emitted when the `strategyWhitelister` is changed\n    event StrategyWhitelisterChanged(\n        address previousAddress,\n        address newAddress\n    );\n\n    /// @notice Emitted when a strategy is added to the approved list of strategies for deposit\n    event StrategyAddedToDepositWhitelist(IStrategy strategy);\n\n    /// @notice Emitted when a strategy is removed from the approved list of strategies for deposit\n    event StrategyRemovedFromDepositWhitelist(IStrategy strategy);\n\n    /**\n     * @notice Deposits `amount` of `token` into the specified `strategy`, with the resultant shares credited to `msg.sender`\n     * @param strategy is the specified strategy where deposit is to be made,\n     * @param token is the denomination in which the deposit is to be made,\n     * @param amount is the amount of token to be deposited in the strategy by the staker\n     * @return shares The amount of new shares in the `strategy` created as part of the action.\n     * @dev The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf.\n     * @dev Cannot be called by an address that is 'frozen' (this function will revert if the `msg.sender` is frozen).\n     *\n     * WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended.  This can lead to attack vectors\n     *          where the token balance and corresponding strategy shares are not in sync upon reentrancy.\n     */\n    function depositIntoStrategy(\n        IStrategy strategy,\n        IERC20 token,\n        uint256 amount\n    ) external returns (uint256 shares);\n\n    /**\n     * @notice Used for depositing an asset into the specified strategy with the resultant shares credited to `staker`,\n     * who must sign off on the action.\n     * Note that the assets are transferred out/from the `msg.sender`, not from the `staker`; this function is explicitly designed\n     * purely to help one address deposit 'for' another.\n     * @param strategy is the specified strategy where deposit is to be made,\n     * @param token is the denomination in which the deposit is to be made,\n     * @param amount is the amount of token to be deposited in the strategy by the staker\n     * @param staker the staker that the deposited assets will be credited to\n     * @param expiry the timestamp at which the signature expires\n     * @param signature is a valid signature from the `staker`. either an ECDSA signature if the `staker` is an EOA, or data to forward\n     * following EIP-1271 if the `staker` is a contract\n     * @return shares The amount of new shares in the `strategy` created as part of the action.\n     * @dev The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf.\n     * @dev A signature is required for this function to eliminate the possibility of griefing attacks, specifically those\n     * targeting stakers who may be attempting to undelegate.\n     * @dev Cannot be called if thirdPartyTransfersForbidden is set to true for this strategy\n     *\n     *  WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended.  This can lead to attack vectors\n     *          where the token balance and corresponding strategy shares are not in sync upon reentrancy\n     */\n    function depositIntoStrategyWithSignature(\n        IStrategy strategy,\n        IERC20 token,\n        uint256 amount,\n        address staker,\n        uint256 expiry,\n        bytes memory signature\n    ) external returns (uint256 shares);\n\n    /// @notice Used by the DelegationManager to remove a Staker's shares from a particular strategy when entering the withdrawal queue\n    function removeShares(\n        address staker,\n        IStrategy strategy,\n        uint256 shares\n    ) external;\n\n    /// @notice Used by the DelegationManager to award a Staker some shares that have passed through the withdrawal queue\n    function addShares(\n        address staker,\n        IERC20 token,\n        IStrategy strategy,\n        uint256 shares\n    ) external;\n\n    /// @notice Used by the DelegationManager to convert withdrawn shares to tokens and send them to a recipient\n    function withdrawSharesAsTokens(\n        address recipient,\n        IStrategy strategy,\n        uint256 shares,\n        IERC20 token\n    ) external;\n\n    /// @notice Returns the current shares of `user` in `strategy`\n    function stakerStrategyShares(\n        address user,\n        IStrategy strategy\n    ) external view returns (uint256 shares);\n\n    /**\n     * @notice Get all details on the staker's deposits and corresponding shares\n     * @return (staker's strategies, shares in these strategies)\n     */\n    function getDeposits(\n        address staker\n    ) external view returns (IStrategy[] memory, uint256[] memory);\n\n    /// @notice Simple getter function that returns `stakerStrategyList[staker].length`.\n    function stakerStrategyListLength(\n        address staker\n    ) external view returns (uint256);\n\n    /**\n     * @notice Owner-only function that adds the provided Strategies to the 'whitelist' of strategies that stakers can deposit into\n     * @param strategiesToWhitelist Strategies that will be added to the `strategyIsWhitelistedForDeposit` mapping (if they aren't in it already)\n     * @param thirdPartyTransfersForbiddenValues bool values to set `thirdPartyTransfersForbidden` to for each strategy\n     */\n    function addStrategiesToDepositWhitelist(\n        IStrategy[] calldata strategiesToWhitelist,\n        bool[] calldata thirdPartyTransfersForbiddenValues\n    ) external;\n\n    /**\n     * @notice Owner-only function that removes the provided Strategies from the 'whitelist' of strategies that stakers can deposit into\n     * @param strategiesToRemoveFromWhitelist Strategies that will be removed to the `strategyIsWhitelistedForDeposit` mapping (if they are in it)\n     */\n    function removeStrategiesFromDepositWhitelist(\n        IStrategy[] calldata strategiesToRemoveFromWhitelist\n    ) external;\n\n    /// @notice Returns the single, central Delegation contract of EigenLayer\n    function delegation() external view returns (IDelegationManager);\n\n    /// @notice Returns the single, central Slasher contract of EigenLayer\n    function slasher() external view returns (ISlasher);\n\n    /// @notice Returns the EigenPodManager contract of EigenLayer\n    function eigenPodManager() external view returns (IEigenPodManager);\n\n    /// @notice Returns the address of the `strategyWhitelister`\n    function strategyWhitelister() external view returns (address);\n\n    /**\n     * @notice Returns bool for whether or not `strategy` enables credit transfers. i.e enabling\n     * depositIntoStrategyWithSignature calls or queueing withdrawals to a different address than the staker.\n     */\n    function thirdPartyTransfersForbidden(\n        IStrategy strategy\n    ) external view returns (bool);\n\n    // LIMITED BACKWARDS-COMPATIBILITY FOR DEPRECATED FUNCTIONALITY\n    // packed struct for queued withdrawals; helps deal with stack-too-deep errors\n    struct DeprecatedStruct_WithdrawerAndNonce {\n        address withdrawer;\n        uint96 nonce;\n    }\n\n    /**\n     * Struct type used to specify an existing queued withdrawal. Rather than storing the entire struct, only a hash is stored.\n     * In functions that operate on existing queued withdrawals -- e.g. `startQueuedWithdrawalWaitingPeriod` or `completeQueuedWithdrawal`,\n     * the data is resubmitted and the hash of the submitted data is computed by `calculateWithdrawalRoot` and checked against the\n     * stored hash in order to confirm the integrity of the submitted data.\n     */\n    struct DeprecatedStruct_QueuedWithdrawal {\n        IStrategy[] strategies;\n        uint256[] shares;\n        address staker;\n        DeprecatedStruct_WithdrawerAndNonce withdrawerAndNonce;\n        uint32 withdrawalStartBlock;\n        address delegatedAddress;\n    }\n\n    function migrateQueuedWithdrawal(\n        DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal\n    ) external returns (bool, bytes32);\n\n    function calculateWithdrawalRoot(\n        DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal\n    ) external pure returns (bytes32);\n}\n"},{"file_path":"contracts/libraries/BeaconChainProofs.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"./Merkle.sol\";\nimport \"../libraries/Endian.sol\";\n\n//Utility library for parsing and PHASE0 beacon chain block headers\n//SSZ Spec: https://github.com/ethereum/consensus-specs/blob/dev/ssz/simple-serialize.md#merkleization\n//BeaconBlockHeader Spec: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader\n//BeaconState Spec: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconstate\nlibrary BeaconChainProofs {\n\n    /// @notice Heights of various merkle trees in the beacon chain\n    /// - beaconBlockRoot\n    /// |                                             HEIGHT: BEACON_BLOCK_HEADER_TREE_HEIGHT\n    /// -- beaconStateRoot\n    /// |                                             HEIGHT: BEACON_STATE_TREE_HEIGHT\n    /// validatorContainerRoot, balanceContainerRoot\n    /// |                       |                     HEIGHT: BALANCE_TREE_HEIGHT\n    /// |                       individual balances\n    /// |                                             HEIGHT: VALIDATOR_TREE_HEIGHT\n    /// individual validators\n    uint256 internal constant BEACON_BLOCK_HEADER_TREE_HEIGHT = 3;\n    uint256 internal constant BEACON_STATE_TREE_HEIGHT = 5;\n    uint256 internal constant BALANCE_TREE_HEIGHT = 38;\n    uint256 internal constant VALIDATOR_TREE_HEIGHT = 40;\n    \n    /// @notice Index of the beaconStateRoot in the `BeaconBlockHeader` container\n    ///\n    /// BeaconBlockHeader = [..., state_root, ...]\n    ///                      0...      3\n    ///\n    /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader)\n    uint256 internal constant STATE_ROOT_INDEX = 3;\n\n    /// @notice Indices for fields in the `BeaconState` container\n    ///\n    /// BeaconState = [..., validators, balances, ...]\n    ///                0...     11         12\n    ///\n    /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#beaconstate)\n    uint256 internal constant VALIDATOR_CONTAINER_INDEX = 11;\n    uint256 internal constant BALANCE_CONTAINER_INDEX = 12;\n\n    /// @notice Number of fields in the `Validator` container\n    /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator)\n    uint256 internal constant VALIDATOR_FIELDS_LENGTH = 8;\n\n    /// @notice Indices for fields in the `Validator` container\n    uint256 internal constant VALIDATOR_PUBKEY_INDEX = 0;\n    uint256 internal constant VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX = 1;\n    uint256 internal constant VALIDATOR_BALANCE_INDEX = 2;\n    uint256 internal constant VALIDATOR_SLASHED_INDEX = 3;\n    uint256 internal constant VALIDATOR_EXIT_EPOCH_INDEX = 6;\n\n    /// @notice Slot/Epoch timings\n    uint64 internal constant SECONDS_PER_SLOT = 12;\n    uint64 internal constant SLOTS_PER_EPOCH = 32;\n    uint64 internal constant SECONDS_PER_EPOCH = SLOTS_PER_EPOCH * SECONDS_PER_SLOT;\n\n    /// @notice `FAR_FUTURE_EPOCH` is used as the default value for certain `Validator`\n    /// fields when a `Validator` is first created on the beacon chain\n    uint64 internal constant FAR_FUTURE_EPOCH = type(uint64).max;\n    bytes8 internal constant UINT64_MASK = 0xffffffffffffffff;\n\n    /// @notice Contains a beacon state root and a merkle proof verifying its inclusion under a beacon block root\n    struct StateRootProof {\n        bytes32 beaconStateRoot;\n        bytes proof;\n    }\n\n    /// @notice Contains a validator's fields and a merkle proof of their inclusion under a beacon state root\n    struct ValidatorProof {\n        bytes32[] validatorFields;\n        bytes proof;\n    }\n\n    /// @notice Contains a beacon balance container root and a proof of this root under a beacon block root\n    struct BalanceContainerProof {\n        bytes32 balanceContainerRoot;\n        bytes proof;\n    }\n\n    /// @notice Contains a validator balance root and a proof of its inclusion under a balance container root\n    struct BalanceProof {\n        bytes32 pubkeyHash;\n        bytes32 balanceRoot;\n        bytes proof;\n    }\n\n    /*******************************************************************************\n                 VALIDATOR FIELDS -> BEACON STATE ROOT -> BEACON BLOCK ROOT\n    *******************************************************************************/\n\n    /// @notice Verify a merkle proof of the beacon state root against a beacon block root\n    /// @param beaconBlockRoot merkle root of the beacon block\n    /// @param proof the beacon state root and merkle proof of its inclusion under `beaconBlockRoot`\n    function verifyStateRoot(\n        bytes32 beaconBlockRoot,\n        StateRootProof calldata proof\n    ) internal view {\n        require(\n            proof.proof.length == 32 * (BEACON_BLOCK_HEADER_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyStateRoot: Proof has incorrect length\"\n        );\n\n        /// This merkle proof verifies the `beaconStateRoot` under the `beaconBlockRoot`\n        /// - beaconBlockRoot\n        /// |                            HEIGHT: BEACON_BLOCK_HEADER_TREE_HEIGHT\n        /// -- beaconStateRoot\n        require(\n            Merkle.verifyInclusionSha256({\n                proof: proof.proof,\n                root: beaconBlockRoot,\n                leaf: proof.beaconStateRoot,\n                index: STATE_ROOT_INDEX\n            }),\n            \"BeaconChainProofs.verifyStateRoot: Invalid state root merkle proof\"\n        );\n    }\n\n    /// @notice Verify a merkle proof of a validator container against a `beaconStateRoot`\n    /// @dev This proof starts at a validator's container root, proves through the validator container root,\n    /// and continues proving to the root of the `BeaconState`\n    /// @dev See https://eth2book.info/capella/part3/containers/dependencies/#validator for info on `Validator` containers\n    /// @dev See https://eth2book.info/capella/part3/containers/state/#beaconstate for info on `BeaconState` containers\n    /// @param beaconStateRoot merkle root of the `BeaconState` container\n    /// @param validatorFields an individual validator's fields. These are merklized to form a `validatorRoot`,\n    /// which is used as the leaf to prove against `beaconStateRoot`\n    /// @param validatorFieldsProof a merkle proof of inclusion of `validatorFields` under `beaconStateRoot`\n    /// @param validatorIndex the validator's unique index\n    function verifyValidatorFields(\n        bytes32 beaconStateRoot,\n        bytes32[] calldata validatorFields,\n        bytes calldata validatorFieldsProof,\n        uint40 validatorIndex\n    ) internal view {\n        require(\n            validatorFields.length == VALIDATOR_FIELDS_LENGTH,\n            \"BeaconChainProofs.verifyValidatorFields: Validator fields has incorrect length\"\n        );\n\n        /// Note: the reason we use `VALIDATOR_TREE_HEIGHT + 1` here is because the merklization process for\n        /// this container includes hashing the root of the validator tree with the length of the validator list\n        require(\n            validatorFieldsProof.length == 32 * ((VALIDATOR_TREE_HEIGHT + 1) + BEACON_STATE_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyValidatorFields: Proof has incorrect length\"\n        );\n\n        // Merkleize `validatorFields` to get the leaf to prove\n        bytes32 validatorRoot = Merkle.merkleizeSha256(validatorFields);\n\n        /// This proof combines two proofs, so its index accounts for the relative position of leaves in two trees:\n        /// - beaconStateRoot\n        /// |                            HEIGHT: BEACON_STATE_TREE_HEIGHT\n        /// -- validatorContainerRoot\n        /// |                            HEIGHT: VALIDATOR_TREE_HEIGHT + 1\n        /// ---- validatorRoot\n        uint256 index = (VALIDATOR_CONTAINER_INDEX << (VALIDATOR_TREE_HEIGHT + 1)) | uint256(validatorIndex);\n\n        require(\n            Merkle.verifyInclusionSha256({\n                proof: validatorFieldsProof,\n                root: beaconStateRoot,\n                leaf: validatorRoot,\n                index: index\n            }),\n            \"BeaconChainProofs.verifyValidatorFields: Invalid merkle proof\"\n        );\n    }\n\n    /*******************************************************************************\n             VALIDATOR BALANCE -> BALANCE CONTAINER ROOT -> BEACON BLOCK ROOT\n    *******************************************************************************/\n\n    /// @notice Verify a merkle proof of the beacon state's balances container against the beacon block root\n    /// @dev This proof starts at the balance container root, proves through the beacon state root, and\n    /// continues proving through the beacon block root. As a result, this proof will contain elements\n    /// of a `StateRootProof` under the same block root, with the addition of proving the balances field\n    /// within the beacon state.\n    /// @dev This is used to make checkpoint proofs more efficient, as a checkpoint will verify multiple balances\n    /// against the same balance container root.\n    /// @param beaconBlockRoot merkle root of the beacon block\n    /// @param proof a beacon balance container root and merkle proof of its inclusion under `beaconBlockRoot`\n    function verifyBalanceContainer(\n        bytes32 beaconBlockRoot,\n        BalanceContainerProof calldata proof\n    ) internal view {\n        require(\n            proof.proof.length == 32 * (BEACON_BLOCK_HEADER_TREE_HEIGHT + BEACON_STATE_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyBalanceContainer: Proof has incorrect length\"\n        );\n\n        /// This proof combines two proofs, so its index accounts for the relative position of leaves in two trees:\n        /// - beaconBlockRoot\n        /// |                            HEIGHT: BEACON_BLOCK_HEADER_TREE_HEIGHT\n        /// -- beaconStateRoot\n        /// |                            HEIGHT: BEACON_STATE_TREE_HEIGHT\n        /// ---- balancesContainerRoot\n        uint256 index = (STATE_ROOT_INDEX << (BEACON_STATE_TREE_HEIGHT)) | BALANCE_CONTAINER_INDEX;\n        \n        require(\n            Merkle.verifyInclusionSha256({\n                proof: proof.proof,\n                root: beaconBlockRoot,\n                leaf: proof.balanceContainerRoot,\n                index: index\n            }),\n            \"BeaconChainProofs.verifyBalanceContainer: invalid balance container proof\"\n        );\n    }\n\n    /// @notice Verify a merkle proof of a validator's balance against the beacon state's `balanceContainerRoot`\n    /// @param balanceContainerRoot the merkle root of all validators' current balances\n    /// @param validatorIndex the index of the validator whose balance we are proving\n    /// @param proof the validator's associated balance root and a merkle proof of inclusion under `balanceContainerRoot`\n    /// @return validatorBalanceGwei the validator's current balance (in gwei)\n    function verifyValidatorBalance(\n        bytes32 balanceContainerRoot,\n        uint40 validatorIndex,\n        BalanceProof calldata proof\n    ) internal view returns (uint64 validatorBalanceGwei) {\n        /// Note: the reason we use `BALANCE_TREE_HEIGHT + 1` here is because the merklization process for\n        /// this container includes hashing the root of the balances tree with the length of the balances list\n        require(\n            proof.proof.length == 32 * (BALANCE_TREE_HEIGHT + 1),\n            \"BeaconChainProofs.verifyValidatorBalance: Proof has incorrect length\"\n        );\n\n        /// When merkleized, beacon chain balances are combined into groups of 4 called a `balanceRoot`. The merkle\n        /// proof here verifies that this validator's `balanceRoot` is included in the `balanceContainerRoot`\n        /// - balanceContainerRoot\n        /// |                            HEIGHT: BALANCE_TREE_HEIGHT\n        /// -- balanceRoot\n        uint256 balanceIndex = uint256(validatorIndex / 4);\n \n        require(\n            Merkle.verifyInclusionSha256({\n                proof: proof.proof,\n                root: balanceContainerRoot,\n                leaf: proof.balanceRoot,\n                index: balanceIndex\n            }),\n            \"BeaconChainProofs.verifyValidatorBalance: Invalid merkle proof\"\n        );\n\n        /// Extract the individual validator's balance from the `balanceRoot`\n        return getBalanceAtIndex(proof.balanceRoot, validatorIndex);\n    }\n\n    /**\n     * @notice Parses a balanceRoot to get the uint64 balance of a validator.  \n     * @dev During merkleization of the beacon state balance tree, four uint64 values are treated as a single \n     * leaf in the merkle tree. We use validatorIndex % 4 to determine which of the four uint64 values to \n     * extract from the balanceRoot.\n     * @param balanceRoot is the combination of 4 validator balances being proven for\n     * @param validatorIndex is the index of the validator being proven for\n     * @return The validator's balance, in Gwei\n     */\n    function getBalanceAtIndex(bytes32 balanceRoot, uint40 validatorIndex) internal pure returns (uint64) {\n        uint256 bitShiftAmount = (validatorIndex % 4) * 64;\n        return \n            Endian.fromLittleEndianUint64(bytes32((uint256(balanceRoot) << bitShiftAmount)));\n    }\n\n    /// @notice Indices for fields in the `Validator` container:\n    /// 0: pubkey\n    /// 1: withdrawal credentials\n    /// 2: effective balance\n    /// 3: slashed?\n    /// 4: activation elligibility epoch\n    /// 5: activation epoch\n    /// 6: exit epoch\n    /// 7: withdrawable epoch\n    ///\n    /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator)\n\n    /// @dev Retrieves a validator's pubkey hash\n    function getPubkeyHash(bytes32[] memory validatorFields) internal pure returns (bytes32) {\n        return \n            validatorFields[VALIDATOR_PUBKEY_INDEX];\n    }\n\n    /// @dev Retrieves a validator's withdrawal credentials\n    function getWithdrawalCredentials(bytes32[] memory validatorFields) internal pure returns (bytes32) {\n        return\n            validatorFields[VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX];\n    }\n\n    /// @dev Retrieves a validator's effective balance (in gwei)\n    function getEffectiveBalanceGwei(bytes32[] memory validatorFields) internal pure returns (uint64) {\n        return \n            Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_BALANCE_INDEX]);\n    }\n\n    /// @dev Retrieves true IFF a validator is marked slashed\n    function isValidatorSlashed(bytes32[] memory validatorFields) internal pure returns (bool) {\n        return validatorFields[VALIDATOR_SLASHED_INDEX] != 0;\n    }\n\n    /// @dev Retrieves a validator's exit epoch\n    function getExitEpoch(bytes32[] memory validatorFields) internal pure returns (uint64) {\n        return \n            Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_EXIT_EPOCH_INDEX]);\n    }\n}\n"},{"file_path":"contracts/libraries/Endian.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\nlibrary Endian {\n    /**\n     * @notice Converts a little endian-formatted uint64 to a big endian-formatted uint64\n     * @param lenum little endian-formatted uint64 input, provided as 'bytes32' type\n     * @return n The big endian-formatted uint64\n     * @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)\n     * through a right-shift/shr operation.\n     */\n    function fromLittleEndianUint64(\n        bytes32 lenum\n    ) internal pure returns (uint64 n) {\n        // the number needs to be stored in little-endian encoding (ie in bytes 0-8)\n        n = uint64(uint256(lenum >> 192));\n        return\n            (n >> 56) |\n            ((0x00FF000000000000 & n) >> 40) |\n            ((0x0000FF0000000000 & n) >> 24) |\n            ((0x000000FF00000000 & n) >> 8) |\n            ((0x00000000FF000000 & n) << 8) |\n            ((0x0000000000FF0000 & n) << 24) |\n            ((0x000000000000FF00 & n) << 40) |\n            ((0x00000000000000FF & n) << 56);\n    }\n}\n"},{"file_path":"contracts/libraries/InceptionLibrary.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/**\n * @dev It serves two primary functions:\n * 1. Flash vault-related logic for the calculation of deposit bonuses and withdrawal fees.\n * 2. Conversion between shares and assets.\n * @author InceptionLRT V2\n */\nlibrary InceptionLibrary {\n    uint256 constant MAX_PERCENT = 100 * 1e8;\n\n    /************************************************************\n     ************************ Flash Vault ***********************\n     ************************************************************/\n\n    function calculateDepositBonus(\n        uint256 amount,\n        uint256 capacity,\n        uint256 optimalCapacity,\n        uint256 optimalBonusRate,\n        uint256 maxDepositBonusRate,\n        uint256 targetCapacity\n    ) external pure returns (uint256 bonus) {\n        /// @dev the utilization rate is in the range [0:25] %\n        if (amount > 0 && capacity < optimalCapacity) {\n            uint256 replenished = amount;\n            if (optimalCapacity < capacity + amount)\n                replenished = optimalCapacity - capacity;\n\n            uint256 bonusSlope = ((maxDepositBonusRate - optimalBonusRate) *\n                1e18) / ((optimalCapacity * 1e18) / targetCapacity);\n            uint256 bonusPercent = maxDepositBonusRate -\n                (bonusSlope * (capacity + replenished / 2)) /\n                targetCapacity;\n\n            capacity += replenished;\n            bonus += (replenished * bonusPercent) / MAX_PERCENT;\n            amount -= replenished;\n        }\n        /// @dev the utilization rate is in the range [25: ] %\n        if (amount > 0 && capacity <= targetCapacity) {\n            uint256 replenished = targetCapacity > capacity + amount\n                ? amount\n                : targetCapacity - capacity;\n\n            bonus += (replenished * optimalBonusRate) / MAX_PERCENT;\n        }\n    }\n\n    function calculateWithdrawalFee(\n        uint256 amount,\n        uint256 capacity,\n        uint256 optimalCapacity,\n        uint256 optimalFeeRate,\n        uint256 maxFlashWithdrawalFeeRate,\n        uint256 targetCapacity\n    ) external pure returns (uint256 fee) {\n        /// @dev the utilization rate is in the range [100:25] %\n        if (amount > 0 && capacity > optimalCapacity) {\n            uint256 replenished = amount;\n            if (capacity - amount < optimalCapacity)\n                replenished = capacity - optimalCapacity;\n\n            fee += (replenished * optimalFeeRate) / MAX_PERCENT;\n            amount -= replenished;\n            capacity -= replenished;\n            if (fee == 0) ++fee;\n        }\n        /// @dev the utilization rate is in the range [25:0] %\n        if (amount > 0) {\n            uint256 feeSlope = ((maxFlashWithdrawalFeeRate - optimalFeeRate) *\n                1e18) / ((optimalCapacity * 1e18) / targetCapacity);\n            uint256 bonusPercent = maxFlashWithdrawalFeeRate -\n                (feeSlope * (capacity - amount / 2)) /\n                targetCapacity;\n            fee += (amount * bonusPercent) / MAX_PERCENT;\n            if (fee == 0) ++fee;\n        }\n        if (fee == 0) ++fee;\n    }\n}\n"},{"file_path":"contracts/libraries/Merkle.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\n// Adapted from OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The tree and the proofs can be generated using our\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\n * You will find a quickstart guide in the readme.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n * OpenZeppelin's JavaScript library generates merkle trees that are safe\n * against this attack out of the box.\n */\nlibrary Merkle {\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * Note this is for a Merkle tree using the keccak/sha3 hash function\n     */\n    function verifyInclusionKeccak(\n        bytes memory proof,\n        bytes32 root,\n        bytes32 leaf,\n        uint256 index\n    ) internal pure returns (bool) {\n        return processInclusionProofKeccak(proof, leaf, index) == root;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * _Available since v4.4._\n     *\n     * Note this is for a Merkle tree using the keccak/sha3 hash function\n     */\n    function processInclusionProofKeccak(\n        bytes memory proof,\n        bytes32 leaf,\n        uint256 index\n    ) internal pure returns (bytes32) {\n        require(\n            proof.length != 0 && proof.length % 32 == 0,\n            \"Merkle.processInclusionProofKeccak: proof length should be a non-zero multiple of 32\"\n        );\n        bytes32 computedHash = leaf;\n        for (uint256 i = 32; i <= proof.length; i += 32) {\n            if (index % 2 == 0) {\n                // if ith bit of index is 0, then computedHash is a left sibling\n                assembly {\n                    mstore(0x00, computedHash)\n                    mstore(0x20, mload(add(proof, i)))\n                    computedHash := keccak256(0x00, 0x40)\n                    index := div(index, 2)\n                }\n            } else {\n                // if ith bit of index is 1, then computedHash is a right sibling\n                assembly {\n                    mstore(0x00, mload(add(proof, i)))\n                    mstore(0x20, computedHash)\n                    computedHash := keccak256(0x00, 0x40)\n                    index := div(index, 2)\n                }\n            }\n        }\n        return computedHash;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * Note this is for a Merkle tree using the sha256 hash function\n     */\n    function verifyInclusionSha256(\n        bytes memory proof,\n        bytes32 root,\n        bytes32 leaf,\n        uint256 index\n    ) internal view returns (bool) {\n        return processInclusionProofSha256(proof, leaf, index) == root;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * _Available since v4.4._\n     *\n     * Note this is for a Merkle tree using the sha256 hash function\n     */\n    function processInclusionProofSha256(\n        bytes memory proof,\n        bytes32 leaf,\n        uint256 index\n    ) internal view returns (bytes32) {\n        require(\n            proof.length != 0 && proof.length % 32 == 0,\n            \"Merkle.processInclusionProofSha256: proof length should be a non-zero multiple of 32\"\n        );\n        bytes32[1] memory computedHash = [leaf];\n        for (uint256 i = 32; i <= proof.length; i += 32) {\n            if (index % 2 == 0) {\n                // if ith bit of index is 0, then computedHash is a left sibling\n                assembly {\n                    mstore(0x00, mload(computedHash))\n                    mstore(0x20, mload(add(proof, i)))\n                    if iszero(\n                        staticcall(\n                            sub(gas(), 2000),\n                            2,\n                            0x00,\n                            0x40,\n                            computedHash,\n                            0x20\n                        )\n                    ) {\n                        revert(0, 0)\n                    }\n                    index := div(index, 2)\n                }\n            } else {\n                // if ith bit of index is 1, then computedHash is a right sibling\n                assembly {\n                    mstore(0x00, mload(add(proof, i)))\n                    mstore(0x20, mload(computedHash))\n                    if iszero(\n                        staticcall(\n                            sub(gas(), 2000),\n                            2,\n                            0x00,\n                            0x40,\n                            computedHash,\n                            0x20\n                        )\n                    ) {\n                        revert(0, 0)\n                    }\n                    index := div(index, 2)\n                }\n            }\n        }\n        return computedHash[0];\n    }\n\n    /**\n     @notice this function returns the merkle root of a tree created from a set of leaves using sha256 as its hash function\n     @param leaves the leaves of the merkle tree\n     @return The computed Merkle root of the tree.\n     @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.\n     */\n    function merkleizeSha256(\n        bytes32[] memory leaves\n    ) internal pure returns (bytes32) {\n        //there are half as many nodes in the layer above the leaves\n        uint256 numNodesInLayer = leaves.length / 2;\n        //create a layer to store the internal nodes\n        bytes32[] memory layer = new bytes32[](numNodesInLayer);\n        //fill the layer with the pairwise hashes of the leaves\n        for (uint i = 0; i < numNodesInLayer; i++) {\n            layer[i] = sha256(\n                abi.encodePacked(leaves[2 * i], leaves[2 * i + 1])\n            );\n        }\n        //the next layer above has half as many nodes\n        numNodesInLayer /= 2;\n        //while we haven't computed the root\n        while (numNodesInLayer != 0) {\n            //overwrite the first numNodesInLayer nodes in layer with the pairwise hashes of their children\n            for (uint i = 0; i < numNodesInLayer; i++) {\n                layer[i] = sha256(\n                    abi.encodePacked(layer[2 * i], layer[2 * i + 1])\n                );\n            }\n            //the next layer above has half as many nodes\n            numNodesInLayer /= 2;\n        }\n        //the first node in the layer is the root\n        return layer[0];\n    }\n}\n"},{"file_path":"contracts/restaker/IRestaker.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"./IRestakerFacets.sol\";\n\n/**\n * @title Diamond-like implementation which support call with context (simple call).\n * @author GenesisLST\n */\ninterface IRestaker {\n    error RestakerCannotClaim();\n\n    event Claimed(address indexed recipient, uint256 amount);\n\n    event RewardsCoordinatorChanged(address indexed rewardCoordinator, address indexed newRewardCoordinator);\n\n    function initialize(address owner, IRestakerFacets facets) external;\n\n    function __claim() external;\n\n    function __setRewardsCoordinator(address newRewardsCoordinator, address claimer) external;\n}\n"},{"file_path":"contracts/restaker/IRestakerDeployer.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"./IRestaker.sol\";\n\ninterface IRestakerDeployer {\n    event RestakerDeployed(\n        address indexed creator,\n        IRestaker indexed restaker,\n        uint256 id\n    );\n\n    function BEACON_PROXY_BYTECODE() external view returns (bytes memory);\n\n    function beacon() external view returns (address);\n\n    function nonce() external view returns (uint256);\n\n    function deployRestaker() external returns (IRestaker restaker);\n\n    function getRestaker(uint256 id) external view returns (address);\n}\n"},{"file_path":"contracts/restaker/IRestakerFacets.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"../interfaces/IEigenPodManager.sol\";\n\ninterface IRestakerFacets {\n    error ZeroAddress();\n\n    event SignatureSet(FuncTarget indexed target, bytes4 signature);\n\n    enum FuncTarget {\n        POD,\n        POD_MANAGER,\n        DELEGATION_MANAGER\n    }\n\n    function selectorToTarget(bytes4 sig) external view returns (address);\n\n    function getEigenPodManager() external view returns (IEigenPodManager);\n\n    function getDelegationManager() external view returns (IDelegationManager);\n}\n"}],"is_verified_via_sourcify":true,"can_be_visualized_via_sol2uml":true,"evm_version":"paris","language":"solidity","is_verified_via_eth_bytecode_db":true,"is_fully_verified":false,"license_type":"none","is_blueprint":false,"name":"RestakingPool","creation_bytecode":"0x60806040523480156200001157600080fd5b506200001c62000022565b620000d6565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000735760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000d35780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6157e680620000e66000396000f3fe6080604052600436106103a55760003560e01c80637e388224116101e7578063bc7829271161010d578063e6a49733116100a0578063f21748ad1161006f578063f21748ad14610acc578063f527463314610aec578063fa57d00214610b0c578063fb8fa29014610b2157600080fd5b8063e6a4973314610a50578063e93c4f1514610a70578063eea4684d14610a85578063f1d37a2014610aa557600080fd5b8063d2045f6d116100dc578063d2045f6d146109db578063d50b810d146109f0578063d95edac914610a10578063dc835d6b14610a3057600080fd5b8063bc78292714610952578063c0d64a8714610988578063c2a672e01461099b578063d11531da146109bb57600080fd5b80639669c7cf11610185578063b0e21e8a11610154578063b0e21e8a146108ce578063b3870ef7146108f5578063b56c044114610915578063b637d6691461093c57600080fd5b80639669c7cf146104b657806396dae88b1461086e578063aa7e4e541461088e578063ad72cc35146108ae57600080fd5b80638c80fd90116101c15780638c80fd90146108025780638e59fbf6146108225780638e5f141d14610838578063901a7d531461085857600080fd5b80637e3882241461078c578063845b9150146107ac5780638903ab9d146107cc57600080fd5b80633f908551116102cc5780636180c6091161026a578063779a6cdd11610239578063779a6cdd146106c957806378288a38146106f057806379502c55146107125780637cf3d51e1461074457600080fd5b80636180c609146106575780636b77b2f51461066c5780636ff23d3114610682578063765fccca146106a957600080fd5b806345cced29116102a657806345cced29146105e25780634a6b629d1461060257806356a3b5fa146106225780635f4aa38d1461063757600080fd5b80633f9085511461058d578063417f9246146105a257806343bc42d3146105c257600080fd5b8063126d5df6116103445780633397547211610313578063339754721461052f5780633a0acdc1146105455780633a4b66f1146105655780633b1ddc611461056d57600080fd5b8063126d5df6146104cb57806314d6aed0146104e05780631f2ed36f146104e857806328af87b51461050f57600080fd5b80630c4f0e3f116103805780630c4f0e3f1461045b5780630f19aaef1461047d5780631036bbe21461049d57806311ae9ed2146104b657600080fd5b8062928917146103e657806301e1d11414610423578063034c44541461044657600080fd5b366103e15760405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b600080fd5b3480156103f257600080fd5b50604154610406906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b34801561042f57600080fd5b50610438610b41565b60405190815260200161041a565b34801561045257600080fd5b50610438610bbf565b34801561046757600080fd5b5061047b610476366004614400565b610d2a565b005b34801561048957600080fd5b5061047b61049836600461444b565b610e39565b3480156104a957600080fd5b506104066402540be40081565b3480156104c257600080fd5b50610438610f5b565b3480156104d757600080fd5b50603854610438565b61047b610f6a565b3480156104f457600080fd5b5060405461040690600160801b90046001600160401b031681565b34801561051b57600080fd5b5061047b61052a366004614494565b6110bb565b34801561053b57600080fd5b50610438603f5481565b34801561055157600080fd5b5061047b6105603660046144c4565b611440565b61047b611561565b34801561057957600080fd5b5061047b610588366004614525565b611847565b34801561059957600080fd5b5061043861199d565b3480156105ae57600080fd5b5061047b6105bd3660046146b5565b611a9c565b3480156105ce57600080fd5b5061047b6105dd366004614400565b611bcc565b3480156105ee57600080fd5b5061047b6105fd36600461471d565b611d22565b34801561060e57600080fd5b50604054610406906001600160401b031681565b34801561062e57600080fd5b50610438611e49565b34801561064357600080fd5b5061047b610652366004614751565b611f46565b34801561066357600080fd5b50603b54610438565b34801561067857600080fd5b5061043860435481565b34801561068e57600080fd5b5060415461040690600160801b90046001600160401b031681565b3480156106b557600080fd5b5061047b6106c43660046149f2565b6121c5565b3480156106d557600080fd5b5060405461040690600160401b90046001600160401b031681565b3480156106fc57600080fd5b506107056122e8565b60405161041a9190614ac7565b34801561071e57600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161041a565b34801561075057600080fd5b5061077c61075f366004614b1f565b6001600160a01b03166000908152603c6020526040902054151590565b604051901515815260200161041a565b34801561079857600080fd5b5061047b6107a7366004614b3c565b6123f1565b3480156107b857600080fd5b5061047b6107c73660046144c4565b6125f0565b3480156107d857600080fd5b506104386107e7366004614b1f565b6001600160a01b03166000908152603c602052604090205490565b34801561080e57600080fd5b5061047b61081d3660046144c4565b6126d7565b34801561082e57600080fd5b5061043861271081565b34801561084457600080fd5b5061047b610853366004614b3c565b6127be565b34801561086457600080fd5b5061043860425481565b34801561087a57600080fd5b506104386108893660046144c4565b6129a3565b34801561089a57600080fd5b5061047b6108a9366004614b7f565b6129bc565b3480156108ba57600080fd5b5061072c6108c9366004614bcc565b612ac7565b3480156108da57600080fd5b5060415461040690600160c01b90046001600160401b031681565b34801561090157600080fd5b5061047b610910366004614c0d565b612b2d565b34801561092157600080fd5b5060405461040690600160c01b90046001600160401b031681565b34801561094857600080fd5b5061043860445481565b34801561095e57600080fd5b5061043861096d366004614b1f565b6001600160a01b031660009081526039602052604090205490565b61047b6109963660046144c4565b612cb0565b3480156109a757600080fd5b5061047b6109b6366004614c94565b612ce6565b3480156109c757600080fd5b5061047b6109d6366004614b1f565b612ee1565b3480156109e757600080fd5b50603e54610438565b3480156109fc57600080fd5b5061047b610a0b366004614cc0565b61302d565b348015610a1c57600080fd5b5061047b610a2b366004614d0b565b61328c565b348015610a3c57600080fd5b5061047b610a4b366004614d26565b61333b565b348015610a5c57600080fd5b50610705610a6b366004614b1f565b61341f565b348015610a7c57600080fd5b50610438613582565b348015610a9157600080fd5b5061047b610aa0366004614e0c565b6135b6565b348015610ab157600080fd5b5060415461040690600160401b90046001600160401b031681565b348015610ad857600080fd5b5061047b610ae73660046144c4565b6136e2565b348015610af857600080fd5b50610438610b073660046144c4565b613791565b348015610b1857600080fd5b5061047b6138b8565b348015610b2d57600080fd5b5061047b610b3c36600461471d565b613af9565b6000806201518060435442610b569190614f17565b610b609190614f40565b9050600062015180604454610b759190614f40565b905080821115610b8757479250505090565b6000610b938383614f17565b82604254610ba19190614f40565b610bab9190614f54565b9050610bb78147614f17565b935050505090565b600080610bd46000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c359190614f6b565b604051600162e422bd60e01b03198152600160048201529091506000906001600160a01b0383169063c6e6f59290829063ff1bdd4390602401602060405180830381865afa158015610c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610caf9190614f88565b6040518263ffffffff1660e01b8152600401610ccd91815260200190565b602060405180830381865afa158015610cea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0e9190614f88565b90508060335411610d1f5780610d23565b6033545b9250505090565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9f9190614f6b565b6001600160a01b0316336001600160a01b031614610dd05760405163e2d4f15f60e01b815260040160405180910390fd5b6040805481516001600160401b03918216815290831660208201527fbf127022ae43ce46c7042f13c6e64c507f75f20314c2aee1b03b0cf208a10f39910160405180910390a16040805467ffffffffffffffff19166001600160401b0392909216919091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b0316600081158015610e7e5750825b90506000826001600160401b03166001148015610e9a5750303b155b905081158015610ea8575080155b15610ec65760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610ef057845460ff60401b1916600160401b1785555b610ef8613d33565b610f0188613d43565b610f0b8787613d6d565b8315610f5157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b6000610f65613d87565b905090565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdf9190614f6b565b6001600160a01b0316336001600160a01b03161461101057604051633734611360e01b815260040160405180910390fd5b6042543490156110735760006201518060445461102d9190614f40565b9050600062015180604354426110439190614f17565b61104d9190614f40565b90508181101561107057604051637f50d1ab60e11b815260040160405180910390fd5b50505b60428190554260438190556040805183815260208101929092527f40df43107e8b4d467127964bd3c966687c0a6a39aaede970755397fd09535e98910160405180910390a150565b6110c3613dd5565b6040546001600160401b03166000036110ef5760405163fe17a04160e01b815260040160405180910390fd5b3360006111046000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111659190614f6b565b604051600162e422bd60e01b03198152600481018690529091506000906001600160a01b0383169063ff1bdd4390602401602060405180830381865afa1580156111b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d79190614f88565b90506111e1610bbf565b811015611201576040516307bd37ff60e01b815260040160405180910390fd5b611209610f5b565b81111561123d57611218610f5b565b604051636688dd2d60e11b815260040161123491815260200190565b60405180910390fd5b600061124882613791565b90508060000361126b57604051630d23170560e01b815260040160405180910390fd5b6041546000906402540be4009061129290600160c01b90046001600160401b031684614f54565b61129c9190614f40565b604051632770a7eb60e21b81526001600160a01b038781166004830152602482018a905291925090851690639dc29fac90604401600060405180830381600087803b1580156112ea57600080fd5b505af11580156112fe573d6000803e3d6000fd5b5050505082603560008282546113149190614fa1565b9091555061132490508284614f17565b92506113308183614f17565b603f60008282546113419190614fa1565b90915550506000546113bf906001600160a01b03166001600160a01b0316633b19e84a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b79190614f6b565b826000613e0d565b506113cc86846000613e0d565b5060408051848152602081018990529081018390526001600160a01b03808716919088169082907f628a6f39215835333501afcce023c08e1e61c026768b46f5076804d344e023e39060600160405180910390a4505050505061143c600160008051602061579183398151915255565b5050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b59190614f6b565b6001600160a01b0316336001600160a01b0316146114e65760405163e2d4f15f60e01b815260040160405180910390fd5b6201518081108061150257506114ff6201518082614fb4565b15155b156115205760405163afff5f7760e01b815260040160405180910390fd5b60445460408051918252602082018390527f1638f4dadb33895a0e192a35d63a2677a5b9dbe482091d94d8877d0919473320910160405180910390a1604455565b60405434906001600160401b031660000361158f5760405163fe17a04160e01b815260040160405180910390fd5b611597611e49565b8110156115b75760405163273d2bdb60e21b815260040160405180910390fd5b6115bf61199d565b8111156115df57604051633175986360e21b815260040160405180910390fd5b603f546000901561168d5760006115f4610f5b565b90508281101561161057611609600084613ec1565b9150611626565b61162361161d8483614f17565b84613ec1565b91505b603f5482111561164057603f805460009091559150611658565b81603f60008282546116529190614f17565b90915550505b6040518281527f98b37da5bc0dc3a6af25a940988aef0df1a74411148692d8d74aa066658173059060200160405180910390a1505b6116978183614fa1565b915060006116ad6000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170e9190614f6b565b6040516363737ac960e11b8152600481018590529091506000906001600160a01b0383169063c6e6f59290602401602060405180830381865afa158015611759573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177d9190614f88565b90506001600160a01b0382166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b1580156117d757600080fd5b505af11580156117eb573d6000803e3d6000fd5b5050505083603460008282546118019190614fa1565b9091555050604080518581526020810183905233917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90910160405180910390a250505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bc9190614f6b565b6001600160a01b0316336001600160a01b0316146118ed5760405163e2d4f15f60e01b815260040160405180910390fd5b600061192e85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613f9492505050565b6040516388b856a760e01b81526001600160a01b0385811660048301528481166024830152919250908216906388b856a7906044015b600060405180830381600087803b15801561197e57600080fd5b505af1158015611992573d6000803e3d6000fd5b505050505050505050565b6000806119b26000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a139190614f6b565b6001600160a01b03166301e1d1146040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a749190614f88565b9050603e54811115611a8857600091505090565b80603e54611a969190614f17565b91505090565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b119190614f6b565b6001600160a01b0316336001600160a01b031614611b4257604051633734611360e01b815260040160405180910390fd5b6000611b4d84613f94565b6040516306ec6e8160e11b81529091506001600160a01b03821690630dd8dd0290611b7e908690869060040161508b565b6000604051808303816000875af1158015611b9d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bc59190810190615155565b5050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c419190614f6b565b6001600160a01b0316336001600160a01b031614611c725760405163e2d4f15f60e01b815260040160405180910390fd5b6402540be4006001600160401b0382161115611cac57604051630513fb8f60e31b81526001600160401b0382166004820152602401611234565b604154604080516001600160401b03600160c01b9093048316815291831660208301527fb51bef650ff5ad43303dbe2e500a74d4fd1bdc9ae05f046bece330e82ae0ba87910160405180910390a1604180546001600160401b03909216600160c01b026001600160c01b03909216919091179055565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d979190614f6b565b6001600160a01b0316336001600160a01b031614611dc857604051633734611360e01b815260040160405180910390fd5b6000611dd382613f94565b6040516336a2fa1960e21b81526001600160a01b0382166004820181905291925063da8be864906024016000604051808303816000875af1158015611e1c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611e449190810190615155565b505050565b600080611e5e6000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebf9190614f6b565b604051600162e422bd60e01b03198152600160048201526001600160a01b03919091169063ff1bdd4390602401602060405180830381865afa158015611f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2d9190614f88565b90508060325411611f3e5780611a96565b505060325490565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190614f6b565b6001600160a01b0316336001600160a01b031614611fec57604051633734611360e01b815260040160405180910390fd5b611ff4613dd5565b8483811415806120045750808214155b15612022576040516367af08e760e11b815260040160405180910390fd5b612035816801bc16d674ec800000614f54565b61203d613582565b101561205c57604051635093740560e01b815260040160405180910390fd5b600061206789613f94565b905060005b8281101561215357816001600160a01b0316639b4e46346801bc16d674ec8000008b8b8581811061209f5761209f6151e5565b90506020028101906120b191906151fb565b8b8b878181106120c3576120c36151e5565b90506020028101906120d591906151fb565b8b8b898181106120e7576120e76151e5565b905060200201356040518763ffffffff1660e01b815260040161210e95949392919061526a565b6000604051808303818588803b15801561212757600080fd5b505af115801561213b573d6000803e3d6000fd5b5050505050808061214b906152a4565b91505061206c565b508860405161216291906152e1565b60405180910390207f82893d4437db377df0abca554a4a9ef54de226c99efe74077b214d6d3390e7dd898960405161219b929190615392565b60405180910390a250506121bc600160008051602061579183398151915255565b50505050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223a9190614f6b565b6001600160a01b0316336001600160a01b03161461226b57604051633734611360e01b815260040160405180910390fd5b600061227687613f94565b6040516319a021cb60e11b81529091506001600160a01b038216906333404396906122ad9089908990899089908990600401615489565b600060405180830381600087803b1580156122c757600080fd5b505af11580156122db573d6000803e3d6000fd5b5050505050505050505050565b6036546037546060916122fa91614f17565b6001600160401b038111156123115761231161458c565b60405190808252806020026020018201604052801561235657816020015b604080518082019091526000808252602082015281526020019060019003908161232f5790505b506036549091506000905b6037548110156123ec576037818154811061237e5761237e6151e5565b60009182526020918290206040805180820190915260029092020180546001600160a01b03168252600101549181019190915283836123bc816152a4565b9450815181106123ce576123ce6151e5565b602002602001018190525080806123e4906152a4565b915050612361565b505090565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124669190614f6b565b6001600160a01b0316336001600160a01b0316146124975760405163e2d4f15f60e01b815260040160405180910390fd5b6402540be4006001600160401b03841611156124d157604051630513fb8f60e31b81526001600160401b0384166004820152602401611234565b6402540be4006001600160401b038316111561250b57604051630513fb8f60e31b81526001600160401b0383166004820152602401611234565b6402540be4006001600160401b038216111561254557604051630513fb8f60e31b81526001600160401b0382166004820152602401611234565b6040805477ffffffffffffffffffffffffffffffff00000000000000001916600160401b6001600160401b0386811691820267ffffffffffffffff60801b191692909217600160801b868416908102919091176001600160c01b0316600160c01b93861693840217845583519182526020820152918201527fbdd363e1b2c509839731ca7a94e48c8835b6de783af60bbfaeb08b9ba3862bea906060015b60405180910390a1505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126659190614f6b565b6001600160a01b0316336001600160a01b0316146126965760405163e2d4f15f60e01b815260040160405180910390fd5b60335460408051918252602082018390527f984016d328adef81f3cc09f8ea9e3420f85d390635be94215c432e83837aa0a2910160405180910390a1603355565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061274c9190614f6b565b6001600160a01b0316336001600160a01b03161461277d5760405163e2d4f15f60e01b815260040160405180910390fd5b60325460408051918252602082018390527fca11c8a4c461b60c9f485404c272650c2aaae260b2067d72e9924abb68556593910160405180910390a1603255565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561280f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128339190614f6b565b6001600160a01b0316336001600160a01b0316146128645760405163e2d4f15f60e01b815260040160405180910390fd5b6402540be4006001600160401b038416111561289e57604051630513fb8f60e31b81526001600160401b0384166004820152602401611234565b6402540be4006001600160401b03831611156128d857604051630513fb8f60e31b81526001600160401b0383166004820152602401611234565b6402540be4006001600160401b038216111561291257604051630513fb8f60e31b81526001600160401b0382166004820152602401611234565b604180546001600160401b03838116600160801b810267ffffffffffffffff60801b19878416600160401b81026fffffffffffffffffffffffffffffffff19909616948a16948517959095171617909355604080519182526020820192909252908101919091527ff3f49a7eaa29cb38bb074c44803e3ef1f47960b9529ee0c0a3aa47c0d4f93a9d906060016125e3565b60006129b66129b0610f5b565b83613ec1565b92915050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a319190614f6b565b6001600160a01b0316336001600160a01b031614612a6257604051633734611360e01b815260040160405180910390fd5b6000612a6d83613f94565b6040516388676cad60e01b815283151560048201529091506001600160a01b038216906388676cad90602401600060405180830381600087803b158015612ab357600080fd5b505af11580156121bc573d6000803e3d6000fd5b6000603d6000612b0c85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613fe892505050565b81526020810191909152604001600020546001600160a01b03169392505050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ba29190614f6b565b6001600160a01b0316336001600160a01b031614612bd357604051633734611360e01b815260040160405180910390fd5b6000612bde84613f94565b9050806001600160a01b031663dda3346c8484612c036000546001600160a01b031690565b6001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c649190614f6b565b6040518463ffffffff1660e01b8152600401612c82939291906155e4565b600060405180830381600087803b158015612c9c57600080fd5b505af1158015610f51573d6000803e3d6000fd5b612cb8611561565b60405181907f8c355e502e4eade8ac341bcb08dcfca0ae238efe6431e5a63b75be9026d9163b90600090a250565b612cee613dd5565b600080543391906001600160a01b03166001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5f9190614f6b565b604051600162e422bd60e01b03198152600481018590529091506000906001600160a01b0383169063ff1bdd4390602401602060405180830381865afa158015612dad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd19190614f88565b9050612ddb610bbf565b811015612dfb576040516307bd37ff60e01b815260040160405180910390fd5b604051632770a7eb60e21b81526001600160a01b03848116600483015260248201869052831690639dc29fac90604401600060405180830381600087803b158015612e4557600080fd5b505af1158015612e59573d6000803e3d6000fd5b50505050612e678582613ff3565b8060356000828254612e799190614fa1565b909155505060408051828152602081018690526001600160a01b0380881692908616917f06cc7e90b4f2b554a9614b0caa84f909f3498c820ae47c731f490c28c07f7d3b910160405180910390a350505061143c600160008051602061579183398151915255565b612ee9613dd5565b6001600160a01b038116612f10576040516321cb944560e11b815260040160405180910390fd5b6001600160a01b0381166000908152603c602052604081205490819003612f4a57604051630d23170560e01b815260040160405180910390fd5b603b54612f55610b41565b1015612f7457604051635093740560e01b815260040160405180910390fd5b80603b6000828254612f869190614f17565b90915550506001600160a01b0382166000908152603c60205260408120819055612fb1838383613e0d565b905080612fd157604051634dbb90c960e01b815260040160405180910390fd5b60405182815233906001600160a01b038516907febc6a30f46090cafd1f043241dbc148c4310b7026aae29ff950ea25a5411879b9060200160405180910390a3505061302a600160008051602061579183398151915255565b50565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa15801561307e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a29190614f6b565b6001600160a01b0316336001600160a01b0316146130d357604051633734611360e01b815260040160405180910390fd5b600061311484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613f9492505050565b90506000479050816001600160a01b031663ef8cdf7c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561315657600080fd5b505af115801561316a573d6000803e3d6000fd5b505050506000814761317c9190614f17565b9050808411156131a957604051634f274ad560e11b81526004810182905260248101859052604401611234565b600080546001600160a01b03166001600160a01b0316633b19e84a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132179190614f6b565b9050841561322d5761322b81866000613e0d565b505b806001600160a01b0316846001600160a01b03167f2ee827557318e24ad8fdb9f616bbfd73b44656ea23439623780d719c369f0c1d878560405161327b929190918252602082015260400190565b60405180910390a350505050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133019190614f6b565b6001600160a01b0316336001600160a01b0316146133325760405163e2d4f15f60e01b815260040160405180910390fd5b61302a81614114565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa15801561338c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b09190614f6b565b6001600160a01b0316336001600160a01b0316146133e157604051633734611360e01b815260040160405180910390fd5b60006133ec85613f94565b60405163eea9064b60e01b81529091506001600160a01b0382169063eea9064b9061196490879087908790600401615622565b60365460375460609161343191614f17565b6001600160401b038111156134485761344861458c565b60405190808252806020026020018201604052801561348d57816020015b60408051808201909152600080825260208201528152602001906001900390816134665790505b506036549091506000905b60375481101561355f57836001600160a01b0316603782815481106134bf576134bf6151e5565b60009182526020909120600290910201546001600160a01b03160361354d57603781815481106134f1576134f16151e5565b60009182526020918290206040805180820190915260029092020180546001600160a01b031682526001015491810191909152838361352f816152a4565b945081518110613541576135416151e5565b60200260200101819052505b80613557816152a4565b915050613498565b50600081835161356f9190614f17565b9050801561357b578183525b5050919050565b60008061358d610f5b565b905060006135996141b4565b9050818111156135ac5760009250505090565b610d238183614f17565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015613607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061362b9190614f6b565b6001600160a01b0316336001600160a01b03161461365c57604051633734611360e01b815260040160405180910390fd5b60006136678a613f94565b604051633f65cf1960e01b81529091506001600160a01b03821690633f65cf19906136a4908c908c908c908c908c908c908c908c906004016156d1565b600060405180830381600087803b1580156136be57600080fd5b505af11580156136d2573d6000803e3d6000fd5b5050505050505050505050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137579190614f6b565b6001600160a01b0316336001600160a01b0316146137885760405163e2d4f15f60e01b815260040160405180910390fd5b61302a816142b0565b60008061379c610f5b565b9050808311156137c257604051636688dd2d60e11b815260048101829052602401611234565b60006137cc6141b4565b604154909150738a6a8a7233b16d0ecaa7510bfd110464a0d69f669063cfe6424490869085906402540be4009061381390600160801b90046001600160401b031687614f54565b61381d9190614f40565b6041546040516001600160e01b031960e087901b1681526004810194909452602484019290925260448301526001600160401b03600160401b82048116606484015216608482015260a4810184905260c401602060405180830381865af415801561388c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b09190614f88565b949350505050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015613909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061392d9190614f6b565b6001600160a01b0316336001600160a01b03161461395e57604051633734611360e01b815260040160405180910390fd5b613966613dd5565b6000613970613582565b603754603654919250905b818110801561398a5750600083115b801561399d5750603a5463ffffffff165a115b15613ade576000603782815481106139b7576139b76151e5565b60009182526020918290206040805180820190915260029092020180546001600160a01b031680835260019091015492820192909252915015806139fd57506020810151155b15613a1357613a0b826152a4565b91505061397b565b8060200151841015613a255750613ade565b60208082015182516001600160a01b03166000908152603990925260408220805491929091613a55908490614f17565b9091555050602081015160388054600090613a71908490614f17565b90915550506020810151613a859085614f17565b935060378281548110613a9a57613a9a6151e5565b60009182526020822060029091020180546001600160a01b031916815560010155613ac4826152a4565b9150613ad881600001518260200151614312565b5061397b565b6036555050600160008051602061579183398151915255565b565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b6e9190614f6b565b6001600160a01b0316336001600160a01b031614613b9f5760405163e2d4f15f60e01b815260040160405180910390fd5b805160208201206000906000818152603d60205260409020549091506001600160a01b03168015613be357604051638b1a6ce760e01b815260040160405180910390fd5b6000546001600160a01b03166001600160a01b0316633f69e0f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613c2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c509190614f6b565b6001600160a01b0316639ce953c86040518163ffffffff1660e01b81526004016020604051808303816000875af1158015613c8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cb39190614f6b565b6000838152603d60205260409081902080546001600160a01b0319166001600160a01b03841617905551909150613ceb9084906152e1565b6040519081900381206001600160a01b0383168252907f187f9ad308b4b25229d086a632166f351b45905117cc3162fb9ec6873b9a9ce89060200160405180910390a2505050565b613d3b614398565b613af76143e1565b613d4b614398565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b613d75614398565b613d7e82614114565b61143c816142b0565b600080613d92610b41565b90506000613d9f603b5490565b603f5490915082613db08284614fa1565b1115613dc0576000935050505090565b80613dcb8385614f17565b610bb79190614f17565b600080516020615791833981519152805460011901613e0757604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b600082613e18610b41565b1015613e3757604051635093740560e01b815260040160405180910390fd5b838215613e51576000806000808785612710f19150613ea5565b6040516001600160a01b038216908590600081818185875af1925050503d8060008114613e9a576040519150601f19603f3d011682016040523d82523d6000602084013e613e9f565b606091505b50909250505b509392505050565b600160008051602061579183398151915255565b600080613ecc6141b4565b604054909150738a6a8a7233b16d0ecaa7510bfd110464a0d69f669063fea65f7290859087906402540be40090613f1390600160c01b90046001600160401b031687614f54565b613f1d9190614f40565b6040805490516001600160e01b031960e087901b1681526004810194909452602484019290925260448301526001600160401b03600160801b820481166064840152600160401b90910416608482015260a4810184905260c401602060405180830381865af415801561388c573d6000803e3d6000fd5b6000603d6000613fa984805160209091012090565b81526020810191909152604001600020546001600160a01b0316905080613fe357604051631b355a8760e31b815260040160405180910390fd5b919050565b805160209091012090565b6001600160a01b03821661401a576040516321cb944560e11b815260040160405180910390fd5b8060000361403b57604051630d23170560e01b815260040160405180910390fd5b806038600082825461404d9190614fa1565b90915550506001600160a01b0382166000908152603960205260408120805483929061407a908490614fa1565b9091555050604080518082019091526001600160a01b039283168152602081019182526037805460018101825560009190915290517f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae600290920291820180546001600160a01b0319169190941617909255517f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31af90910155565b6301c9c38063ffffffff82161180614130575063ffffffff8116155b1561415457604051633bbbd90160e21b81526301c9c3806004820152602401611234565b603a546040805163ffffffff928316815291831660208301527f55c1474264b8038534b3e34b09a3a99d1f3436634d4e34fa13cea4c33c9a832e910160405180910390a1603a805463ffffffff191663ffffffff92909216919091179055565b60006402540be4006141ce6000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561420b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061422f9190614f6b565b6001600160a01b03166301e1d1146040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142909190614f88565b6040546142a691906001600160401b0316614f54565b610f659190614f40565b806000036142d157604051630d23170560e01b815260040160405180910390fd5b603e5460408051918252602082018390527f3e6e3950c3fc7a0bbe5c0ded9285010d1c1ef843817fed86973510375eb07418910160405180910390a1603e55565b80603b60008282546143249190614fa1565b90915550506001600160a01b0382166000908152603c602052604081208054839290614351908490614fa1565b90915550506040518181526001600160a01b038316907ff4426c1412b22225874f3898e67e34c12ba628bff6d89fd87ba593927a80b4219060200160405180910390a25050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16613af757604051631afcd79f60e31b815260040160405180910390fd5b613ead614398565b80356001600160401b0381168114613fe357600080fd5b60006020828403121561441257600080fd5b61441b826143e9565b9392505050565b6001600160a01b038116811461302a57600080fd5b803563ffffffff81168114613fe357600080fd5b60008060006060848603121561446057600080fd5b833561446b81614422565b925061447960208501614437565b9150604084013590509250925092565b8035613fe381614422565b600080604083850312156144a757600080fd5b8235915060208301356144b981614422565b809150509250929050565b6000602082840312156144d657600080fd5b5035919050565b60008083601f8401126144ef57600080fd5b5081356001600160401b0381111561450657600080fd5b60208301915083602082850101111561451e57600080fd5b9250929050565b6000806000806060858703121561453b57600080fd5b84356001600160401b0381111561455157600080fd5b61455d878288016144dd565b909550935050602085013561457181614422565b9150604085013561458181614422565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156145c4576145c461458c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145f2576145f261458c565b604052919050565b60006001600160401b038311156146135761461361458c565b614626601f8401601f19166020016145ca565b905082815283838301111561463a57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261466257600080fd5b61441b838335602085016145fa565b60008083601f84011261468357600080fd5b5081356001600160401b0381111561469a57600080fd5b6020830191508360208260051b850101111561451e57600080fd5b6000806000604084860312156146ca57600080fd5b83356001600160401b03808211156146e157600080fd5b6146ed87838801614651565b9450602086013591508082111561470357600080fd5b5061471086828701614671565b9497909650939450505050565b60006020828403121561472f57600080fd5b81356001600160401b0381111561474557600080fd5b6138b084828501614651565b60008060008060008060006080888a03121561476c57600080fd5b87356001600160401b038082111561478357600080fd5b61478f8b838c01614651565b985060208a01359150808211156147a557600080fd5b6147b18b838c01614671565b909850965060408a01359150808211156147ca57600080fd5b6147d68b838c01614671565b909650945060608a01359150808211156147ef57600080fd5b506147fc8a828b01614671565b989b979a50959850939692959293505050565b60006001600160401b038211156148285761482861458c565b5060051b60200190565b600082601f83011261484357600080fd5b813560206148586148538361480f565b6145ca565b82815260059290921b8401810191818101908684111561487757600080fd5b8286015b8481101561489b57803561488e81614422565b835291830191830161487b565b509695505050505050565b600082601f8301126148b757600080fd5b813560206148c76148538361480f565b82815260059290921b840181019181810190868411156148e657600080fd5b8286015b8481101561489b5780356001600160401b038111156149095760008081fd5b6149178986838b0101614832565b8452509183019183016148ea565b600082601f83011261493657600080fd5b813560206149466148538361480f565b82815260059290921b8401810191818101908684111561496557600080fd5b8286015b8481101561489b5780358352918301918301614969565b80358015158114613fe357600080fd5b600082601f8301126149a157600080fd5b813560206149b16148538361480f565b82815260059290921b840181019181810190868411156149d057600080fd5b8286015b8481101561489b576149e581614980565b83529183019183016149d4565b60008060008060008060a08789031215614a0b57600080fd5b86356001600160401b0380821115614a2257600080fd5b614a2e8a838b01614651565b97506020890135915080821115614a4457600080fd5b614a508a838b01614671565b90975095506040890135915080821115614a6957600080fd5b614a758a838b016148a6565b94506060890135915080821115614a8b57600080fd5b614a978a838b01614925565b93506080890135915080821115614aad57600080fd5b50614aba89828a01614990565b9150509295509295509295565b602080825282518282018190526000919060409081850190868401855b82811015614b1257815180516001600160a01b03168552860151868501529284019290850190600101614ae4565b5091979650505050505050565b600060208284031215614b3157600080fd5b813561441b81614422565b600080600060608486031215614b5157600080fd5b614b5a846143e9565b9250614b68602085016143e9565b9150614b76604085016143e9565b90509250925092565b60008060408385031215614b9257600080fd5b82356001600160401b03811115614ba857600080fd5b614bb485828601614651565b925050614bc360208401614980565b90509250929050565b60008060208385031215614bdf57600080fd5b82356001600160401b03811115614bf557600080fd5b614c01858286016144dd565b90969095509350505050565b600080600060608486031215614c2257600080fd5b83356001600160401b0380821115614c3957600080fd5b614c4587838801614651565b94506020860135915080821115614c5b57600080fd5b614c6787838801614832565b93506040860135915080821115614c7d57600080fd5b50614c8a86828701614925565b9150509250925092565b60008060408385031215614ca757600080fd5b8235614cb281614422565b946020939093013593505050565b600080600060408486031215614cd557600080fd5b83356001600160401b03811115614ceb57600080fd5b614cf7868287016144dd565b909790965060209590950135949350505050565b600060208284031215614d1d57600080fd5b61441b82614437565b60008060008060808587031215614d3c57600080fd5b84356001600160401b0380821115614d5357600080fd5b614d5f88838901614651565b955060208701359150614d7182614422565b90935060408601359080821115614d8757600080fd5b9086019060408289031215614d9b57600080fd5b614da36145a2565b823582811115614db257600080fd5b83019150601f82018913614dc557600080fd5b614dd4898335602085016145fa565b815260209283013592810192909252509396929550929360600135925050565b600060408284031215614e0657600080fd5b50919050565b600080600080600080600080600060c08a8c031215614e2a57600080fd5b89356001600160401b0380821115614e4157600080fd5b614e4d8d838e01614651565b9a50614e5b60208d016143e9565b995060408c0135915080821115614e7157600080fd5b614e7d8d838e01614df4565b985060608c0135915080821115614e9357600080fd5b614e9f8d838e01614671565b909850965060808c0135915080821115614eb857600080fd5b614ec48d838e01614671565b909650945060a08c0135915080821115614edd57600080fd5b50614eea8c828d01614671565b915080935050809150509295985092959850929598565b634e487b7160e01b600052601160045260246000fd5b818103818111156129b6576129b6614f01565b634e487b7160e01b600052601260045260246000fd5b600082614f4f57614f4f614f2a565b500490565b80820281158282048414176129b6576129b6614f01565b600060208284031215614f7d57600080fd5b815161441b81614422565b600060208284031215614f9a57600080fd5b5051919050565b808201808211156129b6576129b6614f01565b600082614fc357614fc3614f2a565b500690565b6000808335601e19843603018112614fdf57600080fd5b83016020810192503590506001600160401b03811115614ffe57600080fd5b8060051b360382131561451e57600080fd5b8183526000602080850194508260005b8581101561504e57813561503381614422565b6001600160a01b031687529582019590820190600101615020565b509495945050505050565b81835260006001600160fb1b0383111561507257600080fd5b8260051b80836020870137939093016020019392505050565b60208082528181018390526000906040808401600586901b850182018785805b8981101561514657888403603f190185528235368c9003605e190181126150d0578283fd5b8b0160606150de8280614fc8565b8288526150ee8389018284615010565b925050506150fe89830183614fc8565b8783038b890152615110838284615059565b9250505087820135915061512382614422565b6001600160a01b03919091169487019490945293860193918601916001016150ab565b50919998505050505050505050565b6000602080838503121561516857600080fd5b82516001600160401b0381111561517e57600080fd5b8301601f8101851361518f57600080fd5b805161519d6148538261480f565b81815260059190911b820183019083810190878311156151bc57600080fd5b928401925b828410156151da578351825292840192908401906151c1565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261521257600080fd5b8301803591506001600160401b0382111561522c57600080fd5b60200191503681900382131561451e57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061527e606083018789615241565b8281036020840152615291818688615241565b9150508260408301529695505050505050565b6000600182016152b6576152b6614f01565b5060010190565b60005b838110156152d85781810151838201526020016152c0565b50506000910152565b600082516152f38184602087016152bd565b9190910192915050565b6000808335601e1984360301811261531457600080fd5b83016020810192503590506001600160401b0381111561533357600080fd5b80360382131561451e57600080fd5b81835260006020808501808196508560051b810191508460005b87811015614b1257828403895261537382886152fd565b61537e868284615241565b9a87019a955050509084019060010161535c565b6020815260006138b0602083018486615342565b600081518084526020808501945080840160005b8381101561504e5781516001600160a01b0316875295820195908201906001016153ba565b600081518084526020808501808196508360051b8101915082860160005b85811015614b125782840389526154158483516153a6565b988501989350908401906001016153fd565b600081518084526020808501945080840160005b8381101561504e5781518752958201959082019060010161543b565b600081518084526020808501945080840160005b8381101561504e57815115158752958201959082019060010161546b565b608080825281810186905260009060a0808401600589901b850182018a85805b8c81101561559857888403609f190185528235368f900360de190181126154ce578283fd5b8e0160e081356154dd81614422565b6001600160a01b031686526020828101356154f781614422565b6001600160a01b0316818801526040615511848201614489565b6001600160a01b031690880152606083810135908801526155338a8401614437565b63ffffffff168a880152615549838a0184614fc8565b838b8a015261555b848a018284615010565b9350505060c061556d81850185614fc8565b9450888403828a0152615581848683615059565b9983019998505050949094019350506001016154a9565b50505085810360208701526155ad818a6153df565b935050505082810360408401526155c48186615427565b905082810360608401526155d88185615457565b98975050505050505050565b6060815260006155f760608301866153a6565b82810360208401526156098186615427565b91505060018060a01b0383166040830152949350505050565b60018060a01b038416815260606020820152600083516040606084015280518060a08501526156588160c08601602085016152bd565b60209590950151608084015250506040810191909152601f91909101601f19160160c001919050565b81835260006020808501808196508560051b810191508460005b87811015614b125782840389526156b28288614fc8565b6156bd868284615059565b9a87019a955050509084019060010161569b565b6001600160401b03891681526000602060a081840152893560a08401526156fa818b018b6152fd565b604060c086015261570f60e086018284615241565b85810360408701528a81528b9250830190506000805b8b81101561575557833564ffffffffff8116808214615742578384fd5b8452509284019291840191600101615725565b5050848103606086015261576a81898b615342565b925050508281036080840152615781818587615681565b9b9a505050505050505050505056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a264697066735822122062bafef7f713bdffe92c78597e5e6fb430366a754467ec9c1a41a3d8e330b95664736f6c63430008140033","external_libraries":[{"name":"contracts/libraries/InceptionLibrary.sol:InceptionLibrary","address_hash":"0x8A6a8a7233B16d0ECaA7510BfD110464A0D69F66"}],"proxy_type":null,"implementations":[],"verified_at":"2024-12-26T02:23:19.498730Z","is_verified_via_verifier_alliance":false,"compiler_version":"0.8.20+commit.a1b79de6","decoded_constructor_args":null,"sourcify_repo_url":"https://repo.sourcify.dev/1/0xa27f2F4da035f847ad4b40f83E186B4ABb589E7d","optimization_runs":200,"compiler_settings":{"evmVersion":"paris","libraries":{"contracts/libraries/InceptionLibrary.sol:InceptionLibrary":"0x8a6a8a7233b16d0ecaa7510bfd110464a0d69f66"},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":true,"runs":200},"remappings":[]},"is_verified":true,"verified_twin_address_hash":null,"optimization_enabled":true,"deployed_bytecode":"0x6080604052600436106103a55760003560e01c80637e388224116101e7578063bc7829271161010d578063e6a49733116100a0578063f21748ad1161006f578063f21748ad14610acc578063f527463314610aec578063fa57d00214610b0c578063fb8fa29014610b2157600080fd5b8063e6a4973314610a50578063e93c4f1514610a70578063eea4684d14610a85578063f1d37a2014610aa557600080fd5b8063d2045f6d116100dc578063d2045f6d146109db578063d50b810d146109f0578063d95edac914610a10578063dc835d6b14610a3057600080fd5b8063bc78292714610952578063c0d64a8714610988578063c2a672e01461099b578063d11531da146109bb57600080fd5b80639669c7cf11610185578063b0e21e8a11610154578063b0e21e8a146108ce578063b3870ef7146108f5578063b56c044114610915578063b637d6691461093c57600080fd5b80639669c7cf146104b657806396dae88b1461086e578063aa7e4e541461088e578063ad72cc35146108ae57600080fd5b80638c80fd90116101c15780638c80fd90146108025780638e59fbf6146108225780638e5f141d14610838578063901a7d531461085857600080fd5b80637e3882241461078c578063845b9150146107ac5780638903ab9d146107cc57600080fd5b80633f908551116102cc5780636180c6091161026a578063779a6cdd11610239578063779a6cdd146106c957806378288a38146106f057806379502c55146107125780637cf3d51e1461074457600080fd5b80636180c609146106575780636b77b2f51461066c5780636ff23d3114610682578063765fccca146106a957600080fd5b806345cced29116102a657806345cced29146105e25780634a6b629d1461060257806356a3b5fa146106225780635f4aa38d1461063757600080fd5b80633f9085511461058d578063417f9246146105a257806343bc42d3146105c257600080fd5b8063126d5df6116103445780633397547211610313578063339754721461052f5780633a0acdc1146105455780633a4b66f1146105655780633b1ddc611461056d57600080fd5b8063126d5df6146104cb57806314d6aed0146104e05780631f2ed36f146104e857806328af87b51461050f57600080fd5b80630c4f0e3f116103805780630c4f0e3f1461045b5780630f19aaef1461047d5780631036bbe21461049d57806311ae9ed2146104b657600080fd5b8062928917146103e657806301e1d11414610423578063034c44541461044657600080fd5b366103e15760405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b600080fd5b3480156103f257600080fd5b50604154610406906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b34801561042f57600080fd5b50610438610b41565b60405190815260200161041a565b34801561045257600080fd5b50610438610bbf565b34801561046757600080fd5b5061047b610476366004614400565b610d2a565b005b34801561048957600080fd5b5061047b61049836600461444b565b610e39565b3480156104a957600080fd5b506104066402540be40081565b3480156104c257600080fd5b50610438610f5b565b3480156104d757600080fd5b50603854610438565b61047b610f6a565b3480156104f457600080fd5b5060405461040690600160801b90046001600160401b031681565b34801561051b57600080fd5b5061047b61052a366004614494565b6110bb565b34801561053b57600080fd5b50610438603f5481565b34801561055157600080fd5b5061047b6105603660046144c4565b611440565b61047b611561565b34801561057957600080fd5b5061047b610588366004614525565b611847565b34801561059957600080fd5b5061043861199d565b3480156105ae57600080fd5b5061047b6105bd3660046146b5565b611a9c565b3480156105ce57600080fd5b5061047b6105dd366004614400565b611bcc565b3480156105ee57600080fd5b5061047b6105fd36600461471d565b611d22565b34801561060e57600080fd5b50604054610406906001600160401b031681565b34801561062e57600080fd5b50610438611e49565b34801561064357600080fd5b5061047b610652366004614751565b611f46565b34801561066357600080fd5b50603b54610438565b34801561067857600080fd5b5061043860435481565b34801561068e57600080fd5b5060415461040690600160801b90046001600160401b031681565b3480156106b557600080fd5b5061047b6106c43660046149f2565b6121c5565b3480156106d557600080fd5b5060405461040690600160401b90046001600160401b031681565b3480156106fc57600080fd5b506107056122e8565b60405161041a9190614ac7565b34801561071e57600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161041a565b34801561075057600080fd5b5061077c61075f366004614b1f565b6001600160a01b03166000908152603c6020526040902054151590565b604051901515815260200161041a565b34801561079857600080fd5b5061047b6107a7366004614b3c565b6123f1565b3480156107b857600080fd5b5061047b6107c73660046144c4565b6125f0565b3480156107d857600080fd5b506104386107e7366004614b1f565b6001600160a01b03166000908152603c602052604090205490565b34801561080e57600080fd5b5061047b61081d3660046144c4565b6126d7565b34801561082e57600080fd5b5061043861271081565b34801561084457600080fd5b5061047b610853366004614b3c565b6127be565b34801561086457600080fd5b5061043860425481565b34801561087a57600080fd5b506104386108893660046144c4565b6129a3565b34801561089a57600080fd5b5061047b6108a9366004614b7f565b6129bc565b3480156108ba57600080fd5b5061072c6108c9366004614bcc565b612ac7565b3480156108da57600080fd5b5060415461040690600160c01b90046001600160401b031681565b34801561090157600080fd5b5061047b610910366004614c0d565b612b2d565b34801561092157600080fd5b5060405461040690600160c01b90046001600160401b031681565b34801561094857600080fd5b5061043860445481565b34801561095e57600080fd5b5061043861096d366004614b1f565b6001600160a01b031660009081526039602052604090205490565b61047b6109963660046144c4565b612cb0565b3480156109a757600080fd5b5061047b6109b6366004614c94565b612ce6565b3480156109c757600080fd5b5061047b6109d6366004614b1f565b612ee1565b3480156109e757600080fd5b50603e54610438565b3480156109fc57600080fd5b5061047b610a0b366004614cc0565b61302d565b348015610a1c57600080fd5b5061047b610a2b366004614d0b565b61328c565b348015610a3c57600080fd5b5061047b610a4b366004614d26565b61333b565b348015610a5c57600080fd5b50610705610a6b366004614b1f565b61341f565b348015610a7c57600080fd5b50610438613582565b348015610a9157600080fd5b5061047b610aa0366004614e0c565b6135b6565b348015610ab157600080fd5b5060415461040690600160401b90046001600160401b031681565b348015610ad857600080fd5b5061047b610ae73660046144c4565b6136e2565b348015610af857600080fd5b50610438610b073660046144c4565b613791565b348015610b1857600080fd5b5061047b6138b8565b348015610b2d57600080fd5b5061047b610b3c36600461471d565b613af9565b6000806201518060435442610b569190614f17565b610b609190614f40565b9050600062015180604454610b759190614f40565b905080821115610b8757479250505090565b6000610b938383614f17565b82604254610ba19190614f40565b610bab9190614f54565b9050610bb78147614f17565b935050505090565b600080610bd46000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c359190614f6b565b604051600162e422bd60e01b03198152600160048201529091506000906001600160a01b0383169063c6e6f59290829063ff1bdd4390602401602060405180830381865afa158015610c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610caf9190614f88565b6040518263ffffffff1660e01b8152600401610ccd91815260200190565b602060405180830381865afa158015610cea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0e9190614f88565b90508060335411610d1f5780610d23565b6033545b9250505090565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9f9190614f6b565b6001600160a01b0316336001600160a01b031614610dd05760405163e2d4f15f60e01b815260040160405180910390fd5b6040805481516001600160401b03918216815290831660208201527fbf127022ae43ce46c7042f13c6e64c507f75f20314c2aee1b03b0cf208a10f39910160405180910390a16040805467ffffffffffffffff19166001600160401b0392909216919091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b0316600081158015610e7e5750825b90506000826001600160401b03166001148015610e9a5750303b155b905081158015610ea8575080155b15610ec65760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610ef057845460ff60401b1916600160401b1785555b610ef8613d33565b610f0188613d43565b610f0b8787613d6d565b8315610f5157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b6000610f65613d87565b905090565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdf9190614f6b565b6001600160a01b0316336001600160a01b03161461101057604051633734611360e01b815260040160405180910390fd5b6042543490156110735760006201518060445461102d9190614f40565b9050600062015180604354426110439190614f17565b61104d9190614f40565b90508181101561107057604051637f50d1ab60e11b815260040160405180910390fd5b50505b60428190554260438190556040805183815260208101929092527f40df43107e8b4d467127964bd3c966687c0a6a39aaede970755397fd09535e98910160405180910390a150565b6110c3613dd5565b6040546001600160401b03166000036110ef5760405163fe17a04160e01b815260040160405180910390fd5b3360006111046000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111659190614f6b565b604051600162e422bd60e01b03198152600481018690529091506000906001600160a01b0383169063ff1bdd4390602401602060405180830381865afa1580156111b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d79190614f88565b90506111e1610bbf565b811015611201576040516307bd37ff60e01b815260040160405180910390fd5b611209610f5b565b81111561123d57611218610f5b565b604051636688dd2d60e11b815260040161123491815260200190565b60405180910390fd5b600061124882613791565b90508060000361126b57604051630d23170560e01b815260040160405180910390fd5b6041546000906402540be4009061129290600160c01b90046001600160401b031684614f54565b61129c9190614f40565b604051632770a7eb60e21b81526001600160a01b038781166004830152602482018a905291925090851690639dc29fac90604401600060405180830381600087803b1580156112ea57600080fd5b505af11580156112fe573d6000803e3d6000fd5b5050505082603560008282546113149190614fa1565b9091555061132490508284614f17565b92506113308183614f17565b603f60008282546113419190614fa1565b90915550506000546113bf906001600160a01b03166001600160a01b0316633b19e84a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b79190614f6b565b826000613e0d565b506113cc86846000613e0d565b5060408051848152602081018990529081018390526001600160a01b03808716919088169082907f628a6f39215835333501afcce023c08e1e61c026768b46f5076804d344e023e39060600160405180910390a4505050505061143c600160008051602061579183398151915255565b5050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b59190614f6b565b6001600160a01b0316336001600160a01b0316146114e65760405163e2d4f15f60e01b815260040160405180910390fd5b6201518081108061150257506114ff6201518082614fb4565b15155b156115205760405163afff5f7760e01b815260040160405180910390fd5b60445460408051918252602082018390527f1638f4dadb33895a0e192a35d63a2677a5b9dbe482091d94d8877d0919473320910160405180910390a1604455565b60405434906001600160401b031660000361158f5760405163fe17a04160e01b815260040160405180910390fd5b611597611e49565b8110156115b75760405163273d2bdb60e21b815260040160405180910390fd5b6115bf61199d565b8111156115df57604051633175986360e21b815260040160405180910390fd5b603f546000901561168d5760006115f4610f5b565b90508281101561161057611609600084613ec1565b9150611626565b61162361161d8483614f17565b84613ec1565b91505b603f5482111561164057603f805460009091559150611658565b81603f60008282546116529190614f17565b90915550505b6040518281527f98b37da5bc0dc3a6af25a940988aef0df1a74411148692d8d74aa066658173059060200160405180910390a1505b6116978183614fa1565b915060006116ad6000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170e9190614f6b565b6040516363737ac960e11b8152600481018590529091506000906001600160a01b0383169063c6e6f59290602401602060405180830381865afa158015611759573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177d9190614f88565b90506001600160a01b0382166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b1580156117d757600080fd5b505af11580156117eb573d6000803e3d6000fd5b5050505083603460008282546118019190614fa1565b9091555050604080518581526020810183905233917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90910160405180910390a250505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bc9190614f6b565b6001600160a01b0316336001600160a01b0316146118ed5760405163e2d4f15f60e01b815260040160405180910390fd5b600061192e85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613f9492505050565b6040516388b856a760e01b81526001600160a01b0385811660048301528481166024830152919250908216906388b856a7906044015b600060405180830381600087803b15801561197e57600080fd5b505af1158015611992573d6000803e3d6000fd5b505050505050505050565b6000806119b26000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a139190614f6b565b6001600160a01b03166301e1d1146040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a749190614f88565b9050603e54811115611a8857600091505090565b80603e54611a969190614f17565b91505090565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b119190614f6b565b6001600160a01b0316336001600160a01b031614611b4257604051633734611360e01b815260040160405180910390fd5b6000611b4d84613f94565b6040516306ec6e8160e11b81529091506001600160a01b03821690630dd8dd0290611b7e908690869060040161508b565b6000604051808303816000875af1158015611b9d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bc59190810190615155565b5050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c419190614f6b565b6001600160a01b0316336001600160a01b031614611c725760405163e2d4f15f60e01b815260040160405180910390fd5b6402540be4006001600160401b0382161115611cac57604051630513fb8f60e31b81526001600160401b0382166004820152602401611234565b604154604080516001600160401b03600160c01b9093048316815291831660208301527fb51bef650ff5ad43303dbe2e500a74d4fd1bdc9ae05f046bece330e82ae0ba87910160405180910390a1604180546001600160401b03909216600160c01b026001600160c01b03909216919091179055565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d979190614f6b565b6001600160a01b0316336001600160a01b031614611dc857604051633734611360e01b815260040160405180910390fd5b6000611dd382613f94565b6040516336a2fa1960e21b81526001600160a01b0382166004820181905291925063da8be864906024016000604051808303816000875af1158015611e1c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611e449190810190615155565b505050565b600080611e5e6000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebf9190614f6b565b604051600162e422bd60e01b03198152600160048201526001600160a01b03919091169063ff1bdd4390602401602060405180830381865afa158015611f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2d9190614f88565b90508060325411611f3e5780611a96565b505060325490565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190614f6b565b6001600160a01b0316336001600160a01b031614611fec57604051633734611360e01b815260040160405180910390fd5b611ff4613dd5565b8483811415806120045750808214155b15612022576040516367af08e760e11b815260040160405180910390fd5b612035816801bc16d674ec800000614f54565b61203d613582565b101561205c57604051635093740560e01b815260040160405180910390fd5b600061206789613f94565b905060005b8281101561215357816001600160a01b0316639b4e46346801bc16d674ec8000008b8b8581811061209f5761209f6151e5565b90506020028101906120b191906151fb565b8b8b878181106120c3576120c36151e5565b90506020028101906120d591906151fb565b8b8b898181106120e7576120e76151e5565b905060200201356040518763ffffffff1660e01b815260040161210e95949392919061526a565b6000604051808303818588803b15801561212757600080fd5b505af115801561213b573d6000803e3d6000fd5b5050505050808061214b906152a4565b91505061206c565b508860405161216291906152e1565b60405180910390207f82893d4437db377df0abca554a4a9ef54de226c99efe74077b214d6d3390e7dd898960405161219b929190615392565b60405180910390a250506121bc600160008051602061579183398151915255565b50505050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223a9190614f6b565b6001600160a01b0316336001600160a01b03161461226b57604051633734611360e01b815260040160405180910390fd5b600061227687613f94565b6040516319a021cb60e11b81529091506001600160a01b038216906333404396906122ad9089908990899089908990600401615489565b600060405180830381600087803b1580156122c757600080fd5b505af11580156122db573d6000803e3d6000fd5b5050505050505050505050565b6036546037546060916122fa91614f17565b6001600160401b038111156123115761231161458c565b60405190808252806020026020018201604052801561235657816020015b604080518082019091526000808252602082015281526020019060019003908161232f5790505b506036549091506000905b6037548110156123ec576037818154811061237e5761237e6151e5565b60009182526020918290206040805180820190915260029092020180546001600160a01b03168252600101549181019190915283836123bc816152a4565b9450815181106123ce576123ce6151e5565b602002602001018190525080806123e4906152a4565b915050612361565b505090565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124669190614f6b565b6001600160a01b0316336001600160a01b0316146124975760405163e2d4f15f60e01b815260040160405180910390fd5b6402540be4006001600160401b03841611156124d157604051630513fb8f60e31b81526001600160401b0384166004820152602401611234565b6402540be4006001600160401b038316111561250b57604051630513fb8f60e31b81526001600160401b0383166004820152602401611234565b6402540be4006001600160401b038216111561254557604051630513fb8f60e31b81526001600160401b0382166004820152602401611234565b6040805477ffffffffffffffffffffffffffffffff00000000000000001916600160401b6001600160401b0386811691820267ffffffffffffffff60801b191692909217600160801b868416908102919091176001600160c01b0316600160c01b93861693840217845583519182526020820152918201527fbdd363e1b2c509839731ca7a94e48c8835b6de783af60bbfaeb08b9ba3862bea906060015b60405180910390a1505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126659190614f6b565b6001600160a01b0316336001600160a01b0316146126965760405163e2d4f15f60e01b815260040160405180910390fd5b60335460408051918252602082018390527f984016d328adef81f3cc09f8ea9e3420f85d390635be94215c432e83837aa0a2910160405180910390a1603355565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061274c9190614f6b565b6001600160a01b0316336001600160a01b03161461277d5760405163e2d4f15f60e01b815260040160405180910390fd5b60325460408051918252602082018390527fca11c8a4c461b60c9f485404c272650c2aaae260b2067d72e9924abb68556593910160405180910390a1603255565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561280f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128339190614f6b565b6001600160a01b0316336001600160a01b0316146128645760405163e2d4f15f60e01b815260040160405180910390fd5b6402540be4006001600160401b038416111561289e57604051630513fb8f60e31b81526001600160401b0384166004820152602401611234565b6402540be4006001600160401b03831611156128d857604051630513fb8f60e31b81526001600160401b0383166004820152602401611234565b6402540be4006001600160401b038216111561291257604051630513fb8f60e31b81526001600160401b0382166004820152602401611234565b604180546001600160401b03838116600160801b810267ffffffffffffffff60801b19878416600160401b81026fffffffffffffffffffffffffffffffff19909616948a16948517959095171617909355604080519182526020820192909252908101919091527ff3f49a7eaa29cb38bb074c44803e3ef1f47960b9529ee0c0a3aa47c0d4f93a9d906060016125e3565b60006129b66129b0610f5b565b83613ec1565b92915050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a319190614f6b565b6001600160a01b0316336001600160a01b031614612a6257604051633734611360e01b815260040160405180910390fd5b6000612a6d83613f94565b6040516388676cad60e01b815283151560048201529091506001600160a01b038216906388676cad90602401600060405180830381600087803b158015612ab357600080fd5b505af11580156121bc573d6000803e3d6000fd5b6000603d6000612b0c85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613fe892505050565b81526020810191909152604001600020546001600160a01b03169392505050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ba29190614f6b565b6001600160a01b0316336001600160a01b031614612bd357604051633734611360e01b815260040160405180910390fd5b6000612bde84613f94565b9050806001600160a01b031663dda3346c8484612c036000546001600160a01b031690565b6001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c649190614f6b565b6040518463ffffffff1660e01b8152600401612c82939291906155e4565b600060405180830381600087803b158015612c9c57600080fd5b505af1158015610f51573d6000803e3d6000fd5b612cb8611561565b60405181907f8c355e502e4eade8ac341bcb08dcfca0ae238efe6431e5a63b75be9026d9163b90600090a250565b612cee613dd5565b600080543391906001600160a01b03166001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5f9190614f6b565b604051600162e422bd60e01b03198152600481018590529091506000906001600160a01b0383169063ff1bdd4390602401602060405180830381865afa158015612dad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd19190614f88565b9050612ddb610bbf565b811015612dfb576040516307bd37ff60e01b815260040160405180910390fd5b604051632770a7eb60e21b81526001600160a01b03848116600483015260248201869052831690639dc29fac90604401600060405180830381600087803b158015612e4557600080fd5b505af1158015612e59573d6000803e3d6000fd5b50505050612e678582613ff3565b8060356000828254612e799190614fa1565b909155505060408051828152602081018690526001600160a01b0380881692908616917f06cc7e90b4f2b554a9614b0caa84f909f3498c820ae47c731f490c28c07f7d3b910160405180910390a350505061143c600160008051602061579183398151915255565b612ee9613dd5565b6001600160a01b038116612f10576040516321cb944560e11b815260040160405180910390fd5b6001600160a01b0381166000908152603c602052604081205490819003612f4a57604051630d23170560e01b815260040160405180910390fd5b603b54612f55610b41565b1015612f7457604051635093740560e01b815260040160405180910390fd5b80603b6000828254612f869190614f17565b90915550506001600160a01b0382166000908152603c60205260408120819055612fb1838383613e0d565b905080612fd157604051634dbb90c960e01b815260040160405180910390fd5b60405182815233906001600160a01b038516907febc6a30f46090cafd1f043241dbc148c4310b7026aae29ff950ea25a5411879b9060200160405180910390a3505061302a600160008051602061579183398151915255565b50565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa15801561307e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a29190614f6b565b6001600160a01b0316336001600160a01b0316146130d357604051633734611360e01b815260040160405180910390fd5b600061311484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613f9492505050565b90506000479050816001600160a01b031663ef8cdf7c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561315657600080fd5b505af115801561316a573d6000803e3d6000fd5b505050506000814761317c9190614f17565b9050808411156131a957604051634f274ad560e11b81526004810182905260248101859052604401611234565b600080546001600160a01b03166001600160a01b0316633b19e84a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132179190614f6b565b9050841561322d5761322b81866000613e0d565b505b806001600160a01b0316846001600160a01b03167f2ee827557318e24ad8fdb9f616bbfd73b44656ea23439623780d719c369f0c1d878560405161327b929190918252602082015260400190565b60405180910390a350505050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133019190614f6b565b6001600160a01b0316336001600160a01b0316146133325760405163e2d4f15f60e01b815260040160405180910390fd5b61302a81614114565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa15801561338c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b09190614f6b565b6001600160a01b0316336001600160a01b0316146133e157604051633734611360e01b815260040160405180910390fd5b60006133ec85613f94565b60405163eea9064b60e01b81529091506001600160a01b0382169063eea9064b9061196490879087908790600401615622565b60365460375460609161343191614f17565b6001600160401b038111156134485761344861458c565b60405190808252806020026020018201604052801561348d57816020015b60408051808201909152600080825260208201528152602001906001900390816134665790505b506036549091506000905b60375481101561355f57836001600160a01b0316603782815481106134bf576134bf6151e5565b60009182526020909120600290910201546001600160a01b03160361354d57603781815481106134f1576134f16151e5565b60009182526020918290206040805180820190915260029092020180546001600160a01b031682526001015491810191909152838361352f816152a4565b945081518110613541576135416151e5565b60200260200101819052505b80613557816152a4565b915050613498565b50600081835161356f9190614f17565b9050801561357b578183525b5050919050565b60008061358d610f5b565b905060006135996141b4565b9050818111156135ac5760009250505090565b610d238183614f17565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015613607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061362b9190614f6b565b6001600160a01b0316336001600160a01b03161461365c57604051633734611360e01b815260040160405180910390fd5b60006136678a613f94565b604051633f65cf1960e01b81529091506001600160a01b03821690633f65cf19906136a4908c908c908c908c908c908c908c908c906004016156d1565b600060405180830381600087803b1580156136be57600080fd5b505af11580156136d2573d6000803e3d6000fd5b5050505050505050505050505050565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137579190614f6b565b6001600160a01b0316336001600160a01b0316146137885760405163e2d4f15f60e01b815260040160405180910390fd5b61302a816142b0565b60008061379c610f5b565b9050808311156137c257604051636688dd2d60e11b815260048101829052602401611234565b60006137cc6141b4565b604154909150738a6a8a7233b16d0ecaa7510bfd110464a0d69f669063cfe6424490869085906402540be4009061381390600160801b90046001600160401b031687614f54565b61381d9190614f40565b6041546040516001600160e01b031960e087901b1681526004810194909452602484019290925260448301526001600160401b03600160401b82048116606484015216608482015260a4810184905260c401602060405180830381865af415801561388c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b09190614f88565b949350505050565b60008054906101000a90046001600160a01b03166001600160a01b031663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015613909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061392d9190614f6b565b6001600160a01b0316336001600160a01b03161461395e57604051633734611360e01b815260040160405180910390fd5b613966613dd5565b6000613970613582565b603754603654919250905b818110801561398a5750600083115b801561399d5750603a5463ffffffff165a115b15613ade576000603782815481106139b7576139b76151e5565b60009182526020918290206040805180820190915260029092020180546001600160a01b031680835260019091015492820192909252915015806139fd57506020810151155b15613a1357613a0b826152a4565b91505061397b565b8060200151841015613a255750613ade565b60208082015182516001600160a01b03166000908152603990925260408220805491929091613a55908490614f17565b9091555050602081015160388054600090613a71908490614f17565b90915550506020810151613a859085614f17565b935060378281548110613a9a57613a9a6151e5565b60009182526020822060029091020180546001600160a01b031916815560010155613ac4826152a4565b9150613ad881600001518260200151614312565b5061397b565b6036555050600160008051602061579183398151915255565b565b60008054906101000a90046001600160a01b03166001600160a01b031663289b3c0d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b6e9190614f6b565b6001600160a01b0316336001600160a01b031614613b9f5760405163e2d4f15f60e01b815260040160405180910390fd5b805160208201206000906000818152603d60205260409020549091506001600160a01b03168015613be357604051638b1a6ce760e01b815260040160405180910390fd5b6000546001600160a01b03166001600160a01b0316633f69e0f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613c2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c509190614f6b565b6001600160a01b0316639ce953c86040518163ffffffff1660e01b81526004016020604051808303816000875af1158015613c8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cb39190614f6b565b6000838152603d60205260409081902080546001600160a01b0319166001600160a01b03841617905551909150613ceb9084906152e1565b6040519081900381206001600160a01b0383168252907f187f9ad308b4b25229d086a632166f351b45905117cc3162fb9ec6873b9a9ce89060200160405180910390a2505050565b613d3b614398565b613af76143e1565b613d4b614398565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b613d75614398565b613d7e82614114565b61143c816142b0565b600080613d92610b41565b90506000613d9f603b5490565b603f5490915082613db08284614fa1565b1115613dc0576000935050505090565b80613dcb8385614f17565b610bb79190614f17565b600080516020615791833981519152805460011901613e0757604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b600082613e18610b41565b1015613e3757604051635093740560e01b815260040160405180910390fd5b838215613e51576000806000808785612710f19150613ea5565b6040516001600160a01b038216908590600081818185875af1925050503d8060008114613e9a576040519150601f19603f3d011682016040523d82523d6000602084013e613e9f565b606091505b50909250505b509392505050565b600160008051602061579183398151915255565b600080613ecc6141b4565b604054909150738a6a8a7233b16d0ecaa7510bfd110464a0d69f669063fea65f7290859087906402540be40090613f1390600160c01b90046001600160401b031687614f54565b613f1d9190614f40565b6040805490516001600160e01b031960e087901b1681526004810194909452602484019290925260448301526001600160401b03600160801b820481166064840152600160401b90910416608482015260a4810184905260c401602060405180830381865af415801561388c573d6000803e3d6000fd5b6000603d6000613fa984805160209091012090565b81526020810191909152604001600020546001600160a01b0316905080613fe357604051631b355a8760e31b815260040160405180910390fd5b919050565b805160209091012090565b6001600160a01b03821661401a576040516321cb944560e11b815260040160405180910390fd5b8060000361403b57604051630d23170560e01b815260040160405180910390fd5b806038600082825461404d9190614fa1565b90915550506001600160a01b0382166000908152603960205260408120805483929061407a908490614fa1565b9091555050604080518082019091526001600160a01b039283168152602081019182526037805460018101825560009190915290517f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae600290920291820180546001600160a01b0319169190941617909255517f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31af90910155565b6301c9c38063ffffffff82161180614130575063ffffffff8116155b1561415457604051633bbbd90160e21b81526301c9c3806004820152602401611234565b603a546040805163ffffffff928316815291831660208301527f55c1474264b8038534b3e34b09a3a99d1f3436634d4e34fa13cea4c33c9a832e910160405180910390a1603a805463ffffffff191663ffffffff92909216919091179055565b60006402540be4006141ce6000546001600160a01b031690565b6001600160a01b031663ec6c350c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561420b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061422f9190614f6b565b6001600160a01b03166301e1d1146040518163ffffffff1660e01b8152600401602060405180830381865afa15801561426c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142909190614f88565b6040546142a691906001600160401b0316614f54565b610f659190614f40565b806000036142d157604051630d23170560e01b815260040160405180910390fd5b603e5460408051918252602082018390527f3e6e3950c3fc7a0bbe5c0ded9285010d1c1ef843817fed86973510375eb07418910160405180910390a1603e55565b80603b60008282546143249190614fa1565b90915550506001600160a01b0382166000908152603c602052604081208054839290614351908490614fa1565b90915550506040518181526001600160a01b038316907ff4426c1412b22225874f3898e67e34c12ba628bff6d89fd87ba593927a80b4219060200160405180910390a25050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16613af757604051631afcd79f60e31b815260040160405180910390fd5b613ead614398565b80356001600160401b0381168114613fe357600080fd5b60006020828403121561441257600080fd5b61441b826143e9565b9392505050565b6001600160a01b038116811461302a57600080fd5b803563ffffffff81168114613fe357600080fd5b60008060006060848603121561446057600080fd5b833561446b81614422565b925061447960208501614437565b9150604084013590509250925092565b8035613fe381614422565b600080604083850312156144a757600080fd5b8235915060208301356144b981614422565b809150509250929050565b6000602082840312156144d657600080fd5b5035919050565b60008083601f8401126144ef57600080fd5b5081356001600160401b0381111561450657600080fd5b60208301915083602082850101111561451e57600080fd5b9250929050565b6000806000806060858703121561453b57600080fd5b84356001600160401b0381111561455157600080fd5b61455d878288016144dd565b909550935050602085013561457181614422565b9150604085013561458181614422565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156145c4576145c461458c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145f2576145f261458c565b604052919050565b60006001600160401b038311156146135761461361458c565b614626601f8401601f19166020016145ca565b905082815283838301111561463a57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261466257600080fd5b61441b838335602085016145fa565b60008083601f84011261468357600080fd5b5081356001600160401b0381111561469a57600080fd5b6020830191508360208260051b850101111561451e57600080fd5b6000806000604084860312156146ca57600080fd5b83356001600160401b03808211156146e157600080fd5b6146ed87838801614651565b9450602086013591508082111561470357600080fd5b5061471086828701614671565b9497909650939450505050565b60006020828403121561472f57600080fd5b81356001600160401b0381111561474557600080fd5b6138b084828501614651565b60008060008060008060006080888a03121561476c57600080fd5b87356001600160401b038082111561478357600080fd5b61478f8b838c01614651565b985060208a01359150808211156147a557600080fd5b6147b18b838c01614671565b909850965060408a01359150808211156147ca57600080fd5b6147d68b838c01614671565b909650945060608a01359150808211156147ef57600080fd5b506147fc8a828b01614671565b989b979a50959850939692959293505050565b60006001600160401b038211156148285761482861458c565b5060051b60200190565b600082601f83011261484357600080fd5b813560206148586148538361480f565b6145ca565b82815260059290921b8401810191818101908684111561487757600080fd5b8286015b8481101561489b57803561488e81614422565b835291830191830161487b565b509695505050505050565b600082601f8301126148b757600080fd5b813560206148c76148538361480f565b82815260059290921b840181019181810190868411156148e657600080fd5b8286015b8481101561489b5780356001600160401b038111156149095760008081fd5b6149178986838b0101614832565b8452509183019183016148ea565b600082601f83011261493657600080fd5b813560206149466148538361480f565b82815260059290921b8401810191818101908684111561496557600080fd5b8286015b8481101561489b5780358352918301918301614969565b80358015158114613fe357600080fd5b600082601f8301126149a157600080fd5b813560206149b16148538361480f565b82815260059290921b840181019181810190868411156149d057600080fd5b8286015b8481101561489b576149e581614980565b83529183019183016149d4565b60008060008060008060a08789031215614a0b57600080fd5b86356001600160401b0380821115614a2257600080fd5b614a2e8a838b01614651565b97506020890135915080821115614a4457600080fd5b614a508a838b01614671565b90975095506040890135915080821115614a6957600080fd5b614a758a838b016148a6565b94506060890135915080821115614a8b57600080fd5b614a978a838b01614925565b93506080890135915080821115614aad57600080fd5b50614aba89828a01614990565b9150509295509295509295565b602080825282518282018190526000919060409081850190868401855b82811015614b1257815180516001600160a01b03168552860151868501529284019290850190600101614ae4565b5091979650505050505050565b600060208284031215614b3157600080fd5b813561441b81614422565b600080600060608486031215614b5157600080fd5b614b5a846143e9565b9250614b68602085016143e9565b9150614b76604085016143e9565b90509250925092565b60008060408385031215614b9257600080fd5b82356001600160401b03811115614ba857600080fd5b614bb485828601614651565b925050614bc360208401614980565b90509250929050565b60008060208385031215614bdf57600080fd5b82356001600160401b03811115614bf557600080fd5b614c01858286016144dd565b90969095509350505050565b600080600060608486031215614c2257600080fd5b83356001600160401b0380821115614c3957600080fd5b614c4587838801614651565b94506020860135915080821115614c5b57600080fd5b614c6787838801614832565b93506040860135915080821115614c7d57600080fd5b50614c8a86828701614925565b9150509250925092565b60008060408385031215614ca757600080fd5b8235614cb281614422565b946020939093013593505050565b600080600060408486031215614cd557600080fd5b83356001600160401b03811115614ceb57600080fd5b614cf7868287016144dd565b909790965060209590950135949350505050565b600060208284031215614d1d57600080fd5b61441b82614437565b60008060008060808587031215614d3c57600080fd5b84356001600160401b0380821115614d5357600080fd5b614d5f88838901614651565b955060208701359150614d7182614422565b90935060408601359080821115614d8757600080fd5b9086019060408289031215614d9b57600080fd5b614da36145a2565b823582811115614db257600080fd5b83019150601f82018913614dc557600080fd5b614dd4898335602085016145fa565b815260209283013592810192909252509396929550929360600135925050565b600060408284031215614e0657600080fd5b50919050565b600080600080600080600080600060c08a8c031215614e2a57600080fd5b89356001600160401b0380821115614e4157600080fd5b614e4d8d838e01614651565b9a50614e5b60208d016143e9565b995060408c0135915080821115614e7157600080fd5b614e7d8d838e01614df4565b985060608c0135915080821115614e9357600080fd5b614e9f8d838e01614671565b909850965060808c0135915080821115614eb857600080fd5b614ec48d838e01614671565b909650945060a08c0135915080821115614edd57600080fd5b50614eea8c828d01614671565b915080935050809150509295985092959850929598565b634e487b7160e01b600052601160045260246000fd5b818103818111156129b6576129b6614f01565b634e487b7160e01b600052601260045260246000fd5b600082614f4f57614f4f614f2a565b500490565b80820281158282048414176129b6576129b6614f01565b600060208284031215614f7d57600080fd5b815161441b81614422565b600060208284031215614f9a57600080fd5b5051919050565b808201808211156129b6576129b6614f01565b600082614fc357614fc3614f2a565b500690565b6000808335601e19843603018112614fdf57600080fd5b83016020810192503590506001600160401b03811115614ffe57600080fd5b8060051b360382131561451e57600080fd5b8183526000602080850194508260005b8581101561504e57813561503381614422565b6001600160a01b031687529582019590820190600101615020565b509495945050505050565b81835260006001600160fb1b0383111561507257600080fd5b8260051b80836020870137939093016020019392505050565b60208082528181018390526000906040808401600586901b850182018785805b8981101561514657888403603f190185528235368c9003605e190181126150d0578283fd5b8b0160606150de8280614fc8565b8288526150ee8389018284615010565b925050506150fe89830183614fc8565b8783038b890152615110838284615059565b9250505087820135915061512382614422565b6001600160a01b03919091169487019490945293860193918601916001016150ab565b50919998505050505050505050565b6000602080838503121561516857600080fd5b82516001600160401b0381111561517e57600080fd5b8301601f8101851361518f57600080fd5b805161519d6148538261480f565b81815260059190911b820183019083810190878311156151bc57600080fd5b928401925b828410156151da578351825292840192908401906151c1565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261521257600080fd5b8301803591506001600160401b0382111561522c57600080fd5b60200191503681900382131561451e57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061527e606083018789615241565b8281036020840152615291818688615241565b9150508260408301529695505050505050565b6000600182016152b6576152b6614f01565b5060010190565b60005b838110156152d85781810151838201526020016152c0565b50506000910152565b600082516152f38184602087016152bd565b9190910192915050565b6000808335601e1984360301811261531457600080fd5b83016020810192503590506001600160401b0381111561533357600080fd5b80360382131561451e57600080fd5b81835260006020808501808196508560051b810191508460005b87811015614b1257828403895261537382886152fd565b61537e868284615241565b9a87019a955050509084019060010161535c565b6020815260006138b0602083018486615342565b600081518084526020808501945080840160005b8381101561504e5781516001600160a01b0316875295820195908201906001016153ba565b600081518084526020808501808196508360051b8101915082860160005b85811015614b125782840389526154158483516153a6565b988501989350908401906001016153fd565b600081518084526020808501945080840160005b8381101561504e5781518752958201959082019060010161543b565b600081518084526020808501945080840160005b8381101561504e57815115158752958201959082019060010161546b565b608080825281810186905260009060a0808401600589901b850182018a85805b8c81101561559857888403609f190185528235368f900360de190181126154ce578283fd5b8e0160e081356154dd81614422565b6001600160a01b031686526020828101356154f781614422565b6001600160a01b0316818801526040615511848201614489565b6001600160a01b031690880152606083810135908801526155338a8401614437565b63ffffffff168a880152615549838a0184614fc8565b838b8a015261555b848a018284615010565b9350505060c061556d81850185614fc8565b9450888403828a0152615581848683615059565b9983019998505050949094019350506001016154a9565b50505085810360208701526155ad818a6153df565b935050505082810360408401526155c48186615427565b905082810360608401526155d88185615457565b98975050505050505050565b6060815260006155f760608301866153a6565b82810360208401526156098186615427565b91505060018060a01b0383166040830152949350505050565b60018060a01b038416815260606020820152600083516040606084015280518060a08501526156588160c08601602085016152bd565b60209590950151608084015250506040810191909152601f91909101601f19160160c001919050565b81835260006020808501808196508560051b810191508460005b87811015614b125782840389526156b28288614fc8565b6156bd868284615059565b9a87019a955050509084019060010161569b565b6001600160401b03891681526000602060a081840152893560a08401526156fa818b018b6152fd565b604060c086015261570f60e086018284615241565b85810360408701528a81528b9250830190506000805b8b81101561575557833564ffffffffff8116808214615742578384fd5b8452509284019291840191600101615725565b5050848103606086015261576a81898b615342565b925050508281036080840152615781818587615681565b9b9a505050505050505050505056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a264697066735822122062bafef7f713bdffe92c78597e5e6fb430366a754467ec9c1a41a3d8e330b95664736f6c63430008140033","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol\";\nimport {Configurable} from \"./Configurable.sol\";\n\nimport \"./interfaces/IEigenPod.sol\";\nimport {ICToken} from \"./interfaces/ICToken.sol\";\nimport {IRestaker} from \"./restaker/IRestaker.sol\";\nimport {IDelegationManager} from \"./interfaces/IDelegationManager.sol\";\nimport {IProtocolConfig} from \"./interfaces/IProtocolConfig.sol\";\nimport {IRestakingPool} from \"./interfaces/IRestakingPool.sol\";\nimport {ISignatureUtils} from \"./interfaces/ISignatureUtils.sol\";\n\nimport {InceptionLibrary} from \"./libraries/InceptionLibrary.sol\";\n\n/**\n * @title General contract where stakes and unstakes of inETH happens.\n * @author InceptionLRT V2\n */\ncontract RestakingPool is\n    Configurable,\n    ReentrancyGuardUpgradeable,\n    IRestakingPool\n{\n    /**\n     * @dev block gas limit\n     */\n    uint64 internal constant MAX_GAS_LIMIT = 30_000_000;\n\n    /**\n     * @notice gas available to receive unstake\n     * @dev max gas allocated for {_sendValue}\n     */\n    uint256 public constant CALL_GAS_LIMIT = 10_000;\n\n    uint256 internal _minStakeAmount;\n    uint256 internal _minUnstakeAmount;\n\n    /**\n     * @dev staked ETH to protocol.\n     */\n    uint256 internal _totalStaked;\n    /**\n     * @dev unstaked ETH from protocol\n     */\n    uint256 internal _totalUnstaked;\n\n    /**\n     * @dev Current gap of {_pendingUnstakes}.\n     */\n    uint256 internal _pendingGap;\n    /**\n     * @dev Unstake queue.\n     */\n    Unstake[] internal _pendingUnstakes;\n    /**\n     * @dev Total unstake amount in {_pendingUnstakes}.\n     */\n    uint256 internal _totalPendingUnstakes;\n    mapping(address => uint256) internal _totalUnstakesOf;\n    /**\n     * @dev max gas spendable per interation of {distributeUnstakes}\n     */\n    uint32 internal _distributeGasLimit;\n\n    uint256 internal _totalClaimable;\n    mapping(address => uint256) internal _claimable;\n\n    /**\n     * @dev keccak256(provider name) => Restaker\n     */\n    mapping(bytes32 => address) internal _restakers;\n\n    /**\n     * @dev max accepted TVL of protocol\n     */\n    uint256 internal _maxTVL;\n\n    /// @dev 100%\n    uint64 public constant MAX_PERCENT = 100 * 1e8;\n\n    uint256 public stakeBonusAmount;\n\n    uint64 public targetCapacity;\n    uint64 public maxBonusRate;\n    uint64 public optimalBonusRate;\n    uint64 public stakeUtilizationKink;\n\n    uint64 public maxFlashFeeRate;\n    uint64 public optimalUnstakeRate;\n    uint64 public unstakeUtilizationKink;\n    uint64 public protocolFee;\n\n    uint256 public currentRewards;\n    /// @dev blockTime\n    uint256 public startTimeline;\n    /// @dev in seconds\n    uint256 public rewardsTimeline;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50 - 19] private __gap;\n\n    /*******************************************************************************\n                        CONSTRUCTOR\n    *******************************************************************************/\n\n    /// @dev https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(\n        IProtocolConfig config,\n        uint32 distributeGasLimit,\n        uint256 newMaxTVL\n    ) external initializer {\n        __ReentrancyGuard_init();\n        __Configurable_init(config);\n        __RestakingPool_init(distributeGasLimit, newMaxTVL);\n    }\n\n    function __RestakingPool_init(uint32 distributeGasLimit, uint256 newMaxTVL)\n        internal\n        onlyInitializing\n    {\n        _setDistributeGasLimit(distributeGasLimit);\n        _setMaxTVL(newMaxTVL);\n    }\n\n    /*******************************************************************************\n                        WRITE FUNCTIONS\n    *******************************************************************************/\n\n    /**\n     *\n     * @dev need to open incoming transfers to receive ETH from EigenPods\n     */\n    receive() external payable {\n        emit Received(_msgSender(), msg.value);\n    }\n\n    function stake(bytes32 code) external payable {\n        stake();\n        emit ReferralStake(code);\n    }\n\n    /**\n     * @notice Exchange `msg.value` ETH for inETH by ratio.\n     */\n    function stake() public payable {\n        uint256 amount = msg.value;\n        if (targetCapacity == 0) revert TargetCapacityNotSet();\n        if (amount < getMinStake()) revert PoolStakeAmLessThanMin();\n        if (amount > availableToStake())\n            revert PoolStakeAmGreaterThanAvailable();\n\n        uint256 stakeBonus;\n        if (stakeBonusAmount > 0) {\n            uint256 capacity = getFlashCapacity();\n            if (capacity < amount) {\n                stakeBonus = _calculateStakeBonus(0, amount);\n            } else {\n                stakeBonus = _calculateStakeBonus(capacity - amount, amount);\n            }\n\n            if (stakeBonus > stakeBonusAmount) {\n                stakeBonus = stakeBonusAmount;\n                stakeBonusAmount = 0;\n            } else {\n                stakeBonusAmount -= stakeBonus;\n            }\n            emit StakeBonus(stakeBonus);\n        }\n        amount += stakeBonus;\n\n        ICToken token = config().getCToken();\n        uint256 shares = token.convertToShares(amount);\n        token.mint(_msgSender(), shares);\n\n        _totalStaked += amount;\n        emit Staked(_msgSender(), amount, shares);\n    }\n\n    /**\n     * @notice Deposit pubkeys together with 32 ETH to given `provider`.\n     * @param provider Provider to restake ETH.\n     * @param pubkeys Array of provider's `pubkeys`.\n     * @param signatures Array of provider's `signatures`.\n     * @param deposit_data_roots Array of provider's `deposit_data_roots`.\n     */\n    function batchDeposit(\n        string memory provider,\n        bytes[] calldata pubkeys,\n        bytes[] calldata signatures,\n        bytes32[] calldata deposit_data_roots\n    ) external onlyOperator nonReentrant {\n        uint256 pubkeysLen = pubkeys.length;\n\n        if (\n            pubkeysLen != signatures.length ||\n            pubkeysLen != deposit_data_roots.length\n        ) revert PoolWrongInputLength();\n\n        if (getFreeBalance() < 32 ether * pubkeysLen)\n            revert PoolInsufficientBalance();\n\n        IEigenPodManager restaker = IEigenPodManager(\n            _getRestakerOrRevert(provider)\n        );\n\n        for (uint i; i < pubkeysLen; i++) {\n            restaker.stake{value: 32 ether}(\n                pubkeys[i],\n                signatures[i],\n                deposit_data_roots[i]\n            );\n        }\n\n        emit Deposited(provider, pubkeys);\n    }\n\n    /**\n     * @dev Creates a withdrawal request based on the current ratio.\n     * @param shares The number of shares to be unstaked.\n     * @param receiver The address that will receive the withdrawn amount.\n     */\n    function flashUnstake(uint256 shares, address receiver)\n        external\n        nonReentrant\n    {\n        if (targetCapacity == 0) revert TargetCapacityNotSet();\n\n        address claimer = msg.sender;\n        ICToken token = config().getCToken();\n        uint256 amount = token.convertToAmount(shares);\n        if (amount < getMinUnstake()) revert PoolUnstakeAmLessThanMin();\n        if (amount > getFlashCapacity())\n            revert InsufficientCapacity(getFlashCapacity());\n\n        uint256 fee = calculateFlashUnstakeFee(amount);\n        if (fee == 0) revert PoolZeroAmount();\n        uint256 protocolWithdrawalFee = (fee * protocolFee) / MAX_PERCENT;\n\n        token.burn(claimer, shares);\n\n        _totalUnstaked += amount;\n        amount -= fee;\n        stakeBonusAmount += (fee - protocolWithdrawalFee);\n\n        _sendValue(config().getTreasury(), protocolWithdrawalFee, false);\n        _sendValue(receiver, amount, false);\n\n        emit FlashUnstaked(claimer, receiver, claimer, amount, shares, fee);\n    }\n\n    /**\n     * @notice Burns shares from owner and add exactly amount of ETH to unstake queue in order for `to`.\n     * @dev Returns ETH via queue\n     * @param to Address for receiving unstaked funds\n     * @param shares Amount of cToken to unstake\n     */\n    function unstake(address to, uint256 shares) external nonReentrant {\n        address from = _msgSender();\n        ICToken token = config().getCToken();\n        uint256 amount = token.convertToAmount(shares);\n        if (amount < getMinUnstake()) revert PoolUnstakeAmLessThanMin();\n\n        // @dev don't need to check balance, because it throws ERC20InsufficientBalance\n        token.burn(from, shares);\n\n        _addIntoQueue(to, amount);\n\n        _totalUnstaked += amount;\n        emit Unstaked(from, to, amount, shares);\n    }\n\n    function _addIntoQueue(address recipient, uint256 amount) internal {\n        if (recipient == address(0)) revert PoolZeroAddress();\n        if (amount == 0) revert PoolZeroAmount();\n\n        // each new request is placed at the end of the queue\n        _totalPendingUnstakes += amount;\n        _totalUnstakesOf[recipient] += amount;\n\n        _pendingUnstakes.push(Unstake(recipient, amount));\n    }\n\n    function claimRestaker(string calldata provider, uint256 fee)\n        external\n        onlyOperator\n    {\n        IRestaker restaker = IRestaker(_getRestakerOrRevert(provider));\n        uint256 balanceBefore = address(this).balance;\n        restaker.__claim();\n        uint256 claimed = address(this).balance - balanceBefore;\n\n        if (fee > claimed) revert AmbiguousFee(claimed, fee);\n        // send committed by operator fee (deducted from ratio) to multi-sig treasury\n        address treasury = config().getTreasury();\n        if (fee > 0) _sendValue(treasury, fee, false);\n\n        // from {provider} fee claimed to {treasury}\n        emit FeeClaimed(address(restaker), treasury, fee, claimed);\n    }\n\n    /**\n     * @notice Pay unstakes from {getPending} balance.\n     * @dev Callable by operator once per 1-3 days if {getPending} enough to pay at least one unstake.\n     */\n    function distributeUnstakes() external onlyOperator nonReentrant {\n        /// no need to check for {_distributeGasLimit} because it's never be 0\n        /// TODO: claim from Restakers and spent fee from this sum\n\n        uint256 poolBalance = getFreeBalance();\n\n        uint256 unstakesLength = _pendingUnstakes.length;\n        uint256 i = _pendingGap;\n\n        while (\n            i < unstakesLength &&\n            poolBalance > 0 &&\n            gasleft() > _distributeGasLimit\n        ) {\n            Unstake memory unstake_ = _pendingUnstakes[i];\n\n            if (unstake_.recipient == address(0) || unstake_.amount == 0) {\n                ++i;\n                continue;\n            }\n            if (poolBalance < unstake_.amount) break;\n\n            _totalUnstakesOf[unstake_.recipient] -= unstake_.amount;\n            _totalPendingUnstakes -= unstake_.amount;\n            poolBalance -= unstake_.amount;\n            delete _pendingUnstakes[i];\n            ++i;\n            _addClaimable(unstake_.recipient, unstake_.amount);\n        }\n        _pendingGap = i;\n    }\n\n    function _sendValue(\n        address recipient,\n        uint256 amount,\n        bool limit\n    ) internal returns (bool success) {\n        if (totalAssets() < amount) revert PoolInsufficientBalance();\n\n        address payable wallet = payable(recipient);\n        if (limit) {\n            assembly {\n                success := call(CALL_GAS_LIMIT, wallet, amount, 0, 0, 0, 0)\n            }\n        } else {\n            (success, ) = wallet.call{value: amount}(\"\");\n        }\n\n        return success;\n    }\n\n    function _addClaimable(address account, uint256 amount) internal {\n        _totalClaimable += amount;\n        _claimable[account] += amount;\n        emit ClaimExpected(account, amount);\n    }\n\n    /**\n     * @notice Claim ETH available in {claimableOf}\n     */\n    function claimUnstake(address claimer) external nonReentrant {\n        if (claimer == address(0)) revert PoolZeroAddress();\n\n        uint256 amount = claimableOf(claimer);\n        if (amount == 0) revert PoolZeroAmount();\n\n        if (totalAssets() < getTotalClaimable())\n            revert PoolInsufficientBalance();\n\n        _totalClaimable -= amount;\n        _claimable[claimer] = 0;\n\n        bool result = _sendValue(claimer, amount, false);\n        if (!result) revert PoolFailedInnerCall();\n\n        emit UnstakeClaimed(claimer, _msgSender(), amount);\n    }\n\n    /*******************************************************************************\n                        EIGEN POD OWNER WRITE FUNCTIONS\n                        THIS FUNCTIONS MAKE POSSIBLE TO\n                        CALL DIFFERENT CONTRACTS WITH\n                        RESTAKER CONTEXT\n    *******************************************************************************/\n\n    /**\n     * @notice Verify that validators has withdrawal credentials pointed to EigenPod\n     */\n    function verifyWithdrawalCredentials(\n        string memory provider,\n        uint64 oracleTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        uint40[] calldata validatorIndices,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields\n    ) external onlyOperator {\n        IEigenPod restaker = IEigenPod(_getRestakerOrRevert(provider));\n        restaker.verifyWithdrawalCredentials(\n            oracleTimestamp,\n            stateRootProof,\n            validatorIndices,\n            validatorFieldsProofs,\n            validatorFields\n        );\n    }\n\n    function recoverTokens(\n        string memory provider,\n        IERC20[] memory tokenList,\n        uint256[] memory amountsToWithdraw\n    ) external onlyOperator {\n        IEigenPod restaker = IEigenPod(_getRestakerOrRevert(provider));\n        restaker.recoverTokens(\n            tokenList,\n            amountsToWithdraw,\n            config().getOperator()\n        );\n    }\n\n    function startWithdrawalCheckpoint(\n        string memory provider,\n        bool revertIfNoBalance\n    ) external onlyOperator {\n        IEigenPod restaker = IEigenPod(_getRestakerOrRevert(provider));\n        restaker.startCheckpoint(revertIfNoBalance);\n    }\n\n    function delegateTo(\n        string memory provider,\n        address elOperator,\n        ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry,\n        bytes32 approverSalt\n    ) external onlyOperator {\n        IDelegationManager restaker = IDelegationManager(\n            _getRestakerOrRevert(provider)\n        );\n        restaker.delegateTo(\n            elOperator,\n            approverSignatureAndExpiry,\n            approverSalt\n        );\n    }\n\n    function undelegate(string memory provider) external onlyOperator {\n        IDelegationManager restaker = IDelegationManager(\n            _getRestakerOrRevert(provider)\n        );\n        restaker.undelegate(address(restaker));\n    }\n\n    function queueWithdrawals(\n        string memory provider,\n        IDelegationManager.QueuedWithdrawalParams[] calldata withdrawals\n    ) external onlyOperator {\n        IDelegationManager restaker = IDelegationManager(\n            _getRestakerOrRevert(provider)\n        );\n        restaker.queueWithdrawals(withdrawals);\n    }\n\n    function completeWithdrawals(\n        string memory provider,\n        IDelegationManager.Withdrawal[] calldata withdrawals,\n        IERC20[][] memory tokens,\n        uint256[] memory middlewareTimesIndexes,\n        bool[] memory receiveAsTokens\n    ) external onlyOperator {\n        IDelegationManager restaker = IDelegationManager(\n            _getRestakerOrRevert(provider)\n        );\n        restaker.completeQueuedWithdrawals(\n            withdrawals,\n            tokens,\n            middlewareTimesIndexes,\n            receiveAsTokens\n        );\n    }\n\n    /*******************************************************************************\n                        VIEW FUNCTIONS\n    *******************************************************************************/\n\n    function totalAssets() public view returns (uint256) {\n        uint256 elapsedDays = (block.timestamp - startTimeline) / 1 days;\n        uint256 totalDays = rewardsTimeline / 1 days;\n        if (elapsedDays > totalDays) return address(this).balance;\n\n        uint256 reservedRewards = (currentRewards / totalDays) *\n            (totalDays - elapsedDays);\n\n        return (address(this).balance - reservedRewards);\n    }\n\n    function getFlashCapacity() public view returns (uint256 total) {\n        return _pureBalance();\n    }\n\n    function _getTargetCapacity() internal view returns (uint256) {\n        return\n            (targetCapacity * config().getCToken().totalAssets()) / MAX_PERCENT;\n    }\n\n    /**\n     * @notice Get ETH amount available to stake before protocol reach max TVL.\n     */\n    function availableToStake() public view virtual returns (uint256) {\n        uint256 _totalAssets = config().getCToken().totalAssets();\n        if (_totalAssets > _maxTVL) {\n            return 0;\n        }\n        return _maxTVL - _totalAssets;\n    }\n\n    /**\n     * @notice Get minimal available amount to stake.\n     */\n    function getMinStake() public view virtual returns (uint256 amount) {\n        // 1 shares = minimal respresentable amount\n        uint256 minConvertableAmount = config().getCToken().convertToAmount(1);\n        return\n            _minStakeAmount > minConvertableAmount\n                ? _minStakeAmount\n                : minConvertableAmount;\n    }\n\n    /**\n     * @notice Get minimal availabe unstake of shares.\n     */\n    function getMinUnstake()\n        public\n        view\n        virtual\n        override\n        returns (uint256 shares)\n    {\n        ICToken token = config().getCToken();\n        // 1 shares => amount => shares = minimal possible shares amount\n        uint256 minConvertableShare = token.convertToShares(\n            token.convertToAmount(1)\n        );\n        return\n            _minUnstakeAmount > minConvertableShare\n                ? _minUnstakeAmount\n                : minConvertableShare;\n    }\n\n    /**\n     * @notice Get pending to calculate ratio.\n     */\n    function getPending() public view returns (uint256) {\n       return _pureBalance();\n    }\n\n    /**\n     * @dev Returns pure balance excluding bonuses and claimables.\n     */\n    function _pureBalance() internal view returns (uint256) {\n        uint256 balance = totalAssets();\n        uint256 claimable = getTotalClaimable();\n        uint256 stakeBonus = stakeBonusAmount;\n\n        if (claimable + stakeBonus > balance) {\n            return 0;\n        } else {\n            return balance - claimable - stakeBonus;\n        }\n    }\n\n    /**\n     * @notice Get free to {batchDeposit}/{distributeUnstakes} balance.\n     */\n    function getFreeBalance() public view returns (uint256) {\n        uint256 pending = getPending();\n        uint256 targetCap = _getTargetCapacity();\n\n        if (targetCap > pending) {\n            return 0;\n        } else {\n            return pending - targetCap;\n        }\n    }\n\n    /**\n     * @notice Total amount waiting for claim by users.\n     */\n    function getTotalClaimable() public view returns (uint256) {\n        return _totalClaimable;\n    }\n\n    function maxTVL() public view returns (uint256) {\n        return _maxTVL;\n    }\n\n    /**\n     * @notice Total amount of waiting unstakes.\n     */\n    function getTotalPendingUnstakes() public view returns (uint256) {\n        return _totalPendingUnstakes;\n    }\n\n    /**\n     * @notice Get all waiting unstakes in queue.\n     * @dev Avoid to use not in view methods.\n     */\n    function getUnstakes() external view returns (Unstake[] memory unstakes) {\n        unstakes = new Unstake[](_pendingUnstakes.length - _pendingGap);\n        uint256 j;\n        for (uint256 i = _pendingGap; i < _pendingUnstakes.length; i++) {\n            unstakes[j++] = _pendingUnstakes[i];\n        }\n    }\n\n    /**\n     * @notice Get waiting unstakes.\n     * @dev Avoid to use not in view methods.\n     */\n    function getUnstakesOf(address recipient)\n        external\n        view\n        returns (Unstake[] memory unstakes)\n    {\n        unstakes = new Unstake[](_pendingUnstakes.length - _pendingGap);\n        uint256 j;\n        for (uint256 i = _pendingGap; i < _pendingUnstakes.length; i++) {\n            if (_pendingUnstakes[i].recipient == recipient) {\n                unstakes[j++] = _pendingUnstakes[i];\n            }\n        }\n        uint256 removeCells = unstakes.length - j;\n        if (removeCells > 0) {\n            assembly {\n                mstore(unstakes, j)\n            }\n        }\n    }\n\n    /**\n     *\n     * @notice Get total amount of waiting unstakes of user.\n     */\n    function getTotalUnstakesOf(address recipient)\n        public\n        view\n        returns (uint256)\n    {\n        return _totalUnstakesOf[recipient];\n    }\n\n    /**\n     * @notice Is {claimableOf} > 0.\n     */\n    function hasClaimable(address claimer) public view returns (bool) {\n        return _claimable[claimer] != uint256(0);\n    }\n\n    /**\n     * @notice Claimable amount of non executed unstakes.\n     * @dev Value increased when {_sendValue} failed during {distributeUnstakes} due to {CALL_GAS_LIMIT}.\n     */\n    function claimableOf(address claimer) public view returns (uint256) {\n        return _claimable[claimer];\n    }\n\n    function getRestaker(string calldata provider)\n        public\n        view\n        returns (address)\n    {\n        return _restakers[_getProviderHash(provider)];\n    }\n\n    function _getRestakerOrRevert(string memory provider)\n        internal\n        view\n        returns (address restaker)\n    {\n        restaker = _restakers[_getProviderHash(provider)];\n        if (restaker == address(0)) {\n            revert PoolRestakerNotExists();\n        }\n    }\n\n    function _getProviderHash(string memory providerName)\n        internal\n        pure\n        returns (bytes32)\n    {\n        return keccak256(bytes(providerName));\n    }\n\n    /**\n     * @dev Function to calculate stake bonus based on the current utilization rate (interest rate model).\n     * @param amount The amount for which the stake bonus is to be calculated.\n     * @return The calculated stake bonus.\n     */\n    function calculateStakeBonus(uint256 amount) public view returns (uint256) {\n        return _calculateStakeBonus(getFlashCapacity(), amount);\n    }\n\n    function _calculateStakeBonus(uint256 capacity, uint256 amount)\n        internal\n        view\n        returns (uint256)\n    {\n        uint256 targetCap = _getTargetCapacity();\n        return\n            InceptionLibrary.calculateDepositBonus(\n                amount,\n                capacity,\n                (targetCap * stakeUtilizationKink) / MAX_PERCENT,\n                optimalBonusRate,\n                maxBonusRate,\n                targetCap\n            );\n    }\n\n    /**\n     * @dev Function to calculate flash unstake fee based on the utilization rate.\n     * @param amount The amount for which the flash unstake fee is to be calculated.\n     * @return The calculated flash unstake fee.\n     */\n    function calculateFlashUnstakeFee(uint256 amount)\n        public\n        view\n        returns (uint256)\n    {\n        uint256 capacity = getFlashCapacity();\n        if (amount > capacity) revert InsufficientCapacity(capacity);\n        uint256 targetCap = _getTargetCapacity();\n        return\n            InceptionLibrary.calculateWithdrawalFee(\n                amount,\n                capacity,\n                (targetCap * unstakeUtilizationKink) / MAX_PERCENT,\n                optimalUnstakeRate,\n                maxFlashFeeRate,\n                targetCap\n            );\n    }\n\n    /*******************************************************************************\n                        Rewards\n    *******************************************************************************/\n    /**\n     * @notice Adds new rewards to the contract, starting a new rewards timeline.\n     * @dev The function allows the operator to deposit Ether as rewards.\n     * It verifies that the previous rewards timeline is over before accepting new rewards.\n     */\n    function addRewards() external payable onlyOperator {\n        uint256 amount = msg.value;\n\n        /// @dev Verify whether the previous timeline is over\n        if (currentRewards > 0) {\n            uint256 totalDays = rewardsTimeline / 1 days;\n            uint256 dayNum = (block.timestamp - startTimeline) / 1 days;\n            if (dayNum < totalDays) revert TimelineNotOver();\n        }\n        currentRewards = amount;\n        startTimeline = block.timestamp;\n\n        emit RewardsAdded(amount, startTimeline);\n    }\n\n    /**\n     * @notice Updates reward coordinator along with claimer\n     * @param provider The new duration of the rewards timeline, measured in seconds.\n     * @param newCoordinator The new reward coordinator address\n     */\n    function setRewardsCoordinator(string calldata provider, address newCoordinator, address claimer) external onlyGovernance {\n        IRestaker restaker = IRestaker(_getRestakerOrRevert(provider));\n        restaker.__setRewardsCoordinator(newCoordinator, claimer);\n    }\n\n    /**\n     * @notice Updates the duration of the rewards timeline.\n     * @dev The new timeline must be at least 1 day (86400 seconds)\n     * @param newTimelineInSeconds The new duration of the rewards timeline, measured in seconds.\n     */\n    function setRewardsTimeline(uint256 newTimelineInSeconds)\n        external\n        onlyGovernance\n    {\n        if (newTimelineInSeconds < 1 days || newTimelineInSeconds % 1 days != 0)\n            revert InconsistentData();\n\n        emit RewardsTimelineChanged(rewardsTimeline, newTimelineInSeconds);\n        rewardsTimeline = newTimelineInSeconds;\n    }\n\n    /*******************************************************************************\n                        GOVERNANCE FUNCTIONS\n    *******************************************************************************/\n\n    /**\n     * @notice Deploy Restaker contract for the given provider.\n     */\n    function addRestaker(string memory provider) external onlyGovernance {\n        bytes32 providerHash = _getProviderHash(provider);\n        address restaker = _restakers[providerHash];\n        if (restaker != address(0)) {\n            revert PoolRestakerExists();\n        }\n        restaker = address(config().getRestakerDeployer().deployRestaker());\n        _restakers[providerHash] = restaker;\n        emit RestakerAdded(provider, restaker);\n    }\n\n    /**\n     * @dev Governance can set gas limit allocated for unstake payout\n     */\n    function setDistributeGasLimit(uint32 newValue) external onlyGovernance {\n        _setDistributeGasLimit(newValue);\n    }\n\n    function _setDistributeGasLimit(uint32 newValue) internal {\n        if (newValue > MAX_GAS_LIMIT || newValue == 0) {\n            revert PoolDistributeGasLimitNotInRange(MAX_GAS_LIMIT);\n        }\n        emit DistributeGasLimitChanged(_distributeGasLimit, newValue);\n        _distributeGasLimit = newValue;\n    }\n\n    /**\n     * @notice Updates the minimum stake amount required for staking.\n     * @param newValue The new minimum stake amount.\n     */\n    function setMinStake(uint256 newValue) external onlyGovernance {\n        emit MinStakeChanged(_minStakeAmount, newValue);\n        _minStakeAmount = newValue;\n    }\n\n    /**\n     * @notice Updates the minimum unstake amount allowed for unstaking.\n     * @param newValue The new minimum unstake amount.\n     */\n    function setMinUnstake(uint256 newValue) external onlyGovernance {\n        emit MinUnstakeChanged(_minUnstakeAmount, newValue);\n        _minUnstakeAmount = newValue;\n    }\n\n    /**\n     * @notice Updates the maximum Total Value Locked (TVL) in the contract.\n     * @dev Calls the internal function `_setMaxTVL` to perform the update.\n     * @param newValue The new maximum TVL value.\n     */\n    function setMaxTVL(uint256 newValue) external onlyGovernance {\n        _setMaxTVL(newValue);\n    }\n\n    function setStakeBonusParams(\n        uint64 newMaxBonusRate,\n        uint64 newOptimalBonusRate,\n        uint64 newStakeUtilizationKink\n    ) external onlyGovernance {\n        if (newMaxBonusRate > MAX_PERCENT)\n            revert ParameterExceedsLimits(newMaxBonusRate);\n        if (newOptimalBonusRate > MAX_PERCENT)\n            revert ParameterExceedsLimits(newOptimalBonusRate);\n        if (newStakeUtilizationKink > MAX_PERCENT)\n            revert ParameterExceedsLimits(newStakeUtilizationKink);\n\n        maxBonusRate = newMaxBonusRate;\n        optimalBonusRate = newOptimalBonusRate;\n        stakeUtilizationKink = newStakeUtilizationKink;\n\n        emit StakeBonusParamsChanged(\n            newMaxBonusRate,\n            newOptimalBonusRate,\n            newStakeUtilizationKink\n        );\n    }\n\n    function setFlashUnstakeFeeParams(\n        uint64 newMaxFlashFeeRate,\n        uint64 newOptimalUnstakeRate,\n        uint64 newUnstakeUtilizationKink\n    ) external onlyGovernance {\n        if (newMaxFlashFeeRate > MAX_PERCENT)\n            revert ParameterExceedsLimits(newMaxFlashFeeRate);\n        if (newOptimalUnstakeRate > MAX_PERCENT)\n            revert ParameterExceedsLimits(newOptimalUnstakeRate);\n        if (newUnstakeUtilizationKink > MAX_PERCENT)\n            revert ParameterExceedsLimits(newUnstakeUtilizationKink);\n\n        maxFlashFeeRate = newMaxFlashFeeRate;\n        optimalUnstakeRate = newOptimalUnstakeRate;\n        unstakeUtilizationKink = newUnstakeUtilizationKink;\n\n        emit UnstakeFeeParamsChanged(\n            newMaxFlashFeeRate,\n            newOptimalUnstakeRate,\n            newUnstakeUtilizationKink\n        );\n    }\n\n    /**\n     * @notice Updates the protocol fee percentage used in the contract.\n     * @dev The new protocol fee must not exceed `MAX_PERCENT`.\n     * @param newProtocolFee The new protocol fee percentage, represented as a `uint64`.\n     */\n    function setProtocolFee(uint64 newProtocolFee) external onlyGovernance {\n        if (newProtocolFee > MAX_PERCENT)\n            revert ParameterExceedsLimits(newProtocolFee);\n\n        emit ProtocolFeeChanged(protocolFee, newProtocolFee);\n        protocolFee = newProtocolFee;\n    }\n\n    /**\n     * @notice Updates the target flash loan capacity of the contract.\n     * @dev Sets a new target capacity for flash loans.\n     * @param newTargetCapacity The new target flash loan capacity, represented as a `uint64`.\n     */\n    function setTargetFlashCapacity(uint64 newTargetCapacity)\n        external\n        onlyGovernance\n    {\n        emit TargetCapacityChanged(targetCapacity, newTargetCapacity);\n        targetCapacity = newTargetCapacity;\n    }\n\n    function _setMaxTVL(uint256 newValue) internal {\n        if (newValue == 0) {\n            revert PoolZeroAmount();\n        }\n        emit MaxTVLChanged(_maxTVL, newValue);\n        _maxTVL = newValue;\n    }\n}\n","creation_status":"success","file_path":"contracts/RestakingPool.sol"}