{"file_path":"contracts/OndoOFT.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport { ILayerZeroEndpointV2 } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol\";\nimport { Origin } from \"@layerzerolabs/oapp-evm/contracts/oapp/OApp.sol\";\n\nimport { OFTMsgCodec } from \"@layerzerolabs/oft-evm/contracts/libs/OFTMsgCodec.sol\";\nimport { OFTComposeMsgCodec } from \"@layerzerolabs/oft-evm/contracts/libs/OFTComposeMsgCodec.sol\";\nimport { IMintBurnVoidReturn } from \"./interfaces/IMintBurnVoidReturn.sol\";\n\nimport { IMessenger, MessagingParam } from \"./interfaces/IMessenger.sol\";\n\nimport { IOndoOFT, SendParam, MessagingFee, MessagingReceipt, OFTLimit, OFTFeeDetail, OFTReceipt } from \"./interfaces/IOndoOFT.sol\";\n\nimport { DecimalConversions } from \"./libs/DecimalConversions.sol\";\n\ncontract OndoOFT is IOndoOFT, Ownable {\n    using DecimalConversions for uint256;\n    using DecimalConversions for uint64;\n    using OFTMsgCodec for bytes;\n    using OFTMsgCodec for bytes32;\n\n    IMessenger internal messenger;\n    ILayerZeroEndpointV2 public immutable endpoint;\n    IMintBurnVoidReturn internal immutable innerToken;\n    bytes32 public immutable tokenId;\n\n    constructor(address _messenger, address _token, bytes32 _tokenId, address _owner) Ownable(_owner) {\n        messenger = IMessenger(_messenger);\n        endpoint = messenger.endpoint();\n        innerToken = IMintBurnVoidReturn(_token);\n        tokenId = _tokenId;\n\n        // @dev Sanity check that the underlying token is 18 decimals, to ensure conversions are correct.\n        if (IERC20Metadata(_token).decimals() != DecimalConversions.LOCAL_DECIMALS) {\n            revert InvalidLocalDecimals();\n        }\n    }\n\n    /**\n     * @notice Sets the messenger address for the OFT contract.\n     * @param _messenger The address of the messenger contract.\n     *\n     * @dev This function can only be called by the owner of the contract.\n     * It allows changing the messenger address to a new one.\n     */\n    function setMessenger(address _messenger) external onlyOwner {\n        IMessenger newMessenger = IMessenger(_messenger);\n\n        // @dev Check that the new messenger has the same endpoint as the current messenger.\n        if (address(newMessenger.endpoint()) != address(endpoint)) {\n            revert EndpointMismatch(address(newMessenger.endpoint()), address(endpoint));\n        }\n\n        messenger = newMessenger;\n        emit MessengerSet(_messenger);\n    }\n\n    /**\n     * @notice Retrieves the address of the underlying ERC20 implementation.\n     * @return The address of the adapted ERC-20 token.\n     *\n     * @dev In the case of OndoOFT, address(this) and erc20 are NOT the same contract.\n     */\n    function token() public view returns (address) {\n        return address(innerToken);\n    }\n\n    /**\n     * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n     * @return requiresApproval Needs approval of the underlying token implementation.\n     *\n     * @dev In the case of this OFT, approval is NOT required. Because this OFT has mint/burn privileges.\n     */\n    function approvalRequired() external pure virtual returns (bool) {\n        return false;\n    }\n\n    /**\n     * @notice Retrieves interfaceID and the version of the OFT.\n     * @return interfaceId The interface ID.\n     * @return version The version.\n     *\n     * @dev interfaceId: This specific interface ID is '0xa42519c0'.\n     * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n     * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n     * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n     */\n    function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\n        // @dev The nature of this OFT is very different, we are using a shared single OApp to handle the oftMessaging\n        // between multiple ofts on a given chain. This means we have a slightly different encoding. Further we\n        // also don't have a typical lzReceive() on this contract.\n        return (type(IOndoOFT).interfaceId, 1);\n    }\n\n    /**\n     * @notice Retrieves the shared decimals of the OFT.\n     * @return The shared decimals of the OFT.\n     *\n     * @dev Sets an implicit cap on the amount of tokens,\n     * over uint64.max() will need some sort of outbound cap / totalSupply cap.\n     * Lowest common decimal denominator between chains.\n     * Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\n     * ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\n     */\n    function sharedDecimals() public view virtual returns (uint8) {\n        return DecimalConversions.SHARED_DECIMALS;\n    }\n\n    /**\n     * @notice Provides the fee breakdown and settings data for an OFT. Unused in the default implementation.\n     * @param _sendParam The parameters for the send operation.\n     * @return oftLimit The OFT limit information.\n     * @return oftFeeDetails The details of OFT fees.\n     * @return oftReceipt The OFT receipt information.\n     */\n    function quoteOFT(\n        SendParam calldata _sendParam\n    )\n        external\n        view\n        virtual\n        returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\n    {\n        uint256 minAmountLD = 0; // Unused in the default implementation.\n\n        // @dev Pulls the current rateLimit maximum amount available,\n        // by calling the messenger who routes to the rateLimiter.\n        (\n            uint256 sendable /*uint256 currentOutbound*/ /*uint256 receivable*/ /*uint256 currentInbound*/,\n            ,\n            ,\n\n        ) = messenger.getRateLimitedAmounts(tokenId, address(innerToken), _sendParam.dstEid);\n        uint256 maxAmountLD = sendable;\n\n        oftLimit = OFTLimit(minAmountLD, maxAmountLD);\n\n        // Unused in the default implementation; reserved for future complex fee details.\n        oftFeeDetails = new OFTFeeDetail[](0);\n\n        // @dev This is the same as the send() operation, but without the actual send.\n        // - amountSentLD is the amount in local decimals that would be sent from the sender.\n        // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT.\n        // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\n        (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\n            _sendParam.amountLD,\n            _sendParam.minAmountLD,\n            _sendParam.dstEid\n        );\n        oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n    }\n\n    /**\n     * @notice Provides a quote for the send() operation.\n     * @param _sendParam The parameters for the send() operation.\n     * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n     * @return msgFee The calculated LayerZero messaging fee from the send() operation.\n     *\n     * @dev MessagingFee: LayerZero msg fee\n     *  - nativeFee: The native fee.\n     *  - lzTokenFee: The lzToken fee.\n     */\n    function quoteSend(\n        SendParam calldata _sendParam,\n        bool _payInLzToken\n    ) external view virtual returns (MessagingFee memory msgFee) {\n        // @dev Mock the amount to receive, this is the same operation used in the send().\n        // The quote is as similar as possible to the actual send() operation.\n        (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\n\n        // @dev Calculates the LayerZero fee for the send() operation.\n        return\n            messenger.quoteSend(\n                MessagingParam({\n                    dstEid: _sendParam.dstEid,\n                    to: _sendParam.to,\n                    amountLD: amountReceivedLD,\n                    extraOptions: _sendParam.extraOptions,\n                    composeMsg: _sendParam.composeMsg\n                }),\n                _payInLzToken\n            );\n    }\n\n    /**\n     * @notice Executes the send operation.\n     * @param _sendParam The parameters for the send operation.\n     * @param _fee The calculated fee for the send() operation.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param _refundAddress The address to receive any excess funds.\n     * @return msgReceipt The receipt for the send operation.\n     * @return oftReceipt The OFT receipt information.\n     *\n     * @dev MessagingReceipt: LayerZero msg receipt\n     *  - guid: The unique identifier for the sent message.\n     *  - nonce: The nonce of the sent message.\n     *  - fee: The LayerZero fee incurred for the message.\n     */\n    function send(\n        SendParam calldata _sendParam,\n        MessagingFee calldata _fee,\n        address _refundAddress\n    ) external payable returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n        // @dev Applies the token transfers regarding this send() operation.\n        // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\n        // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient.\n        (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\n            msg.sender,\n            _sendParam.amountLD,\n            _sendParam.minAmountLD,\n            _sendParam.dstEid\n        );\n\n        // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\n        msgReceipt = messenger.send{ value: msg.value }(\n            MessagingParam({\n                dstEid: _sendParam.dstEid,\n                to: _sendParam.to,\n                amountLD: amountReceivedLD,\n                extraOptions: _sendParam.extraOptions,\n                composeMsg: _sendParam.composeMsg\n            }),\n            _fee,\n            _refundAddress\n        );\n        // @dev Formulate the OFT receipt.\n        oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n\n        emit OFTSent(msgReceipt.guid, _sendParam.dstEid, msg.sender, amountSentLD, amountReceivedLD);\n    }\n\n    /**\n     * @notice Internal function to handle the receive on the LayerZero endpoint.\n     * @param _origin The origin information.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address from the src chain.\n     *  - nonce: The nonce of the LayerZero message.\n     * @param _guid The unique identifier for the received LayerZero message.\n     * @param _message The encoded message.\n     * @dev _executor The address of the executor.\n     * @dev _extraData Additional data.\n     *\n     * @dev This varies from the traditional lzReceive() because the OFT itself is NOT an OApp,\n     * and thus we need to validate it comes from the current Messenger contract\n     */\n    function messagingReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address /*_executor*/,\n        bytes calldata /*_extraData*/\n    ) external {\n        if (msg.sender != address(messenger)) revert OnlyMessenger(msg.sender);\n\n        // @dev The src sending chain doesn't know the address length on this chain (potentially non-evm)\n        // Thus everything is bytes32() encoded in flight.\n        address toAddress = _message.sendTo().bytes32ToAddress();\n        // @dev Credit the amountLD to the recipient and return the ACTUAL amount received in local decimals\n        uint256 amountReceivedLD = _credit(toAddress, _message.amountSD().toLD(), _origin.srcEid);\n\n        if (_message.isComposed()) {\n            // @dev Proprietary composeMsg format for the OFT.\n            bytes memory composeMsg = OFTComposeMsgCodec.encode(\n                _origin.nonce,\n                _origin.srcEid,\n                amountReceivedLD,\n                _message.composeMsg()\n            );\n\n            // @dev Stores the lzCompose payload that will be executed in a separate tx.\n            // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\n            // @dev The off-chain executor will process the msg based on the src-chain-caller's compose options passed.\n            // @dev The index is used when an OApp needs to compose multiple msgs on lzReceive.\n            // For default OFT implementation there is only 1 compose msg per lzReceive, thus it's always 0.\n            endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\n        }\n\n        emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\n    }\n\n    /**\n     * @notice Internal function to mock the amount mutation from a OFT debit() operation.\n     * @param _amountLD The amount to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @dev _dstEid The destination endpoint ID.\n     * @return amountSentLD The amount sent, in local decimals.\n     * @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\n     */\n    function _debitView(\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 /*_dstEid*/\n    ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n        // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals.\n        amountSentLD = _amountLD.removeDust();\n        // @dev The amount to send is the same as amount received in the default implementation.\n        amountReceivedLD = amountSentLD;\n\n        // @dev Check for slippage.\n        if (amountReceivedLD < _minAmountLD) {\n            revert SlippageExceeded(amountReceivedLD, _minAmountLD);\n        }\n    }\n\n    /**\n     * @notice Burns tokens from the sender's specified balance.\n     * @param _from The address to debit the tokens from.\n     * @param _amountLD The amount of tokens to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @param _dstEid The destination chain ID.\n     * @return amountSentLD The amount sent in local decimals.\n     * @return amountReceivedLD The amount received in local decimals on the remote.\n     */\n    function _debit(\n        address _from,\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 _dstEid\n    ) internal returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n        (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n        // Burns tokens from the caller.\n        innerToken.burnFrom(_from, amountSentLD);\n    }\n\n    /**\n     * @notice Credits tokens to the specified address.\n     * @param _to The address to credit the tokens to.\n     * @param _amountLD The amount of tokens to credit in local decimals.\n     * @dev _srcEid The source chain ID.\n     * @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n     */\n    function _credit(address _to, uint256 _amountLD, uint32 /* _srcEid */) internal returns (uint256 amountReceivedLD) {\n        if (_to == address(0x0)) _to = address(0xdead); // _mint(...) does not support address(0x0)\n        // Mints the tokens and transfers to the recipient.\n        innerToken.mint(_to, _amountLD);\n        // In the case of NON-default OFTAdapter, the amountLD MIGHT not be equal to amountReceivedLD.\n        return _amountLD;\n    }\n}\n","deployed_bytecode":"0x6080604052600436106100dd5760003560e01c8063857749b01161007f578063c7c7f5b311610059578063c7c7f5b31461028a578063d5da4fdb146102ab578063f2fde38b146102cb578063fc0c546a146102eb57600080fd5b8063857749b0146102345780638da5cb5b146102505780639f68b9641461026e57600080fd5b80633b6f743b116100bb5780633b6f743b146101845780635e280f11146101b157806366285967146101fd578063715018a61461021f57600080fd5b80630d35b415146100e2578063156a0d0f1461011a57806317d70f7c14610142575b600080fd5b3480156100ee57600080fd5b506101026100fd366004610f6d565b61031e565b60405161011193929190610ff1565b60405180910390f35b34801561012657600080fd5b5060408051630290946760e61b81526001602082015201610111565b34801561014e57600080fd5b506101767f0c0ec8be076721e1ab53083a294d7e017a0ad57bd9d50192ef03fe2f4d5edbc781565b604051908152602001610111565b34801561019057600080fd5b506101a461019f36600461108d565b6104d0565b60405161011191906110e3565b3480156101bd57600080fd5b506101e57f0000000000000000000000001a44076050125825900e736c501f859c50fe728c81565b6040516001600160a01b039091168152602001610111565b34801561020957600080fd5b5061021d61021836600461110f565b610643565b005b34801561022b57600080fd5b5061021d6107f0565b34801561024057600080fd5b5060405160068152602001610111565b34801561025c57600080fd5b506000546001600160a01b03166101e5565b34801561027a57600080fd5b5060405160008152602001610111565b61029d61029836600461112c565b610804565b604051610111929190611199565b3480156102b757600080fd5b5061021d6102c6366004611233565b610a02565b3480156102d757600080fd5b5061021d6102e636600461110f565b610b9f565b3480156102f757600080fd5b507f0000000000000000000000004f0ca3df1c2e6b943cf82e649d576ffe7b2fabcf6101e5565b60408051808201909152600080825260208201526060610351604051806040016040528060008152602001600081525090565b60015460009081906001600160a01b031663a18ccbd37f0c0ec8be076721e1ab53083a294d7e017a0ad57bd9d50192ef03fe2f4d5edbc77f0000000000000000000000004f0ca3df1c2e6b943cf82e649d576ffe7b2fabcf6103b660208b018b6112d9565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b03909116602483015263ffffffff166044820152606401608060405180830381865afa15801561040d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043191906112ff565b5050604080518082018252858152602080820185905282516000808252918101909352909850929350839290915061048c565b6040805180820190915260008152606060208201528152602001906001900390816104645790505b5094506000806104b160408a013560608b01356104ac60208d018d6112d9565b610bdd565b6040805180820190915291825260208201529799969850505050505050565b60408051808201909152600080825260208201526000610500604085013560608601356104ac60208801886112d9565b6001546040805160a081019091529193506001600160a01b031691506331fc0636908061053060208901896112d9565b63ffffffff16815260208881013590820152604081018590526060016105596080890189611335565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506020016105a060a0890189611335565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b1681526105f9919087906004016113d6565b6040805180830381865afa158015610615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106399190611456565b9150505b92915050565b61064b610c21565b60008190507f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b0316816001600160a01b0316635e280f116040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc9190611472565b6001600160a01b03161461079f57806001600160a01b0316635e280f116040518163ffffffff1660e01b8152600401602060405180830381865afa158015610728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074c9190611472565b604051634188d4bd60e01b81526001600160a01b0391821660048201527f0000000000000000000000001a44076050125825900e736c501f859c50fe728c90911660248201526044015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117909155604051908316907faf53bfd91676a5f7c3d8a2bcd6a9df83b50bde13a00670e3db6a6cefa04823bc90600090a25050565b6107f8610c21565b6108026000610c4e565b565b61080c610f0e565b604080518082019091526000808252602082015260008061084333604089013560608a013561083e60208c018c6112d9565b610c9e565b6001546040805160a081019091529294509092506001600160a01b03169063a84cbec29034908061087760208d018d6112d9565b63ffffffff16815260208c81013590820152604081018690526060016108a060808d018d611335565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506020016108e760a08d018d611335565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e085901b16815261094291908b908b9060040161148f565b60806040518083038185885af1158015610960573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098591906114e3565b60408051808201909152838152602080820184905282519296509094503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a906109d3908b018b6112d9565b6040805163ffffffff909216825260208201879052810185905260600160405180910390a35050935093915050565b6001546001600160a01b03163314610a2f5760405163c135a40560e01b8152336004820152602401610796565b6000610a41610a3e8787610d3f565b90565b90506000610a7682610a64610a568a8a610d5e565b6001600160401b0316610d81565b610a7160208d018d6112d9565b610dad565b90506028861115610b3d576000610ab3610a9660608c0160408d01611558565b610aa360208d018d6112d9565b84610aae8c8c610e4d565b610e98565b604051633e5ac80960e11b81529091506001600160a01b037f0000000000000000000000001a44076050125825900e736c501f859c50fe728c1690637cb5901290610b099086908d906000908790600401611575565b600060405180830381600087803b158015610b2357600080fd5b505af1158015610b37573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c610b7660208d018d6112d9565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b610ba7610c21565b6001600160a01b038116610bd157604051631e4fbdf760e01b815260006004820152602401610796565b610bda81610c4e565b50565b600080610be985610eca565b915081905083811015610c19576040516371c4efed60e01b81526004810182905260248101859052604401610796565b935093915050565b6000546001600160a01b031633146108025760405163118cdaa760e01b8152336004820152602401610796565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080610cac858585610bdd565b60405163079cc67960e41b81526001600160a01b038981166004830152602482018490529294509092507f0000000000000000000000004f0ca3df1c2e6b943cf82e649d576ffe7b2fabcf909116906379cc679090604401600060405180830381600087803b158015610d1e57600080fd5b505af1158015610d32573d6000803e3d6000fd5b5050505094509492505050565b6000610d4e60208284866115b0565b610d57916115da565b9392505050565b6000610d6e6028602084866115b0565b610d77916115f8565b60c01c9392505050565b6000610d8f6006601261163e565b610d9a90600a61173b565b61063d906001600160401b03841661174a565b60006001600160a01b038416610dc35761dead93505b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018590527f0000000000000000000000004f0ca3df1c2e6b943cf82e649d576ffe7b2fabcf16906340c10f1990604401600060405180830381600087803b158015610e2d57600080fd5b505af1158015610e41573d6000803e3d6000fd5b50949695505050505050565b6060610e5c82602881866115b0565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001610eb19493929190611761565b6040516020818303038152906040529050949350505050565b6000610ed86006601261163e565b610ee390600a61173b565b610eef6006601261163e565b610efa90600a61173b565b610f0490846117b0565b61063d919061174a565b60405180606001604052806000801916815260200160006001600160401b03168152602001610f50604051806040016040528060008152602001600081525090565b905290565b600060e08284031215610f6757600080fd5b50919050565b600060208284031215610f7f57600080fd5b81356001600160401b03811115610f9557600080fd5b61063984828501610f55565b60005b83811015610fbc578181015183820152602001610fa4565b50506000910152565b60008151808452610fdd816020860160208601610fa1565b601f01601f19169290920160200192915050565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561106c5788870360bf1901855281518051885283015183880187905261105987890182610fc5565b975050938201939082019060010161102d565b50508751606088015250505060208501516080850152509050949350505050565b600080604083850312156110a057600080fd5b82356001600160401b038111156110b657600080fd5b6110c285828601610f55565b925050602083013580151581146110d857600080fd5b809150509250929050565b81518152602080830151908201526040810161063d565b6001600160a01b0381168114610bda57600080fd5b60006020828403121561112157600080fd5b8135610d57816110fa565b6000806000838503608081121561114257600080fd5b84356001600160401b0381111561115857600080fd5b61116487828801610f55565b9450506040601f198201121561117957600080fd5b50602084019150606084013561118e816110fa565b809150509250925092565b600060c082019050835182526001600160401b03602085015116602083015260408401516111d4604084018280518252602090810151910152565b5082516080830152602083015160a0830152610d57565b60008083601f8401126111fd57600080fd5b5081356001600160401b0381111561121457600080fd5b60208301915083602082850101111561122c57600080fd5b9250929050565b600080600080600080600087890360e081121561124f57600080fd5b606081121561125d57600080fd5b508796506060880135955060808801356001600160401b038082111561128257600080fd5b61128e8b838c016111eb565b909750955060a08a013591506112a3826110fa565b90935060c089013590808211156112b957600080fd5b506112c68a828b016111eb565b989b979a50959850939692959293505050565b6000602082840312156112eb57600080fd5b813563ffffffff81168114610d5757600080fd5b6000806000806080858703121561131557600080fd5b505082516020840151604085015160609095015191969095509092509050565b6000808335601e1984360301811261134c57600080fd5b8301803591506001600160401b0382111561136657600080fd5b60200191503681900382131561122c57600080fd5b63ffffffff815116825260208101516020830152604081015160408301526000606082015160a060608501526113b460a0850182610fc5565b9050608083015184820360808601526113cd8282610fc5565b95945050505050565b6040815260006113e9604083018561137b565b905082151560208301529392505050565b60006040828403121561140c57600080fd5b604051604081018181106001600160401b038211171561143c57634e487b7160e01b600052604160045260246000fd5b604052825181526020928301519281019290925250919050565b60006040828403121561146857600080fd5b610d5783836113fa565b60006020828403121561148457600080fd5b8151610d57816110fa565b6080815260006114a2608083018661137b565b8435602084810191909152909401356040830152506001600160a01b0391909116606090910152919050565b6001600160401b0381168114610bda57600080fd5b6000608082840312156114f557600080fd5b604051606081018181106001600160401b038211171561152557634e487b7160e01b600052604160045260246000fd5b60405282518152602083015161153a816114ce565b602082015261154c84604085016113fa565b60408201529392505050565b60006020828403121561156a57600080fd5b8135610d57816114ce565b60018060a01b038516815283602082015261ffff831660408201526080606082015260006115a66080830184610fc5565b9695505050505050565b600080858511156115c057600080fd5b838611156115cd57600080fd5b5050820193919092039150565b8035602083101561063d57600019602084900360031b1b1692915050565b6001600160c01b031981358181169160088510156116205780818660080360031b1b83161692505b505092915050565b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111561063d5761063d611628565b600181815b8085111561169257816000190482111561167857611678611628565b8085161561168557918102915b93841c939080029061165c565b509250929050565b6000826116a95750600161063d565b816116b65750600061063d565b81600181146116cc57600281146116d6576116f2565b600191505061063d565b60ff8411156116e7576116e7611628565b50506001821b61063d565b5060208310610133831016604e8410600b8410161715611715575081810a61063d565b61171f8383611657565b806000190482111561173357611733611628565b029392505050565b6000610d5760ff84168361169a565b808202811582820484141761063d5761063d611628565b6001600160401b0360c01b8560c01b16815263ffffffff60e01b8460e01b16600882015282600c820152600082516117a081602c850160208701610fa1565b91909101602c0195945050505050565b6000826117cd57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212205b265622b14e1a53463cf9af911640555782fc027bac3fb9588f6ee5c2a789e364736f6c63430008160033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"":["*"],"*":["*"]}}},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0xff2BABA46Df92919705E60120C477Ae5b7341Eb3",{"internalType":"address","name":"_messenger","type":"address"}],["0x4f0CA3df1c2e6b943cf82E649d576ffe7B2fABCF",{"internalType":"address","name":"_token","type":"address"}],["0x0c0ec8be076721e1ab53083a294d7e017a0ad57bd9d50192ef03fe2f4d5edbc7",{"internalType":"bytes32","name":"_tokenId","type":"bytes32"}],["0xbC6D5C103a3f586e68bd475942a49d041b171C3e",{"internalType":"address","name":"_owner","type":"address"}]],"compiler_version":"v0.8.22+commit.4fc1097e","is_verified_via_verifier_alliance":false,"verified_at":"2026-04-27T13:16:47.064434Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60e06040523480156200001157600080fd5b5060405162001b1538038062001b15833981016040819052620000349162000204565b806001600160a01b0381166200006457604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200006f816200019b565b50600180546001600160a01b0319166001600160a01b03861690811790915560408051635e280f1160e01b81529051635e280f11916004808201926020929091908290030181865afa158015620000ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f0919062000260565b6001600160a01b03908116608052831660a081905260c08390526040805163313ce56760e01b815290516012929163313ce5679160048083019260209291908290030181865afa15801562000149573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016f919062000287565b60ff161462000191576040516301e9714b60e41b815260040160405180910390fd5b50505050620002ac565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200020157600080fd5b50565b600080600080608085870312156200021b57600080fd5b84516200022881620001eb565b60208601519094506200023b81620001eb565b6040860151606087015191945092506200025581620001eb565b939692955090935050565b6000602082840312156200027357600080fd5b81516200028081620001eb565b9392505050565b6000602082840312156200029a57600080fd5b815160ff811681146200028057600080fd5b60805160a05160c0516118086200030d6000396000818161015401526103690152600081816102fa0152818161038a01528181610cd80152610de90152600081816101c3015281816106520152818161076b0152610acd01526118086000f3fe6080604052600436106100dd5760003560e01c8063857749b01161007f578063c7c7f5b311610059578063c7c7f5b31461028a578063d5da4fdb146102ab578063f2fde38b146102cb578063fc0c546a146102eb57600080fd5b8063857749b0146102345780638da5cb5b146102505780639f68b9641461026e57600080fd5b80633b6f743b116100bb5780633b6f743b146101845780635e280f11146101b157806366285967146101fd578063715018a61461021f57600080fd5b80630d35b415146100e2578063156a0d0f1461011a57806317d70f7c14610142575b600080fd5b3480156100ee57600080fd5b506101026100fd366004610f6d565b61031e565b60405161011193929190610ff1565b60405180910390f35b34801561012657600080fd5b5060408051630290946760e61b81526001602082015201610111565b34801561014e57600080fd5b506101767f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610111565b34801561019057600080fd5b506101a461019f36600461108d565b6104d0565b60405161011191906110e3565b3480156101bd57600080fd5b506101e57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610111565b34801561020957600080fd5b5061021d61021836600461110f565b610643565b005b34801561022b57600080fd5b5061021d6107f0565b34801561024057600080fd5b5060405160068152602001610111565b34801561025c57600080fd5b506000546001600160a01b03166101e5565b34801561027a57600080fd5b5060405160008152602001610111565b61029d61029836600461112c565b610804565b604051610111929190611199565b3480156102b757600080fd5b5061021d6102c6366004611233565b610a02565b3480156102d757600080fd5b5061021d6102e636600461110f565b610b9f565b3480156102f757600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006101e5565b60408051808201909152600080825260208201526060610351604051806040016040528060008152602001600081525090565b60015460009081906001600160a01b031663a18ccbd37f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006103b660208b018b6112d9565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b03909116602483015263ffffffff166044820152606401608060405180830381865afa15801561040d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043191906112ff565b5050604080518082018252858152602080820185905282516000808252918101909352909850929350839290915061048c565b6040805180820190915260008152606060208201528152602001906001900390816104645790505b5094506000806104b160408a013560608b01356104ac60208d018d6112d9565b610bdd565b6040805180820190915291825260208201529799969850505050505050565b60408051808201909152600080825260208201526000610500604085013560608601356104ac60208801886112d9565b6001546040805160a081019091529193506001600160a01b031691506331fc0636908061053060208901896112d9565b63ffffffff16815260208881013590820152604081018590526060016105596080890189611335565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506020016105a060a0890189611335565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e084901b1681526105f9919087906004016113d6565b6040805180830381865afa158015610615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106399190611456565b9150505b92915050565b61064b610c21565b60008190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316635e280f116040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc9190611472565b6001600160a01b03161461079f57806001600160a01b0316635e280f116040518163ffffffff1660e01b8152600401602060405180830381865afa158015610728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074c9190611472565b604051634188d4bd60e01b81526001600160a01b0391821660048201527f000000000000000000000000000000000000000000000000000000000000000090911660248201526044015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117909155604051908316907faf53bfd91676a5f7c3d8a2bcd6a9df83b50bde13a00670e3db6a6cefa04823bc90600090a25050565b6107f8610c21565b6108026000610c4e565b565b61080c610f0e565b604080518082019091526000808252602082015260008061084333604089013560608a013561083e60208c018c6112d9565b610c9e565b6001546040805160a081019091529294509092506001600160a01b03169063a84cbec29034908061087760208d018d6112d9565b63ffffffff16815260208c81013590820152604081018690526060016108a060808d018d611335565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506020016108e760a08d018d611335565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506040516001600160e01b031960e085901b16815261094291908b908b9060040161148f565b60806040518083038185885af1158015610960573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098591906114e3565b60408051808201909152838152602080820184905282519296509094503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a906109d3908b018b6112d9565b6040805163ffffffff909216825260208201879052810185905260600160405180910390a35050935093915050565b6001546001600160a01b03163314610a2f5760405163c135a40560e01b8152336004820152602401610796565b6000610a41610a3e8787610d3f565b90565b90506000610a7682610a64610a568a8a610d5e565b6001600160401b0316610d81565b610a7160208d018d6112d9565b610dad565b90506028861115610b3d576000610ab3610a9660608c0160408d01611558565b610aa360208d018d6112d9565b84610aae8c8c610e4d565b610e98565b604051633e5ac80960e11b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb5901290610b099086908d906000908790600401611575565b600060405180830381600087803b158015610b2357600080fd5b505af1158015610b37573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c610b7660208d018d6112d9565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b610ba7610c21565b6001600160a01b038116610bd157604051631e4fbdf760e01b815260006004820152602401610796565b610bda81610c4e565b50565b600080610be985610eca565b915081905083811015610c19576040516371c4efed60e01b81526004810182905260248101859052604401610796565b935093915050565b6000546001600160a01b031633146108025760405163118cdaa760e01b8152336004820152602401610796565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080610cac858585610bdd565b60405163079cc67960e41b81526001600160a01b038981166004830152602482018490529294509092507f0000000000000000000000000000000000000000000000000000000000000000909116906379cc679090604401600060405180830381600087803b158015610d1e57600080fd5b505af1158015610d32573d6000803e3d6000fd5b5050505094509492505050565b6000610d4e60208284866115b0565b610d57916115da565b9392505050565b6000610d6e6028602084866115b0565b610d77916115f8565b60c01c9392505050565b6000610d8f6006601261163e565b610d9a90600a61173b565b61063d906001600160401b03841661174a565b60006001600160a01b038416610dc35761dead93505b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018590527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b158015610e2d57600080fd5b505af1158015610e41573d6000803e3d6000fd5b50949695505050505050565b6060610e5c82602881866115b0565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001610eb19493929190611761565b6040516020818303038152906040529050949350505050565b6000610ed86006601261163e565b610ee390600a61173b565b610eef6006601261163e565b610efa90600a61173b565b610f0490846117b0565b61063d919061174a565b60405180606001604052806000801916815260200160006001600160401b03168152602001610f50604051806040016040528060008152602001600081525090565b905290565b600060e08284031215610f6757600080fd5b50919050565b600060208284031215610f7f57600080fd5b81356001600160401b03811115610f9557600080fd5b61063984828501610f55565b60005b83811015610fbc578181015183820152602001610fa4565b50506000910152565b60008151808452610fdd816020860160208601610fa1565b601f01601f19169290920160200192915050565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561106c5788870360bf1901855281518051885283015183880187905261105987890182610fc5565b975050938201939082019060010161102d565b50508751606088015250505060208501516080850152509050949350505050565b600080604083850312156110a057600080fd5b82356001600160401b038111156110b657600080fd5b6110c285828601610f55565b925050602083013580151581146110d857600080fd5b809150509250929050565b81518152602080830151908201526040810161063d565b6001600160a01b0381168114610bda57600080fd5b60006020828403121561112157600080fd5b8135610d57816110fa565b6000806000838503608081121561114257600080fd5b84356001600160401b0381111561115857600080fd5b61116487828801610f55565b9450506040601f198201121561117957600080fd5b50602084019150606084013561118e816110fa565b809150509250925092565b600060c082019050835182526001600160401b03602085015116602083015260408401516111d4604084018280518252602090810151910152565b5082516080830152602083015160a0830152610d57565b60008083601f8401126111fd57600080fd5b5081356001600160401b0381111561121457600080fd5b60208301915083602082850101111561122c57600080fd5b9250929050565b600080600080600080600087890360e081121561124f57600080fd5b606081121561125d57600080fd5b508796506060880135955060808801356001600160401b038082111561128257600080fd5b61128e8b838c016111eb565b909750955060a08a013591506112a3826110fa565b90935060c089013590808211156112b957600080fd5b506112c68a828b016111eb565b989b979a50959850939692959293505050565b6000602082840312156112eb57600080fd5b813563ffffffff81168114610d5757600080fd5b6000806000806080858703121561131557600080fd5b505082516020840151604085015160609095015191969095509092509050565b6000808335601e1984360301811261134c57600080fd5b8301803591506001600160401b0382111561136657600080fd5b60200191503681900382131561122c57600080fd5b63ffffffff815116825260208101516020830152604081015160408301526000606082015160a060608501526113b460a0850182610fc5565b9050608083015184820360808601526113cd8282610fc5565b95945050505050565b6040815260006113e9604083018561137b565b905082151560208301529392505050565b60006040828403121561140c57600080fd5b604051604081018181106001600160401b038211171561143c57634e487b7160e01b600052604160045260246000fd5b604052825181526020928301519281019290925250919050565b60006040828403121561146857600080fd5b610d5783836113fa565b60006020828403121561148457600080fd5b8151610d57816110fa565b6080815260006114a2608083018661137b565b8435602084810191909152909401356040830152506001600160a01b0391909116606090910152919050565b6001600160401b0381168114610bda57600080fd5b6000608082840312156114f557600080fd5b604051606081018181106001600160401b038211171561152557634e487b7160e01b600052604160045260246000fd5b60405282518152602083015161153a816114ce565b602082015261154c84604085016113fa565b60408201529392505050565b60006020828403121561156a57600080fd5b8135610d57816114ce565b60018060a01b038516815283602082015261ffff831660408201526080606082015260006115a66080830184610fc5565b9695505050505050565b600080858511156115c057600080fd5b838611156115cd57600080fd5b5050820193919092039150565b8035602083101561063d57600019602084900360031b1b1692915050565b6001600160c01b031981358181169160088510156116205780818660080360031b1b83161692505b505092915050565b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111561063d5761063d611628565b600181815b8085111561169257816000190482111561167857611678611628565b8085161561168557918102915b93841c939080029061165c565b509250929050565b6000826116a95750600161063d565b816116b65750600061063d565b81600181146116cc57600281146116d6576116f2565b600191505061063d565b60ff8411156116e7576116e7611628565b50506001821b61063d565b5060208310610133831016604e8410600b8410161715611715575081810a61063d565b61171f8383611657565b806000190482111561173357611733611628565b029392505050565b6000610d5760ff84168361169a565b808202811582820484141761063d5761063d611628565b6001600160401b0360c01b8560c01b16815263ffffffff60e01b8460e01b16600882015282600c820152600082516117a081602c850160208701610fa1565b91909101602c0195945050505050565b6000826117cd57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212205b265622b14e1a53463cf9af911640555782fc027bac3fb9588f6ee5c2a789e364736f6c63430008160033000000000000000000000000ff2baba46df92919705e60120c477ae5b7341eb30000000000000000000000004f0ca3df1c2e6b943cf82e649d576ffe7b2fabcf0c0ec8be076721e1ab53083a294d7e017a0ad57bd9d50192ef03fe2f4d5edbc7000000000000000000000000bc6d5c103a3f586e68bd475942a49d041b171c3e","name":"OndoOFT","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol","source_code":"// 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"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol","source_code":"// 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"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol","source_code":"// 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 _gracePeriod) 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 _expiry) 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"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol","source_code":"// 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"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol","source_code":"// 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"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol","source_code":"// 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"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/OApp.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport { OAppSender, MessagingFee, MessagingReceipt } from \"./OAppSender.sol\";\n// @dev Import the 'Origin' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport { OAppReceiver, Origin } from \"./OAppReceiver.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OApp\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\n */\nabstract contract OApp is OAppSender, OAppReceiver {\n    /**\n     * @dev Constructor to initialize the OApp with the provided endpoint and owner.\n     * @param _endpoint The address of the LOCAL LayerZero endpoint.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     */\n    constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {}\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol implementation.\n     * @return receiverVersion The version of the OAppReceiver.sol implementation.\n     */\n    function oAppVersion()\n        public\n        pure\n        virtual\n        override(OAppSender, OAppReceiver)\n        returns (uint64 senderVersion, uint64 receiverVersion)\n    {\n        return (SENDER_VERSION, RECEIVER_VERSION);\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/OAppCore.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.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 OAppCore is IOAppCore, Ownable {\n    // The LayerZero endpoint associated with the given OApp\n    ILayerZeroEndpointV2 public immutable endpoint;\n\n    // Mapping to store peers associated with corresponding endpoints\n    mapping(uint32 eid => bytes32 peer) public peers;\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     * @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     */\n    constructor(address _endpoint, address _delegate) {\n        endpoint = ILayerZeroEndpointV2(_endpoint);\n\n        if (_delegate == address(0)) revert InvalidDelegate();\n        endpoint.setDelegate(_delegate);\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        _setPeer(_eid, _peer);\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 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) internal virtual {\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        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"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/OAppReceiver.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"./interfaces/IOAppReceiver.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\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 = 2;\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 Indicates whether an address is an approved composeMsg sender to the Endpoint.\n     * @dev _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     * @dev _message The lzReceive payload.\n     * @param _sender The sender address.\n     * @return isSender Is a valid sender.\n     *\n     * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\n     * @dev The default sender IS the OAppReceiver implementer.\n     */\n    function isComposeMsgSender(\n        Origin calldata /*_origin*/,\n        bytes calldata /*_message*/,\n        address _sender\n    ) public view virtual returns (bool) {\n        return _sender == 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"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/OAppSender.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20, IERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n */\nabstract contract OAppSender is OAppCore {\n    using SafeERC20 for IERC20;\n\n    // Custom error messages\n    error NotEnoughNative(uint256 msgValue);\n    error LzTokenUnavailable();\n\n    // @dev The version of the OAppSender implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant SENDER_VERSION = 1;\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 OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n     * ie. this is a SEND 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 (SENDER_VERSION, 0);\n    }\n\n    /**\n     * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n     * @param _dstEid The destination endpoint ID.\n     * @param _message The message payload.\n     * @param _options Additional options for the message.\n     * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n     * @return fee The calculated MessagingFee for the message.\n     *      - nativeFee: The native fee for the message.\n     *      - lzTokenFee: The LZ token fee for the message.\n     */\n    function _quote(\n        uint32 _dstEid,\n        bytes memory _message,\n        bytes memory _options,\n        bool _payInLzToken\n    ) internal view virtual returns (MessagingFee memory fee) {\n        return\n            endpoint.quote(\n                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n                address(this)\n            );\n    }\n\n    /**\n     * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n     * @param _dstEid The destination endpoint ID.\n     * @param _message The message payload.\n     * @param _options Additional options for the message.\n     * @param _fee The calculated LayerZero fee for the message.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n     * @return receipt The receipt for the sent message.\n     *      - guid: The unique identifier for the sent message.\n     *      - nonce: The nonce of the sent message.\n     *      - fee: The LayerZero fee incurred for the message.\n     */\n    function _lzSend(\n        uint32 _dstEid,\n        bytes memory _message,\n        bytes memory _options,\n        MessagingFee memory _fee,\n        address _refundAddress\n    ) internal virtual returns (MessagingReceipt memory receipt) {\n        // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n        uint256 messageValue = _payNative(_fee.nativeFee);\n        if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n        return\n            // solhint-disable-next-line check-send-result\n            endpoint.send{ value: messageValue }(\n                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n                _refundAddress\n            );\n    }\n\n    /**\n     * @dev Internal function to pay the native fee associated with the message.\n     * @param _nativeFee The native fee to be paid.\n     * @return nativeFee The amount of native currency paid.\n     *\n     * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n     * this will need to be overridden because msg.value would contain multiple lzFees.\n     * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n     * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n     * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n     */\n    function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n        if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n        return _nativeFee;\n    }\n\n    /**\n     * @dev Internal function to pay the LZ token fee associated with the message.\n     * @param _lzTokenFee The LZ token fee to be paid.\n     *\n     * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n     * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n     */\n    function _payLzToken(uint256 _lzTokenFee) internal virtual {\n        // @dev Cannot cache the token because it is not immutable in the endpoint.\n        address lzToken = endpoint.lzToken();\n        if (lzToken == address(0)) revert LzTokenUnavailable();\n\n        // Pay LZ token fee by sending tokens to the endpoint.\n        IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol","source_code":"// 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"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppReceiver.sol","source_code":"// 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 Indicates whether an address is an approved composeMsg sender to 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 _message The lzReceive payload.\n     * @param _sender The sender address.\n     * @return isSender Is a valid sender.\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 OAppReceiver implementer.\n     */\n    function isComposeMsgSender(\n        Origin calldata _origin,\n        bytes calldata _message,\n        address _sender\n    ) external view returns (bool isSender);\n}\n"},{"file_path":"@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { MessagingReceipt, MessagingFee } from \"@layerzerolabs/oapp-evm/contracts/oapp/OAppSender.sol\";\n\n/**\n * @dev Struct representing token parameters for the OFT send() operation.\n */\nstruct SendParam {\n    uint32 dstEid; // Destination endpoint ID.\n    bytes32 to; // Recipient address.\n    uint256 amountLD; // Amount to send in local decimals.\n    uint256 minAmountLD; // Minimum amount to send in local decimals.\n    bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\n    bytes composeMsg; // The composed message for the send() operation.\n    bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\n}\n\n/**\n * @dev Struct representing OFT limit information.\n * @dev These amounts can change dynamically and are up the specific oft implementation.\n */\nstruct OFTLimit {\n    uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\n    uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\n}\n\n/**\n * @dev Struct representing OFT receipt information.\n */\nstruct OFTReceipt {\n    uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\n    // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\n    uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\n}\n\n/**\n * @dev Struct representing OFT fee details.\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\n */\nstruct OFTFeeDetail {\n    int256 feeAmountLD; // Amount of the fee in local decimals.\n    string description; // Description of the fee.\n}\n\n/**\n * @title IOFT\n * @dev Interface for the OftChain (OFT) token.\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\n * @dev This specific interface ID is '0x02e49c2c'.\n */\ninterface IOFT {\n    // Custom error messages\n    error InvalidLocalDecimals();\n    error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\n    error AmountSDOverflowed(uint256 amountSD);\n\n    // Events\n    event OFTSent(\n        bytes32 indexed guid, // GUID of the OFT message.\n        uint32 dstEid, // Destination Endpoint ID.\n        address indexed fromAddress, // Address of the sender on the src chain.\n        uint256 amountSentLD, // Amount of tokens sent in local decimals.\n        uint256 amountReceivedLD // Amount of tokens received in local decimals.\n    );\n    event OFTReceived(\n        bytes32 indexed guid, // GUID of the OFT message.\n        uint32 srcEid, // Source Endpoint ID.\n        address indexed toAddress, // Address of the recipient on the dst chain.\n        uint256 amountReceivedLD // Amount of tokens received in local decimals.\n    );\n\n    /**\n     * @notice Retrieves interfaceID and the version of the OFT.\n     * @return interfaceId The interface ID.\n     * @return version The version.\n     *\n     * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n     * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n     * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n     * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n     */\n    function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\n\n    /**\n     * @notice Retrieves the address of the token associated with the OFT.\n     * @return token The address of the ERC20 token implementation.\n     */\n    function token() external view returns (address);\n\n    /**\n     * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n     * @return requiresApproval Needs approval of the underlying token implementation.\n     *\n     * @dev Allows things like wallet implementers to determine integration requirements,\n     * without understanding the underlying token implementation.\n     */\n    function approvalRequired() external view returns (bool);\n\n    /**\n     * @notice Retrieves the shared decimals of the OFT.\n     * @return sharedDecimals The shared decimals of the OFT.\n     */\n    function sharedDecimals() external view returns (uint8);\n\n    /**\n     * @notice Provides the fee breakdown and settings data for an OFT. Unused in the default implementation.\n     * @param _sendParam The parameters for the send operation.\n     * @return limit The OFT limit information.\n     * @return oftFeeDetails The details of OFT fees.\n     * @return receipt The OFT receipt information.\n     */\n    function quoteOFT(\n        SendParam calldata _sendParam\n    ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\n\n    /**\n     * @notice Provides a quote for the send() operation.\n     * @param _sendParam The parameters for the send() operation.\n     * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n     * @return fee The calculated LayerZero messaging fee from the send() operation.\n     *\n     * @dev MessagingFee: LayerZero msg fee\n     *  - nativeFee: The native fee.\n     *  - lzTokenFee: The lzToken fee.\n     */\n    function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\n\n    /**\n     * @notice Executes the send() operation.\n     * @param _sendParam The parameters for the send operation.\n     * @param _fee The fee information supplied by the caller.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\n     * @return receipt The LayerZero messaging receipt from the send() operation.\n     * @return oftReceipt The OFT receipt information.\n     *\n     * @dev MessagingReceipt: LayerZero msg receipt\n     *  - guid: The unique identifier for the sent message.\n     *  - nonce: The nonce of the sent message.\n     *  - fee: The LayerZero fee incurred for the message.\n     */\n    function send(\n        SendParam calldata _sendParam,\n        MessagingFee calldata _fee,\n        address _refundAddress\n    ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\n}\n"},{"file_path":"@layerzerolabs/oft-evm/contracts/libs/OFTComposeMsgCodec.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTComposeMsgCodec {\n    // Offset constants for decoding composed messages\n    uint8 private constant NONCE_OFFSET = 8;\n    uint8 private constant SRC_EID_OFFSET = 12;\n    uint8 private constant AMOUNT_LD_OFFSET = 44;\n    uint8 private constant COMPOSE_FROM_OFFSET = 76;\n\n    /**\n     * @dev Encodes a OFT composed message.\n     * @param _nonce The nonce value.\n     * @param _srcEid The source endpoint ID.\n     * @param _amountLD The amount in local decimals.\n     * @param _composeMsg The composed message.\n     * @return _msg The encoded Composed message.\n     */\n    function encode(\n        uint64 _nonce,\n        uint32 _srcEid,\n        uint256 _amountLD,\n        bytes memory _composeMsg // 0x[composeFrom][composeMsg]\n    ) internal pure returns (bytes memory _msg) {\n        _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\n    }\n\n    /**\n     * @dev Retrieves the nonce for the composed message.\n     * @param _msg The message.\n     * @return The nonce value.\n     */\n    function nonce(bytes calldata _msg) internal pure returns (uint64) {\n        return uint64(bytes8(_msg[:NONCE_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the source endpoint ID for the composed message.\n     * @param _msg The message.\n     * @return The source endpoint ID.\n     */\n    function srcEid(bytes calldata _msg) internal pure returns (uint32) {\n        return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the amount in local decimals from the composed message.\n     * @param _msg The message.\n     * @return The amount in local decimals.\n     */\n    function amountLD(bytes calldata _msg) internal pure returns (uint256) {\n        return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the composeFrom value from the composed message.\n     * @param _msg The message.\n     * @return The composeFrom value.\n     */\n    function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\n        return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\n    }\n\n    /**\n     * @dev Retrieves the composed message.\n     * @param _msg The message.\n     * @return The composed message.\n     */\n    function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n        return _msg[COMPOSE_FROM_OFFSET:];\n    }\n\n    /**\n     * @dev Converts an address to bytes32.\n     * @param _addr The address to convert.\n     * @return The bytes32 representation of the address.\n     */\n    function addressToBytes32(address _addr) internal pure returns (bytes32) {\n        return bytes32(uint256(uint160(_addr)));\n    }\n\n    /**\n     * @dev Converts bytes32 to an address.\n     * @param _b The bytes32 value to convert.\n     * @return The address representation of bytes32.\n     */\n    function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n        return address(uint160(uint256(_b)));\n    }\n}\n"},{"file_path":"@layerzerolabs/oft-evm/contracts/libs/OFTMsgCodec.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTMsgCodec {\n    // Offset constants for encoding and decoding OFT messages\n    uint8 private constant SEND_TO_OFFSET = 32;\n    uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n    /**\n     * @dev Encodes an OFT LayerZero message.\n     * @param _sendTo The recipient address.\n     * @param _amountShared The amount in shared decimals.\n     * @param _composeMsg The composed message.\n     * @return _msg The encoded message.\n     * @return hasCompose A boolean indicating whether the message has a composed payload.\n     */\n    function encode(\n        bytes32 _sendTo,\n        uint64 _amountShared,\n        bytes memory _composeMsg\n    ) internal view returns (bytes memory _msg, bool hasCompose) {\n        hasCompose = _composeMsg.length > 0;\n        // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n        _msg = hasCompose\n            ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(msg.sender), _composeMsg)\n            : abi.encodePacked(_sendTo, _amountShared);\n    }\n\n    /**\n     * @dev Checks if the OFT message is composed.\n     * @param _msg The OFT message.\n     * @return A boolean indicating whether the message is composed.\n     */\n    function isComposed(bytes calldata _msg) internal pure returns (bool) {\n        return _msg.length > SEND_AMOUNT_SD_OFFSET;\n    }\n\n    /**\n     * @dev Retrieves the recipient address from the OFT message.\n     * @param _msg The OFT message.\n     * @return The recipient address.\n     */\n    function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n        return bytes32(_msg[:SEND_TO_OFFSET]);\n    }\n\n    /**\n     * @dev Retrieves the amount in shared decimals from the OFT message.\n     * @param _msg The OFT message.\n     * @return The amount in shared decimals.\n     */\n    function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n        return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the composed message from the OFT message.\n     * @param _msg The OFT message.\n     * @return The composed message.\n     */\n    function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n        return _msg[SEND_AMOUNT_SD_OFFSET:];\n    }\n\n    /**\n     * @dev Converts an address to bytes32.\n     * @param _addr The address to convert.\n     * @return The bytes32 representation of the address.\n     */\n    function addressToBytes32(address _addr) internal pure returns (bytes32) {\n        return bytes32(uint256(uint160(_addr)));\n    }\n\n    /**\n     * @dev Converts bytes32 to an address.\n     * @param _b The bytes32 value to convert.\n     * @return The address representation of bytes32.\n     */\n    function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n        return address(uint160(uint256(_b)));\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/access/Ownable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.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 Ownable is Context {\n    address private _owner;\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    constructor(address initialOwner) {\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        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        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC1363.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n    /*\n     * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n     * 0xb0202a11 ===\n     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n     */\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @param data Additional data with no specified format, sent in call to `spender`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 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    /**\n     * @dev An operation with an ERC-20 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 Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {\n        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {\n        return _callOptionalReturnBool(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     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\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     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\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     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n     * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n     * set here.\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 Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            safeTransfer(token, to, value);\n        } else if (!token.transferAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferFromAndCallRelaxed(\n        IERC1363 token,\n        address from,\n        address to,\n        uint256 value,\n        bytes memory data\n    ) internal {\n        if (to.code.length == 0) {\n            safeTransferFrom(token, from, to, value);\n        } else if (!token.transferFromAndCall(from, to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n     * once without retrying, and relies on the returned value to be true.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            forceApprove(token, to, value);\n        } else if (!token.approveAndCall(to, value, data)) {\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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            // bubble errors\n            if iszero(success) {\n                let ptr := mload(0x40)\n                returndatacopy(ptr, 0, returndatasize())\n                revert(ptr, returndatasize())\n            }\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n\n        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\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 silently catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        bool success;\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\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 Context {\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"},{"file_path":"@openzeppelin/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},{"file_path":"contracts/interfaces/IMessenger.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport { IOAppCore } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol\";\nimport { MessagingFee, MessagingReceipt } from \"@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol\";\n\n/**\n * @notice Struct representing messaging parameters for the Messenger send() operation.\n */\nstruct MessagingParam {\n    uint32 dstEid; // Destination endpoint ID.\n    bytes32 to; // Recipient address.\n    uint256 amountLD; // Amount to send in local decimals.\n    bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\n    bytes composeMsg; // The composed message for the send() operation.\n}\n\n/**\n * @title IMessenger\n * @notice Interface for the Messenger, the OApp responsible for routing OFT messages cross-chain.\n */\ninterface IMessenger is IOAppCore {\n    // @dev Custom error messages\n    error InvalidTokenRegistration(bytes32 tokenId, address tokenAddress);\n    error InvalidTokenRegistrationWithOFT(bytes32 tokenId, address tokenAddress, address oftAddress);\n    error TokenAlreadyRegistered(bytes32 tokenId, address tokenAddress);\n    error TokenNotRegistered(bytes32 tokenId);\n    error OFTAlreadyRegistered(address oftAddress, bytes32 existingTokenId);\n    error InvalidOFT(address oft);\n    error InvalidTokenId(bytes32 tokenId);\n    error InvalidRateLimiter();\n\n    // @dev Events\n    event InspectorSet(address inspector);\n    event RateLimiterSet(address rateLimiter);\n    event TokenRegistered(bytes32 indexed tokenId, address indexed tokenAddress, address indexed oftAddress);\n    event TokenDeregistered(bytes32 indexed tokenId, address indexed tokenAddress, address indexed oftAddress);\n\n    // @dev Interface functions for the token detail mappings\n    function idToOft(bytes32 tokenId) external view returns (address oftAddress);\n    function idToToken(bytes32 tokenId) external view returns (address tokenAddress);\n    function oftToId(address oftAddress) external view returns (bytes32 tokenId);\n\n    /**\n     * @notice Sets the inspector address, which is used to inspect messages before they are sent.\n     * @param inspector The address of the inspector contract.\n     * @dev This can be set to address(0) if no inspector is required.\n     */\n    function setInspector(address inspector) external;\n\n    /**\n     * @notice Sets the rate limiter address, which is used to validate inflows and outflows of tokens.\n     * @param rateLimiter The address of the rate limiter contract.\n     */\n    function setRateLimiter(address rateLimiter) external;\n\n    /**\n     * @notice Registers a new token with its corresponding generated OFT contract.\n     * @param tokenId The unique identifier for the token.\n     * @param tokenAddress The address of the token contract.\n     * @return oftAddress The address of the newly created OndoOFT contract.\n     *\n     * @dev This function is more limited in that it can only register a brand new tokenId, it cannot alter existing.\n     */\n    function registerToken(bytes32 tokenId, address tokenAddress) external returns (address oftAddress);\n\n    /**\n     * @notice Deregisters an existing token and clears all associated mappings.\n     * @param tokenId The unique identifier for the token to be deregistered.\n     *\n     * @dev This function completely removes the token from all mappings, making it no longer usable.\n     */\n    function deregisterToken(bytes32 tokenId) external;\n\n    /**\n     * @notice Registers a token with an existing OFT contract address.\n     * @param tokenId The unique identifier for the token.\n     * @param tokenAddress The address of the token contract.\n     * @param oftAddress The address of the existing OFT contract.\n     *\n     * @dev This function allows registering with a pre-existing OFT contract instead of creating a new one.\n     * @dev Useful for fixing registration mistakes or migrating to new OFT contracts.\n     */\n    function registerTokenWithOFT(bytes32 tokenId, address tokenAddress, address oftAddress) external;\n\n    /**\n     * @notice Provides rate limit available for sending and receiving tokens by routing the call to the rateLimiter.\n     * @param _tokenId The identifier for which the rate limit is being checked.\n     * @param _tokenAddress The address of the token from the corresponding Id.\n     * @param _remoteEid The remote endpoint id.\n     * @return sendable The current amount that can be sent.\n     * @return currentOutbound The current amount used for outbound flows.\n     * @return receivable The amount that can be received.\n     * @return currentInbound The current amount used for inbound flows.\n     */\n    function getRateLimitedAmounts(\n        bytes32 _tokenId,\n        address _tokenAddress,\n        uint32 _remoteEid\n    ) external view returns (uint256 sendable, uint256 currentOutbound, uint256 receivable, uint256 currentInbound);\n\n    /**\n     * @notice Provides a quote for the send() operation.\n     * @param messagingParam The parameters for the send() operation.\n     * @param payInLzToken Flag indicating whether the caller is paying in the LZ token.\n     * @return msgFee The calculated LayerZero messaging fee from the send() operation.\n     *\n     * @dev MessagingFee: LayerZero msg fee\n     *  - nativeFee: The native fee.\n     *  - lzTokenFee: The lzToken fee.\n     */\n    function quoteSend(\n        MessagingParam calldata messagingParam,\n        bool payInLzToken\n    ) external view returns (MessagingFee memory msgFee);\n\n    /**\n     * @notice Executes and routes the send function through the endpoint.\n     * @param messagingParam The parameters for the send() operation.\n     * @param fee The calculated fee for the send() operation.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param refundAddress The address to receive any excess funds.\n     * @return msgReceipt The receipt for the send operation.\n     *\n     * @dev Since this is an external version, MUST index on the msg.sender to verify it's a valid OFT calling this.\n     *\n     * @dev MessagingReceipt: LayerZero msg receipt\n     *  - guid: The unique identifier for the sent message.\n     *  - nonce: The nonce of the sent message.\n     *  - fee: The LayerZero fee incurred for the message.\n     */\n    function send(\n        MessagingParam calldata messagingParam,\n        MessagingFee calldata fee,\n        address refundAddress\n    ) external payable returns (MessagingReceipt memory msgReceipt);\n}\n"},{"file_path":"contracts/interfaces/IMintBurnVoidReturn.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.22;\n\n/// @title Interface for mintable and burnable tokens that DOES NOT return success boolean\ninterface IMintBurnVoidReturn {\n    /**\n     * @notice Burns tokens from a specified account\n     * @param from Address from which tokens will be burned\n     * @param amount Amount of tokens to be burned\n     */\n    function burnFrom(address from, uint256 amount) external;\n\n    /**\n     * @notice Mints tokens to a specified account\n     * @param to Address to which tokens will be minted\n     * @param amount Amount of tokens to be minted\n     */\n    function mint(address to, uint256 amount) external;\n}\n"},{"file_path":"contracts/interfaces/IOndoOFT.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport { Origin } from \"@layerzerolabs/oapp-evm/contracts/oapp/OApp.sol\";\n\n// @dev Disabling unused, because we want to pipe down the structs so we ensure correct ones are used.\n// solhint-disable no-unused-import\nimport { IOFT, SendParam, MessagingFee, MessagingReceipt, OFTLimit, OFTFeeDetail, OFTReceipt } from \"@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol\";\n\n/**\n * @title IOndoOFT\n * @notice Interface for the Ondo OFT, which extends the LayerZero OFT interface.\n * @dev This interface is used for handling cross-chain messaging and operations then routing to the Messenger contract.\n */\ninterface IOndoOFT is IOFT {\n    // @dev Custom error messages\n    error OnlyMessenger(address messenger);\n    error EndpointMismatch(address actualEndpoint, address expectedEndpoint);\n\n    // @dev Events\n    event MessengerSet(address indexed messenger);\n\n    /**\n     * @notice The unique identifier for this token in the bridge system.\n     * @return The token ID as a bytes32 value.\n     */\n    function tokenId() external view returns (bytes32);\n\n    /**\n     * @notice Sets the messenger address for the OFT contract.\n     * @param _messenger The address of the messenger contract.\n     *\n     * @dev This function can only be called by the owner of the contract.\n     * It allows changing the messenger address to a new one.\n     */\n    function setMessenger(address _messenger) external;\n\n    /**\n     * @notice Internal function to handle the receive on the LayerZero endpoint.\n     * @param origin The origin information.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address from the src chain.\n     *  - nonce: The nonce of the LayerZero message.\n     * @param guid The unique identifier for the received LayerZero message.\n     * @param message The encoded message.\n     * @param executor The address of the executor.\n     * @param extraData Additional data.\n     *\n     * @dev This varies from the traditional lzReceive() because the OFT itself is NOT an OApp,\n     * and thus we need to validate it comes from the current Messenger contract\n     */\n    function messagingReceive(\n        Origin calldata origin,\n        bytes32 guid,\n        bytes calldata message,\n        address executor,\n        bytes calldata extraData\n    ) external;\n}\n"},{"file_path":"contracts/libs/DecimalConversions.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n/**\n * @title DecimalConversions\n * @notice Library for handling a preset decimal conversion between shared and local decimals.\n */\nlibrary DecimalConversions {\n    // @dev Sets an implicit cap on the amount of tokens,\n    // over uint64.max() will need some sort of outbound cap / totalSupply cap.\n    // Lowest common decimal denominator between chains.\n    // Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\n    // ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\n    uint8 public constant SHARED_DECIMALS = 6;\n\n    // @dev This library as is, assumes token contracts that are using it, contain 18 decimals as the local decimals\n    uint8 public constant LOCAL_DECIMALS = 18;\n\n    // @dev Provides a conversion rate between local and shared decimals.\n    uint256 public constant DECIMAL_CONVERSION_RATE = 10 ** (LOCAL_DECIMALS - SHARED_DECIMALS);\n\n    /**\n     * @notice Internal function to remove dust from the given local decimal amount.\n     * @param _amountLD The amount in local decimals.\n     * @return amountLD The amount after removing dust.\n     *\n     * @dev Prevents the loss of dust when moving amounts between chains with different decimals.\n     * @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\n     */\n    function removeDust(uint256 _amountLD) internal pure returns (uint256 amountLD) {\n        return (_amountLD / DECIMAL_CONVERSION_RATE) * DECIMAL_CONVERSION_RATE;\n    }\n\n    /**\n     * @notice Internal function to convert an amount from shared decimals into local decimals.\n     * @param _amountSD The amount in shared decimals.\n     * @return amountLD The amount in local decimals.\n     */\n    function toLD(uint64 _amountSD) internal pure returns (uint256 amountLD) {\n        return _amountSD * DECIMAL_CONVERSION_RATE;\n    }\n\n    /**\n     * @notice Internal function to convert an amount from local decimals into shared decimals.\n     * @param _amountLD The amount in local decimals.\n     * @return amountSD The amount in shared decimals.\n     */\n    function toSD(uint256 _amountLD) internal pure returns (uint64 amountSD) {\n        return uint64(_amountLD / DECIMAL_CONVERSION_RATE);\n    }\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_messenger","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes32","name":"_tokenId","type":"bytes32"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"amountSD","type":"uint256"}],"name":"AmountSDOverflowed","type":"error"},{"inputs":[{"internalType":"address","name":"actualEndpoint","type":"address"},{"internalType":"address","name":"expectedEndpoint","type":"address"}],"name":"EndpointMismatch","type":"error"},{"inputs":[],"name":"InvalidLocalDecimals","type":"error"},{"inputs":[{"internalType":"address","name":"messenger","type":"address"}],"name":"OnlyMessenger","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"}],"name":"SlippageExceeded","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"messenger","type":"address"}],"name":"MessengerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"dstEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"approvalRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpointV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"","type":"address"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"messagingReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oftVersion","outputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"},{"internalType":"uint64","name":"version","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"}],"name":"quoteOFT","outputs":[{"components":[{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"uint256","name":"maxAmountLD","type":"uint256"}],"internalType":"struct OFTLimit","name":"oftLimit","type":"tuple"},{"components":[{"internalType":"int256","name":"feeAmountLD","type":"int256"},{"internalType":"string","name":"description","type":"string"}],"internalType":"struct OFTFeeDetail[]","name":"oftFeeDetails","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"internalType":"bool","name":"_payInLzToken","type":"bool"}],"name":"quoteSend","outputs":[{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"msgFee","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"_fee","type":"tuple"},{"internalType":"address","name":"_refundAddress","type":"address"}],"name":"send","outputs":[{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"msgReceipt","type":"tuple"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_messenger","type":"address"}],"name":"setMessenger","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":"000000000000000000000000ff2baba46df92919705e60120c477ae5b7341eb30000000000000000000000004f0ca3df1c2e6b943cf82e649d576ffe7b2fabcf0c0ec8be076721e1ab53083a294d7e017a0ad57bd9d50192ef03fe2f4d5edbc7000000000000000000000000bc6d5c103a3f586e68bd475942a49d041b171c3e"}