creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/EigenpieEnterprise.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\nimport { UtilLib } from \"./utils/UtilLib.sol\";\nimport { EigenpieConstants } from \"./utils/EigenpieConstants.sol\";\nimport { EigenpieConfigRoleChecker, IEigenpieConfig } from \"./utils/EigenpieConfigRoleChecker.sol\";\nimport { IEigenpieEnterprise } from \"./interfaces/IEigenpieEnterprise.sol\";\nimport { IMLRTWallet } from \"./interfaces/IMLRTWallet.sol\";\nimport { IMLRT } from \"./interfaces/IMLRT.sol\";\nimport { IEigenPod } from \"./interfaces/eigenlayer/IEigenPod.sol\";\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\ncontract EigenpieEnterprise is\n    IEigenpieEnterprise,\n    EigenpieConfigRoleChecker,\n    PausableUpgradeable,\n    ReentrancyGuardUpgradeable\n{\n    mapping (address => ClientData) public allowedClients;    \n    mapping (address => bool) public registeredPod;\n    // keep tracking of total enterprise minted mRLT by receipt \n    mapping (address => uint256) public totalMintedMlrt;\n\n    address[] public allClients;\n\n    // mLRT Wallet upgradable beacon\n    address public mLRTWalletBeacon;\n\n    bytes internal constant BeaconProxyBytecode =\n        hex\"608060405260405161090e38038061090e83398101604081905261002291610460565b61002e82826000610035565b505061058a565b61003e83610100565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100fb576100f9836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e99190610520565b836102a360201b6100291760201c565b505b505050565b610113816102cf60201b6100551760201c565b6101725760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101e6816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610520565b6102cf60201b6100551760201c565b61024b5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610169565b806102827fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b6102de60201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606102c883836040518060600160405280602781526020016108e7602791396102e1565b9392505050565b6001600160a01b03163b151590565b90565b6060600080856001600160a01b0316856040516102fe919061053b565b600060405180830381855af49150503d8060008114610339576040519150601f19603f3d011682016040523d82523d6000602084013e61033e565b606091505b5090925090506103508683838761035a565b9695505050505050565b606083156103c65782516103bf576001600160a01b0385163b6103bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610169565b50816103d0565b6103d083836103d8565b949350505050565b8151156103e85781518083602001fd5b8060405162461bcd60e51b81526004016101699190610557565b80516001600160a01b038116811461041957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561044f578181015183820152602001610437565b838111156100f95750506000910152565b6000806040838503121561047357600080fd5b61047c83610402565b60208401519092506001600160401b038082111561049957600080fd5b818501915085601f8301126104ad57600080fd5b8151818111156104bf576104bf61041e565b604051601f8201601f19908116603f011681019083821181831017156104e7576104e761041e565b8160405282815288602084870101111561050057600080fd5b610511836020830160208801610434565b80955050505050509250929050565b60006020828403121561053257600080fd5b6102c882610402565b6000825161054d818460208701610434565b9190910192915050565b6020815260008251806020840152610576816040850160208701610434565b601f01601f19169190910160400192915050565b61034e806105996000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b610100565b565b606061004e83836040518060600160405280602781526020016102f260279139610124565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb9190610249565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161014191906102a2565b600060405180830381855af49150503d806000811461017c576040519150601f19603f3d011682016040523d82523d6000602084013e610181565b606091505b50915091506101928683838761019c565b9695505050505050565b6060831561020d578251610206576001600160a01b0385163b6102065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610217565b610217838361021f565b949350505050565b81511561022f5781518083602001fd5b8060405162461bcd60e51b81526004016101fd91906102be565b60006020828403121561025b57600080fd5b81516001600160a01b038116811461004e57600080fd5b60005b8381101561028d578181015183820152602001610275565b8381111561029c576000848401525b50505050565b600082516102b4818460208701610272565b9190910192915050565b60208152600082518060208401526102dd816040850160208701610272565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d51e81d3bc5ed20a26aeb05dce7e825c503b2061aa78628027300c8d65b9d89a64736f6c634300080c0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\n\n    uint256[50] private __gap; // reserve for upgrade\n\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(address _eigenpieConfigAddr, address _mLRTWalletBeacon) external initializer {\n        UtilLib.checkNonZeroAddress(_eigenpieConfigAddr);\n\n        __Pausable_init();\n        __ReentrancyGuard_init();\n\n        eigenpieConfig = IEigenpieConfig(_eigenpieConfigAddr);\n        mLRTWalletBeacon = _mLRTWalletBeacon;\n\n        emit UpdatedEigenpieConfig(_eigenpieConfigAddr);\n    }\n\n    modifier onlyAllowedClient() {\n        ClientData memory clientData = allowedClients[msg.sender];\n\n        if (clientData.registered != true) revert InvalidClient();\n        _;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            View functions\n    //////////////////////////////////////////////////////////////*/    \n\n    function getClient(uint256 index) external returns (address) {\n        return allClients[index];\n    }\n\n    function getClientLength() external returns (uint256) {\n        return allClients.length;\n    }\n\n    function getClientData(address client) external override returns (ClientData memory clientData) {\n        clientData = allowedClients[client];\n    }\n\n    function getTotalMintedNativeMlrt() external override returns (uint256 totalMlrt) {\n        address receipt = eigenpieConfig.mLRTReceiptByAsset(EigenpieConstants.PLATFORM_TOKEN_ADDRESS);\n\n        return totalMintedMlrt[receipt];\n    }\n\n    function nativeRestakedLess(address client) external override returns (uint256 ethLessAmount, uint256 mlrtShouldBurn) {\n        ClientData storage clientData = allowedClients[client];\n        return _checkCollateralLess(clientData, EigenpieConstants.PLATFORM_TOKEN_ADDRESS);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            Write functions\n    //////////////////////////////////////////////////////////////*/   \n\n    function burnNativeMLRT(address client) external nonReentrant {\n        ClientData storage clientData = allowedClients[client];\n        (uint256 valuedEthLess, uint256 shouldBurn) =  _checkCollateralLess(clientData, EigenpieConstants.PLATFORM_TOKEN_ADDRESS);\n        if (valuedEthLess == 0) revert EnoughCollateral();\n\n        _burnFromMRLTWallet(clientData, EigenpieConstants.PLATFORM_TOKEN_ADDRESS, valuedEthLess, shouldBurn);\n\n        emit BurnMLRTFromWallet(client, EigenpieConstants.PLATFORM_TOKEN_ADDRESS, valuedEthLess, shouldBurn);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            Client functions\n    //////////////////////////////////////////////////////////////*/\n    \n    // TODO, client's native restaed value should be synced from Eigenpod once M2 launches\n    function registerNativeReStaking(uint256 nativeAmountToMintMlt) external onlyAllowedClient {\n        // check if amount can be minted\n        ClientData storage clientData = allowedClients[msg.sender];\n        _checkValidMint(clientData, nativeAmountToMintMlt);\n\n        // mint mLRT to wallt\n        (address receipt, uint256 amountToMint) = _calculateMintAndUpdate(clientData, EigenpieConstants.PLATFORM_TOKEN_ADDRESS, nativeAmountToMintMlt);\n        \n        if (clientData.mlrtWallet == address(0))\n            clientData.mlrtWallet = _deployMLRTWallet(msg.sender, clientData.eigenPod);\n\n        IMLRT(receipt).mint(clientData.mlrtWallet, amountToMint);\n\n        totalMintedMlrt[receipt] += amountToMint;\n\n        emit ClientRegisterNativeRestake(msg.sender, clientData.mlrtWallet, nativeAmountToMintMlt, amountToMint);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        Eigenpie Admin functions\n    //////////////////////////////////////////////////////////////*/    \n\n    function updateAllowedClient(address client, uint256 nativeRestakedAmount, address eigenPod) external onlyDefaultAdmin {\n        if (registeredPod[eigenPod]) revert EigenpodUsed();\n        if (IEigenPod(eigenPod).podOwner() != client) revert EigenpodMisMatch();\n        ClientData storage clientData = allowedClients[client];\n\n        if (!clientData.registered) {\n            clientData.registered = true;\n            allClients.push(client);\n        }\n\n        clientData.nativeRestakedAmount = nativeRestakedAmount;\n        clientData.eigenPod = eigenPod;\n\n        registeredPod[eigenPod] = true;\n\n        emit UpdateAllowedClient(client, nativeRestakedAmount, eigenPod);\n    }\n\n    function updateClientRestakedAmount(address client, uint256 nativeRestakedAmount) external onlyDefaultAdmin {\n        ClientData storage clientData = allowedClients[client];\n        if (!clientData.registered) revert InvalidClient();\n\n        clientData.nativeRestakedAmount = nativeRestakedAmount;\n\n        emit UpdateClientNativeRestakedAmount(client, nativeRestakedAmount);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        Internal functions\n    //////////////////////////////////////////////////////////////*/        \n\n    function _checkValidMint(ClientData storage clientData, uint256 nativeAmountToMintMlt) internal view {\n        uint256 quotaLeft = clientData.nativeRestakedAmount - clientData.nativeUsed;\n        if (quotaLeft < nativeAmountToMintMlt)\n            revert EthNotEnough(quotaLeft, nativeAmountToMintMlt);        \n    }\n\n    function _deployMLRTWallet(address client, address eigenPod) internal returns (address) {\n        // create the pod\n        IMLRTWallet wallet = \n            IMLRTWallet(\n                Create2.deploy(\n                    0, \n                    bytes32(uint256(uint160(msg.sender))), \n                    // set the beacon address to the mLRTWalletBeacon and initialize it\n                    abi.encodePacked(\n                        BeaconProxyBytecode, \n                        abi.encode(mLRTWalletBeacon, \"\")\n                    )\n                )\n            );\n        wallet.initialize(client, eigenPod, address(eigenpieConfig), address(this));\n        // store the pod in the mapping\n        return address(wallet);\n    }\n\n    function _calculateMintAndUpdate(ClientData storage clientData, address asset, uint256 nativeAmountToMintMlt) internal returns (address receipt, uint256 mLRTAmountToMint) {\n        receipt = eigenpieConfig.mLRTReceiptByAsset(asset);\n        uint256 rate = IMLRT(receipt).exchangeRateToLST();\n        mLRTAmountToMint = (nativeAmountToMintMlt * 1 ether) / rate;\n\n        clientData.nativeUsed += nativeAmountToMintMlt;\n        clientData.mlrtMinted += mLRTAmountToMint;\n        clientData.exchangeRate = clientData.nativeUsed * 1 ether / clientData.mlrtMinted;\n    }\n\n    function _burnFromMRLTWallet(ClientData storage clientData, address asset, uint256 lessAmount, uint256 shouldBurn) internal {\n        address receipt = eigenpieConfig.mLRTReceiptByAsset(asset);\n        IMLRT(receipt).burnFrom(clientData.mlrtWallet, shouldBurn);\n\n        if (clientData.mlrtMinted > shouldBurn)\n            clientData.mlrtMinted -= shouldBurn;\n        else\n            clientData.mlrtMinted = 0;\n\n        if (clientData.nativeUsed > lessAmount)\n            clientData.nativeUsed -= lessAmount;\n        else\n            clientData.nativeUsed = 0;\n\n        if (totalMintedMlrt[receipt] > shouldBurn)\n            totalMintedMlrt[receipt] -= shouldBurn;\n        else\n            totalMintedMlrt[receipt] = 0;\n    }\n\n    function _checkCollateralLess(ClientData storage clientData, address asset) internal view returns (uint256 collateralLess, uint256 shouldBurn) {\n        uint256 valuedEth = clientData.mlrtMinted * clientData.exchangeRate / 1 ether;\n        if (valuedEth <= clientData.nativeRestakedAmount)\n            return (0, 0);\n\n        collateralLess = valuedEth - clientData.nativeRestakedAmount;\n        shouldBurn = collateralLess * 1 ether / clientData.exchangeRate;         \n    }    \n}"
      },
      "contracts/utils/UtilLib.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\nimport { EigenpieConstants } from \"./EigenpieConstants.sol\";\n\n/// @title UtilLib - Utility library\n/// @notice Utility functions\nlibrary UtilLib {\n    error ZeroAddressNotAllowed();\n\n    /// @dev zero address check modifier\n    /// @param address_ address to check\n    function checkNonZeroAddress(address address_) internal pure {\n        if (address_ == address(0)) revert ZeroAddressNotAllowed();\n    }\n\n    function isNativeToken(address addr) internal pure returns (bool) {\n        return addr == EigenpieConstants.PLATFORM_TOKEN_ADDRESS;\n    }\n}\n"
      },
      "contracts/utils/EigenpieConstants.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\nlibrary EigenpieConstants {\n    //contracts\n    bytes32 public constant EIGENPIE_STAKING = keccak256(\"EIGENPIE_STAKING\");\n    bytes32 public constant EIGEN_STRATEGY_MANAGER = keccak256(\"EIGEN_STRATEGY_MANAGER\");\n    bytes32 public constant PRICE_PROVIDER = keccak256(\"PRICE_PROVIDER\");\n    bytes32 public constant BEACON_DEPOSIT = keccak256(\"BEACON_DEPOSIT\");\n    bytes32 public constant EIGENPOD_MANAGER = keccak256(\"EIGENPOD_MANAGER\");\n    bytes32 public constant EIGENPIE_PREDEPOSITHELPER = keccak256(\"EIGENPIE_PREDEPOSITHELPER\");\n    bytes32 public constant EIGENPIE_REWADR_DISTRIBUTOR = keccak256(\"EIGENPIE_REWADR_DISTRIBUTOR\");\n\n    //Roles\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n    bytes32 public constant MANAGER = keccak256(\"MANAGER\");\n    bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n    bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");\n\n    bytes32 public constant ORACLE_ROLE = keccak256(\"ORACLE_ROLE\");\n    bytes32 public constant ORACLE_ADMIN_ROLE = keccak256(\"ORACLE_ADMIN_ROLE\");\n    bytes32 public constant PRICE_PROVIDER_ROLE = keccak256(\"PRICE_PROVIDER_ROLE\");\n\n    // For Native Restaking\n    uint256 constant PUBKEY_LENGTH = 48;\n    uint256 constant SIGNATURE_LENGTH = 96;\n    uint256 constant MAX_VALIDATORS = 100;\n    uint256 constant DEPOSIT_AMOUNT = 32 ether;\n    uint256 constant GWEI_TO_WEI = 1e9;\n\n    uint256 public constant DENOMINATOR = 10_000;\n    address public constant PLATFORM_TOKEN_ADDRESS = 0xeFEfeFEfeFeFEFEFEfefeFeFefEfEfEfeFEFEFEf;\n    bytes32 public constant EIGENPIE_WITHDRAW_MANAGER = keccak256(\"EIGENPIE_WITHDRAW_MANAGER\");\n\n    // External Defi\n    bytes32 public constant ZIRCUIT_ZSTAKIGPOOL = keccak256(\"ZIRCUIT_ZSTAKIGPOOL\");\n}\n"
      },
      "contracts/utils/EigenpieConfigRoleChecker.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\nimport { UtilLib } from \"./UtilLib.sol\";\nimport { EigenpieConstants } from \"./EigenpieConstants.sol\";\n\nimport { IEigenpieConfig } from \"../interfaces/IEigenpieConfig.sol\";\n\nimport { IAccessControl } from \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/// @title EigenpieConfigRoleChecker - Eigenpie Config Role Checker Contract\n/// @notice Handles Eigenpie config role checks\nabstract contract EigenpieConfigRoleChecker {\n    IEigenpieConfig public eigenpieConfig;\n\n    uint256[49] private __gap; // reserve for upgrade\n\n    // events\n    event UpdatedEigenpieConfig(address indexed eigenpieConfig);\n\n    // modifiers\n    modifier onlyRole(bytes32 role) {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(role, msg.sender)) {\n            string memory roleStr = string(abi.encodePacked(role));\n            revert IEigenpieConfig.CallerNotEigenpieConfigAllowedRole(roleStr);\n        }\n        _;\n    }\n\n    modifier onlyEigenpieManager() {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(EigenpieConstants.MANAGER, msg.sender)) {\n            revert IEigenpieConfig.CallerNotEigenpieConfigManager();\n        }\n        _;\n    }\n\n    modifier onlyPriceProvider() {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(EigenpieConstants.PRICE_PROVIDER_ROLE, msg.sender)) {\n            revert IEigenpieConfig.CallerNotEigenpieConfigPriceProvider();\n        }\n        _;\n    }\n\n    modifier onlyDefaultAdmin() {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(EigenpieConstants.DEFAULT_ADMIN_ROLE, msg.sender)) {\n            revert IEigenpieConfig.CallerNotEigenpieConfigAdmin();\n        }\n        _;\n    }\n\n    modifier onlyOracleAdmin() {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(EigenpieConstants.ORACLE_ADMIN_ROLE, msg.sender)) {\n            revert IEigenpieConfig.CallerNotEigenpieConfigOracleAdmin();\n        }\n        _;\n    }\n\n    modifier onlyOracle() {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(EigenpieConstants.ORACLE_ROLE, msg.sender)) {\n            revert IEigenpieConfig.CallerNotEigenpieConfigOracle();\n        }\n        _;\n    }\n\n    modifier onlyMinter() {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(EigenpieConstants.MINTER_ROLE, msg.sender)) {\n            revert IEigenpieConfig.CallerNotEigenpieConfigMinter();\n        }\n        _;\n    }\n\n    modifier onlyBurner() {\n        if (!IAccessControl(address(eigenpieConfig)).hasRole(EigenpieConstants.BURNER_ROLE, msg.sender)) {\n            revert IEigenpieConfig.CallerNotEigenpieConfigBurner();\n        }\n        _;\n    }\n\n    modifier onlySupportedAsset(address asset) {\n        if (!eigenpieConfig.isSupportedAsset(asset)) {\n            revert IEigenpieConfig.AssetNotSupported();\n        }\n        _;\n    }\n\n    // setters\n\n    /// @notice Updates the Eigenpie config contract\n    /// @dev only callable by Eigenpie default\n    /// @param eigenpieConfigAddr the new Eigenpie config contract Address\n    function updateEigenpieConfig(address eigenpieConfigAddr) external virtual onlyDefaultAdmin {\n        UtilLib.checkNonZeroAddress(eigenpieConfigAddr);\n        eigenpieConfig = IEigenpieConfig(eigenpieConfigAddr);\n        emit UpdatedEigenpieConfig(eigenpieConfigAddr);\n    }\n}\n"
      },
      "contracts/interfaces/IEigenpieEnterprise.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\ninterface IEigenpieEnterprise {\n\n    // Sturcts\n    struct ClientData {\n        bool registered;\n        uint256 nativeRestakedAmount;\n        uint256 nativeUsed;\n        uint256 mlrtMinted;\n        uint256 exchangeRate; // client's own exchange rate of mLRT to native\n        address mlrtWallet;\n        address eigenPod;\n    }\n\n    // Errors\n    error InvalidClient();\n    error EthNotEnough(uint256 quotaLeft, uint256 toUse);\n    error EnoughCollateral();\n    error EigenpodUsed();\n    error EigenpodMisMatch();\n\n    // Events\n    event UpdateAllowedClient(address indexed client, uint256 nativeRestakedAmount, address eigenPod);\n    event UpdateClientNativeRestakedAmount(address indexed client, uint256 nativeRestakedAmount);\n    event ClientRegisterNativeRestake(address indexed client, address indexed mlrtWallet, uint256 nativeUsed, uint256 mlrtMinted);\n    event BurnMLRTFromWallet(address indexed client, address asset, uint256 assetLess, uint256 mlrtBurnt);\n\n    // methods\n    function getClientData(address client) external returns (ClientData memory clientData);\n    function nativeRestakedLess(address client) external returns (uint256 lessAmount, uint256 mlrtShouldBurn);\n    function getTotalMintedNativeMlrt() external returns (uint256 totalMlrt);\n}\n"
      },
      "contracts/interfaces/IMLRTWallet.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\ninterface IMLRTWallet {\n    // Errors\n    error OnlyClient();\n    error NotAllowedCaller();\n\n    // Events\n    event UpdateAllowedClient(address indexed client, bool allowed);\n    event DepositToZicruit(address indexed caller, address mlrt, uint256 amount);\n    event WithdrawFromZicruit(address indexed caller, address mlrt, uint256 amount);\n\n    // methods\n    function initialize(address client, address eigenPod, address eigenpieConfig, address engienpieEnterprise) external;\n    function nativeRestakedLess() external returns (uint256 ethLess, uint256 shouldBurn);\n}\n"
      },
      "contracts/interfaces/IMLRT.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IMLRT is IERC20 {\n    function updateExchangeRateToLST(uint256 _newRate) external;\n\n    function exchangeRateToLST() external view returns (uint256);\n\n    function underlyingAsset() external view returns (address);\n\n    function mint(address to, uint256 amount) external;\n\n    function burnFrom(address account, uint256 amount) external;\n}\n"
      },
      "contracts/interfaces/eigenlayer/IEigenPod.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.21;\n\nimport { BeaconChainProofs } from \"../../utils/external/BeaconChainProofs.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 * @notice The main functionalities are:\n * - creating new ETH validators with their withdrawal credentials pointed to this contract\n * - proving from beacon chain state roots that withdrawal credentials are pointed to this contract\n * - proving from beacon chain state roots the balances of ETH validators with their withdrawal credentials\n *   pointed to this contract\n * - updating aggregate balances in the EigenPodManager\n * - withdrawing eth when withdrawals are initiated\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    enum VALIDATOR_STATUS {\n        INACTIVE, // doesnt exist\n        ACTIVE, // staked on ethpos and withdrawal credentials are pointed to the EigenPod\n        OVERCOMMITTED, // proven to be overcommitted to EigenLayer\n        WITHDRAWN // withdrawn from the Beacon Chain\n    }\n\n    // this struct keeps track of PartialWithdrawalClaims\n    struct PartialWithdrawalClaim {\n        PARTIAL_WITHDRAWAL_CLAIM_STATUS status;\n        // block at which the PartialWithdrawalClaim was created\n        uint32 creationBlockNumber;\n        // last block (inclusive) in which the PartialWithdrawalClaim can be fraudproofed\n        uint32 fraudproofPeriodEndBlockNumber;\n        // amount of ETH -- in Gwei -- to be withdrawn until completion of this claim\n        uint64 partialWithdrawalAmountGwei;\n    }\n\n    enum PARTIAL_WITHDRAWAL_CLAIM_STATUS {\n        REDEEMED,\n        PENDING,\n        FAILED\n    }\n\n    /// @notice The amount of eth, in gwei, that is restaked per validator\n    function REQUIRED_BALANCE_GWEI() external view returns(uint64);\n\n    /// @notice The amount of eth, in wei, that is restaked per validator\n    function REQUIRED_BALANCE_WEI() external view returns(uint256);\n\n    /// @notice this is a mapping of validator indices to a Validator struct containing pertinent info about the validator\n    function validatorStatus(uint40 validatorIndex) external view returns(VALIDATOR_STATUS);\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 restakedExecutionLayerGwei() external view returns(uint64);\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 Called during withdrawal or slashing.\n     * @dev Note that this function is marked as non-reentrant to prevent the recipient calling back into it\n     */\n    function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) external;\n\n    /// @notice The owner of this EigenPod\n    function podOwner() external view returns (address);\n\n    /// @notice an indicator of whether or not the podOwner has ever \"fully restaked\" by successfully calling `verifyCorrectWithdrawalCredentials`.\n    function hasRestaked() external view returns (bool);\n\n    /// @notice block number of the most recent withdrawal\n    function mostRecentWithdrawalBlockNumber() external view returns (uint64);\n\n\n    ///@notice mapping that tracks proven partial withdrawals\n    function provenPartialWithdrawal(uint40 validatorIndex, uint64 slot) external view returns (bool);\n\n    /**\n     * @notice This function verifies that the withdrawal credentials of the podOwner are pointed to\n     * this contract. It also verifies the current (not effective) balance  of the validator.  It verifies the provided proof of the ETH validator against the beacon chain state\n     * root, marks the validator as 'active' in EigenLayer, and credits the restaked ETH in Eigenlayer.\n     * @param oracleBlockNumber is the Beacon Chain blockNumber whose state root the `proof` will be proven against.\n     * @param validatorIndex is the index of the validator being proven, refer to consensus specs \n     * @param proofs is the bytes that prove the ETH validator's balance and withdrawal credentials against a beacon chain state root\n     * @param validatorFields are the fields of the \"Validator Container\", refer to consensus specs \n     * for details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator\n     */\n    function verifyWithdrawalCredentialsAndBalance(\n        uint64 oracleBlockNumber,\n        uint40 validatorIndex,\n        BeaconChainProofs.ValidatorFieldsAndBalanceProofs memory proofs,\n        bytes32[] calldata validatorFields\n    ) external;\n    \n    /**\n     * @notice This function records an overcommitment of stake to EigenLayer on behalf of a certain ETH validator.\n     *         If successful, the overcommitted balance is penalized (available for withdrawal whenever the pod's balance allows).\n     *         The ETH validator's shares in the enshrined beaconChainETH strategy are also removed from the StrategyManager and undelegated.\n     * @param oracleBlockNumber The oracleBlockNumber whose state root the `proof` will be proven against.\n     *        Must be within `VERIFY_OVERCOMMITTED_WINDOW_BLOCKS` of the current block.\n     * @param validatorIndex is the index of the validator being proven, refer to consensus specs \n     * @param proofs is the proof of the validator's balance and validatorFields in the balance tree and the balanceRoot to prove for\n     * @param beaconChainETHStrategyIndex is the index of the beaconChainETHStrategy for the pod owner for the callback to \n     *                                    the StrategyManager in case it must be removed from the list of the podOwners strategies\n     * @param validatorFields are the fields of the \"Validator Container\", refer to consensus specs\n     * @dev For more details on the Beacon Chain spec, see: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator\n     */\n    function verifyOvercommittedStake(\n        uint40 validatorIndex,\n        BeaconChainProofs.ValidatorFieldsAndBalanceProofs calldata proofs,\n        bytes32[] calldata validatorFields,\n        uint256 beaconChainETHStrategyIndex,\n        uint64 oracleBlockNumber\n    ) external;\n\n    /**\n     * @notice This function records a full withdrawal on behalf of one of the Ethereum validators for this EigenPod\n     * @param withdrawalProofs is the information needed to check the veracity of the block number and withdrawal being proven\n     * @param validatorFieldsProof is the proof of the validator's fields in the validator tree\n     * @param withdrawalFields are the fields of the withdrawal being proven\n     * @param validatorFields are the fields of the validator being proven\n     * @param beaconChainETHStrategyIndex is the index of the beaconChainETHStrategy for the pod owner for the callback to \n     *        the EigenPodManager to the StrategyManager in case it must be removed from the podOwner's list of strategies\n     */\n    function verifyAndProcessWithdrawal(\n        BeaconChainProofs.WithdrawalProofs calldata withdrawalProofs, \n        bytes calldata validatorFieldsProof,\n        bytes32[] calldata validatorFields,\n        bytes32[] calldata withdrawalFields,\n        uint256 beaconChainETHStrategyIndex,\n        uint64 oracleBlockNumber\n    ) external;\n\n    /// @notice Called by the pod owner to withdraw the balance of the pod when `hasRestaked` is set to false\n    function withdrawBeforeRestaking() external;\n\n    function delayedWithdrawalRouter() external returns (address);\n}"
      },
      "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\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 amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` 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 amount) 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 `amount` as the allowance of `spender` over the 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 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` 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 amount) external returns (bool);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    bool private _paused;\n\n    /**\n     * @dev Initializes the contract in unpaused state.\n     */\n    function __Pausable_init() internal onlyInitializing {\n        __Pausable_init_unchained();\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n        _paused = false;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        return _paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        require(!paused(), \"Pausable: paused\");\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        require(paused(), \"Pausable: not paused\");\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        _paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        _paused = false;\n        emit Unpaused(_msgSender());\n    }\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[49] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../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    uint256 private _status;\n\n    function __ReentrancyGuard_init() internal onlyInitializing {\n        __ReentrancyGuard_init_unchained();\n    }\n\n    function __ReentrancyGuard_init_unchained() internal onlyInitializing {\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        // On the first call to nonReentrant, _status will be _NOT_ENTERED\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\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        return _status == _ENTERED;\n    }\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[49] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/Create2.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n    /**\n     * @dev Deploys a contract using `CREATE2`. The address where the contract\n     * will be deployed can be known in advance via {computeAddress}.\n     *\n     * The bytecode for a contract can be obtained from Solidity with\n     * `type(contractName).creationCode`.\n     *\n     * Requirements:\n     *\n     * - `bytecode` must not be empty.\n     * - `salt` must have not been used for `bytecode` already.\n     * - the factory must have a balance of at least `amount`.\n     * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n     */\n    function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\n        require(address(this).balance >= amount, \"Create2: insufficient balance\");\n        require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n        /// @solidity memory-safe-assembly\n        assembly {\n            addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n        }\n        require(addr != address(0), \"Create2: Failed on deploy\");\n    }\n\n    /**\n     * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n     * `bytecodeHash` or `salt` will result in a new destination address.\n     */\n    function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n        return computeAddress(salt, bytecodeHash, address(this));\n    }\n\n    /**\n     * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n     * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n     */\n    function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ptr := mload(0x40) // Get free memory pointer\n\n            // |                   | ↓ ptr ...  ↓ ptr + 0x0B (start) ...  ↓ ptr + 0x20 ...  ↓ ptr + 0x40 ...   |\n            // |-------------------|---------------------------------------------------------------------------|\n            // | bytecodeHash      |                                                        CCCCCCCCCCCCC...CC |\n            // | salt              |                                      BBBBBBBBBBBBB...BB                   |\n            // | deployer          | 000000...0000AAAAAAAAAAAAAAAAAAA...AA                                     |\n            // | 0xFF              |            FF                                                             |\n            // |-------------------|---------------------------------------------------------------------------|\n            // | memory            | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n            // | keccak(start, 85) |            ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n            mstore(add(ptr, 0x40), bytecodeHash)\n            mstore(add(ptr, 0x20), salt)\n            mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n            let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n            mstore8(start, 0xff)\n            addr := keccak256(start, 85)\n        }\n    }\n}\n"
      },
      "contracts/interfaces/IEigenpieConfig.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity 0.8.21;\n\ninterface IEigenpieConfig {\n    // Errors\n    error ValueAlreadyInUse();\n    error AssetAlreadySupported();\n    error AssetNotSupported();\n    error CallerNotEigenpieConfigAdmin();\n    error CallerNotEigenpieConfigManager();\n    error CallerNotEigenpieConfigOracle();\n    error CallerNotEigenpieConfigOracleAdmin();\n    error CallerNotEigenpieConfigPriceProvider();\n    error CallerNotEigenpieConfigMinter();\n    error CallerNotEigenpieConfigBurner();\n    error CallerNotEigenpieConfigAllowedRole(string role);\n\n    // Events\n    event SetContract(bytes32 key, address indexed contractAddr);\n    event AddedNewSupportedAsset(address indexed asset, address indexed receipt, uint256 depositLimit);\n    event ReceiptTokenUpdated(address indexed asset, address indexed receipt);\n    event RemovedSupportedAsset(address indexed asset);\n    event AssetDepositLimitUpdate(address indexed asset, uint256 depositLimit);\n    event AssetStrategyUpdate(address indexed asset, address indexed strategy);\n    event AssetBoostUpdate(address indexed asset, uint256 newBoost);\n    event ReferralUpdate(address indexed me, address indexed myReferral);\n\n    // methods\n\n    function assetStrategy(address asset) external view returns (address);\n\n    function boostByAsset(address) external view returns (uint256);\n\n    function mLRTReceiptByAsset(address) external view returns (address);\n\n    function isSupportedAsset(address asset) external view returns (bool);\n\n    function getContract(bytes32 contractId) external view returns (address);\n\n    function getSupportedAssetList() external view returns (address[] memory);\n\n    function depositLimitByAsset(address asset) external view returns (uint256);\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/access/IAccessControl.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n}\n"
      },
      "contracts/utils/external/BeaconChainProofs.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.21;\n\nimport \"./Merkle.sol\";\nimport \"./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:\n// 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    // constants are the number of fields and the heights of the different merkle trees used in merkleizing beacon chain\n    // containers\n    uint256 internal constant NUM_BEACON_BLOCK_HEADER_FIELDS = 5;\n    uint256 internal constant BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT = 3;\n\n    uint256 internal constant NUM_BEACON_BLOCK_BODY_FIELDS = 11;\n    uint256 internal constant BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT = 4;\n\n    uint256 internal constant NUM_BEACON_STATE_FIELDS = 21;\n    uint256 internal constant BEACON_STATE_FIELD_TREE_HEIGHT = 5;\n\n    uint256 internal constant NUM_ETH1_DATA_FIELDS = 3;\n    uint256 internal constant ETH1_DATA_FIELD_TREE_HEIGHT = 2;\n\n    uint256 internal constant NUM_VALIDATOR_FIELDS = 8;\n    uint256 internal constant VALIDATOR_FIELD_TREE_HEIGHT = 3;\n\n    uint256 internal constant NUM_EXECUTION_PAYLOAD_HEADER_FIELDS = 15;\n    uint256 internal constant EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT = 4;\n\n    uint256 internal constant NUM_EXECUTION_PAYLOAD_FIELDS = 15;\n    uint256 internal constant EXECUTION_PAYLOAD_FIELD_TREE_HEIGHT = 4;\n\n    // HISTORICAL_ROOTS_LIMIT\t = 2**24, so tree height is 24\n    uint256 internal constant HISTORICAL_ROOTS_TREE_HEIGHT = 24;\n\n    // HISTORICAL_BATCH is root of state_roots and block_root, so number of leaves =  2^1\n    uint256 internal constant HISTORICAL_BATCH_TREE_HEIGHT = 1;\n\n    // SLOTS_PER_HISTORICAL_ROOT = 2**13, so tree height is 13\n    uint256 internal constant STATE_ROOTS_TREE_HEIGHT = 13;\n    uint256 internal constant BLOCK_ROOTS_TREE_HEIGHT = 13;\n\n    uint256 internal constant NUM_WITHDRAWAL_FIELDS = 4;\n    // tree height for hash tree of an individual withdrawal container\n    uint256 internal constant WITHDRAWAL_FIELD_TREE_HEIGHT = 2;\n\n    uint256 internal constant VALIDATOR_TREE_HEIGHT = 40;\n    //refer to the eigenlayer-cli proof library.  Despite being the same dimensions as the validator tree, the balance\n    // tree is merkleized differently\n    uint256 internal constant BALANCE_TREE_HEIGHT = 38;\n\n    // MAX_WITHDRAWALS_PER_PAYLOAD = 2**4, making tree height = 4\n    uint256 internal constant WITHDRAWALS_TREE_HEIGHT = 4;\n\n    //in beacon block body\n    uint256 internal constant EXECUTION_PAYLOAD_INDEX = 9;\n\n    // in beacon block header\n    uint256 internal constant STATE_ROOT_INDEX = 3;\n    uint256 internal constant PROPOSER_INDEX_INDEX = 1;\n    uint256 internal constant SLOT_INDEX = 0;\n    uint256 internal constant BODY_ROOT_INDEX = 4;\n    // in beacon state\n    uint256 internal constant STATE_ROOTS_INDEX = 6;\n    uint256 internal constant BLOCK_ROOTS_INDEX = 5;\n    uint256 internal constant HISTORICAL_ROOTS_INDEX = 7;\n    uint256 internal constant ETH_1_ROOT_INDEX = 8;\n    uint256 internal constant VALIDATOR_TREE_ROOT_INDEX = 11;\n    uint256 internal constant BALANCE_INDEX = 12;\n    uint256 internal constant EXECUTION_PAYLOAD_HEADER_INDEX = 24;\n    uint256 internal constant HISTORICAL_BATCH_STATE_ROOT_INDEX = 1;\n\n    // in validator\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_WITHDRAWABLE_EPOCH_INDEX = 7;\n\n    // in execution payload header\n    uint256 internal constant BLOCK_NUMBER_INDEX = 6;\n    uint256 internal constant WITHDRAWALS_ROOT_INDEX = 14;\n\n    //in execution payload\n    uint256 internal constant WITHDRAWALS_INDEX = 14;\n\n    // in withdrawal\n    uint256 internal constant WITHDRAWAL_VALIDATOR_INDEX_INDEX = 1;\n    uint256 internal constant WITHDRAWAL_VALIDATOR_AMOUNT_INDEX = 3;\n\n    //In historicalBatch\n    uint256 internal constant HISTORICALBATCH_STATEROOTS_INDEX = 1;\n\n    //Misc Constants\n    uint256 internal constant SLOTS_PER_EPOCH = 32;\n\n    bytes8 internal constant UINT64_MASK = 0xffffffffffffffff;\n\n    struct WithdrawalProofs {\n        bytes blockHeaderProof;\n        bytes withdrawalProof;\n        bytes slotProof;\n        bytes executionPayloadProof;\n        bytes blockNumberProof;\n        uint64 blockHeaderRootIndex;\n        uint64 withdrawalIndex;\n        bytes32 blockHeaderRoot;\n        bytes32 blockBodyRoot;\n        bytes32 slotRoot;\n        bytes32 blockNumberRoot;\n        bytes32 executionPayloadRoot;\n    }\n\n    struct ValidatorFieldsAndBalanceProofs {\n        bytes validatorFieldsProof;\n        bytes validatorBalanceProof;\n        bytes32 balanceRoot;\n    }\n\n    struct ValidatorFieldsProof {\n        bytes validatorProof;\n        uint40 validatorIndex;\n    }\n\n    /**\n     *\n     * @notice This function is parses the balanceRoot to get the uint64 balance of a validator.  During merkleization\n     * of the\n     * beacon state balance tree, four uint64 values (making 32 bytes) are grouped together and treated as a single leaf\n     * in the merkle tree. Thus the\n     * validatorIndex mod 4 is used to determine which of the four uint64 values to extract from the balanceRoot.\n     * @param validatorIndex is the index of the validator being proven for.\n     * @param balanceRoot is the combination of 4 validator balances being proven for.\n     * @return The validator's balance, in Gwei\n     */\n    function getBalanceFromBalanceRoot(uint40 validatorIndex, bytes32 balanceRoot) internal pure returns (uint64) {\n        uint256 bitShiftAmount = (validatorIndex % 4) * 64;\n        bytes32 validatorBalanceLittleEndian = bytes32((uint256(balanceRoot) << bitShiftAmount));\n        uint64 validatorBalance = Endian.fromLittleEndianUint64(validatorBalanceLittleEndian);\n        return validatorBalance;\n    }\n\n    /**\n     * @notice This function verifies merkle proofs of the fields of a certain validator against a beacon chain state\n     * root\n     * @param validatorIndex the index of the proven validator\n     * @param beaconStateRoot is the beacon chain state root to be proven against.\n     * @param proof is the data used in proving the validator's fields\n     * @param validatorFields the claimed fields of the validator\n     */\n    function verifyValidatorFields(\n        uint40 validatorIndex,\n        bytes32 beaconStateRoot,\n        bytes calldata proof,\n        bytes32[] calldata validatorFields\n    )\n        internal\n        view\n    {\n        require(\n            validatorFields.length == 2 ** VALIDATOR_FIELD_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyValidatorFields: Validator fields has incorrect length\"\n        );\n\n        /**\n         * Note: the length of the validator merkle proof is BeaconChainProofs.VALIDATOR_TREE_HEIGHT + 1.\n         * There is an additional layer added by hashing the root with the length of the validator list\n         */\n        require(\n            proof.length == 32 * ((VALIDATOR_TREE_HEIGHT + 1) + BEACON_STATE_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyValidatorFields: Proof has incorrect length\"\n        );\n        uint256 index = (VALIDATOR_TREE_ROOT_INDEX << (VALIDATOR_TREE_HEIGHT + 1)) | uint256(validatorIndex);\n        // merkleize the validatorFields to get the leaf to prove\n        bytes32 validatorRoot = Merkle.merkleizeSha256(validatorFields);\n\n        // verify the proof of the validatorRoot against the beaconStateRoot\n        require(\n            Merkle.verifyInclusionSha256(proof, beaconStateRoot, validatorRoot, index),\n            \"BeaconChainProofs.verifyValidatorFields: Invalid merkle proof\"\n        );\n    }\n\n    /**\n     * @notice This function verifies merkle proofs of the balance of a certain validator against a beacon chain state\n     * root\n     * @param validatorIndex the index of the proven validator\n     * @param beaconStateRoot is the beacon chain state root to be proven against.\n     * @param proof is the proof of the balance against the beacon chain state root\n     * @param balanceRoot is the serialized balance used to prove the balance of the validator (refer to\n     * `getBalanceFromBalanceRoot` above for detailed explanation)\n     */\n    function verifyValidatorBalance(\n        uint40 validatorIndex,\n        bytes32 beaconStateRoot,\n        bytes calldata proof,\n        bytes32 balanceRoot\n    )\n        internal\n        view\n    {\n        require(\n            proof.length == 32 * ((BALANCE_TREE_HEIGHT + 1) + BEACON_STATE_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyValidatorBalance: Proof has incorrect length\"\n        );\n\n        /**\n         * the beacon state's balance list is a list of uint64 values, and these are grouped together in 4s when\n         * merkleized.\n         * Therefore, the index of the balance of a validator is validatorIndex/4\n         */\n        uint256 balanceIndex = uint256(validatorIndex / 4);\n        balanceIndex = (BALANCE_INDEX << (BALANCE_TREE_HEIGHT + 1)) | balanceIndex;\n\n        require(\n            Merkle.verifyInclusionSha256(proof, beaconStateRoot, balanceRoot, balanceIndex),\n            \"BeaconChainProofs.verifyValidatorBalance: Invalid merkle proof\"\n        );\n    }\n\n    /**\n     * @notice This function verifies the slot and the withdrawal fields for a given withdrawal\n     * @param beaconStateRoot is the beacon chain state root to be proven against.\n     * @param proofs is the provided set of merkle proofs\n     * @param withdrawalFields is the serialized withdrawal container to be proven\n     */\n    function verifyWithdrawalProofs(\n        bytes32 beaconStateRoot,\n        WithdrawalProofs calldata proofs,\n        bytes32[] calldata withdrawalFields\n    )\n        internal\n        view\n    {\n        require(\n            withdrawalFields.length == 2 ** WITHDRAWAL_FIELD_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyWithdrawalProofs: withdrawalFields has incorrect length\"\n        );\n\n        require(\n            proofs.blockHeaderRootIndex < 2 ** BLOCK_ROOTS_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyWithdrawalProofs: blockRootIndex is too large\"\n        );\n        require(\n            proofs.withdrawalIndex < 2 ** WITHDRAWALS_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyWithdrawalProofs: withdrawalIndex is too large\"\n        );\n\n        // verify the block header proof length\n        require(\n            proofs.blockHeaderProof.length == 32 * (BEACON_STATE_FIELD_TREE_HEIGHT + BLOCK_ROOTS_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyWithdrawalProofs: blockHeaderProof has incorrect length\"\n        );\n        require(\n            proofs.withdrawalProof.length\n                == 32 * (EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT + WITHDRAWALS_TREE_HEIGHT + 1),\n            \"BeaconChainProofs.verifyWithdrawalProofs: withdrawalProof has incorrect length\"\n        );\n        require(\n            proofs.executionPayloadProof.length\n                == 32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT + BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyWithdrawalProofs: executionPayloadProof has incorrect length\"\n        );\n        require(\n            proofs.slotProof.length == 32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyWithdrawalProofs: slotProof has incorrect length\"\n        );\n        require(\n            proofs.blockNumberProof.length == 32 * (EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyWithdrawalProofs: blockNumberProof has incorrect length\"\n        );\n\n        /**\n         * Computes the block_header_index relative to the beaconStateRoot.  It concatenates the indexes of all the\n         * intermediate root indexes from the bottom of the sub trees (the block header container) to the top of the\n         * tree\n         */\n        uint256 blockHeaderIndex = BLOCK_ROOTS_INDEX << (BLOCK_ROOTS_TREE_HEIGHT) | uint256(proofs.blockHeaderRootIndex);\n        // Verify the blockHeaderRoot against the beaconStateRoot\n        require(\n            Merkle.verifyInclusionSha256(\n                proofs.blockHeaderProof, beaconStateRoot, proofs.blockHeaderRoot, blockHeaderIndex\n            ),\n            \"BeaconChainProofs.verifyWithdrawalProofs: Invalid block header merkle proof\"\n        );\n\n        //Next we verify the slot against the blockHeaderRoot\n        require(\n            Merkle.verifyInclusionSha256(proofs.slotProof, proofs.blockHeaderRoot, proofs.slotRoot, SLOT_INDEX),\n            \"BeaconChainProofs.verifyWithdrawalProofs: Invalid slot merkle proof\"\n        );\n\n        // Next we verify the executionPayloadRoot against the blockHeaderRoot\n        uint256 executionPayloadIndex =\n            BODY_ROOT_INDEX << (BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT) | EXECUTION_PAYLOAD_INDEX;\n        require(\n            Merkle.verifyInclusionSha256(\n                proofs.executionPayloadProof, proofs.blockHeaderRoot, proofs.executionPayloadRoot, executionPayloadIndex\n            ),\n            \"BeaconChainProofs.verifyWithdrawalProofs: Invalid executionPayload merkle proof\"\n        );\n\n        // Next we verify the blockNumberRoot against the executionPayload root\n        require(\n            Merkle.verifyInclusionSha256(\n                proofs.blockNumberProof, proofs.executionPayloadRoot, proofs.blockNumberRoot, BLOCK_NUMBER_INDEX\n            ),\n            \"BeaconChainProofs.verifyWithdrawalProofs: Invalid blockNumber merkle proof\"\n        );\n\n        /**\n         * Next we verify the withdrawal fields against the blockHeaderRoot:\n         * First we compute the withdrawal_index relative to the blockHeaderRoot by concatenating the indexes of all the\n         * intermediate root indexes from the bottom of the sub trees (the withdrawal container) to the top, the\n         * blockHeaderRoot.\n         * Then we calculate merkleize the withdrawalFields container to calculate the the withdrawalRoot.\n         * Finally we verify the withdrawalRoot against the executionPayloadRoot.\n         */\n        uint256 withdrawalIndex = WITHDRAWALS_INDEX << (WITHDRAWALS_TREE_HEIGHT + 1) | uint256(proofs.withdrawalIndex);\n        bytes32 withdrawalRoot = Merkle.merkleizeSha256(withdrawalFields);\n        require(\n            Merkle.verifyInclusionSha256(\n                proofs.withdrawalProof, proofs.executionPayloadRoot, withdrawalRoot, withdrawalIndex\n            ),\n            \"BeaconChainProofs.verifyWithdrawalProofs: Invalid withdrawal merkle proof\"\n        );\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../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    /**\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] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\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 Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 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 functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n            \"Initializable: contract is already initialized\"\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 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\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        require(_initializing, \"Initializable: contract is not initializing\");\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        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized != type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _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 _initializing;\n    }\n}\n"
      },
      "contracts/utils/external/Merkle.sol": {
        "content": "// 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.21;\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    )\n        internal\n        pure\n        returns (bool)\n    {\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    )\n        internal\n        pure\n        returns (bytes32)\n    {\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    )\n        internal\n        view\n        returns (bool)\n    {\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    )\n        internal\n        view\n        returns (bytes32)\n    {\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(staticcall(sub(gas(), 2000), 2, 0x00, 0x40, computedHash, 0x20)) { revert(0, 0) }\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(staticcall(sub(gas(), 2000), 2, 0x00, 0x40, computedHash, 0x20)) { revert(0, 0) }\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\n     * 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\n     * merkleize the inputs incorrectly.\n     */\n    function merkleizeSha256(bytes32[] memory leaves) 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 (uint256 i = 0; i < numNodesInLayer; i++) {\n            layer[i] = sha256(abi.encodePacked(leaves[2 * i], leaves[2 * i + 1]));\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 (uint256 i = 0; i < numNodesInLayer; i++) {\n                layer[i] = sha256(abi.encodePacked(layer[2 * i], layer[2 * i + 1]));\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"
      },
      "contracts/utils/external/Endian.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.21;\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\n     * uint64 (i.e. 64 bits)\n     * through a right-shift/shr operation.\n     */\n    function fromLittleEndianUint64(bytes32 lenum) 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 >> 56) | ((0x00FF000000000000 & n) >> 40) | ((0x0000FF0000000000 & n) >> 24)\n            | ((0x000000FF00000000 & n) >> 8) | ((0x00000000FF000000 & n) << 8) | ((0x0000000000FF0000 & n) << 24)\n            | ((0x000000000000FF00 & n) << 40) | ((0x00000000000000FF & n) << 56);\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "forge-std/=lib/forge-std/src/",
        "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
        "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
        "@arbitrum/=node_modules/@arbitrum/",
        "@chainlink/=node_modules/@chainlink/",
        "@eth-optimism/=node_modules/@chainlink/contracts-ccip/node_modules/@eth-optimism/",
        "@offchainlabs/=node_modules/@offchainlabs/",
        "@scroll-tech/=node_modules/@scroll-tech/",
        "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
        "eth-gas-reporter/=node_modules/eth-gas-reporter/",
        "hardhat/=node_modules/hardhat/",
        "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
        "solidity-code-metrics/=node_modules/solidity-code-metrics/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 10000
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "shanghai",
      "libraries": {}
    }
  }}