creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/etherfi/L1/EtherfiL1SyncPoolETH.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport {IDummyToken} from \"../../interfaces/IDummyToken.sol\";\nimport {L1BaseSyncPoolUpgradeable, Constants} from \"../../L1/L1BaseSyncPoolUpgradeable.sol\";\nimport {ILiquifier} from \"../interfaces/ILiquifier.sol\";\nimport {IWeEth} from \"../interfaces/IWeEth.sol\";\n\ncontract EtherfiL1SyncPoolETH is L1BaseSyncPoolUpgradeable {\n    error EtherfiL1SyncPoolETH__OnlyETH();\n    error EtherfiL1SyncPoolETH__InvalidAmountIn();\n    error EtherfiL1SyncPoolETH__UnsetDummyToken();\n\n    ILiquifier private _liquifier;\n    IERC20 private _eEth;\n\n    mapping(uint32 => IDummyToken) private _dummyTokens;\n\n    event LiquifierSet(address liquifier);\n    event EEthSet(address eEth);\n    event DummyTokenSet(uint32 originEid, address dummyToken);\n\n    /**\n     * @dev Constructor for Etherfi L1 Sync Pool ETH\n     * @param endpoint Address of the LayerZero endpoint\n     */\n    constructor(address endpoint) L1BaseSyncPoolUpgradeable(endpoint) {}\n\n    /**\n     * @dev Initialize the contract\n     * @param liquifier Address of the liquifier\n     * @param eEth Address of the eEth\n     * @param tokenOut Address of the main token\n     * @param lockBox Address of the lock box\n     * @param owner Address of the owner\n     */\n    function initialize(address liquifier, address eEth, address tokenOut, address lockBox, address owner)\n        external\n        initializer\n    {\n        __L1BaseSyncPool_init(tokenOut, lockBox, owner);\n        __Ownable_init(owner);\n\n        _setLiquifier(liquifier);\n        _setEEth(eEth);\n    }\n\n    /**\n     * @dev Get the liquifier address\n     * @return The liquifier address\n     */\n    function getLiquifier() public view returns (address) {\n        return address(_liquifier);\n    }\n\n    /**\n     * @dev Get the eEth address\n     * @return The eEth address\n     */\n    function getEEth() public view returns (address) {\n        return address(_eEth);\n    }\n\n    /**\n     * @dev Get the dummy token address for a given origin EID\n     * @param originEid Origin EID\n     * @return The dummy token address\n     */\n    function getDummyToken(uint32 originEid) public view virtual returns (address) {\n        return address(_dummyTokens[originEid]);\n    }\n\n    /**\n     * @dev Set the liquifier address\n     * @param liquifier The liquifier address\n     */\n    function setLiquifier(address liquifier) public onlyOwner {\n        _setLiquifier(liquifier);\n    }\n\n    /**\n     * @dev Set the eEth address\n     * @param eEth The eEth address\n     */\n    function setEEth(address eEth) public onlyOwner {\n        _setEEth(eEth);\n    }\n\n    /**\n     * @dev Set the dummy token address for a given origin EID\n     * @param originEid Origin EID\n     * @param dummyToken The dummy token address\n     */\n    function setDummyToken(uint32 originEid, address dummyToken) public onlyOwner {\n        _setDummyToken(originEid, dummyToken);\n    }\n\n    /**\n     * @dev Internal function to set the liquifier address\n     * @param liquifier The liquifier address\n     */\n    function _setLiquifier(address liquifier) internal {\n        _liquifier = ILiquifier(liquifier);\n\n        emit LiquifierSet(liquifier);\n    }\n\n    /**\n     * @dev Internal function to set the eEth address\n     * @param eEth The eEth address\n     */\n    function _setEEth(address eEth) internal {\n        _eEth = IERC20(eEth);\n\n        emit EEthSet(eEth);\n    }\n\n    /**\n     * @dev Internal function to set the dummy token address for a given origin EID\n     * @param originEid Origin EID\n     * @param dummyToken The dummy token address\n     */\n    function _setDummyToken(uint32 originEid, address dummyToken) internal {\n        _dummyTokens[originEid] = IDummyToken(dummyToken);\n\n        emit DummyTokenSet(originEid, dummyToken);\n    }\n\n    /**\n     * @dev Internal function to anticipate a deposit\n     * Will mint the dummy tokens and deposit them to the L1 deposit pool\n     * Will revert if:\n     * - The token in is not ETH\n     * - The dummy token is not set\n     * @param originEid Origin EID\n     * @param tokenIn Address of the token in\n     * @param amountIn Amount in\n     * @return actualAmountOut The actual amount of token received\n     */\n    function _anticipatedDeposit(uint32 originEid, bytes32, address tokenIn, uint256 amountIn, uint256)\n        internal\n        virtual\n        override\n        returns (uint256 actualAmountOut)\n    {\n        if (tokenIn != Constants.ETH_ADDRESS) revert EtherfiL1SyncPoolETH__OnlyETH();\n\n        IERC20 tokenOut = IERC20(getTokenOut());\n\n        ILiquifier liquifier = _liquifier;\n        IDummyToken dummyToken = _dummyTokens[originEid];\n\n        if (address(dummyToken) == address(0)) revert EtherfiL1SyncPoolETH__UnsetDummyToken();\n\n        uint256 balanceBefore = tokenOut.balanceOf(address(this));\n\n        dummyToken.mint(address(this), amountIn);\n        dummyToken.approve(address(liquifier), amountIn);\n\n        liquifier.depositWithERC20(address(dummyToken), amountIn, address(0));\n\n        uint256 eEthBalance = _eEth.balanceOf(address(this));\n\n        _eEth.approve(address(tokenOut), eEthBalance);\n        IWeEth(address(tokenOut)).wrap(eEthBalance);\n\n        return tokenOut.balanceOf(address(this)) - balanceBefore;\n    }\n\n    /**\n     * @dev Internal function to finalize a deposit\n     * Will swap the dummy tokens for the actual ETH\n     * Will revert if:\n     * - The token in is not ETH\n     * - The amount in is not equal to the value\n     * - The dummy token is not set\n     * @param originEid Origin EID\n     * @param tokenIn Address of the token in\n     * @param amountIn Amount in\n     */\n    function _finalizeDeposit(uint32 originEid, bytes32, address tokenIn, uint256 amountIn, uint256)\n        internal\n        virtual\n        override\n    {\n        if (tokenIn != Constants.ETH_ADDRESS) revert EtherfiL1SyncPoolETH__OnlyETH();\n        if (amountIn != msg.value) revert EtherfiL1SyncPoolETH__InvalidAmountIn();\n\n        ILiquifier liquifier = _liquifier;\n        IDummyToken dummyToken = _dummyTokens[originEid];\n\n        if (address(dummyToken) == address(0)) revert EtherfiL1SyncPoolETH__UnsetDummyToken();\n\n        uint256 dummyBalance = dummyToken.balanceOf(address(liquifier));\n        uint256 ethBalance = address(this).balance;\n\n        uint256 swapAmount = ethBalance > dummyBalance ? dummyBalance : ethBalance;\n\n        liquifier.unwrapL2Eth{value: swapAmount}(address(dummyToken));\n\n        dummyToken.burn(swapAmount);\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"
      },
      "contracts/interfaces/IDummyToken.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {IMintableERC20} from \"./IMintableERC20.sol\";\n\ninterface IDummyToken is IMintableERC20 {\n    function burn(uint256 amount) external;\n}\n"
      },
      "contracts/L1/L1BaseSyncPoolUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol\";\nimport {SafeERC20, IERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {\n    OAppReceiverUpgradeable,\n    OAppCoreUpgradeable\n} from \"@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/OAppReceiverUpgradeable.sol\";\nimport {Origin} from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\nimport {IL1SyncPool} from \"../interfaces/IL1SyncPool.sol\";\nimport {Constants} from \"../libraries/Constants.sol\";\n\n/**\n * @title L1 Base Sync Pool\n * @dev Base contract for L1 Sync Pools\n * A sync pool is an OApp that allows users to deposit tokens on Layer 2, and then sync them to Layer 1\n * using the LayerZero messaging protocol.\n * The L1 sync pool takes care of the actual syncing process, it receives different messages from L2s\n * and handles the anticipated deposits and the actual deposits.\n * The L1 sync pool is responsible for managing the lock box making sure it is backed by the correct amount of tokens.\n * Fast messages are used to anticipate the deposit, and slow messages are used to finalize the deposit.\n * For example, a user can deposit 100 ETH on L2, the L2 sync pool will send a fast message to the L1 sync pool\n * anticipating the actual 100 ETH deposit (as it takes ~7 days to finalize the deposit), and finalize the deposit\n * when the 100 ETH is actually received from the L2.\n */\nabstract contract L1BaseSyncPoolUpgradeable is OAppReceiverUpgradeable, ReentrancyGuardUpgradeable, IL1SyncPool {\n    struct L1BaseSyncPoolStorage {\n        IERC20 tokenOut;\n        address lockBox;\n        uint256 totalUnbackedTokens;\n        mapping(uint32 => address) receivers;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(syncpools.storage.l1basesyncpool)) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant L1BaseSyncPoolStorageLocation =\n        0xd96cd964f71a052084af61290ff53294a8f76de4d8f66ba7682fe6598635ef00;\n\n    function _getL1BaseSyncPoolStorage() internal pure returns (L1BaseSyncPoolStorage storage $) {\n        assembly {\n            $.slot := L1BaseSyncPoolStorageLocation\n        }\n    }\n\n    error L1BaseSyncPool__UnauthorizedCaller();\n    error L1BaseSyncPool__NativeTransferFailed();\n\n    event ReceiverSet(uint32 indexed originEid, address receiver);\n    event TokenOutSet(address tokenOut);\n    event LockBoxSet(address lockBox);\n    event InsufficientDeposit(\n        uint32 indexed originEid,\n        bytes32 guid,\n        uint256 actualAmountOut,\n        uint256 expectedAmountOut,\n        uint256 unbackedTokens\n    );\n    event Fee(uint32 indexed originEid, bytes32 guid, uint256 actualAmountOut, uint256 expectedAmountOut, uint256 fee);\n    event Sweep(address token, address receiver, uint256 amount);\n\n    /**\n     * @dev Constructor for L1 Base Sync Pool\n     * @param endpoint Address of the LayerZero endpoint\n     */\n    constructor(address endpoint) OAppCoreUpgradeable(endpoint) {}\n\n    function __L1BaseSyncPool_init(address tokenOut, address lockBox, address delegate) internal onlyInitializing {\n        __ReentrancyGuard_init();\n        __OAppCore_init(delegate);\n        __L1BaseSyncPool_init_unchained(tokenOut, lockBox);\n    }\n\n    function __L1BaseSyncPool_init_unchained(address tokenOut, address lockBox) internal onlyInitializing {\n        _setTokenOut(tokenOut);\n        _setLockBox(lockBox);\n    }\n\n    /**\n     * @dev Get the main token address\n     * @return The main token address\n     */\n    function getTokenOut() public view virtual returns (address) {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n        return address($.tokenOut);\n    }\n\n    /**\n     * @dev Get the lock box address\n     * @return The lock box address\n     */\n    function getLockBox() public view virtual returns (address) {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n        return $.lockBox;\n    }\n\n    /**\n     * @dev Get the receiver address for a specific origin EID\n     * @param originEid Origin EID\n     * @return The receiver address\n     */\n    function getReceiver(uint32 originEid) public view virtual returns (address) {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n        return $.receivers[originEid];\n    }\n\n    /**\n     * @dev Get the total unbacked tokens\n     * @return The total unbacked tokens\n     */\n    function getTotalUnbackedTokens() public view virtual returns (uint256) {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n        return $.totalUnbackedTokens;\n    }\n\n    /**\n     * @dev Receive a message from an L2\n     * Will revert if:\n     * - The caller is not the receiver\n     * @param originEid Origin EID\n     * @param guid Message GUID\n     * @param tokenIn Token address\n     * @param amountIn Amount in\n     * @param amountOut Amount out\n     */\n    function onMessageReceived(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut)\n        public\n        payable\n        override\n        nonReentrant\n    {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n\n        if (msg.sender != $.receivers[originEid]) revert L1BaseSyncPool__UnauthorizedCaller();\n\n        _finalizeDeposit(originEid, guid, tokenIn, amountIn, amountOut);\n    }\n\n    /**\n     * @dev Receive a message from LayerZero\n     * Overriden to add reentrancy guard\n     * @param origin Origin\n     * @param guid Message GUID\n     * @param message Message\n     * @param executor Executor\n     * @param extraData Extra data\n     */\n    function lzReceive(\n        Origin calldata origin,\n        bytes32 guid,\n        bytes calldata message,\n        address executor,\n        bytes calldata extraData\n    ) public payable virtual override nonReentrant {\n        super.lzReceive(origin, guid, message, executor, extraData);\n    }\n\n    /**\n     * @dev Set the main token address\n     * @param tokenOut Address of the main token\n     */\n    function setTokenOut(address tokenOut) public virtual onlyOwner {\n        _setTokenOut(tokenOut);\n    }\n\n    /**\n     * @dev Set the lock box address\n     * @param lockBox Address of the lock box\n     */\n    function setLockBox(address lockBox) public virtual onlyOwner {\n        _setLockBox(lockBox);\n    }\n\n    /**\n     * @dev Set the receiver address for a specific origin EID\n     * @param originEid Origin EID\n     * @param receiver Receiver address\n     */\n    function setReceiver(uint32 originEid, address receiver) public virtual onlyOwner {\n        _setReceiver(originEid, receiver);\n    }\n\n    /**\n     * @dev Sweep tokens from the contract\n     * @param token Token address\n     * @param receiver Receiver address\n     * @param amount Amount to sweep\n     */\n    function sweep(address token, address receiver, uint256 amount) public virtual onlyOwner {\n        if (token == Constants.ETH_ADDRESS) {\n            (bool success,) = receiver.call{value: amount}(\"\");\n            if (!success) revert L1BaseSyncPool__NativeTransferFailed();\n        } else {\n            SafeERC20.safeTransfer(IERC20(token), receiver, amount);\n        }\n\n        emit Sweep(token, receiver, amount);\n    }\n\n    /**\n     * @dev Internal function called when a LZ message is received\n     * @param origin Origin\n     * @param guid Message GUID\n     * @param message Message\n     */\n    function _lzReceive(Origin calldata origin, bytes32 guid, bytes calldata message, address, bytes calldata)\n        internal\n        virtual\n        override\n    {\n        (address tokenIn, uint256 amountIn, uint256 amountOut) = abi.decode(message, (address, uint256, uint256));\n\n        uint256 actualAmountOut = _anticipatedDeposit(origin.srcEid, guid, tokenIn, amountIn, amountOut);\n\n        _handleAnticipatedDeposit(origin.srcEid, guid, actualAmountOut, amountOut);\n    }\n\n    /**\n     * @dev Internal function to set the main token address\n     * @param tokenOut Address of the main token\n     */\n    function _setTokenOut(address tokenOut) internal virtual {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n        $.tokenOut = IERC20(tokenOut);\n\n        emit TokenOutSet(tokenOut);\n    }\n\n    /**\n     * @dev Internal function to set the receiver address for a specific origin EID\n     * @param originEid Origin EID\n     * @param receiver Receiver address\n     */\n    function _setReceiver(uint32 originEid, address receiver) internal virtual {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n        $.receivers[originEid] = receiver;\n\n        emit ReceiverSet(originEid, receiver);\n    }\n\n    /**\n     * @dev Internal function to set the lock box address\n     * @param lockBox Address of the lock box\n     */\n    function _setLockBox(address lockBox) internal virtual {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n        $.lockBox = lockBox;\n\n        emit LockBoxSet(lockBox);\n    }\n\n    /**\n     * @dev Internal function to handle an anticipated deposit\n     * Will emit an InsufficientDeposit event if the actual amount out is less than the expected amount out\n     * Will emit a Fee event if the actual amount out is equal or greater than the expected amount out\n     * The fee kept in this contract will be used to back any future insufficient deposits\n     * When the fee is used, the total unbacked tokens will be lower than the actual missing amount\n     * Any time the InsufficientDeposit event is emitted, necessary actions should be taken to back the lock box\n     * such as using POL, increasing the deposit fee on the faulty L2, etc.\n     * @param originEid Origin EID\n     * @param guid Message GUID\n     * @param actualAmountOut Actual amount out\n     * @param expectedAmountOut Expected amount out\n     */\n    function _handleAnticipatedDeposit(\n        uint32 originEid,\n        bytes32 guid,\n        uint256 actualAmountOut,\n        uint256 expectedAmountOut\n    ) internal virtual {\n        L1BaseSyncPoolStorage storage $ = _getL1BaseSyncPoolStorage();\n\n        IERC20 tokenOut = $.tokenOut;\n\n        uint256 totalUnbackedTokens = $.totalUnbackedTokens;\n        uint256 balance = tokenOut.balanceOf(address(this));\n\n        uint256 totalAmountOut = expectedAmountOut + totalUnbackedTokens;\n        uint256 amountToSend;\n\n        if (balance < totalAmountOut) {\n            amountToSend = balance;\n\n            $.totalUnbackedTokens = totalAmountOut - balance;\n        } else {\n            amountToSend = totalAmountOut;\n\n            if (totalUnbackedTokens > 0) $.totalUnbackedTokens = 0;\n        }\n\n        if (actualAmountOut < expectedAmountOut) {\n            uint256 unbackedTokens = expectedAmountOut - actualAmountOut;\n            emit InsufficientDeposit(originEid, guid, actualAmountOut, expectedAmountOut, unbackedTokens);\n        } else {\n            uint256 fee = actualAmountOut - expectedAmountOut;\n            emit Fee(originEid, guid, actualAmountOut, expectedAmountOut, fee);\n        }\n\n        SafeERC20.safeTransfer(tokenOut, $.lockBox, amountToSend);\n    }\n\n    /**\n     * @dev Internal function to anticipate a deposit\n     * @param originEid Origin EID\n     * @param guid Message GUID\n     * @param tokenIn Token address\n     * @param amountIn Amount in\n     * @param amountOut Amount out\n     * @return actualAmountOut Actual amount out\n     */\n    function _anticipatedDeposit(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut)\n        internal\n        virtual\n        returns (uint256 actualAmountOut);\n\n    /**\n     * @dev Internal function to finalize a deposit\n     * @param originEid Origin EID\n     * @param guid Message GUID (will match the one used in the anticipated deposit)\n     * @param tokenIn Token address\n     * @param amountIn Amount in\n     * @param amountOut Amount out\n     */\n    function _finalizeDeposit(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut)\n        internal\n        virtual;\n}\n"
      },
      "contracts/etherfi/interfaces/ILiquifier.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface ILiquifier {\n    struct DeprecatedStruct_QueuedWithdrawal {\n        address strategies;\n        uint256[] shares;\n        address staker;\n        DeprecatedStruct_WithdrawerAndNonce withdrawerAndNonce;\n        uint32 withdrawalStartBlock;\n        address delegatedAddress;\n    }\n\n    struct DeprecatedStruct_WithdrawerAndNonce {\n        address withdrawer;\n        uint96 nonce;\n    }\n\n    struct PermitInput {\n        uint256 value;\n        uint256 deadline;\n        uint8 v;\n        bytes32 r;\n        bytes32 s;\n    }\n\n    struct Withdrawal {\n        address staker;\n        address delegatedTo;\n        address withdrawer;\n        uint256 nonce;\n        uint32 startBlock;\n        address strategies;\n        uint256[] shares;\n    }\n\n    error AlreadyRegistered();\n    error EthTransferFailed();\n    error IncorrectCaller();\n    error NotEnoughBalance();\n    error NotRegistered();\n    error NotSupportedToken();\n    error StrategyShareNotEnough();\n    error WrongOutput();\n\n    event AdminChanged(address previousAdmin, address newAdmin);\n    event BeaconUpgraded(address indexed beacon);\n    event CompletedQueuedWithdrawal(bytes32 _withdrawalRoot);\n    event CompletedStEthQueuedWithdrawals(uint256[] _reqIds);\n    event Initialized(uint8 version);\n    event Liquified(address _user, uint256 _toEEthAmount, address _fromToken, bool _isRestaked);\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n    event Paused(address account);\n    event QueuedStEthWithdrawals(uint256[] _reqIds);\n    event RegisteredQueuedWithdrawal(bytes32 _withdrawalRoot, DeprecatedStruct_QueuedWithdrawal _queuedWithdrawal);\n    event RegisteredQueuedWithdrawal_V2(bytes32 _withdrawalRoot, Withdrawal _queuedWithdrawal);\n    event Unpaused(address account);\n    event Upgraded(address indexed implementation);\n\n    function CASE1() external;\n    function DEPRECATED_accumulatedFee() external view returns (uint128);\n    function DEPRECATED_eigenLayerWithdrawalClaimGasCost() external view returns (uint32);\n    function DEPRECATED_quoteStEthWithCurve() external view returns (bool);\n    function admins(address) external view returns (bool);\n    function cbEth() external view returns (address);\n    function cbEth_Eth_Pool() external view returns (address);\n    function completeQueuedWithdrawals(\n        Withdrawal[] memory _queuedWithdrawals,\n        address _tokens,\n        uint256[] memory _middlewareTimesIndexes\n    ) external;\n    function depositWithERC20(address _token, uint256 _amount, address _referral) external returns (uint256);\n    function depositWithERC20WithPermit(address _token, uint256 _amount, address _referral, PermitInput memory _permit)\n        external\n        returns (uint256);\n    function depositWithQueuedWithdrawal(Withdrawal memory _queuedWithdrawal, address _referral)\n        external\n        returns (uint256);\n    function dummies(uint256) external view returns (address);\n    function eigenLayerDelegationManager() external view returns (address);\n    function eigenLayerStrategyManager() external view returns (address);\n    function getImplementation() external view returns (address);\n    function getTotalPooledEther(address _token) external view returns (uint256);\n    function getTotalPooledEther() external view returns (uint256 total);\n    function getTotalPooledEtherSplits(address _token)\n        external\n        view\n        returns (uint256 restaked, uint256 holding, uint256 pendingForWithdrawals);\n    function initialize(\n        address _treasury,\n        address _liquidityPool,\n        address _eigenLayerStrategyManager,\n        address _lidoWithdrawalQueue,\n        address _stEth,\n        address _cbEth,\n        address _wbEth,\n        address _cbEth_Eth_Pool,\n        address _wbEth_Eth_Pool,\n        address _stEth_Eth_Pool,\n        uint32 _timeBoundCapRefreshInterval\n    ) external;\n    function initializeL1SyncPool(address _l1SyncPool) external;\n    function initializeOnUpgrade(address _eigenLayerDelegationManager, address _pancakeRouter) external;\n    function isDepositCapReached(address _token, uint256 _amount) external view returns (bool);\n    function isL2Eth(address _token) external view returns (bool);\n    function isRegisteredQueuedWithdrawals(bytes32) external view returns (bool);\n    function isTokenWhitelisted(address _token) external view returns (bool);\n    function l1SyncPool() external view returns (address);\n    function lido() external view returns (address);\n    function lidoWithdrawalQueue() external view returns (address);\n    function liquidityPool() external view returns (address);\n    function owner() external view returns (address);\n    function pancakeSwapForEth(\n        address _token,\n        uint256 _amount,\n        uint24 _fee,\n        uint256 _minOutputAmount,\n        uint256 _maxWaitingTime\n    ) external;\n    function pauseContract() external;\n    function pauseDeposits(address _token) external;\n    function paused() external view returns (bool);\n    function proxiableUUID() external view returns (bytes32);\n    function quoteByFairValue(address _token, uint256 _amount) external view returns (uint256);\n    function quoteByMarketValue(address _token, uint256 _amount) external view returns (uint256);\n    function quoteStrategyShareForDeposit(address _token, address _strategy, uint256 _share)\n        external\n        view\n        returns (uint256);\n    function registerToken(\n        address _token,\n        address _target,\n        bool _isWhitelisted,\n        uint16 _discountInBasisPoints,\n        uint32 _timeBoundCapInEther,\n        uint32 _totalCapInEther,\n        bool _isL2Eth\n    ) external;\n    function renounceOwnership() external;\n    function stEthClaimWithdrawals(uint256[] memory _requestIds, uint256[] memory _hints) external;\n    function stEthRequestWithdrawal(uint256 _amount) external returns (uint256[] memory);\n    function stEthRequestWithdrawal() external returns (uint256[] memory);\n    function stEth_Eth_Pool() external view returns (address);\n    function swapCbEthToEth(uint256 _amount, uint256 _minOutputAmount) external returns (uint256);\n    function swapStEthToEth(uint256 _amount, uint256 _minOutputAmount) external returns (uint256);\n    function swapWbEthToEth(uint256 _amount, uint256 _minOutputAmount) external returns (uint256);\n    function timeBoundCap(address _token) external view returns (uint256);\n    function timeBoundCapRefreshInterval() external view returns (uint32);\n    function tokenInfos(address)\n        external\n        view\n        returns (\n            uint128 strategyShare,\n            uint128 ethAmountPendingForWithdrawals,\n            address strategy,\n            bool isWhitelisted,\n            uint16 discountInBasisPoints,\n            uint32 timeBoundCapClockStartTime,\n            uint32 timeBoundCapInEther,\n            uint32 totalCapInEther,\n            uint96 totalDepositedThisPeriod,\n            uint96 totalDeposited,\n            bool isL2Eth\n        );\n    function totalCap(address _token) external view returns (uint256);\n    function totalDeposited(address _token) external view returns (uint256);\n    function transferOwnership(address newOwner) external;\n    function treasury() external view returns (address);\n    function unPauseContract() external;\n    function unwrapL2Eth(address _l2Eth) external payable returns (uint256);\n    function updateAdmin(address _address, bool _isAdmin) external;\n    function updateDepositCap(address _token, uint32 _timeBoundCapInEther, uint32 _totalCapInEther) external;\n    function updateTimeBoundCapRefreshInterval(uint32 _timeBoundCapRefreshInterval) external;\n    function updateWhitelistedToken(address _token, bool _isWhitelisted) external;\n    function upgradeTo(address newImplementation) external;\n    function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n    function verifyQueuedWithdrawal(address _user, Withdrawal memory _queuedWithdrawal)\n        external\n        view\n        returns (bytes32);\n    function wbEth() external view returns (address);\n    function wbEth_Eth_Pool() external view returns (address);\n    function withdrawEther() external;\n}\n"
      },
      "contracts/etherfi/interfaces/IWeEth.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IWeEth {\n    struct PermitInput {\n        uint256 value;\n        uint256 deadline;\n        uint8 v;\n        bytes32 r;\n        bytes32 s;\n    }\n\n    event AdminChanged(address previousAdmin, address newAdmin);\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n    event BeaconUpgraded(address indexed beacon);\n    event Initialized(uint8 version);\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n    event Transfer(address indexed from, address indexed to, uint256 value);\n    event Upgraded(address indexed implementation);\n\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n    function allowance(address owner, address spender) external view returns (uint256);\n    function approve(address spender, uint256 amount) external returns (bool);\n    function balanceOf(address account) external view returns (uint256);\n    function decimals() external view returns (uint8);\n    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);\n    function eETH() external view returns (address);\n    function getEETHByWeETH(uint256 _weETHAmount) external view returns (uint256);\n    function getImplementation() external view returns (address);\n    function getRate() external view returns (uint256);\n    function getWeETHByeETH(uint256 _eETHAmount) external view returns (uint256);\n    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);\n    function initialize(address _liquidityPool, address _eETH) external;\n    function liquidityPool() external view returns (address);\n    function name() external view returns (string memory);\n    function nonces(address owner) external view returns (uint256);\n    function owner() external view returns (address);\n    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)\n        external;\n    function proxiableUUID() external view returns (bytes32);\n    function renounceOwnership() external;\n    function symbol() external view returns (string memory);\n    function totalSupply() external view returns (uint256);\n    function transfer(address to, uint256 amount) external returns (bool);\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n    function transferOwnership(address newOwner) external;\n    function unwrap(uint256 _weETHAmount) external returns (uint256);\n    function upgradeTo(address newImplementation) external;\n    function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n    function wrap(uint256 _eETHAmount) external returns (uint256);\n    function wrapWithPermit(uint256 _eETHAmount, PermitInput memory _permit) external returns (uint256);\n}\n"
      },
      "contracts/interfaces/IMintableERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IMintableERC20 is IERC20 {\n    function mint(address account, uint256 amount) external;\n}\n"
      },
      "node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard\n    struct ReentrancyGuardStorage {\n        uint256 _status;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ReentrancyGuard\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;\n\n    function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {\n        assembly {\n            $.slot := ReentrancyGuardStorageLocation\n        }\n    }\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    function __ReentrancyGuard_init() internal onlyInitializing {\n        __ReentrancyGuard_init_unchained();\n    }\n\n    function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        if ($._status == ENTERED) {\n            revert ReentrancyGuardReentrantCall();\n        }\n\n        // Any calls to nonReentrant after this point will fail\n        $._status = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        return $._status == ENTERED;\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC20Permit} from \"../extensions/IERC20Permit.sol\";\nimport {Address} from \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    /**\n     * @dev An operation with an ERC20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        forceApprove(token, spender, oldAllowance + value);\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n     * value, non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n        unchecked {\n            uint256 currentAllowance = token.allowance(address(this), spender);\n            if (currentAllowance < requestedDecrease) {\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n            }\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data);\n        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\n    }\n}\n"
      },
      "node_modules/layerzero-v2/oapp/contracts/oapp/OAppReceiverUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"./interfaces/IOAppReceiver.sol\";\nimport { OAppCoreUpgradeable } from \"./OAppCoreUpgradeable.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiverUpgradeable is IOAppReceiver, OAppCoreUpgradeable {\n    // Custom error message for when the caller is not the registered endpoint/\n    error OnlyEndpoint(address addr);\n\n    // @dev The version of the OAppReceiver implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant RECEIVER_VERSION = 1;\n\n    /**\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppReceiver_init() internal onlyInitializing {}\n\n    function __OAppReceiver_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n     * ie. this is a RECEIVE only OApp.\n     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\n     */\n    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n        return (0, RECEIVER_VERSION);\n    }\n\n    /**\n     * @notice Retrieves the address responsible for 'sending' composeMsg's to the Endpoint.\n     * @return sender The address responsible for 'sending' composeMsg's to the Endpoint.\n     *\n     * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\n     * @dev The default sender IS the OApp implementer.\n     */\n    function composeMsgSender() public view virtual returns (address sender) {\n        return address(this);\n    }\n\n    /**\n     * @notice Checks if the path initialization is allowed based on the provided origin.\n     * @param origin The origin information containing the source endpoint and sender address.\n     * @return Whether the path has been initialized.\n     *\n     * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\n     * @dev This defaults to assuming if a peer has been set, its initialized.\n     * Can be overridden by the OApp if there is other logic to determine this.\n     */\n    function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\n        return peers(origin.srcEid) == origin.sender;\n    }\n\n    /**\n     * @notice Retrieves the next nonce for a given source endpoint and sender address.\n     * @dev _srcEid The source endpoint ID.\n     * @dev _sender The sender address.\n     * @return nonce The next nonce.\n     *\n     * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\n     * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\n     * @dev This is also enforced by the OApp.\n     * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\n     */\n    function nextNonce(uint32, /*_srcEid*/ bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\n        return 0;\n    }\n\n    /**\n     * @dev Entry point for receiving messages or packets from the endpoint.\n     * @param _origin The origin information containing the source endpoint and sender address.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address on the src chain.\n     *  - nonce: The nonce of the message.\n     * @param _guid The unique identifier for the received LayerZero message.\n     * @param _message The payload of the received message.\n     * @param _executor The address of the executor for the received message.\n     * @param _extraData Additional arbitrary data provided by the corresponding executor.\n     *\n     * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\n     */\n    function lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) public payable virtual {\n        // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\n        if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\n\n        // Ensure that the sender matches the expected peer for the source endpoint.\n        if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\n\n        // Call the internal OApp implementation of lzReceive.\n        _lzReceive(_origin, _guid, _message, _executor, _extraData);\n    }\n\n    /**\n     * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\n     */\n    function _lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) internal virtual;\n}\n"
      },
      "node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IMessageLibManager } from \"./IMessageLibManager.sol\";\nimport { IMessagingComposer } from \"./IMessagingComposer.sol\";\nimport { IMessagingChannel } from \"./IMessagingChannel.sol\";\nimport { IMessagingContext } from \"./IMessagingContext.sol\";\n\nstruct MessagingParams {\n    uint32 dstEid;\n    bytes32 receiver;\n    bytes message;\n    bytes options;\n    bool payInLzToken;\n}\n\nstruct MessagingReceipt {\n    bytes32 guid;\n    uint64 nonce;\n    MessagingFee fee;\n}\n\nstruct MessagingFee {\n    uint256 nativeFee;\n    uint256 lzTokenFee;\n}\n\nstruct Origin {\n    uint32 srcEid;\n    bytes32 sender;\n    uint64 nonce;\n}\n\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\n    event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\n\n    event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\n\n    event PacketDelivered(Origin origin, address receiver);\n\n    event LzReceiveAlert(\n        address indexed receiver,\n        address indexed executor,\n        Origin origin,\n        bytes32 guid,\n        uint256 gas,\n        uint256 value,\n        bytes message,\n        bytes extraData,\n        bytes reason\n    );\n\n    event LzTokenSet(address token);\n\n    event DelegateSet(address sender, address delegate);\n\n    function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\n\n    function send(\n        MessagingParams calldata _params,\n        address _refundAddress\n    ) external payable returns (MessagingReceipt memory);\n\n    function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\n\n    function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n    function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n    function lzReceive(\n        Origin calldata _origin,\n        address _receiver,\n        bytes32 _guid,\n        bytes calldata _message,\n        bytes calldata _extraData\n    ) external payable;\n\n    // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\n    function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\n\n    function setLzToken(address _lzToken) external;\n\n    function lzToken() external view returns (address);\n\n    function nativeToken() external view returns (address);\n\n    function setDelegate(address _delegate) external;\n}\n"
      },
      "contracts/interfaces/IL1SyncPool.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {IOAppCore} from \"@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/oapp/interfaces/IOAppCore.sol\";\n\ninterface IL1SyncPool is IOAppCore {\n    function onMessageReceived(uint32 originEid, bytes32 guid, address tokenIn, uint256 amountIn, uint256 amountOut)\n        external\n        payable;\n}\n"
      },
      "contracts/libraries/Constants.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary Constants {\n    address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n    uint256 internal constant PRECISION = 1e18;\n    uint256 internal constant PRECISION_SUB_ONE = PRECISION - 1;\n}\n"
      },
      "node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n *     doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n *     token.safeTransferFrom(msg.sender, address(this), value);\n *     ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     *\n     * CAUTION: See Security Considerations above.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
      },
      "node_modules/@openzeppelin/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error AddressInsufficientBalance(address account);\n\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedInnerCall();\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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert AddressInsufficientBalance(address(this));\n        }\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert FailedInnerCall();\n        }\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 or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {FailedInnerCall} error.\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    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\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    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert AddressInsufficientBalance(address(this));\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n     * unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {FailedInnerCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n     */\n    function _revert(bytes memory returndata) 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 FailedInnerCall();\n        }\n    }\n}\n"
      },
      "node_modules/layerzero-v2/oapp/contracts/oapp/interfaces/IOAppReceiver.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ILayerZeroReceiver, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\n\ninterface IOAppReceiver is ILayerZeroReceiver {\n    /**\n     * @notice Retrieves the address responsible for 'sending' composeMsg's to the Endpoint.\n     * @return sender The address responsible for 'sending' composeMsg's to the Endpoint.\n     *\n     * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\n     * @dev The default sender IS the OApp implementer.\n     */\n    function composeMsgSender() external view returns (address sender);\n}\n"
      },
      "node_modules/layerzero-v2/oapp/contracts/oapp/OAppCoreUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"./interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n */\nabstract contract OAppCoreUpgradeable is IOAppCore, OwnableUpgradeable {\n    struct OAppCoreStorage {\n        mapping(uint32 => bytes32) peers;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oappcore\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OAppCoreStorageLocation =\n        0x72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900;\n\n    function _getOAppCoreStorage() internal pure returns (OAppCoreStorage storage $) {\n        assembly {\n            $.slot := OAppCoreStorageLocation\n        }\n    }\n\n    // The LayerZero endpoint associated with the given OApp\n    ILayerZeroEndpointV2 public immutable endpoint;\n\n    /**\n     * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\n     * @param _endpoint The address of the LOCAL Layer Zero endpoint.\n     */\n    constructor(address _endpoint) {\n        endpoint = ILayerZeroEndpointV2(_endpoint);\n    }\n\n    /**\n     * @dev Initializes the OAppCore with the provided delegate.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppCore_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init_unchained(_delegate);\n    }\n\n    function __OAppCore_init_unchained(address _delegate) internal onlyInitializing {\n        if (_delegate == address(0)) revert InvalidDelegate();\n        endpoint.setDelegate(_delegate);\n    }\n\n    /**\n     * @notice Returns the peer address (OApp instance) associated with a specific endpoint.\n     * @param _eid The endpoint ID.\n     * @return peer The address of the peer associated with the specified endpoint.\n     */\n    function peers(uint32 _eid) public view override returns (bytes32) {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        return $.peers[_eid];\n    }\n\n    /**\n     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @param _peer The address of the peer to be associated with the corresponding endpoint.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n     * @dev Set this to bytes32(0) to remove the peer address.\n     * @dev Peer is a bytes32 to accommodate non-evm chains.\n     */\n    function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        $.peers[_eid] = _peer;\n        emit PeerSet(_eid, _peer);\n    }\n\n    /**\n     * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\n     * ie. the peer is set to bytes32(0).\n     * @param _eid The endpoint ID.\n     * @return peer The address of the peer associated with the specified endpoint.\n     */\n    function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        bytes32 peer = $.peers[_eid];\n        if (peer == bytes32(0)) revert NoPeer(_eid);\n        return peer;\n    }\n\n    /**\n     * @notice Sets the delegate address for the OApp.\n     * @param _delegate The address of the delegate to be set.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\n     */\n    function setDelegate(address _delegate) public onlyOwner {\n        endpoint.setDelegate(_delegate);\n    }\n}\n"
      },
      "node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nstruct SetConfigParam {\n    uint32 eid;\n    uint32 configType;\n    bytes config;\n}\n\ninterface IMessageLibManager {\n    struct Timeout {\n        address lib;\n        uint256 expiry;\n    }\n\n    event LibraryRegistered(address newLib);\n    event DefaultSendLibrarySet(uint32 eid, address newLib);\n    event DefaultReceiveLibrarySet(uint32 eid, address newLib);\n    event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\n    event SendLibrarySet(address sender, uint32 eid, address newLib);\n    event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\n    event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\n\n    function registerLibrary(address _lib) external;\n\n    function isRegisteredLibrary(address _lib) external view returns (bool);\n\n    function getRegisteredLibraries() external view returns (address[] memory);\n\n    function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\n\n    function defaultSendLibrary(uint32 _eid) external view returns (address);\n\n    function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _timeout) external;\n\n    function defaultReceiveLibrary(uint32 _eid) external view returns (address);\n\n    function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\n\n    function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\n\n    function isSupportedEid(uint32 _eid) external view returns (bool);\n\n    function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\n\n    /// ------------------- OApp interfaces -------------------\n    function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\n\n    function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\n\n    function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\n\n    function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n    function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\n\n    function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _gracePeriod) external;\n\n    function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\n\n    function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\n\n    function getConfig(\n        address _oapp,\n        address _lib,\n        uint32 _eid,\n        uint32 _configType\n    ) external view returns (bytes memory config);\n}\n"
      },
      "node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingComposer {\n    event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\n    event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\n    event LzComposeAlert(\n        address indexed from,\n        address indexed to,\n        address indexed executor,\n        bytes32 guid,\n        uint16 index,\n        uint256 gas,\n        uint256 value,\n        bytes message,\n        bytes extraData,\n        bytes reason\n    );\n\n    function composeQueue(\n        address _from,\n        address _to,\n        bytes32 _guid,\n        uint16 _index\n    ) external view returns (bytes32 messageHash);\n\n    function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\n\n    function lzCompose(\n        address _from,\n        address _to,\n        bytes32 _guid,\n        uint16 _index,\n        bytes calldata _message,\n        bytes calldata _extraData\n    ) external payable;\n}\n"
      },
      "node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingChannel {\n    event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\n    event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n    event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n\n    function eid() external view returns (uint32);\n\n    // this is an emergency function if a message cannot be verified for some reasons\n    // required to provide _nextNonce to avoid race condition\n    function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\n\n    function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n    function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n    function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\n\n    function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n\n    function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\n\n    function inboundPayloadHash(\n        address _receiver,\n        uint32 _srcEid,\n        bytes32 _sender,\n        uint64 _nonce\n    ) external view returns (bytes32);\n\n    function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n}\n"
      },
      "node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingContext {\n    function isSendingMessage() external view returns (bool);\n\n    function getSendContext() external view returns (uint32 dstEid, address sender);\n}\n"
      },
      "node_modules/layerzero-v2/oapp/contracts/oapp/interfaces/IOAppCore.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { ILayerZeroEndpointV2 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\n/**\n * @title IOAppCore\n */\ninterface IOAppCore {\n    // Custom error messages\n    error OnlyPeer(uint32 eid, bytes32 sender);\n    error NoPeer(uint32 eid);\n    error InvalidEndpointCall();\n    error InvalidDelegate();\n\n    // Event emitted when a peer (OApp) is set for a corresponding endpoint\n    event PeerSet(uint32 eid, bytes32 peer);\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     */\n    function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\n\n    /**\n     * @notice Retrieves the LayerZero endpoint associated with the OApp.\n     * @return iEndpoint The LayerZero endpoint as an interface.\n     */\n    function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\n\n    /**\n     * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\n     */\n    function peers(uint32 _eid) external view returns (bytes32 peer);\n\n    /**\n     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @param _peer The address of the peer to be associated with the corresponding endpoint.\n     */\n    function setPeer(uint32 _eid, bytes32 _peer) external;\n\n    /**\n     * @notice Sets the delegate address for the OApp Core.\n     * @param _delegate The address of the delegate to be set.\n     */\n    function setDelegate(address _delegate) external;\n}\n"
      },
      "node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"./ILayerZeroEndpointV2.sol\";\n\ninterface ILayerZeroReceiver {\n    function allowInitializePath(Origin calldata _origin) external view returns (bool);\n\n    function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\n\n    function lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) external payable;\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "forge-std/=lib/forge-std/src/",
        "@layerzerolabs/lz-evm-oapp-v2/contracts/=node_modules/@layerzerolabs/lz-evm-oapp-v2/contracts/",
        "@layerzerolabs/lz-evm-protocol-v2/contracts/=node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/",
        "@layerzerolabs/lz-evm-messagelib-v2/contracts/=node_modules/@layerzerolabs/lz-evm-messagelib-v2/contracts/",
        "@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/=node_modules/layerzero-v2/oapp/contracts/",
        "@axelar-network/=node_modules/@axelar-network/",
        "@chainlink/=node_modules/@chainlink/",
        "@eth-optimism/=node_modules/@eth-optimism/",
        "@openzeppelin/=node_modules/@openzeppelin/",
        "hardhat-deploy/=node_modules/hardhat-deploy/",
        "layerzero-v2/=node_modules/layerzero-v2/",
        "solidity-bytes-utils/=node_modules/solidity-bytes-utils/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}