{"file_path":"src/core/DebtTokenWithLz.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { UUPSUpgradeable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport { ERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport { IERC3156FlashBorrower } from \"@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol\";\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\nimport { IRewardManager } from \"../OSHI/interfaces/IRewardManager.sol\";\n\nimport { Utils } from \"../library/Utils.sol\";\nimport { ICoreFacet } from \"./interfaces/ICoreFacet.sol\";\nimport { IDebtToken } from \"./interfaces/IDebtToken.sol\";\nimport { ITroveManager } from \"./interfaces/ITroveManager.sol\";\n\nimport { OFTPermitUpgradeable } from \"./libs/OFTPermitUpgradeable.sol\";\n\n/**\n * @title DebtTokenWithLz\n * @dev Only deploy when LayerZero has already integrated the chain. The constructor must specify lzEndpoint.\n *      If LayerZero has not yet integrated the chain, the `./DebtToken.sol` contract must be used,\n *      and integration should be completed later using the OFT Adapter.\n * @notice DebtToken with LayerZero OFT implementation, ERC20 permit and ERC3156 Flash Loan support\n *      used for cross-chain circulation of debt tokens\n */\ncontract DebtTokenWithLz is IDebtToken, UUPSUpgradeable, OFTPermitUpgradeable {\n    // --- ERC 3156 Data ---\n    bytes32 private constant _RETURN_VALUE = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");\n    uint256 public constant FLASH_LOAN_FEE = 9; // 1 = 0.0001%\n\n    // --- Addresses ---\n    address public gasPool;\n    address public satoshiXApp;\n\n    uint256 internal _debtGasCompensation;\n\n    mapping(ITroveManager => bool) public troveManager;\n\n    // --- Auth ---\n    mapping(address => bool) public wards;\n\n    function rely(address usr) external onlyOwner {\n        wards[usr] = true;\n    }\n\n    function deny(address usr) external onlyOwner {\n        wards[usr] = false;\n    }\n\n    modifier auth() {\n        require(wards[msg.sender], \"DebtTokenWithLz: not-authorized\");\n        _;\n    }\n\n    constructor(address _lzEndpoint) OFTPermitUpgradeable(_lzEndpoint) {\n        _disableInitializers();\n    }\n\n    /// @notice Override the _authorizeUpgrade function inherited from UUPSUpgradeable contract\n    // solhint-disable-next-line no-empty-blocks\n    function _authorizeUpgrade(address newImplementation) internal view override onlyOwner {\n        // No additional authorization logic is needed for this contract\n    }\n\n    function initialize(\n        string memory _name,\n        string memory _symbol,\n        address _gasPool,\n        address _satoshiXApp,\n        address _owner,\n        uint256 debtGasCompensation_\n    )\n        external\n        initializer\n    {\n        Utils.ensureNonzeroAddress(_satoshiXApp);\n        Utils.ensureNonzeroAddress(_owner);\n        Utils.ensureNonzeroAddress(_gasPool);\n        Utils.ensureNonZero(debtGasCompensation_);\n\n        __UUPSUpgradeable_init_unchained();\n        __OFT_init(_name, _symbol, _owner);\n        __Ownable_init(_owner);\n        gasPool = _gasPool;\n        satoshiXApp = _satoshiXApp;\n        _debtGasCompensation = debtGasCompensation_;\n    }\n\n    function enableTroveManager(ITroveManager _troveManager) external {\n        require(msg.sender == satoshiXApp, \"DebtTokenWithLz: Caller not SatoshiXapp\");\n        troveManager[_troveManager] = true;\n    }\n\n    // --- Functions for intra-Satoshi calls ---\n\n    function mintWithGasCompensation(address _account, uint256 _amount) external {\n        require(msg.sender == satoshiXApp, \"DebtTokenWithLz: Caller not SatoshiXapp\");\n        _mint(_account, _amount);\n        _mint(gasPool, _debtGasCompensation);\n    }\n\n    function burnWithGasCompensation(address _account, uint256 _amount) external {\n        require(msg.sender == satoshiXApp, \"DebtTokenWithLz: Caller not SatoshiXapp\");\n        _burn(_account, _amount);\n        _burn(gasPool, _debtGasCompensation);\n    }\n\n    function mint(address _account, uint256 _amount) external {\n        require(\n            msg.sender == satoshiXApp || troveManager[ITroveManager(msg.sender)] || wards[msg.sender],\n            \"Debt: Caller not SatoshiXapp/TM/auth\"\n        );\n        _mint(_account, _amount);\n    }\n\n    function burn(address _account, uint256 _amount) external {\n        require(troveManager[ITroveManager(msg.sender)] || wards[msg.sender], \"Debt: Caller not TroveManager or auth\");\n        _burn(_account, _amount);\n    }\n\n    function sendToXApp(address _sender, uint256 _amount) external {\n        require(msg.sender == satoshiXApp, \"Debt: Caller not SatoshiXapp\");\n        _transfer(_sender, msg.sender, _amount);\n    }\n\n    function returnFromPool(address _poolAddress, address _receiver, uint256 _amount) external {\n        require(msg.sender == satoshiXApp || troveManager[ITroveManager(msg.sender)], \"Debt: Caller not TM/SatoshiXapp\");\n        _transfer(_poolAddress, _receiver, _amount);\n    }\n\n    // --- External functions ---\n\n    function transfer(address recipient, uint256 amount) public override(IDebtToken, ERC20Upgradeable) returns (bool) {\n        _requireValidRecipient(recipient);\n        return super.transfer(recipient, amount);\n    }\n\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    )\n        public\n        override(IDebtToken, ERC20Upgradeable)\n        returns (bool)\n    {\n        _requireValidRecipient(recipient);\n        return super.transferFrom(sender, recipient, amount);\n    }\n\n    function DEBT_GAS_COMPENSATION() external view returns (uint256) {\n        return _debtGasCompensation;\n    }\n\n    // --- ERC 3156 Functions ---\n\n    /**\n     * @dev Returns the maximum amount of tokens available for loan.\n     * @param token The address of the token that is requested.\n     * @return The amount of token that can be loaned.\n     */\n    function maxFlashLoan(address token) public view returns (uint256) {\n        return token == address(this) ? type(uint256).max - totalSupply() : 0;\n    }\n\n    /**\n     * @dev Returns the fee applied when doing flash loans. This function calls\n     * the {_flashFee} function which returns the fee applied when doing flash\n     * loans.\n     * @param token The token to be flash loaned.\n     * @param amount The amount of tokens to be loaned.\n     * @return The fees applied to the corresponding flash loan.\n     */\n    function flashFee(address token, uint256 amount) external view returns (uint256) {\n        return token == address(this) ? _flashFee(amount) : 0;\n    }\n\n    /**\n     * @dev Returns the fee applied when doing flash loans. By default this\n     * implementation has 0 fees. This function can be overloaded to make\n     * the flash loan mechanism deflationary.\n     * @param amount The amount of tokens to be loaned.\n     * @return The fees applied to the corresponding flash loan.\n     */\n    function _flashFee(uint256 amount) internal pure returns (uint256) {\n        return (amount * FLASH_LOAN_FEE) / 10_000;\n    }\n\n    /**\n     * @dev Performs a flash loan. New tokens are minted and sent to the\n     * `receiver`, who is required to implement the {IERC3156FlashBorrower}\n     * interface. By the end of the flash loan, the receiver is expected to own\n     * amount + fee tokens and have them approved back to the token contract itself so\n     * they can be burned.\n     * @param receiver The receiver of the flash loan. Should implement the\n     * {IERC3156FlashBorrower-onFlashLoan} interface.\n     * @param token The token to be flash loaned. Only `address(this)` is\n     * supported.\n     * @param amount The amount of tokens to be loaned.\n     * @param data An arbitrary datafield that is passed to the receiver.\n     * @return `true` if the flash loan was successful.\n     */\n    // This function can reenter, but it doesn't pose a risk because it always preserves the property that the amount\n    // minted at the beginning is always recovered and burned at the end, or else the entire function will revert.\n    // slither-disable-next-line reentrancy-no-eth\n    function flashLoan(\n        IERC3156FlashBorrower receiver,\n        address token,\n        uint256 amount,\n        bytes calldata data\n    )\n        external\n        returns (bool)\n    {\n        require(token == address(this), \"ERC20FlashMint: wrong token\");\n        require(amount <= maxFlashLoan(token), \"ERC20FlashMint: amount exceeds maxFlashLoan\");\n        uint256 fee = _flashFee(amount);\n        _mint(address(receiver), amount);\n        require(\n            receiver.onFlashLoan(msg.sender, token, amount, fee, data) == _RETURN_VALUE,\n            \"ERC20FlashMint: invalid return value\"\n        );\n        _spendAllowance(address(receiver), address(this), amount + fee);\n        _burn(address(receiver), amount);\n\n        address rewardManager = address(ICoreFacet(satoshiXApp).rewardManager());\n        _transfer(address(receiver), address(this), fee);\n        _approve(address(this), rewardManager, fee);\n        IRewardManager(rewardManager).increaseSATPerUintStaked(fee);\n        return true;\n    }\n\n    // --- 'require' functions ---\n\n    function _requireValidRecipient(address _recipient) internal view {\n        require(\n            _recipient != address(0) && _recipient != address(this),\n            \"Debt: Cannot transfer tokens directly to the Debt token contract or the zero address\"\n        );\n        // NOTE: it is not allowing transfers to the SatoshiXApp or TroveManager contracts, if needed, only use sendToXApp or returnFromPool functions\n        require(\n            _recipient != satoshiXApp && !troveManager[ITroveManager(_recipient)],\n            \"Debt: Cannot transfer tokens directly to the SatoshiXApp or TroveManager\"\n        );\n    }\n}\n","deployed_bytecode":"0x6080604052600436106103df575f3560e01c806382413eac116101ff578063b98bd07011610113578063d4243885116100a8578063edf3e29e11610078578063edf3e29e14610bfd578063f2fde38b14610c1c578063fa08b03814610c3b578063fc0c546a146106ac578063ff7bd03d14610c59575f80fd5b8063d424388514610b81578063d505accf14610ba0578063d9d98ce414610bbf578063dd62ed3e14610bde575f80fd5b8063bf353dbb116100e3578063bf353dbb14610b00578063c7c7f5b314610b2e578063ca5eb5e114610b4f578063d045a0dc14610b6e575f80fd5b8063b98bd07014610a72578063bb0b6a5314610a91578063bc70b35414610ace578063bd815db014610aed575f80fd5b8063963efcaa11610194578063a49d399311610164578063a49d3993146109c2578063a9059cbb146109f0578063ad3cb1cc14610a0f578063b731ea0a14610a3f578063b76b0c0814610a53575f80fd5b8063963efcaa1461093f5780639c52a7f1146109725780639dc29fac146109915780639f68b964146109b0575f80fd5b80638cff5fbe116101cf5780638cff5fbe146108e45780638da5cb5b146109035780638ffaacaa1461091757806395d89b411461092b575f80fd5b806382413eac1461086c57806384b0196e1461088b57806385177509146108b2578063857749b0146108d1575f80fd5b80633b6f743b116102f65780635cffe9de1161028b5780636fc1b31e1161025b5780636fc1b31e146107c257806370a08231146107e1578063715018a6146108005780637d25a05e146108145780637ecebe001461084d575f80fd5b80635cffe9de146107325780635e280f1114610751578063613255ab1461078457806365fae35e146107a3575f80fd5b806352ae2879116102c657806352ae2879146106ac57806352d1902d146106be5780635535d461146106d25780635a0dfe4d146106f1575f80fd5b80633b6f743b1461063a57806340c10f19146106665780634ba4a28b146106855780634f1ef28614610699575f80fd5b806317442b701161037757806320c582be1161034757806320c582be146105a857806323b872dd146105c7578063313ce567146105e65780633400288b146106075780633644e51514610626575f80fd5b806317442b701461051757806317dd676d1461053857806318160ddd146105575780631f5e133414610594575f80fd5b806313137d65116103b257806313137d6514610496578063134d4f25146104ab578063136db03a146104d2578063156a0d0f146104f1575f80fd5b806306fdde03146103e3578063095ea7b31461040d5780630d35b4151461043c578063111ecdad1461046a575b5f80fd5b3480156103ee575f80fd5b506103f7610c78565b6040516104049190613ced565b60405180910390f35b348015610418575f80fd5b5061042c610427366004613d13565b610d1d565b6040519015158152602001610404565b348015610447575f80fd5b5061045b610456366004613d53565b610d36565b60405161040493929190613d84565b348015610475575f80fd5b5061047e610e01565b6040516001600160a01b039091168152602001610404565b6104a96104a4366004613e6f565b610e35565b005b3480156104b6575f80fd5b506104bf600281565b60405161ffff9091168152602001610404565b3480156104dd575f80fd5b506104a96104ec366004613d13565b610ef5565b3480156104fc575f80fd5b506040805162b9270b60e21b81526001602082015201610404565b348015610522575f80fd5b5060408051600181526002602082015201610404565b348015610543575f80fd5b506104a9610552366004613f07565b610f5e565b348015610562575f80fd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02545b604051908152602001610404565b34801561059f575f80fd5b506104bf600181565b3480156105b3575f80fd5b506104a96105c2366004613f22565b610fab565b3480156105d2575f80fd5b5061042c6105e1366004613f22565b61102e565b3480156105f1575f80fd5b5060125b60405160ff9091168152602001610404565b348015610612575f80fd5b506104a9610621366004613f78565b61104d565b348015610631575f80fd5b506105866110b8565b348015610645575f80fd5b50610659610654366004613f9f565b6110c6565b6040516104049190613fed565b348015610671575f80fd5b506104a9610680366004613d13565b61112a565b348015610690575f80fd5b50600254610586565b6104a96106a73660046140d1565b6111cc565b3480156106b7575f80fd5b503061047e565b3480156106c9575f80fd5b506105866111e7565b3480156106dd575f80fd5b506103f76106ec366004614141565b611202565b3480156106fc575f80fd5b5061042c61070b366004613f78565b63ffffffff919091165f9081525f80516020614f4f83398151915260205260409020541490565b34801561073d575f80fd5b5061042c61074c366004614172565b6112da565b34801561075c575f80fd5b5061047e7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c81565b34801561078f575f80fd5b5061058661079e366004613f07565b6115aa565b3480156107ae575f80fd5b506104a96107bd366004613f07565b6115ee565b3480156107cd575f80fd5b506104a96107dc366004613f07565b611619565b3480156107ec575f80fd5b506105866107fb366004613f07565b611695565b34801561080b575f80fd5b506104a96116c5565b34801561081f575f80fd5b5061083561082e366004613f78565b5f92915050565b6040516001600160401b039091168152602001610404565b348015610858575f80fd5b50610586610867366004613f07565b6116d8565b348015610877575f80fd5b5061042c6108863660046141df565b6116e2565b348015610896575f80fd5b5061089f6116f7565b6040516104049796959493929190614241565b3480156108bd575f80fd5b506104a96108cc366004613d13565b6117a0565b3480156108dc575f80fd5b5060066105f5565b3480156108ef575f80fd5b506104a96108fe366004613d13565b6117ec565b34801561090e575f80fd5b5061047e611838565b348015610922575f80fd5b50610586600981565b348015610936575f80fd5b506103f7611860565b34801561094a575f80fd5b506105867f000000000000000000000000000000000000000000000000000000e8d4a5100081565b34801561097d575f80fd5b506104a961098c366004613f07565b61189e565b34801561099c575f80fd5b506104a96109ab366004613d13565b6118c6565b3480156109bb575f80fd5b505f61042c565b3480156109cd575f80fd5b5061042c6109dc366004613f07565b60036020525f908152604090205460ff1681565b3480156109fb575f80fd5b5061042c610a0a366004613d13565b611955565b348015610a1a575f80fd5b506103f7604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610a4a575f80fd5b5061047e611969565b348015610a5e575f80fd5b5060015461047e906001600160a01b031681565b348015610a7d575f80fd5b506104a9610a8c366004614318565b611991565b348015610a9c575f80fd5b50610586610aab366004614356565b63ffffffff165f9081525f80516020614f4f833981519152602052604090205490565b348015610ad9575f80fd5b506103f7610ae836600461436f565b611b0d565b6104a9610afb366004614318565b611c9d565b348015610b0b575f80fd5b5061042c610b1a366004613f07565b60046020525f908152604090205460ff1681565b610b41610b3c3660046143cb565b611e29565b604051610404929190614433565b348015610b5a575f80fd5b506104a9610b69366004613f07565b611f21565b6104a9610b7c366004613e6f565b611fa2565b348015610b8c575f80fd5b506104a9610b9b366004613f07565b611fd1565b348015610bab575f80fd5b506104a9610bba366004614484565b612045565b348015610bca575f80fd5b50610586610bd9366004613d13565b61219a565b348015610be9575f80fd5b50610586610bf83660046144f5565b6121ba565b348015610c08575f80fd5b506104a9610c1736600461453f565b612203565b348015610c27575f80fd5b506104a9610c36366004613f07565b61237f565b348015610c46575f80fd5b505f5461047e906001600160a01b031681565b348015610c64575f80fd5b5061042c610c733660046145de565b6123bc565b60605f5f80516020614f2f8339815191525b9050806003018054610c9b906145f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc7906145f8565b8015610d125780601f10610ce957610100808354040283529160200191610d12565b820191905f5260205f20905b815481529060010190602001808311610cf557829003601f168201915b505050505091505090565b5f33610d2a8185856123d9565b60019150505b92915050565b604080518082019091525f80825260208201526060610d6660405180604001604052805f81526020015f81525090565b6040805180820182525f8082526001600160401b03602080840182905284518381529081019094529195509182610dbf565b604080518082019091525f815260606020820152815260200190600190039081610d985790505b5093505f80610de3604089013560608a0135610dde60208c018c614356565b6123e6565b60408051808201909152918252602082015296989597505050505050565b5f807f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c005b546001600160a01b031692915050565b7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b03163314610e85576040516391ac5e4f60e01b81523360048201526024015b60405180910390fd5b60208701803590610e9f90610e9a908a614356565b612429565b14610edd57610eb16020880188614356565b60405163309afaf360e21b815263ffffffff909116600482015260208801356024820152604401610e7c565b610eec87878787878787612472565b50505050505050565b6001546001600160a01b03163314610f4f5760405162461bcd60e51b815260206004820152601c60248201527f446562743a2043616c6c6572206e6f74205361746f73686958617070000000006044820152606401610e7c565b610f5a8233836125d0565b5050565b6001546001600160a01b03163314610f885760405162461bcd60e51b8152600401610e7c9061462a565b6001600160a01b03165f908152600360205260409020805460ff19166001179055565b6001546001600160a01b0316331480610fd25750335f9081526003602052604090205460ff165b61101e5760405162461bcd60e51b815260206004820152601f60248201527f446562743a2043616c6c6572206e6f7420544d2f5361746f73686958617070006044820152606401610e7c565b6110298383836125d0565b505050565b5f6110388361262d565b611043848484612796565b90505b9392505050565b6110556127b9565b63ffffffff82165f8181525f80516020614f4f833981519152602081815260409283902085905582519384528301849052917f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91015b60405180910390a1505050565b5f6110c16127eb565b905090565b604080518082019091525f80825260208201525f6110f460408501356060860135610dde6020880188614356565b9150505f8061110386846127f4565b90925090506111206111186020880188614356565b838388612934565b9695505050505050565b6001546001600160a01b03163314806111515750335f9081526003602052604090205460ff165b8061116a5750335f9081526004602052604090205460ff165b6111c25760405162461bcd60e51b8152602060048201526024808201527f446562743a2043616c6c6572206e6f74205361746f736869586170702f544d2f6044820152630c2eae8d60e31b6064820152608401610e7c565b610f5a8282612a12565b6111d4612a46565b6111dd82612aea565b610f5a8282612af2565b5f6111f0612bae565b505f80516020614f8f83398151915290565b63ffffffff82165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff8616855290915290912080546060929190611255906145f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611281906145f8565b80156112cc5780601f106112a3576101008083540402835291602001916112cc565b820191905f5260205f20905b8154815290600101906020018083116112af57829003601f168201915b505050505091505092915050565b5f6001600160a01b03851630146113335760405162461bcd60e51b815260206004820152601b60248201527f4552433230466c6173684d696e743a2077726f6e6720746f6b656e00000000006044820152606401610e7c565b61133c856115aa565b84111561139f5760405162461bcd60e51b815260206004820152602b60248201527f4552433230466c6173684d696e743a20616d6f756e742065786365656473206d60448201526a30bc233630b9b42637b0b760a91b6064820152608401610e7c565b5f6113a985612bf7565b90506113b58786612a12565b6040516323e30c8b60e01b81527f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9906001600160a01b038916906323e30c8b9061140d9033908b908b9088908c908c90600401614699565b6020604051808303815f875af1158015611429573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061144d91906146df565b146114a65760405162461bcd60e51b8152602060048201526024808201527f4552433230466c6173684d696e743a20696e76616c69642072657475726e2076604482015263616c756560e01b6064820152608401610e7c565b6114ba87306114b5848961470a565b612c10565b6114c48786612c73565b600154604080516307a77c5360e11b815290515f926001600160a01b031691630f4ef8a69160048083019260209291908290030181865afa15801561150b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061152f919061471d565b905061153c8830846125d0565b6115473082846123d9565b60405163d053316f60e01b8152600481018390526001600160a01b0382169063d053316f906024015f604051808303815f87803b158015611586575f80fd5b505af1158015611598573d5f803e3d5ffd5b5060019b9a5050505050505050505050565b5f6001600160a01b03821630146115c1575f610d30565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254610d30905f19614738565b6115f66127b9565b6001600160a01b03165f908152600460205260409020805460ff19166001179055565b6116216127b9565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c0080546001600160a01b0319166001600160a01b03831690811782556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a15050565b5f805f80516020614f2f8339815191525b6001600160a01b039093165f9081526020939093525050604090205490565b6116cd6127b9565b6116d65f612ca7565b565b5f610d3082612d17565b6001600160a01b03811630145b949350505050565b5f60608082808083815f80516020614f6f833981519152805490915015801561172257506001810154155b6117665760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610e7c565b61176e612d3f565b611776612d7d565b604080515f80825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6001546001600160a01b031633146117ca5760405162461bcd60e51b8152600401610e7c9061462a565b6117d48282612c73565b5f54600254610f5a916001600160a01b031690612c73565b6001546001600160a01b031633146118165760405162461bcd60e51b8152600401610e7c9061462a565b6118208282612a12565b5f54600254610f5a916001600160a01b031690612a12565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300610e25565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060915f80516020614f2f83398151915291610c9b906145f8565b6118a66127b9565b6001600160a01b03165f908152600460205260409020805460ff19169055565b335f9081526003602052604090205460ff16806118f15750335f9081526004602052604090205460ff165b61194b5760405162461bcd60e51b815260206004820152602560248201527f446562743a2043616c6c6572206e6f742054726f76654d616e61676572206f72604482015264040c2eae8d60db1b6064820152608401610e7c565b610f5a8282612c73565b5f61195f8361262d565b6110468383612d93565b5f807fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b600610e25565b6119996127b9565b7f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00005f5b82811015611adb576119fe8484838181106119d9576119d961474b565b90506020028101906119eb919061475f565b6119f990604081019061477d565b612da0565b838382818110611a1057611a1061474b565b9050602002810190611a22919061475f565b611a3090604081019061477d565b835f878786818110611a4457611a4461474b565b9050602002810190611a56919061475f565b611a64906020810190614356565b63ffffffff1663ffffffff1681526020019081526020015f205f878786818110611a9057611a9061474b565b9050602002810190611aa2919061475f565b611ab39060408101906020016147bf565b61ffff16815260208101919091526040015f2091611ad291908361481c565b506001016119bc565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b67483836040516110ab9291906148d5565b63ffffffff84165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff88168552909152822080546060939190611b5f906145f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611b8b906145f8565b8015611bd65780601f10611bad57610100808354040283529160200191611bd6565b820191905f5260205f20905b815481529060010190602001808311611bb957829003601f168201915b5050505050905080515f03611c255784848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152509295506116ef945050505050565b5f849003611c365791506116ef9050565b60028410611c8057611c488585612da0565b80611c5685600281896149b4565b604051602001611c68939291906149db565b604051602081830303815290604052925050506116ef565b8484604051639a6d49cd60e01b8152600401610e7c929190614a01565b5f5b81811015611dac5736838383818110611cba57611cba61474b565b9050602002810190611ccc9190614a14565b9050611d0a611cde6020830183614356565b602083013563ffffffff919091165f9081525f80516020614f4f83398151915260205260409020541490565b611d145750611da4565b3063d045a0dc60c08301358360a0810135611d3361010083018361477d565b611d44610100890160e08a01613f07565b611d526101208a018a61477d565b6040518963ffffffff1660e01b8152600401611d749796959493929190614a3d565b5f604051808303818588803b158015611d8b575f80fd5b505af1158015611d9d573d5f803e3d5ffd5b5050505050505b600101611c9f565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b81526004015f60405180830381865afa158015611de8573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e0f9190810190614ac2565b604051638351eea760e01b8152600401610e7c9190613ced565b611e31613c5d565b604080518082019091525f80825260208201525f80611e6633604089013560608a0135611e6160208c018c614356565b612de1565b915091505f80611e7689846127f4565b9092509050611ea2611e8b60208b018b614356565b8383611e9c368d90038d018d614b2a565b8b612e06565b60408051808201909152858152602080820186905282519298509096503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a90611ef0908d018d614356565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b611f296127b9565b60405163ca5eb5e160e01b81526001600160a01b0382811660048301527f0000000000000000000000001a44076050125825900e736c501f859c50fe728c169063ca5eb5e1906024015f604051808303815f87803b158015611f89575f80fd5b505af1158015611f9b573d5f803e3d5ffd5b5050505050565b333014611fc25760405163029a949d60e31b815260040160405180910390fd5b610eec87878787878787610edd565b611fd96127b9565b7fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b60080546001600160a01b0319166001600160a01b03831690811782556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001611689565b834211156120695760405163313c898160e11b815260048101859052602401610e7c565b5f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886120d38c6001600160a01b03165f9081527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006020526040902080546001810190915590565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090505f61212d82612f0c565b90505f61213c82878787612f38565b9050896001600160a01b0316816001600160a01b031614612183576040516325c0072360e11b81526001600160a01b0380831660048301528b166024820152604401610e7c565b61218e8a8a8a6123d9565b50505050505050505050565b5f6001600160a01b03831630146121b1575f611046565b61104682612bf7565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156122475750825b90505f826001600160401b031660011480156122625750303b155b905081158015612270575080155b1561228e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156122b857845460ff60401b1916600160401b1785555b6122c188612f64565b6122ca87612f64565b6122d389612f64565b6122dc86612f8b565b6122e4612fab565b6122ef8b8b89612fb3565b6122f887612fd7565b5f80546001600160a01b03808c166001600160a01b03199283161790925560018054928b16929091169190911790556002869055831561237257845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050505050565b6123876127b9565b6001600160a01b0381166123b057604051631e4fbdf760e01b81525f6004820152602401610e7c565b6123b981612ca7565b50565b5f602082018035906123d290610aab9085614356565b1492915050565b6110298383836001612fe8565b5f806123f1856130cb565b915081905083811015612421576040516371c4efed60e01b81526004810182905260248101859052604401610e7c565b935093915050565b63ffffffff81165f9081525f80516020614f4f83398151915260208190526040822054806110465760405163f6ff4fb760e01b815263ffffffff85166004820152602401610e7c565b5f6124836124808787613101565b90565b90505f6124ae8261249c6124978a8a613118565b61313a565b6124a960208d018d614356565b61316e565b9050602886111561256e575f6124ea6124cd60608c0160408d01614b5a565b6124da60208d018d614356565b846124e58c8c613195565b6131df565b604051633e5ac80960e11b81529091506001600160a01b037f0000000000000000000000001a44076050125825900e736c501f859c50fe728c1690637cb590129061253f9086908d905f908790600401614b75565b5f604051808303815f87803b158015612556575f80fd5b505af1158015612568573d5f803e3d5ffd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c6125a760208d018d614356565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b6001600160a01b0383166125f957604051634b637e8f60e11b81525f6004820152602401610e7c565b6001600160a01b0382166126225760405163ec442f0560e01b81525f6004820152602401610e7c565b611029838383613211565b6001600160a01b0381161580159061264e57506001600160a01b0381163014155b6126dd5760405162461bcd60e51b815260206004820152605460248201527f446562743a2043616e6e6f74207472616e7366657220746f6b656e732064697260448201527f6563746c7920746f20746865204465627420746f6b656e20636f6e7472616374606482015273206f7220746865207a65726f206164647265737360601b608482015260a401610e7c565b6001546001600160a01b0382811691161480159061271357506001600160a01b0381165f9081526003602052604090205460ff16155b6123b95760405162461bcd60e51b815260206004820152604860248201527f446562743a2043616e6e6f74207472616e7366657220746f6b656e732064697260448201527f6563746c7920746f20746865205361746f73686958417070206f722054726f7660648201526732a6b0b730b3b2b960c11b608482015260a401610e7c565b5f336127a3858285612c10565b6127ae8585856125d0565b506001949350505050565b336127c2611838565b6001600160a01b0316146116d65760405163118cdaa760e01b8152336004820152602401610e7c565b5f6110c161334a565b6060805f61284f8560200135612809866133bd565b61281660a089018961477d565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506133e892505050565b90935090505f81612861576001612864565b60025b90506128846128766020880188614356565b82610ae860808a018a61477d565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c008054919450906001600160a01b031680156129295760405163043a78eb60e01b81526001600160a01b0382169063043a78eb906128e89089908990600401614ba5565b602060405180830381865afa158015612903573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129279190614bc9565b505b505050509250929050565b604080518082019091525f80825260208201527f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b031663ddc28c586040518060a001604052808863ffffffff16815260200161299689612429565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b81526004016129cb929190614be4565b6040805180830381865afa1580156129e5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612a099190614c8a565b95945050505050565b6001600160a01b038216612a3b5760405163ec442f0560e01b81525f6004820152602401610e7c565b610f5a5f8383613211565b306001600160a01b037f000000000000000000000000256bd26fddc17a1d1a9b974bcd268f89bfe15789161480612acc57507f000000000000000000000000256bd26fddc17a1d1a9b974bcd268f89bfe157896001600160a01b0316612ac05f80516020614f8f833981519152546001600160a01b031690565b6001600160a01b031614155b156116d65760405163703e46dd60e11b815260040160405180910390fd5b6123b96127b9565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612b4c575060408051601f3d908101601f19168201909252612b49918101906146df565b60015b612b7457604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610e7c565b5f80516020614f8f8339815191528114612ba457604051632a87526960e21b815260048101829052602401610e7c565b6110298383613462565b306001600160a01b037f000000000000000000000000256bd26fddc17a1d1a9b974bcd268f89bfe1578916146116d65760405163703e46dd60e11b815260040160405180910390fd5b5f612710612c06600984614ca4565b610d309190614cbb565b5f612c1b84846121ba565b90505f198114612c6d5781811015612c5f57604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610e7c565b612c6d84848484035f612fe8565b50505050565b6001600160a01b038216612c9c57604051634b637e8f60e11b81525f6004820152602401610e7c565b610f5a825f83613211565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f807f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006116a6565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10280546060915f80516020614f6f83398151915291610c9b906145f8565b60605f5f80516020614f6f833981519152610c8a565b5f33610d2a8185856125d0565b5f612dae60028284866149b4565b612db791614cda565b60f01c905060038114611029578282604051639a6d49cd60e01b8152600401610e7c929190614a01565b5f80612dee8585856123e6565b9092509050612dfd8683612c73565b94509492505050565b612e0e613c5d565b5f612e1b845f01516134b7565b602085015190915015612e3557612e3584602001516134de565b7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001612e858c612429565b81526020018a81526020018981526020015f8960200151111515815250866040518463ffffffff1660e01b8152600401612ec0929190614be4565b60806040518083038185885af1158015612edc573d5f803e3d5ffd5b50505050506040513d601f19601f82011682018060405250810190612f019190614d0a565b979650505050505050565b5f610d30612f186127eb565b8360405161190160f01b8152600281019290925260228201526042902090565b5f805f80612f48888888886135bd565b925092509250612f588282613685565b50909695505050505050565b6001600160a01b0381166123b95760405163d92e233d60e01b815260040160405180910390fd5b805f036123b957604051637c946ed760e01b815260040160405180910390fd5b6116d661373d565b612fbb61373d565b612fc58383613786565b612fce83613798565b611029816137c3565b612fdf61373d565b6123b9816137e4565b5f80516020614f2f8339815191526001600160a01b03851661301f5760405163e602df0560e01b81525f6004820152602401610e7c565b6001600160a01b03841661304857604051634a1406b160e11b81525f6004820152602401610e7c565b6001600160a01b038086165f90815260018301602090815260408083209388168352929052208390558115611f9b57836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516130bc91815260200190565b60405180910390a35050505050565b5f7f000000000000000000000000000000000000000000000000000000e8d4a510006130f78184614cbb565b610d309190614ca4565b5f61310f60208284866149b4565b61104691614d6f565b5f6131276028602084866149b4565b61313091614d8c565b60c01c9392505050565b5f610d307f000000000000000000000000000000000000000000000000000000e8d4a510006001600160401b038416614ca4565b5f6001600160a01b0384166131835761dead93505b61318d8484612a12565b509092915050565b60606131a482602881866149b4565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250929695505050505050565b6060848484846040516020016131f89493929190614dba565b6040516020818303038152906040529050949350505050565b5f80516020614f2f8339815191526001600160a01b03841661324b5781816002015f828254613240919061470a565b909155506132bb9050565b6001600160a01b0384165f908152602082905260409020548281101561329d5760405163391434e360e21b81526001600160a01b03861660048201526024810182905260448101849052606401610e7c565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b0383166132d95760028101805483900390556132f7565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161333c91815260200190565b60405180910390a350505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133746137ec565b61337c613854565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f610d307f000000000000000000000000000000000000000000000000000000e8d4a5100083614cbb565b805160609015158061343157848460405160200161341d92919091825260c01b6001600160c01b031916602082015260280190565b604051602081830303815290604052613458565b848433856040516020016134489493929190614e08565b6040516020818303038152906040525b9150935093915050565b61346b82613896565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156134af5761102982826138f9565b610f5a613962565b5f8134146134da576040516304fb820960e51b8152346004820152602401610e7c565b5090565b5f7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa15801561353b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061355f919061471d565b90506001600160a01b038116613588576040516329b99a9560e11b815260040160405180910390fd5b610f5a6001600160a01b038216337f0000000000000000000000001a44076050125825900e736c501f859c50fe728c85613981565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156135f657505f9150600390508261367b565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613647573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b03811661367257505f92506001915082905061367b565b92505f91508190505b9450945094915050565b5f82600381111561369857613698614e4a565b036136a1575050565b60018260038111156136b5576136b5614e4a565b036136d35760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156136e7576136e7614e4a565b036137085760405163fce698f760e01b815260048101829052602401610e7c565b600382600381111561371c5761371c614e4a565b03610f5a576040516335e2f38360e21b815260048101829052602401610e7c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166116d657604051631afcd79f60e31b815260040160405180910390fd5b61378e61373d565b610f5a82826139db565b6137a061373d565b6123b981604051806040016040528060018152602001603160f81b815250613a2b565b6137cb61373d565b6137d481613a8a565b6137dc612fab565b6123b9612fab565b61238761373d565b5f5f80516020614f6f83398151915281613804612d3f565b80519091501561381c57805160209091012092915050565b8154801561382b579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b5f5f80516020614f6f8339815191528161386c612d7d565b80519091501561388457805160209091012092915050565b6001820154801561382b579392505050565b806001600160a01b03163b5f036138cb57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610e7c565b5f80516020614f8f83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516139159190614e5e565b5f60405180830381855af49150503d805f811461394d576040519150601f19603f3d011682016040523d82523d5f602084013e613952565b606091505b5091509150612a09858383613a9b565b34156116d65760405163b398979f60e01b815260040160405180910390fd5b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612c6d908590613af7565b6139e361373d565b5f80516020614f2f8339815191527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03613a1c8482614e6f565b5060048101612c6d8382614e6f565b613a3361373d565b5f80516020614f6f8339815191527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102613a6c8482614e6f565b5060038101613a7b8382614e6f565b505f8082556001909101555050565b613a9261373d565b6137d481613b58565b606082613ab057613aab82613b69565b611046565b8151158015613ac757506001600160a01b0384163b155b15613af057604051639996b31560e01b81526001600160a01b0385166004820152602401610e7c565b5080611046565b5f613b0b6001600160a01b03841683613b92565b905080515f14158015613b2f575080806020019051810190613b2d9190614bc9565b155b1561102957604051635274afe760e01b81526001600160a01b0384166004820152602401610e7c565b613b6061373d565b6123b981613b9f565b805115613b795780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b606061104683835f613bce565b613ba761373d565b6001600160a01b038116611f2957604051632d618d8160e21b815260040160405180910390fd5b606081471015613bf35760405163cd78605960e01b8152306004820152602401610e7c565b5f80856001600160a01b03168486604051613c0e9190614e5e565b5f6040518083038185875af1925050503d805f8114613c48576040519150601f19603f3d011682016040523d82523d5f602084013e613c4d565b606091505b5091509150611120868383613a9b565b60405180606001604052805f80191681526020015f6001600160401b03168152602001613c9b60405180604001604052805f81526020015f81525090565b905290565b5f5b83811015613cba578181015183820152602001613ca2565b50505f910152565b5f8151808452613cd9816020860160208601613ca0565b601f01601f19169290920160200192915050565b602081525f6110466020830184613cc2565b6001600160a01b03811681146123b9575f80fd5b5f8060408385031215613d24575f80fd5b8235613d2f81613cff565b946020939093013593505050565b5f60e08284031215613d4d575f80fd5b50919050565b5f60208284031215613d63575f80fd5b81356001600160401b03811115613d78575f80fd5b6116ef84828501613d3d565b83518152602080850151908201525f60a08201604060a0604085015281865180845260c08601915060c08160051b870101935060208089015f5b83811015613dfd5788870360bf19018552815180518852830151838801879052613dea87890182613cc2565b9750509382019390820190600101613dbe565b505087516060880152505050602085015160808501525090506116ef565b5f60608284031215613d4d575f80fd5b5f8083601f840112613e3b575f80fd5b5081356001600160401b03811115613e51575f80fd5b602083019150836020828501011115613e68575f80fd5b9250929050565b5f805f805f805f60e0888a031215613e85575f80fd5b613e8f8989613e1b565b96506060880135955060808801356001600160401b0380821115613eb1575f80fd5b613ebd8b838c01613e2b565b909750955060a08a01359150613ed282613cff565b90935060c08901359080821115613ee7575f80fd5b50613ef48a828b01613e2b565b989b979a50959850939692959293505050565b5f60208284031215613f17575f80fd5b813561104681613cff565b5f805f60608486031215613f34575f80fd5b8335613f3f81613cff565b92506020840135613f4f81613cff565b929592945050506040919091013590565b803563ffffffff81168114613f73575f80fd5b919050565b5f8060408385031215613f89575f80fd5b613d2f83613f60565b80151581146123b9575f80fd5b5f8060408385031215613fb0575f80fd5b82356001600160401b03811115613fc5575f80fd5b613fd185828601613d3d565b9250506020830135613fe281613f92565b809150509250929050565b815181526020808301519082015260408101610d30565b634e487b7160e01b5f52604160045260245ffd5b604080519081016001600160401b038111828210171561403a5761403a614004565b60405290565b604051601f8201601f191681016001600160401b038111828210171561406857614068614004565b604052919050565b5f6001600160401b0382111561408857614088614004565b50601f01601f191660200190565b5f6140a86140a384614070565b614040565b90508281528383830111156140bb575f80fd5b828260208301375f602084830101529392505050565b5f80604083850312156140e2575f80fd5b82356140ed81613cff565b915060208301356001600160401b03811115614107575f80fd5b8301601f81018513614117575f80fd5b61412685823560208401614096565b9150509250929050565b803561ffff81168114613f73575f80fd5b5f8060408385031215614152575f80fd5b61415b83613f60565b915061416960208401614130565b90509250929050565b5f805f805f60808688031215614186575f80fd5b853561419181613cff565b945060208601356141a181613cff565b93506040860135925060608601356001600160401b038111156141c2575f80fd5b6141ce88828901613e2b565b969995985093965092949392505050565b5f805f8060a085870312156141f2575f80fd5b6141fc8686613e1b565b935060608501356001600160401b03811115614216575f80fd5b61422287828801613e2b565b909450925050608085013561423681613cff565b939692955090935050565b60ff60f81b881681525f602060e0602084015261426160e084018a613cc2565b8381036040850152614273818a613cc2565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825260208088019350909101905f5b818110156142c6578351835292840192918401916001016142aa565b50909c9b505050505050505050505050565b5f8083601f8401126142e8575f80fd5b5081356001600160401b038111156142fe575f80fd5b6020830191508360208260051b8501011115613e68575f80fd5b5f8060208385031215614329575f80fd5b82356001600160401b0381111561433e575f80fd5b61434a858286016142d8565b90969095509350505050565b5f60208284031215614366575f80fd5b61104682613f60565b5f805f8060608587031215614382575f80fd5b61438b85613f60565b935061439960208601614130565b925060408501356001600160401b038111156143b3575f80fd5b6143bf87828801613e2b565b95989497509550505050565b5f805f83850360808112156143de575f80fd5b84356001600160401b038111156143f3575f80fd5b6143ff87828801613d3d565b9450506040601f1982011215614413575f80fd5b50602084019150606084013561442881613cff565b809150509250925092565b5f60c082019050835182526001600160401b036020850151166020830152604084015161446d604084018280518252602090810151910152565b5082516080830152602083015160a0830152611046565b5f805f805f805f60e0888a03121561449a575f80fd5b87356144a581613cff565b965060208801356144b581613cff565b95506040880135945060608801359350608088013560ff811681146144d8575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215614506575f80fd5b823561451181613cff565b91506020830135613fe281613cff565b5f82601f830112614530575f80fd5b61104683833560208501614096565b5f805f805f8060c08789031215614554575f80fd5b86356001600160401b038082111561456a575f80fd5b6145768a838b01614521565b9750602089013591508082111561458b575f80fd5b5061459889828a01614521565b95505060408701356145a981613cff565b935060608701356145b981613cff565b925060808701356145c981613cff565b8092505060a087013590509295509295509295565b5f606082840312156145ee575f80fd5b6110468383613e1b565b600181811c9082168061460c57607f821691505b602082108103613d4d57634e487b7160e01b5f52602260045260245ffd5b60208082526027908201527f44656274546f6b656e576974684c7a3a2043616c6c6572206e6f74205361746f6040820152660736869586170760cc1b606082015260800190565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a0608082018190525f906146d39083018486614671565b98975050505050505050565b5f602082840312156146ef575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610d3057610d306146f6565b5f6020828403121561472d575f80fd5b815161104681613cff565b81810381811115610d3057610d306146f6565b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112614773575f80fd5b9190910192915050565b5f808335601e19843603018112614792575f80fd5b8301803591506001600160401b038211156147ab575f80fd5b602001915036819003821315613e68575f80fd5b5f602082840312156147cf575f80fd5b61104682614130565b601f82111561102957805f5260205f20601f840160051c810160208510156147fd5750805b601f840160051c820191505b81811015611f9b575f8155600101614809565b6001600160401b0383111561483357614833614004565b6148478361484183546145f8565b836147d8565b5f601f841160018114614878575f85156148615750838201355b5f19600387901b1c1916600186901b178355611f9b565b5f83815260208120601f198716915b828110156148a75786850135825560209485019460019092019101614887565b50868210156148c3575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082528181018390525f906040808401600586901b8501820187855b888110156149a657878303603f190184528135368b9003605e19018112614918575f80fd5b8a01606063ffffffff61492a83613f60565b16855261ffff61493b898401614130565b168886015286820135601e19833603018112614955575f80fd5b9091018781019190356001600160401b03811115614971575f80fd5b80360383131561497f575f80fd5b81888701526149918287018285614671565b968901969550505091860191506001016148f3565b509098975050505050505050565b5f80858511156149c2575f80fd5b838611156149ce575f80fd5b5050820193919092039150565b5f84516149ec818460208901613ca0565b8201838582375f930192835250909392505050565b602081525f611043602083018486614671565b5f823561013e19833603018112614773575f80fd5b6001600160401b03811681146123b9575f80fd5b63ffffffff614a4b89613f60565b168152602088013560208201525f6040890135614a6781614a29565b6001600160401b03811660408401525087606083015260e06080830152614a9260e083018789614671565b6001600160a01b03861660a084015282810360c0840152614ab4818587614671565b9a9950505050505050505050565b5f60208284031215614ad2575f80fd5b81516001600160401b03811115614ae7575f80fd5b8201601f81018413614af7575f80fd5b8051614b056140a382614070565b818152856020838501011115614b19575f80fd5b612a09826020830160208601613ca0565b5f60408284031215614b3a575f80fd5b614b42614018565b82358152602083013560208201528091505092915050565b5f60208284031215614b6a575f80fd5b813561104681614a29565b60018060a01b038516815283602082015261ffff83166040820152608060608201525f6111206080830184613cc2565b604081525f614bb76040830185613cc2565b8281036020840152612a098185613cc2565b5f60208284031215614bd9575f80fd5b815161104681613f92565b6040815263ffffffff8351166040820152602083015160608201525f604084015160a06080840152614c1960e0840182613cc2565b90506060850151603f198483030160a0850152614c368282613cc2565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b5f60408284031215614c6c575f80fd5b614c74614018565b9050815181526020820151602082015292915050565b5f60408284031215614c9a575f80fd5b6110468383614c5c565b8082028115828204841417610d3057610d306146f6565b5f82614cd557634e487b7160e01b5f52601260045260245ffd5b500490565b6001600160f01b03198135818116916002851015614d025780818660020360031b1b83161692505b505092915050565b5f60808284031215614d1a575f80fd5b604051606081018181106001600160401b0382111715614d3c57614d3c614004565b604052825181526020830151614d5181614a29565b6020820152614d638460408501614c5c565b60408201529392505050565b80356020831015610d30575f19602084900360031b1b1692915050565b6001600160c01b03198135818116916008851015614d025760089490940360031b84901b1690921692915050565b6001600160401b0360c01b8560c01b16815263ffffffff60e01b8460e01b16600882015282600c8201525f8251614df881602c850160208701613ca0565b91909101602c0195945050505050565b8481526001600160401b0360c01b8460c01b1660208201528260288201525f8251614e3a816048850160208701613ca0565b9190910160480195945050505050565b634e487b7160e01b5f52602160045260245ffd5b5f8251614773818460208701613ca0565b81516001600160401b03811115614e8857614e88614004565b614e9c81614e9684546145f8565b846147d8565b602080601f831160018114614ecf575f8415614eb85750858301515b5f19600386901b1c1916600185901b178555614f26565b5f85815260208120601f198616915b82811015614efd57888601518255948401946001909101908401614ede565b5085821015614f1a57878501515f19600388901b60f8161c191681555b505060018460011b0185555b50505050505056fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0072ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212204f73ee2654a7c7833773310cc78fba3debe41369d781ddbc51dde61bddb9111564736f6c63430008160033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"shanghai","libraries":{},"metadata":{"appendCBOR":true,"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["abi","evm.bytecode.object","evm.bytecode.sourceMap","evm.bytecode.linkReferences","evm.deployedBytecode.object","evm.deployedBytecode.sourceMap","evm.deployedBytecode.linkReferences","evm.deployedBytecode.immutableReferences","evm.methodIdentifiers","metadata"]}},"remappings":["solidity-bytes-utils/=node_modules/solidity-bytes-utils/","@layerzerolabs/=node_modules/@layerzerolabs/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@solidstate/contracts/=lib/solidstate-solidity/contracts/","@pythnetwork/pyth-sdk-solidity/=lib/pyth-sdk-solidity/","solmate/=lib/solmate/","@api3/contracts/=lib/contracts/contracts/","@chainsight-management-oracle/contracts/=lib/chainsight-management-oracle/contracts/","LayerZero-v2.git/=lib/LayerZero-v2.git/","chainsight-management-oracle/=lib/chainsight-management-oracle/contracts/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","layerzero-v2/=lib/layerzero-v2/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","pyth-sdk-solidity/=lib/pyth-sdk-solidity/","solidstate-solidity/=lib/solidstate-solidity/contracts/"],"viaIR":false},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0x1a44076050125825900e736c501f859c50fE728c",{"internalType":"address","name":"_lzEndpoint","type":"address"}]],"compiler_version":"v0.8.22+commit.4fc1097e","is_verified_via_verifier_alliance":false,"verified_at":"2025-04-30T14:17:54.966223Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60e06040523060c05234801562000014575f80fd5b50604051620052ff380380620052ff83398101604081905262000037916200012e565b6001600160a01b038116608052806012816200005560068362000171565b6200006290600a6200028c565b60a05250620000739150506200007a565b506200029c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000cb5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146200012b5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f602082840312156200013f575f80fd5b81516001600160a01b038116811462000156575f80fd5b9392505050565b634e487b7160e01b5f52601160045260245ffd5b60ff82811682821603908111156200018d576200018d6200015d565b92915050565b600181815b80851115620001d357815f1904821115620001b757620001b76200015d565b80851615620001c557918102915b93841c939080029062000198565b509250929050565b5f82620001eb575060016200018d565b81620001f957505f6200018d565b81600181146200021257600281146200021d576200023d565b60019150506200018d565b60ff8411156200023157620002316200015d565b50506001821b6200018d565b5060208310610133831016604e8410600b841016171562000262575081810a6200018d565b6200026e838362000193565b805f19048211156200028457620002846200015d565b029392505050565b5f6200015660ff841683620001db565b60805160a05160c051614fe46200031b5f395f8181612a5101528181612a7a0152612bb901525f8181610950015281816130ce0152818161314001526133c301525f818161076201528181610e3701528181611f48015281816125040152818161294901528181612e37015281816134e101526135980152614fe45ff3fe6080604052600436106103df575f3560e01c806382413eac116101ff578063b98bd07011610113578063d4243885116100a8578063edf3e29e11610078578063edf3e29e14610bfd578063f2fde38b14610c1c578063fa08b03814610c3b578063fc0c546a146106ac578063ff7bd03d14610c59575f80fd5b8063d424388514610b81578063d505accf14610ba0578063d9d98ce414610bbf578063dd62ed3e14610bde575f80fd5b8063bf353dbb116100e3578063bf353dbb14610b00578063c7c7f5b314610b2e578063ca5eb5e114610b4f578063d045a0dc14610b6e575f80fd5b8063b98bd07014610a72578063bb0b6a5314610a91578063bc70b35414610ace578063bd815db014610aed575f80fd5b8063963efcaa11610194578063a49d399311610164578063a49d3993146109c2578063a9059cbb146109f0578063ad3cb1cc14610a0f578063b731ea0a14610a3f578063b76b0c0814610a53575f80fd5b8063963efcaa1461093f5780639c52a7f1146109725780639dc29fac146109915780639f68b964146109b0575f80fd5b80638cff5fbe116101cf5780638cff5fbe146108e45780638da5cb5b146109035780638ffaacaa1461091757806395d89b411461092b575f80fd5b806382413eac1461086c57806384b0196e1461088b57806385177509146108b2578063857749b0146108d1575f80fd5b80633b6f743b116102f65780635cffe9de1161028b5780636fc1b31e1161025b5780636fc1b31e146107c257806370a08231146107e1578063715018a6146108005780637d25a05e146108145780637ecebe001461084d575f80fd5b80635cffe9de146107325780635e280f1114610751578063613255ab1461078457806365fae35e146107a3575f80fd5b806352ae2879116102c657806352ae2879146106ac57806352d1902d146106be5780635535d461146106d25780635a0dfe4d146106f1575f80fd5b80633b6f743b1461063a57806340c10f19146106665780634ba4a28b146106855780634f1ef28614610699575f80fd5b806317442b701161037757806320c582be1161034757806320c582be146105a857806323b872dd146105c7578063313ce567146105e65780633400288b146106075780633644e51514610626575f80fd5b806317442b701461051757806317dd676d1461053857806318160ddd146105575780631f5e133414610594575f80fd5b806313137d65116103b257806313137d6514610496578063134d4f25146104ab578063136db03a146104d2578063156a0d0f146104f1575f80fd5b806306fdde03146103e3578063095ea7b31461040d5780630d35b4151461043c578063111ecdad1461046a575b5f80fd5b3480156103ee575f80fd5b506103f7610c78565b6040516104049190613ced565b60405180910390f35b348015610418575f80fd5b5061042c610427366004613d13565b610d1d565b6040519015158152602001610404565b348015610447575f80fd5b5061045b610456366004613d53565b610d36565b60405161040493929190613d84565b348015610475575f80fd5b5061047e610e01565b6040516001600160a01b039091168152602001610404565b6104a96104a4366004613e6f565b610e35565b005b3480156104b6575f80fd5b506104bf600281565b60405161ffff9091168152602001610404565b3480156104dd575f80fd5b506104a96104ec366004613d13565b610ef5565b3480156104fc575f80fd5b506040805162b9270b60e21b81526001602082015201610404565b348015610522575f80fd5b5060408051600181526002602082015201610404565b348015610543575f80fd5b506104a9610552366004613f07565b610f5e565b348015610562575f80fd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02545b604051908152602001610404565b34801561059f575f80fd5b506104bf600181565b3480156105b3575f80fd5b506104a96105c2366004613f22565b610fab565b3480156105d2575f80fd5b5061042c6105e1366004613f22565b61102e565b3480156105f1575f80fd5b5060125b60405160ff9091168152602001610404565b348015610612575f80fd5b506104a9610621366004613f78565b61104d565b348015610631575f80fd5b506105866110b8565b348015610645575f80fd5b50610659610654366004613f9f565b6110c6565b6040516104049190613fed565b348015610671575f80fd5b506104a9610680366004613d13565b61112a565b348015610690575f80fd5b50600254610586565b6104a96106a73660046140d1565b6111cc565b3480156106b7575f80fd5b503061047e565b3480156106c9575f80fd5b506105866111e7565b3480156106dd575f80fd5b506103f76106ec366004614141565b611202565b3480156106fc575f80fd5b5061042c61070b366004613f78565b63ffffffff919091165f9081525f80516020614f4f83398151915260205260409020541490565b34801561073d575f80fd5b5061042c61074c366004614172565b6112da565b34801561075c575f80fd5b5061047e7f000000000000000000000000000000000000000000000000000000000000000081565b34801561078f575f80fd5b5061058661079e366004613f07565b6115aa565b3480156107ae575f80fd5b506104a96107bd366004613f07565b6115ee565b3480156107cd575f80fd5b506104a96107dc366004613f07565b611619565b3480156107ec575f80fd5b506105866107fb366004613f07565b611695565b34801561080b575f80fd5b506104a96116c5565b34801561081f575f80fd5b5061083561082e366004613f78565b5f92915050565b6040516001600160401b039091168152602001610404565b348015610858575f80fd5b50610586610867366004613f07565b6116d8565b348015610877575f80fd5b5061042c6108863660046141df565b6116e2565b348015610896575f80fd5b5061089f6116f7565b6040516104049796959493929190614241565b3480156108bd575f80fd5b506104a96108cc366004613d13565b6117a0565b3480156108dc575f80fd5b5060066105f5565b3480156108ef575f80fd5b506104a96108fe366004613d13565b6117ec565b34801561090e575f80fd5b5061047e611838565b348015610922575f80fd5b50610586600981565b348015610936575f80fd5b506103f7611860565b34801561094a575f80fd5b506105867f000000000000000000000000000000000000000000000000000000000000000081565b34801561097d575f80fd5b506104a961098c366004613f07565b61189e565b34801561099c575f80fd5b506104a96109ab366004613d13565b6118c6565b3480156109bb575f80fd5b505f61042c565b3480156109cd575f80fd5b5061042c6109dc366004613f07565b60036020525f908152604090205460ff1681565b3480156109fb575f80fd5b5061042c610a0a366004613d13565b611955565b348015610a1a575f80fd5b506103f7604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610a4a575f80fd5b5061047e611969565b348015610a5e575f80fd5b5060015461047e906001600160a01b031681565b348015610a7d575f80fd5b506104a9610a8c366004614318565b611991565b348015610a9c575f80fd5b50610586610aab366004614356565b63ffffffff165f9081525f80516020614f4f833981519152602052604090205490565b348015610ad9575f80fd5b506103f7610ae836600461436f565b611b0d565b6104a9610afb366004614318565b611c9d565b348015610b0b575f80fd5b5061042c610b1a366004613f07565b60046020525f908152604090205460ff1681565b610b41610b3c3660046143cb565b611e29565b604051610404929190614433565b348015610b5a575f80fd5b506104a9610b69366004613f07565b611f21565b6104a9610b7c366004613e6f565b611fa2565b348015610b8c575f80fd5b506104a9610b9b366004613f07565b611fd1565b348015610bab575f80fd5b506104a9610bba366004614484565b612045565b348015610bca575f80fd5b50610586610bd9366004613d13565b61219a565b348015610be9575f80fd5b50610586610bf83660046144f5565b6121ba565b348015610c08575f80fd5b506104a9610c1736600461453f565b612203565b348015610c27575f80fd5b506104a9610c36366004613f07565b61237f565b348015610c46575f80fd5b505f5461047e906001600160a01b031681565b348015610c64575f80fd5b5061042c610c733660046145de565b6123bc565b60605f5f80516020614f2f8339815191525b9050806003018054610c9b906145f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc7906145f8565b8015610d125780601f10610ce957610100808354040283529160200191610d12565b820191905f5260205f20905b815481529060010190602001808311610cf557829003601f168201915b505050505091505090565b5f33610d2a8185856123d9565b60019150505b92915050565b604080518082019091525f80825260208201526060610d6660405180604001604052805f81526020015f81525090565b6040805180820182525f8082526001600160401b03602080840182905284518381529081019094529195509182610dbf565b604080518082019091525f815260606020820152815260200190600190039081610d985790505b5093505f80610de3604089013560608a0135610dde60208c018c614356565b6123e6565b60408051808201909152918252602082015296989597505050505050565b5f807f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c005b546001600160a01b031692915050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610e85576040516391ac5e4f60e01b81523360048201526024015b60405180910390fd5b60208701803590610e9f90610e9a908a614356565b612429565b14610edd57610eb16020880188614356565b60405163309afaf360e21b815263ffffffff909116600482015260208801356024820152604401610e7c565b610eec87878787878787612472565b50505050505050565b6001546001600160a01b03163314610f4f5760405162461bcd60e51b815260206004820152601c60248201527f446562743a2043616c6c6572206e6f74205361746f73686958617070000000006044820152606401610e7c565b610f5a8233836125d0565b5050565b6001546001600160a01b03163314610f885760405162461bcd60e51b8152600401610e7c9061462a565b6001600160a01b03165f908152600360205260409020805460ff19166001179055565b6001546001600160a01b0316331480610fd25750335f9081526003602052604090205460ff165b61101e5760405162461bcd60e51b815260206004820152601f60248201527f446562743a2043616c6c6572206e6f7420544d2f5361746f73686958617070006044820152606401610e7c565b6110298383836125d0565b505050565b5f6110388361262d565b611043848484612796565b90505b9392505050565b6110556127b9565b63ffffffff82165f8181525f80516020614f4f833981519152602081815260409283902085905582519384528301849052917f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91015b60405180910390a1505050565b5f6110c16127eb565b905090565b604080518082019091525f80825260208201525f6110f460408501356060860135610dde6020880188614356565b9150505f8061110386846127f4565b90925090506111206111186020880188614356565b838388612934565b9695505050505050565b6001546001600160a01b03163314806111515750335f9081526003602052604090205460ff165b8061116a5750335f9081526004602052604090205460ff165b6111c25760405162461bcd60e51b8152602060048201526024808201527f446562743a2043616c6c6572206e6f74205361746f736869586170702f544d2f6044820152630c2eae8d60e31b6064820152608401610e7c565b610f5a8282612a12565b6111d4612a46565b6111dd82612aea565b610f5a8282612af2565b5f6111f0612bae565b505f80516020614f8f83398151915290565b63ffffffff82165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff8616855290915290912080546060929190611255906145f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611281906145f8565b80156112cc5780601f106112a3576101008083540402835291602001916112cc565b820191905f5260205f20905b8154815290600101906020018083116112af57829003601f168201915b505050505091505092915050565b5f6001600160a01b03851630146113335760405162461bcd60e51b815260206004820152601b60248201527f4552433230466c6173684d696e743a2077726f6e6720746f6b656e00000000006044820152606401610e7c565b61133c856115aa565b84111561139f5760405162461bcd60e51b815260206004820152602b60248201527f4552433230466c6173684d696e743a20616d6f756e742065786365656473206d60448201526a30bc233630b9b42637b0b760a91b6064820152608401610e7c565b5f6113a985612bf7565b90506113b58786612a12565b6040516323e30c8b60e01b81527f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9906001600160a01b038916906323e30c8b9061140d9033908b908b9088908c908c90600401614699565b6020604051808303815f875af1158015611429573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061144d91906146df565b146114a65760405162461bcd60e51b8152602060048201526024808201527f4552433230466c6173684d696e743a20696e76616c69642072657475726e2076604482015263616c756560e01b6064820152608401610e7c565b6114ba87306114b5848961470a565b612c10565b6114c48786612c73565b600154604080516307a77c5360e11b815290515f926001600160a01b031691630f4ef8a69160048083019260209291908290030181865afa15801561150b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061152f919061471d565b905061153c8830846125d0565b6115473082846123d9565b60405163d053316f60e01b8152600481018390526001600160a01b0382169063d053316f906024015f604051808303815f87803b158015611586575f80fd5b505af1158015611598573d5f803e3d5ffd5b5060019b9a5050505050505050505050565b5f6001600160a01b03821630146115c1575f610d30565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254610d30905f19614738565b6115f66127b9565b6001600160a01b03165f908152600460205260409020805460ff19166001179055565b6116216127b9565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c0080546001600160a01b0319166001600160a01b03831690811782556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a15050565b5f805f80516020614f2f8339815191525b6001600160a01b039093165f9081526020939093525050604090205490565b6116cd6127b9565b6116d65f612ca7565b565b5f610d3082612d17565b6001600160a01b03811630145b949350505050565b5f60608082808083815f80516020614f6f833981519152805490915015801561172257506001810154155b6117665760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610e7c565b61176e612d3f565b611776612d7d565b604080515f80825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6001546001600160a01b031633146117ca5760405162461bcd60e51b8152600401610e7c9061462a565b6117d48282612c73565b5f54600254610f5a916001600160a01b031690612c73565b6001546001600160a01b031633146118165760405162461bcd60e51b8152600401610e7c9061462a565b6118208282612a12565b5f54600254610f5a916001600160a01b031690612a12565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300610e25565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060915f80516020614f2f83398151915291610c9b906145f8565b6118a66127b9565b6001600160a01b03165f908152600460205260409020805460ff19169055565b335f9081526003602052604090205460ff16806118f15750335f9081526004602052604090205460ff165b61194b5760405162461bcd60e51b815260206004820152602560248201527f446562743a2043616c6c6572206e6f742054726f76654d616e61676572206f72604482015264040c2eae8d60db1b6064820152608401610e7c565b610f5a8282612c73565b5f61195f8361262d565b6110468383612d93565b5f807fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b600610e25565b6119996127b9565b7f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00005f5b82811015611adb576119fe8484838181106119d9576119d961474b565b90506020028101906119eb919061475f565b6119f990604081019061477d565b612da0565b838382818110611a1057611a1061474b565b9050602002810190611a22919061475f565b611a3090604081019061477d565b835f878786818110611a4457611a4461474b565b9050602002810190611a56919061475f565b611a64906020810190614356565b63ffffffff1663ffffffff1681526020019081526020015f205f878786818110611a9057611a9061474b565b9050602002810190611aa2919061475f565b611ab39060408101906020016147bf565b61ffff16815260208101919091526040015f2091611ad291908361481c565b506001016119bc565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b67483836040516110ab9291906148d5565b63ffffffff84165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff88168552909152822080546060939190611b5f906145f8565b80601f0160208091040260200160405190810160405280929190818152602001828054611b8b906145f8565b8015611bd65780601f10611bad57610100808354040283529160200191611bd6565b820191905f5260205f20905b815481529060010190602001808311611bb957829003601f168201915b5050505050905080515f03611c255784848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152509295506116ef945050505050565b5f849003611c365791506116ef9050565b60028410611c8057611c488585612da0565b80611c5685600281896149b4565b604051602001611c68939291906149db565b604051602081830303815290604052925050506116ef565b8484604051639a6d49cd60e01b8152600401610e7c929190614a01565b5f5b81811015611dac5736838383818110611cba57611cba61474b565b9050602002810190611ccc9190614a14565b9050611d0a611cde6020830183614356565b602083013563ffffffff919091165f9081525f80516020614f4f83398151915260205260409020541490565b611d145750611da4565b3063d045a0dc60c08301358360a0810135611d3361010083018361477d565b611d44610100890160e08a01613f07565b611d526101208a018a61477d565b6040518963ffffffff1660e01b8152600401611d749796959493929190614a3d565b5f604051808303818588803b158015611d8b575f80fd5b505af1158015611d9d573d5f803e3d5ffd5b5050505050505b600101611c9f565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b81526004015f60405180830381865afa158015611de8573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e0f9190810190614ac2565b604051638351eea760e01b8152600401610e7c9190613ced565b611e31613c5d565b604080518082019091525f80825260208201525f80611e6633604089013560608a0135611e6160208c018c614356565b612de1565b915091505f80611e7689846127f4565b9092509050611ea2611e8b60208b018b614356565b8383611e9c368d90038d018d614b2a565b8b612e06565b60408051808201909152858152602080820186905282519298509096503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a90611ef0908d018d614356565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b611f296127b9565b60405163ca5eb5e160e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e1906024015f604051808303815f87803b158015611f89575f80fd5b505af1158015611f9b573d5f803e3d5ffd5b5050505050565b333014611fc25760405163029a949d60e31b815260040160405180910390fd5b610eec87878787878787610edd565b611fd96127b9565b7fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b60080546001600160a01b0319166001600160a01b03831690811782556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001611689565b834211156120695760405163313c898160e11b815260048101859052602401610e7c565b5f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886120d38c6001600160a01b03165f9081527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006020526040902080546001810190915590565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090505f61212d82612f0c565b90505f61213c82878787612f38565b9050896001600160a01b0316816001600160a01b031614612183576040516325c0072360e11b81526001600160a01b0380831660048301528b166024820152604401610e7c565b61218e8a8a8a6123d9565b50505050505050505050565b5f6001600160a01b03831630146121b1575f611046565b61104682612bf7565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156122475750825b90505f826001600160401b031660011480156122625750303b155b905081158015612270575080155b1561228e5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156122b857845460ff60401b1916600160401b1785555b6122c188612f64565b6122ca87612f64565b6122d389612f64565b6122dc86612f8b565b6122e4612fab565b6122ef8b8b89612fb3565b6122f887612fd7565b5f80546001600160a01b03808c166001600160a01b03199283161790925560018054928b16929091169190911790556002869055831561237257845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050505050565b6123876127b9565b6001600160a01b0381166123b057604051631e4fbdf760e01b81525f6004820152602401610e7c565b6123b981612ca7565b50565b5f602082018035906123d290610aab9085614356565b1492915050565b6110298383836001612fe8565b5f806123f1856130cb565b915081905083811015612421576040516371c4efed60e01b81526004810182905260248101859052604401610e7c565b935093915050565b63ffffffff81165f9081525f80516020614f4f83398151915260208190526040822054806110465760405163f6ff4fb760e01b815263ffffffff85166004820152602401610e7c565b5f6124836124808787613101565b90565b90505f6124ae8261249c6124978a8a613118565b61313a565b6124a960208d018d614356565b61316e565b9050602886111561256e575f6124ea6124cd60608c0160408d01614b5a565b6124da60208d018d614356565b846124e58c8c613195565b6131df565b604051633e5ac80960e11b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb590129061253f9086908d905f908790600401614b75565b5f604051808303815f87803b158015612556575f80fd5b505af1158015612568573d5f803e3d5ffd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c6125a760208d018d614356565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b6001600160a01b0383166125f957604051634b637e8f60e11b81525f6004820152602401610e7c565b6001600160a01b0382166126225760405163ec442f0560e01b81525f6004820152602401610e7c565b611029838383613211565b6001600160a01b0381161580159061264e57506001600160a01b0381163014155b6126dd5760405162461bcd60e51b815260206004820152605460248201527f446562743a2043616e6e6f74207472616e7366657220746f6b656e732064697260448201527f6563746c7920746f20746865204465627420746f6b656e20636f6e7472616374606482015273206f7220746865207a65726f206164647265737360601b608482015260a401610e7c565b6001546001600160a01b0382811691161480159061271357506001600160a01b0381165f9081526003602052604090205460ff16155b6123b95760405162461bcd60e51b815260206004820152604860248201527f446562743a2043616e6e6f74207472616e7366657220746f6b656e732064697260448201527f6563746c7920746f20746865205361746f73686958417070206f722054726f7660648201526732a6b0b730b3b2b960c11b608482015260a401610e7c565b5f336127a3858285612c10565b6127ae8585856125d0565b506001949350505050565b336127c2611838565b6001600160a01b0316146116d65760405163118cdaa760e01b8152336004820152602401610e7c565b5f6110c161334a565b6060805f61284f8560200135612809866133bd565b61281660a089018961477d565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506133e892505050565b90935090505f81612861576001612864565b60025b90506128846128766020880188614356565b82610ae860808a018a61477d565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c008054919450906001600160a01b031680156129295760405163043a78eb60e01b81526001600160a01b0382169063043a78eb906128e89089908990600401614ba5565b602060405180830381865afa158015612903573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129279190614bc9565b505b505050509250929050565b604080518082019091525f80825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff16815260200161299689612429565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b81526004016129cb929190614be4565b6040805180830381865afa1580156129e5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612a099190614c8a565b95945050505050565b6001600160a01b038216612a3b5760405163ec442f0560e01b81525f6004820152602401610e7c565b610f5a5f8383613211565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480612acc57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612ac05f80516020614f8f833981519152546001600160a01b031690565b6001600160a01b031614155b156116d65760405163703e46dd60e11b815260040160405180910390fd5b6123b96127b9565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612b4c575060408051601f3d908101601f19168201909252612b49918101906146df565b60015b612b7457604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610e7c565b5f80516020614f8f8339815191528114612ba457604051632a87526960e21b815260048101829052602401610e7c565b6110298383613462565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116d65760405163703e46dd60e11b815260040160405180910390fd5b5f612710612c06600984614ca4565b610d309190614cbb565b5f612c1b84846121ba565b90505f198114612c6d5781811015612c5f57604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610e7c565b612c6d84848484035f612fe8565b50505050565b6001600160a01b038216612c9c57604051634b637e8f60e11b81525f6004820152602401610e7c565b610f5a825f83613211565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f807f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb006116a6565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10280546060915f80516020614f6f83398151915291610c9b906145f8565b60605f5f80516020614f6f833981519152610c8a565b5f33610d2a8185856125d0565b5f612dae60028284866149b4565b612db791614cda565b60f01c905060038114611029578282604051639a6d49cd60e01b8152600401610e7c929190614a01565b5f80612dee8585856123e6565b9092509050612dfd8683612c73565b94509492505050565b612e0e613c5d565b5f612e1b845f01516134b7565b602085015190915015612e3557612e3584602001516134de565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001612e858c612429565b81526020018a81526020018981526020015f8960200151111515815250866040518463ffffffff1660e01b8152600401612ec0929190614be4565b60806040518083038185885af1158015612edc573d5f803e3d5ffd5b50505050506040513d601f19601f82011682018060405250810190612f019190614d0a565b979650505050505050565b5f610d30612f186127eb565b8360405161190160f01b8152600281019290925260228201526042902090565b5f805f80612f48888888886135bd565b925092509250612f588282613685565b50909695505050505050565b6001600160a01b0381166123b95760405163d92e233d60e01b815260040160405180910390fd5b805f036123b957604051637c946ed760e01b815260040160405180910390fd5b6116d661373d565b612fbb61373d565b612fc58383613786565b612fce83613798565b611029816137c3565b612fdf61373d565b6123b9816137e4565b5f80516020614f2f8339815191526001600160a01b03851661301f5760405163e602df0560e01b81525f6004820152602401610e7c565b6001600160a01b03841661304857604051634a1406b160e11b81525f6004820152602401610e7c565b6001600160a01b038086165f90815260018301602090815260408083209388168352929052208390558115611f9b57836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516130bc91815260200190565b60405180910390a35050505050565b5f7f00000000000000000000000000000000000000000000000000000000000000006130f78184614cbb565b610d309190614ca4565b5f61310f60208284866149b4565b61104691614d6f565b5f6131276028602084866149b4565b61313091614d8c565b60c01c9392505050565b5f610d307f00000000000000000000000000000000000000000000000000000000000000006001600160401b038416614ca4565b5f6001600160a01b0384166131835761dead93505b61318d8484612a12565b509092915050565b60606131a482602881866149b4565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250929695505050505050565b6060848484846040516020016131f89493929190614dba565b6040516020818303038152906040529050949350505050565b5f80516020614f2f8339815191526001600160a01b03841661324b5781816002015f828254613240919061470a565b909155506132bb9050565b6001600160a01b0384165f908152602082905260409020548281101561329d5760405163391434e360e21b81526001600160a01b03861660048201526024810182905260448101849052606401610e7c565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b0383166132d95760028101805483900390556132f7565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161333c91815260200190565b60405180910390a350505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133746137ec565b61337c613854565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f610d307f000000000000000000000000000000000000000000000000000000000000000083614cbb565b805160609015158061343157848460405160200161341d92919091825260c01b6001600160c01b031916602082015260280190565b604051602081830303815290604052613458565b848433856040516020016134489493929190614e08565b6040516020818303038152906040525b9150935093915050565b61346b82613896565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156134af5761102982826138f9565b610f5a613962565b5f8134146134da576040516304fb820960e51b8152346004820152602401610e7c565b5090565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa15801561353b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061355f919061471d565b90506001600160a01b038116613588576040516329b99a9560e11b815260040160405180910390fd5b610f5a6001600160a01b038216337f000000000000000000000000000000000000000000000000000000000000000085613981565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156135f657505f9150600390508261367b565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613647573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b03811661367257505f92506001915082905061367b565b92505f91508190505b9450945094915050565b5f82600381111561369857613698614e4a565b036136a1575050565b60018260038111156136b5576136b5614e4a565b036136d35760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156136e7576136e7614e4a565b036137085760405163fce698f760e01b815260048101829052602401610e7c565b600382600381111561371c5761371c614e4a565b03610f5a576040516335e2f38360e21b815260048101829052602401610e7c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166116d657604051631afcd79f60e31b815260040160405180910390fd5b61378e61373d565b610f5a82826139db565b6137a061373d565b6123b981604051806040016040528060018152602001603160f81b815250613a2b565b6137cb61373d565b6137d481613a8a565b6137dc612fab565b6123b9612fab565b61238761373d565b5f5f80516020614f6f83398151915281613804612d3f565b80519091501561381c57805160209091012092915050565b8154801561382b579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b5f5f80516020614f6f8339815191528161386c612d7d565b80519091501561388457805160209091012092915050565b6001820154801561382b579392505050565b806001600160a01b03163b5f036138cb57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610e7c565b5f80516020614f8f83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516139159190614e5e565b5f60405180830381855af49150503d805f811461394d576040519150601f19603f3d011682016040523d82523d5f602084013e613952565b606091505b5091509150612a09858383613a9b565b34156116d65760405163b398979f60e01b815260040160405180910390fd5b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612c6d908590613af7565b6139e361373d565b5f80516020614f2f8339815191527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03613a1c8482614e6f565b5060048101612c6d8382614e6f565b613a3361373d565b5f80516020614f6f8339815191527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102613a6c8482614e6f565b5060038101613a7b8382614e6f565b505f8082556001909101555050565b613a9261373d565b6137d481613b58565b606082613ab057613aab82613b69565b611046565b8151158015613ac757506001600160a01b0384163b155b15613af057604051639996b31560e01b81526001600160a01b0385166004820152602401610e7c565b5080611046565b5f613b0b6001600160a01b03841683613b92565b905080515f14158015613b2f575080806020019051810190613b2d9190614bc9565b155b1561102957604051635274afe760e01b81526001600160a01b0384166004820152602401610e7c565b613b6061373d565b6123b981613b9f565b805115613b795780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b606061104683835f613bce565b613ba761373d565b6001600160a01b038116611f2957604051632d618d8160e21b815260040160405180910390fd5b606081471015613bf35760405163cd78605960e01b8152306004820152602401610e7c565b5f80856001600160a01b03168486604051613c0e9190614e5e565b5f6040518083038185875af1925050503d805f8114613c48576040519150601f19603f3d011682016040523d82523d5f602084013e613c4d565b606091505b5091509150611120868383613a9b565b60405180606001604052805f80191681526020015f6001600160401b03168152602001613c9b60405180604001604052805f81526020015f81525090565b905290565b5f5b83811015613cba578181015183820152602001613ca2565b50505f910152565b5f8151808452613cd9816020860160208601613ca0565b601f01601f19169290920160200192915050565b602081525f6110466020830184613cc2565b6001600160a01b03811681146123b9575f80fd5b5f8060408385031215613d24575f80fd5b8235613d2f81613cff565b946020939093013593505050565b5f60e08284031215613d4d575f80fd5b50919050565b5f60208284031215613d63575f80fd5b81356001600160401b03811115613d78575f80fd5b6116ef84828501613d3d565b83518152602080850151908201525f60a08201604060a0604085015281865180845260c08601915060c08160051b870101935060208089015f5b83811015613dfd5788870360bf19018552815180518852830151838801879052613dea87890182613cc2565b9750509382019390820190600101613dbe565b505087516060880152505050602085015160808501525090506116ef565b5f60608284031215613d4d575f80fd5b5f8083601f840112613e3b575f80fd5b5081356001600160401b03811115613e51575f80fd5b602083019150836020828501011115613e68575f80fd5b9250929050565b5f805f805f805f60e0888a031215613e85575f80fd5b613e8f8989613e1b565b96506060880135955060808801356001600160401b0380821115613eb1575f80fd5b613ebd8b838c01613e2b565b909750955060a08a01359150613ed282613cff565b90935060c08901359080821115613ee7575f80fd5b50613ef48a828b01613e2b565b989b979a50959850939692959293505050565b5f60208284031215613f17575f80fd5b813561104681613cff565b5f805f60608486031215613f34575f80fd5b8335613f3f81613cff565b92506020840135613f4f81613cff565b929592945050506040919091013590565b803563ffffffff81168114613f73575f80fd5b919050565b5f8060408385031215613f89575f80fd5b613d2f83613f60565b80151581146123b9575f80fd5b5f8060408385031215613fb0575f80fd5b82356001600160401b03811115613fc5575f80fd5b613fd185828601613d3d565b9250506020830135613fe281613f92565b809150509250929050565b815181526020808301519082015260408101610d30565b634e487b7160e01b5f52604160045260245ffd5b604080519081016001600160401b038111828210171561403a5761403a614004565b60405290565b604051601f8201601f191681016001600160401b038111828210171561406857614068614004565b604052919050565b5f6001600160401b0382111561408857614088614004565b50601f01601f191660200190565b5f6140a86140a384614070565b614040565b90508281528383830111156140bb575f80fd5b828260208301375f602084830101529392505050565b5f80604083850312156140e2575f80fd5b82356140ed81613cff565b915060208301356001600160401b03811115614107575f80fd5b8301601f81018513614117575f80fd5b61412685823560208401614096565b9150509250929050565b803561ffff81168114613f73575f80fd5b5f8060408385031215614152575f80fd5b61415b83613f60565b915061416960208401614130565b90509250929050565b5f805f805f60808688031215614186575f80fd5b853561419181613cff565b945060208601356141a181613cff565b93506040860135925060608601356001600160401b038111156141c2575f80fd5b6141ce88828901613e2b565b969995985093965092949392505050565b5f805f8060a085870312156141f2575f80fd5b6141fc8686613e1b565b935060608501356001600160401b03811115614216575f80fd5b61422287828801613e2b565b909450925050608085013561423681613cff565b939692955090935050565b60ff60f81b881681525f602060e0602084015261426160e084018a613cc2565b8381036040850152614273818a613cc2565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825260208088019350909101905f5b818110156142c6578351835292840192918401916001016142aa565b50909c9b505050505050505050505050565b5f8083601f8401126142e8575f80fd5b5081356001600160401b038111156142fe575f80fd5b6020830191508360208260051b8501011115613e68575f80fd5b5f8060208385031215614329575f80fd5b82356001600160401b0381111561433e575f80fd5b61434a858286016142d8565b90969095509350505050565b5f60208284031215614366575f80fd5b61104682613f60565b5f805f8060608587031215614382575f80fd5b61438b85613f60565b935061439960208601614130565b925060408501356001600160401b038111156143b3575f80fd5b6143bf87828801613e2b565b95989497509550505050565b5f805f83850360808112156143de575f80fd5b84356001600160401b038111156143f3575f80fd5b6143ff87828801613d3d565b9450506040601f1982011215614413575f80fd5b50602084019150606084013561442881613cff565b809150509250925092565b5f60c082019050835182526001600160401b036020850151166020830152604084015161446d604084018280518252602090810151910152565b5082516080830152602083015160a0830152611046565b5f805f805f805f60e0888a03121561449a575f80fd5b87356144a581613cff565b965060208801356144b581613cff565b95506040880135945060608801359350608088013560ff811681146144d8575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215614506575f80fd5b823561451181613cff565b91506020830135613fe281613cff565b5f82601f830112614530575f80fd5b61104683833560208501614096565b5f805f805f8060c08789031215614554575f80fd5b86356001600160401b038082111561456a575f80fd5b6145768a838b01614521565b9750602089013591508082111561458b575f80fd5b5061459889828a01614521565b95505060408701356145a981613cff565b935060608701356145b981613cff565b925060808701356145c981613cff565b8092505060a087013590509295509295509295565b5f606082840312156145ee575f80fd5b6110468383613e1b565b600181811c9082168061460c57607f821691505b602082108103613d4d57634e487b7160e01b5f52602260045260245ffd5b60208082526027908201527f44656274546f6b656e576974684c7a3a2043616c6c6572206e6f74205361746f6040820152660736869586170760cc1b606082015260800190565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a0608082018190525f906146d39083018486614671565b98975050505050505050565b5f602082840312156146ef575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610d3057610d306146f6565b5f6020828403121561472d575f80fd5b815161104681613cff565b81810381811115610d3057610d306146f6565b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112614773575f80fd5b9190910192915050565b5f808335601e19843603018112614792575f80fd5b8301803591506001600160401b038211156147ab575f80fd5b602001915036819003821315613e68575f80fd5b5f602082840312156147cf575f80fd5b61104682614130565b601f82111561102957805f5260205f20601f840160051c810160208510156147fd5750805b601f840160051c820191505b81811015611f9b575f8155600101614809565b6001600160401b0383111561483357614833614004565b6148478361484183546145f8565b836147d8565b5f601f841160018114614878575f85156148615750838201355b5f19600387901b1c1916600186901b178355611f9b565b5f83815260208120601f198716915b828110156148a75786850135825560209485019460019092019101614887565b50868210156148c3575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082528181018390525f906040808401600586901b8501820187855b888110156149a657878303603f190184528135368b9003605e19018112614918575f80fd5b8a01606063ffffffff61492a83613f60565b16855261ffff61493b898401614130565b168886015286820135601e19833603018112614955575f80fd5b9091018781019190356001600160401b03811115614971575f80fd5b80360383131561497f575f80fd5b81888701526149918287018285614671565b968901969550505091860191506001016148f3565b509098975050505050505050565b5f80858511156149c2575f80fd5b838611156149ce575f80fd5b5050820193919092039150565b5f84516149ec818460208901613ca0565b8201838582375f930192835250909392505050565b602081525f611043602083018486614671565b5f823561013e19833603018112614773575f80fd5b6001600160401b03811681146123b9575f80fd5b63ffffffff614a4b89613f60565b168152602088013560208201525f6040890135614a6781614a29565b6001600160401b03811660408401525087606083015260e06080830152614a9260e083018789614671565b6001600160a01b03861660a084015282810360c0840152614ab4818587614671565b9a9950505050505050505050565b5f60208284031215614ad2575f80fd5b81516001600160401b03811115614ae7575f80fd5b8201601f81018413614af7575f80fd5b8051614b056140a382614070565b818152856020838501011115614b19575f80fd5b612a09826020830160208601613ca0565b5f60408284031215614b3a575f80fd5b614b42614018565b82358152602083013560208201528091505092915050565b5f60208284031215614b6a575f80fd5b813561104681614a29565b60018060a01b038516815283602082015261ffff83166040820152608060608201525f6111206080830184613cc2565b604081525f614bb76040830185613cc2565b8281036020840152612a098185613cc2565b5f60208284031215614bd9575f80fd5b815161104681613f92565b6040815263ffffffff8351166040820152602083015160608201525f604084015160a06080840152614c1960e0840182613cc2565b90506060850151603f198483030160a0850152614c368282613cc2565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b5f60408284031215614c6c575f80fd5b614c74614018565b9050815181526020820151602082015292915050565b5f60408284031215614c9a575f80fd5b6110468383614c5c565b8082028115828204841417610d3057610d306146f6565b5f82614cd557634e487b7160e01b5f52601260045260245ffd5b500490565b6001600160f01b03198135818116916002851015614d025780818660020360031b1b83161692505b505092915050565b5f60808284031215614d1a575f80fd5b604051606081018181106001600160401b0382111715614d3c57614d3c614004565b604052825181526020830151614d5181614a29565b6020820152614d638460408501614c5c565b60408201529392505050565b80356020831015610d30575f19602084900360031b1b1692915050565b6001600160c01b03198135818116916008851015614d025760089490940360031b84901b1690921692915050565b6001600160401b0360c01b8560c01b16815263ffffffff60e01b8460e01b16600882015282600c8201525f8251614df881602c850160208701613ca0565b91909101602c0195945050505050565b8481526001600160401b0360c01b8460c01b1660208201528260288201525f8251614e3a816048850160208701613ca0565b9190910160480195945050505050565b634e487b7160e01b5f52602160045260245ffd5b5f8251614773818460208701613ca0565b81516001600160401b03811115614e8857614e88614004565b614e9c81614e9684546145f8565b846147d8565b602080601f831160018114614ecf575f8415614eb85750858301515b5f19600386901b1c1916600185901b178555614f26565b5f85815260208120601f198616915b82811015614efd57888601518255948401946001909101908401614ede565b5085821015614f1a57878501515f19600388901b60f8161c191681555b505060018460011b0185555b50505050505056fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0072ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212204f73ee2654a7c7833773310cc78fba3debe41369d781ddbc51dde61bddb9111564736f6c634300081600330000000000000000000000001a44076050125825900e736c501f859c50fe728c","name":"DebtTokenWithLz","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"shanghai","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\n// solhint-disable-next-line no-unused-import\nimport { InboundPacket, Origin } from \"../libs/Packet.sol\";\n\n/**\n * @title IOAppPreCrimeSimulator Interface\n * @dev Interface for the preCrime simulation functionality in an OApp.\n */\ninterface IOAppPreCrimeSimulator {\n    // @dev simulation result used in PreCrime implementation\n    error SimulationResult(bytes result);\n    error OnlySelf();\n\n    /**\n     * @dev Emitted when the preCrime contract address is set.\n     * @param preCrimeAddress The address of the preCrime contract.\n     */\n    event PreCrimeSet(address preCrimeAddress);\n\n    /**\n     * @dev Retrieves the address of the preCrime contract implementation.\n     * @return The address of the preCrime contract.\n     */\n    function preCrime() external view returns (address);\n\n    /**\n     * @dev Retrieves the address of the OApp contract.\n     * @return The address of the OApp contract.\n     */\n    function oApp() external view returns (address);\n\n    /**\n     * @dev Sets the preCrime contract address.\n     * @param _preCrime The address of the preCrime contract.\n     */\n    function setPreCrime(address _preCrime) external;\n\n    /**\n     * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\n     * @param _packets An array of LayerZero InboundPacket objects representing received packets.\n     */\n    function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\n\n    /**\n     * @dev checks if the specified peer is considered 'trusted' by the OApp.\n     * @param _eid The endpoint Id to check.\n     * @param _peer The peer to check.\n     * @return Whether the peer passed is considered 'trusted' by the OApp.\n     */\n    function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppMsgInspector.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @title IOAppMsgInspector\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\n */\ninterface IOAppMsgInspector {\n    // Custom error message for inspection failure\n    error InspectionFailed(bytes message, bytes options);\n\n    /**\n     * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\n     * @param _message The message payload to be inspected.\n     * @param _options Additional options or parameters for inspection.\n     * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\n     *\n     * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\n     */\n    function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    /**\n     * @dev Muldiv operation overflow.\n     */\n    error MathOverflowedMulDiv();\n\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            return a / b;\n        }\n\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0 = x * y; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            if (denominator <= prod1) {\n                revert MathOverflowedMulDiv();\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { IOAppOptionsType3, EnforcedOptionParam } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppOptionsType3.sol\";\n\n/**\n * @title OAppOptionsType3\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\n */\nabstract contract OAppOptionsType3Upgradeable is IOAppOptionsType3, OwnableUpgradeable {\n    struct OAppOptionsType3Storage {\n        // @dev The \"msgType\" should be defined in the child contract.\n        mapping(uint32 => mapping(uint16 => bytes)) enforcedOptions;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oappoptionstype3\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OAPP_OPTIONS_TYPE_3_STORAGE_LOCATION =\n        0x8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea0000;\n\n    uint16 internal constant OPTION_TYPE_3 = 3;\n\n    function _getOAppOptionsType3Storage() internal pure returns (OAppOptionsType3Storage storage $) {\n        assembly {\n            $.slot := OAPP_OPTIONS_TYPE_3_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppOptionsType3_init() internal onlyInitializing {}\n\n    function __OAppOptionsType3_init_unchained() internal onlyInitializing {}\n\n    function enforcedOptions(uint32 _eid, uint16 _msgType) public view returns (bytes memory) {\n        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();\n        return $.enforcedOptions[_eid][_msgType];\n    }\n\n    /**\n     * @dev Sets the enforced options for specific endpoint and message type combinations.\n     * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n     * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n     * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n     * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n     */\n    function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\n        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();\n        for (uint256 i = 0; i < _enforcedOptions.length; i++) {\n            // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\n            _assertOptionsType3(_enforcedOptions[i].options);\n            $.enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\n        }\n\n        emit EnforcedOptionSet(_enforcedOptions);\n    }\n\n    /**\n     * @notice Combines options for a given endpoint and message type.\n     * @param _eid The endpoint ID.\n     * @param _msgType The OAPP message type.\n     * @param _extraOptions Additional options passed by the caller.\n     * @return options The combination of caller specified options AND enforced options.\n     *\n     * @dev If there is an enforced lzReceive option:\n     * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\n     * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\n     * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\n     */\n    function combineOptions(\n        uint32 _eid,\n        uint16 _msgType,\n        bytes calldata _extraOptions\n    ) public view virtual returns (bytes memory) {\n        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();\n        bytes memory enforced = $.enforcedOptions[_eid][_msgType];\n\n        // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\n        if (enforced.length == 0) return _extraOptions;\n\n        // No caller options, return enforced\n        if (_extraOptions.length == 0) return enforced;\n\n        // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\n        if (_extraOptions.length >= 2) {\n            _assertOptionsType3(_extraOptions);\n            // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\n            return bytes.concat(enforced, _extraOptions[2:]);\n        }\n\n        // No valid set of options was found.\n        revert InvalidOptions(_extraOptions);\n    }\n\n    /**\n     * @dev Internal function to assert that options are of type 3.\n     * @param _options The options to be checked.\n     */\n    function _assertOptionsType3(bytes calldata _options) internal pure virtual {\n        uint16 optionsType = uint16(bytes2(_options[0:2]));\n        if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\n    }\n}\n"},{"file_path":"node_modules/@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":"src/library/Utils.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nlibrary Utils {\n    error ZeroAddress();\n    error ZeroValue();\n\n    function ensureNonzeroAddress(address addr) internal pure {\n        if (addr == address(0)) revert ZeroAddress();\n    }\n\n    function ensureNonZero(uint256 val) internal pure {\n        if (val == 0) revert ZeroValue();\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 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":"node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Packet } from \"../../interfaces/ISendLib.sol\";\nimport { AddressCast } from \"../../libs/AddressCast.sol\";\n\nlibrary PacketV1Codec {\n    using AddressCast for address;\n    using AddressCast for bytes32;\n\n    uint8 internal constant PACKET_VERSION = 1;\n\n    // header (version + nonce + path)\n    // version\n    uint256 private constant PACKET_VERSION_OFFSET = 0;\n    //    nonce\n    uint256 private constant NONCE_OFFSET = 1;\n    //    path\n    uint256 private constant SRC_EID_OFFSET = 9;\n    uint256 private constant SENDER_OFFSET = 13;\n    uint256 private constant DST_EID_OFFSET = 45;\n    uint256 private constant RECEIVER_OFFSET = 49;\n    // payload (guid + message)\n    uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\n    uint256 private constant MESSAGE_OFFSET = 113;\n\n    function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\n        encodedPacket = abi.encodePacked(\n            PACKET_VERSION,\n            _packet.nonce,\n            _packet.srcEid,\n            _packet.sender.toBytes32(),\n            _packet.dstEid,\n            _packet.receiver,\n            _packet.guid,\n            _packet.message\n        );\n    }\n\n    function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\n        return\n            abi.encodePacked(\n                PACKET_VERSION,\n                _packet.nonce,\n                _packet.srcEid,\n                _packet.sender.toBytes32(),\n                _packet.dstEid,\n                _packet.receiver\n            );\n    }\n\n    function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\n        return abi.encodePacked(_packet.guid, _packet.message);\n    }\n\n    function header(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return _packet[0:GUID_OFFSET];\n    }\n\n    function version(bytes calldata _packet) internal pure returns (uint8) {\n        return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\n    }\n\n    function nonce(bytes calldata _packet) internal pure returns (uint64) {\n        return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\n    }\n\n    function srcEid(bytes calldata _packet) internal pure returns (uint32) {\n        return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\n    }\n\n    function sender(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\n    }\n\n    function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\n        return sender(_packet).toAddress();\n    }\n\n    function dstEid(bytes calldata _packet) internal pure returns (uint32) {\n        return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\n    }\n\n    function receiver(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\n    }\n\n    function receiverB20(bytes calldata _packet) internal pure returns (address) {\n        return receiver(_packet).toAddress();\n    }\n\n    function guid(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\n    }\n\n    function message(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return bytes(_packet[MESSAGE_OFFSET:]);\n    }\n\n    function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return bytes(_packet[GUID_OFFSET:]);\n    }\n\n    function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\n        return keccak256(payload(_packet));\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/EIP712Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport {IERC5267} from \"@openzeppelin/contracts/interfaces/IERC5267.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n */\nabstract contract EIP712Upgradeable is Initializable, IERC5267 {\n    bytes32 private constant TYPE_HASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.EIP712\n    struct EIP712Storage {\n        /// @custom:oz-renamed-from _HASHED_NAME\n        bytes32 _hashedName;\n        /// @custom:oz-renamed-from _HASHED_VERSION\n        bytes32 _hashedVersion;\n\n        string _name;\n        string _version;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.EIP712\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;\n\n    function _getEIP712Storage() private pure returns (EIP712Storage storage $) {\n        assembly {\n            $.slot := EIP712StorageLocation\n        }\n    }\n\n    /**\n     * @dev Initializes the domain separator and parameter caches.\n     *\n     * The meaning of `name` and `version` is specified in\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n     *\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n     * - `version`: the current major version of the signing domain.\n     *\n     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n     * contract upgrade].\n     */\n    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n        __EIP712_init_unchained(name, version);\n    }\n\n    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n        EIP712Storage storage $ = _getEIP712Storage();\n        $._name = name;\n        $._version = version;\n\n        // Reset prior values in storage if upgrading\n        $._hashedName = 0;\n        $._hashedVersion = 0;\n    }\n\n    /**\n     * @dev Returns the domain separator for the current chain.\n     */\n    function _domainSeparatorV4() internal view returns (bytes32) {\n        return _buildDomainSeparator();\n    }\n\n    function _buildDomainSeparator() private view returns (bytes32) {\n        return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));\n    }\n\n    /**\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n     * function returns the hash of the fully encoded EIP712 message for this domain.\n     *\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n     *\n     * ```solidity\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n     *     keccak256(\"Mail(address to,string contents)\"),\n     *     mailTo,\n     *     keccak256(bytes(mailContents))\n     * )));\n     * address signer = ECDSA.recover(digest, signature);\n     * ```\n     */\n    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n    }\n\n    /**\n     * @dev See {IERC-5267}.\n     */\n    function eip712Domain()\n        public\n        view\n        virtual\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        )\n    {\n        EIP712Storage storage $ = _getEIP712Storage();\n        // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized\n        // and the EIP712 domain is not reliable, as it will be missing name and version.\n        require($._hashedName == 0 && $._hashedVersion == 0, \"EIP712: Uninitialized\");\n\n        return (\n            hex\"0f\", // 01111\n            _EIP712Name(),\n            _EIP712Version(),\n            block.chainid,\n            address(this),\n            bytes32(0),\n            new uint256[](0)\n        );\n    }\n\n    /**\n     * @dev The name parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Name() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev The version parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Version() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._version;\n    }\n\n    /**\n     * @dev The hash of the name parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.\n     */\n    function _EIP712NameHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory name = _EIP712Name();\n        if (bytes(name).length > 0) {\n            return keccak256(bytes(name));\n        } else {\n            // If the name is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.\n            bytes32 hashedName = $._hashedName;\n            if (hashedName != 0) {\n                return hashedName;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n\n    /**\n     * @dev The hash of the version parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.\n     */\n    function _EIP712VersionHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory version = _EIP712Version();\n        if (bytes(version).length > 0) {\n            return keccak256(bytes(version));\n        } else {\n            // If the version is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.\n            bytes32 hashedVersion = $._hashedVersion;\n            if (hashedVersion != 0) {\n                return hashedVersion;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC20Permit} from \"../extensions/IERC20Permit.sol\";\nimport {Address} from \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    /**\n     * @dev An operation with an ERC20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        forceApprove(token, spender, oldAllowance + value);\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n     * value, non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n        unchecked {\n            uint256 currentAllowance = token.allowance(address(this), spender);\n            if (currentAllowance < requestedDecrease) {\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n            }\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data);\n        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS\n    }\n\n    /**\n     * @dev The signature derives the `address(0)`.\n     */\n    error ECDSAInvalidSignature();\n\n    /**\n     * @dev The signature has an invalid length.\n     */\n    error ECDSAInvalidSignatureLength(uint256 length);\n\n    /**\n     * @dev The signature has an S value that is in the upper half order.\n     */\n    error ECDSAInvalidSignatureS(bytes32 s);\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n     * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n     * and a bytes32 providing additional information about the error.\n     *\n     * If no error is returned, then the address can be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     */\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            /// @solidity memory-safe-assembly\n            assembly {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n     */\n    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {\n        unchecked {\n            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n            // We do not check for an overflow here since the shift operation results in 0 or 1.\n            uint8 v = uint8((uint256(vs) >> 255) + 27);\n            return tryRecover(hash, v, r, s);\n        }\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address, RecoverError, bytes32) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS, s);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature, bytes32(0));\n        }\n\n        return (signer, RecoverError.NoError, bytes32(0));\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n     */\n    function _throwError(RecoverError error, bytes32 errorArg) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert ECDSAInvalidSignature();\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert ECDSAInvalidSignatureLength(uint256(errorArg));\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert ECDSAInvalidSignatureS(errorArg);\n        }\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary AddressCast {\n    error AddressCast_InvalidSizeForAddress();\n    error AddressCast_InvalidAddress();\n\n    function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\n        if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\n        result = bytes32(_addressBytes);\n        unchecked {\n            uint256 offset = 32 - _addressBytes.length;\n            result = result >> (offset * 8);\n        }\n    }\n\n    function toBytes32(address _address) internal pure returns (bytes32 result) {\n        result = bytes32(uint256(uint160(_address)));\n    }\n\n    function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\n        if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\n        result = new bytes(_size);\n        unchecked {\n            uint256 offset = 256 - _size * 8;\n            assembly {\n                mstore(add(result, 32), shl(offset, _addressBytes32))\n            }\n        }\n    }\n\n    function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\n        result = address(uint160(uint256(_addressBytes32)));\n    }\n\n    function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\n        if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\n        result = address(bytes20(_addressBytes));\n    }\n}\n"},{"file_path":"src/core/interfaces/ICoreFacet.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ICommunityIssuance } from \"../../OSHI/interfaces/ICommunityIssuance.sol\";\nimport { IRewardManager } from \"../../OSHI/interfaces/IRewardManager.sol\";\nimport { IDebtToken } from \"./IDebtToken.sol\";\nimport { IBeacon } from \"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\";\n\ninterface ICoreFacet {\n    /// @notice Emitted when the reward manager is set\n    /// @param rewardManager The address of the reward manager\n    event RewardManagerSet(address rewardManager);\n\n    /// @notice Emitted when the fee receiver is set\n    /// @param feeReceiver The address of the fee receiver\n    event FeeReceiverSet(address feeReceiver);\n\n    /// @notice Emitted when the guardian is set\n    /// @param guardian The address of the guardian\n    event GuardianSet(address guardian);\n\n    /// @notice Emitted when the protocol is paused\n    event Paused();\n\n    /// @notice Emitted when the protocol is unpaused\n    event Unpaused();\n\n    /// @notice Sets the fee receiver address\n    /// @param _feeReceiver The address to set as the fee receiver\n    function setFeeReceiver(address _feeReceiver) external;\n\n    /// @notice Sets the reward manager address\n    /// @param _rewardManager The address to set as the reward manager\n    function setRewardManager(address _rewardManager) external;\n\n    /// @notice Sets the paused state of the protocol\n    /// @param _paused The boolean value to set the paused state\n    function setPaused(bool _paused) external;\n\n    /// @notice Returns the address of the fee receiver\n    /// @return The address of the fee receiver\n    function feeReceiver() external view returns (address);\n\n    /// @notice Returns the reward manager interface\n    /// @return The IRewardManager interface\n    function rewardManager() external view returns (IRewardManager);\n\n    /// @notice Returns the paused state of the protocol\n    /// @return A boolean indicating if the protocol is paused\n    function paused() external view returns (bool);\n\n    /// @notice Returns the start time of the protocol\n    /// @return The start time as a uint256\n    function startTime() external view returns (uint256);\n\n    /// @notice Returns the debt token interface\n    /// @return The IDebtToken interface\n    function debtToken() external view returns (IDebtToken);\n\n    /// @notice Returns the gas compensation amount\n    /// @return The gas compensation as a uint256\n    function gasCompensation() external view returns (uint256);\n\n    /// @notice Returns the sorted troves beacon interface\n    /// @return The IBeacon interface for sorted troves\n    function sortedTrovesBeacon() external view returns (IBeacon);\n\n    /// @notice Returns the trove manager beacon interface\n    /// @return The IBeacon interface for the trove manager\n    function troveManagerBeacon() external view returns (IBeacon);\n\n    /// @notice Returns the community issuance interface\n    /// @return The ICommunityIssuance interface\n    function communityIssuance() external view returns (ICommunityIssuance);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n */\nlibrary ERC1967Utils {\n    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.\n    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using\n     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n     */\n    function getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit AdminChanged(getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the EIP1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},{"file_path":"src/core/interfaces/IDebtToken.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { IERC3156FlashBorrower } from \"@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n// import {IERC20Permit} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\";\n\nimport { ITroveManager } from \"./ITroveManager.sol\";\n\ninterface IDebtToken is IERC20, IERC20Metadata {\n    /**\n     * @notice Burns a specific amount of tokens from the specified account.\n     * @param _account The address from which the tokens will be burned.\n     * @param _amount The amount of tokens to burn.\n     */\n    function burn(address _account, uint256 _amount) external;\n\n    /**\n     * @notice Burns a specific amount of tokens from the specified account with gas compensation.\n     * @param _account The address from which the tokens will be burned.\n     * @param _amount The amount of tokens to burn.\n     */\n    function burnWithGasCompensation(address _account, uint256 _amount) external;\n\n    /**\n     * @notice Enables a Trove Manager for the debt token.\n     * @param _troveManager The Trove Manager to enable.\n     */\n    function enableTroveManager(ITroveManager _troveManager) external;\n\n    /**\n     * @notice Initiates a flash loan.\n     * @param receiver The contract that will receive the flash loan.\n     * @param token The address of the token to be loaned.\n     * @param amount The amount of tokens to loan.\n     * @param data Additional data to pass to the receiver.\n     * @return A boolean indicating if the operation was successful.\n     */\n    function flashLoan(\n        IERC3156FlashBorrower receiver,\n        address token,\n        uint256 amount,\n        bytes calldata data\n    )\n        external\n        returns (bool);\n\n    /**\n     * @notice Mints a specific amount of tokens to the specified account.\n     * @param _account The address to which the tokens will be minted.\n     * @param _amount The amount of tokens to mint.\n     */\n    function mint(address _account, uint256 _amount) external;\n\n    /**\n     * @notice Mints a specific amount of tokens to the specified account with gas compensation.\n     * @param _account The address to which the tokens will be minted.\n     * @param _amount The amount of tokens to mint.\n     */\n    function mintWithGasCompensation(address _account, uint256 _amount) external;\n\n    /**\n     * @notice Returns a specific amount of tokens from a pool to a receiver.\n     * @param _poolAddress The address of the pool.\n     * @param _receiver The address to receive the tokens.\n     * @param _amount The amount of tokens to return.\n     */\n    function returnFromPool(address _poolAddress, address _receiver, uint256 _amount) external;\n\n    /**\n     * @notice Sends a specific amount of tokens to the Stability Pool.\n     * @param _sender The address sending the tokens.\n     * @param _amount The amount of tokens to send.\n     */\n    function sendToXApp(address _sender, uint256 _amount) external;\n\n    /**\n     * @notice Transfers a specific amount of tokens to a recipient.\n     * @param recipient The address to receive the tokens.\n     * @param amount The amount of tokens to transfer.\n     * @return A boolean indicating if the operation was successful.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @notice Transfers a specific amount of tokens from a sender to a recipient.\n     * @param sender The address from which the tokens will be transferred.\n     * @param recipient The address to receive the tokens.\n     * @param amount The amount of tokens to transfer.\n     * @return A boolean indicating if the operation was successful.\n     */\n    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @notice Returns the gas compensation amount for debt operations.\n     * @return The gas compensation amount as a uint256.\n     */\n    function DEBT_GAS_COMPENSATION() external view returns (uint256);\n\n    /**\n     * @notice Returns the flash loan fee.\n     * @return The flash loan fee as a uint256.\n     */\n    function FLASH_LOAN_FEE() external view returns (uint256);\n\n    /**\n     * @notice Returns the address of the SatoshiX application.\n     * @return The address of the SatoshiX application.\n     */\n    function satoshiXApp() external view returns (address);\n\n    /**\n     * @notice Calculates the flash fee for a given token and amount.\n     * @param token The address of the token.\n     * @param amount The amount of tokens.\n     * @return The flash fee as a uint256.\n     */\n    function flashFee(address token, uint256 amount) external view returns (uint256);\n\n    /**\n     * @notice Returns the maximum flash loan amount for a given token.\n     * @param token The address of the token.\n     * @return The maximum flash loan amount as a uint256.\n     */\n    function maxFlashLoan(address token) external view returns (uint256);\n\n    /**\n     * @notice Checks if a Trove Manager is enabled.\n     * @param _troveManager The Trove Manager to check.\n     * @return A boolean indicating if the Trove Manager is enabled.\n     */\n    function troveManager(ITroveManager _troveManager) external view returns (bool);\n\n    /**\n     * @notice Initializes the debt token with the specified parameters.\n     * @param _name The name of the token.\n     * @param _symbol The symbol of the token.\n     * @param _gasPool The address of the gas pool.\n     * @param _satoshiXApp The address of the SatoshiX application.\n     * @param _owner The address of the owner.\n     * @param _debtGasCompensation The gas compensation amount for debt operations.\n     */\n    function initialize(\n        string memory _name,\n        string memory _symbol,\n        address _gasPool,\n        address _satoshiXApp,\n        address _owner,\n        uint256 _debtGasCompensation\n    )\n        external;\n\n    /**\n     * @notice Checks if an address is authorized as a ward.\n     * @param _address The address to check.\n     * @return A boolean indicating if the address is a ward.\n     */\n    function wards(address _address) external view returns (bool);\n\n    /**\n     * @notice Grants authorization to an address.\n     * @param _address The address to authorize.\n     */\n    function rely(address _address) external;\n\n    /**\n     * @notice Revokes authorization from an address.\n     * @param _address The address to deauthorize.\n     */\n    function deny(address _address) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\n     * See {_onlyProxy}.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\n    struct ERC20Storage {\n        mapping(address account => uint256) _balances;\n\n        mapping(address account => mapping(address spender => uint256)) _allowances;\n\n        uint256 _totalSupply;\n\n        string _name;\n        string _symbol;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC20\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n    function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n        assembly {\n            $.slot := ERC20StorageLocation\n        }\n    }\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        ERC20Storage storage $ = _getERC20Storage();\n        $._name = name_;\n        $._symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            $._totalSupply += value;\n        } else {\n            uint256 fromBalance = $._balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                $._balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                $._totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                $._balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     * ```\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        $._allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},{"file_path":"node_modules/@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":"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20PermitUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Permit.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20Permit} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\";\nimport {ERC20Upgradeable} from \"../ERC20Upgradeable.sol\";\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport {EIP712Upgradeable} from \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport {NoncesUpgradeable} from \"../../../utils/NoncesUpgradeable.sol\";\nimport {Initializable} from \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20Permit, EIP712Upgradeable, NoncesUpgradeable {\n    bytes32 private constant PERMIT_TYPEHASH =\n        keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n\n    /**\n     * @dev Permit deadline has expired.\n     */\n    error ERC2612ExpiredSignature(uint256 deadline);\n\n    /**\n     * @dev Mismatched signature.\n     */\n    error ERC2612InvalidSigner(address signer, address owner);\n\n    /**\n     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n     *\n     * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n     */\n    function __ERC20Permit_init(string memory name) internal onlyInitializing {\n        __EIP712_init_unchained(name, \"1\");\n    }\n\n    function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n    /**\n     * @inheritdoc IERC20Permit\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual {\n        if (block.timestamp > deadline) {\n            revert ERC2612ExpiredSignature(deadline);\n        }\n\n        bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n        bytes32 hash = _hashTypedDataV4(structHash);\n\n        address signer = ECDSA.recover(hash, v, r, s);\n        if (signer != owner) {\n            revert ERC2612InvalidSigner(signer, owner);\n        }\n\n        _approve(owner, spender, value);\n    }\n\n    /**\n     * @inheritdoc IERC20Permit\n     */\n    function nonces(address owner) public view virtual override(IERC20Permit, NoncesUpgradeable) returns (uint256) {\n        return super.nonces(owner);\n    }\n\n    /**\n     * @inheritdoc IERC20Permit\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {\n        return _domainSeparatorV4();\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IPreCrime.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\nstruct PreCrimePeer {\n    uint32 eid;\n    bytes32 preCrime;\n    bytes32 oApp;\n}\n\n// TODO not done yet\ninterface IPreCrime {\n    error OnlyOffChain();\n\n    // for simulate()\n    error PacketOversize(uint256 max, uint256 actual);\n    error PacketUnsorted();\n    error SimulationFailed(bytes reason);\n\n    // for preCrime()\n    error SimulationResultNotFound(uint32 eid);\n    error InvalidSimulationResult(uint32 eid, bytes reason);\n    error CrimeFound(bytes crime);\n\n    function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\n\n    function simulate(\n        bytes[] calldata _packets,\n        uint256[] calldata _packetMsgValues\n    ) external payable returns (bytes memory);\n\n    function buildSimulationResult() external view returns (bytes memory);\n\n    function preCrime(\n        bytes[] calldata _packets,\n        uint256[] calldata _packetMsgValues,\n        bytes[] calldata _simulations\n    ) external;\n\n    function version() external view returns (uint64 major, uint8 minor);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\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[EIP 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":"src/OSHI/interfaces/IRewardManager.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { IWETH } from \"../../core/helpers/interfaces/IWETH.sol\";\nimport { IDebtToken } from \"../../core/interfaces/IDebtToken.sol\";\n\nimport { ITroveManager } from \"../../core/interfaces/ITroveManager.sol\";\nimport { IOSHIToken } from \"./IOSHIToken.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nenum LockDuration {\n    THREE, // 3 months\n    SIX, // 6 months\n    NINE, // 9 months\n    TWELVE // 12 months\n\n}\n\nuint256 constant NUMBER_OF_LOCK_DURATIONS = 4;\n\ninterface IRewardManager {\n    event TroveManagerRegistered(ITroveManager);\n    event TroveManagerRemoved(ITroveManager);\n    event DebtTokenSet(address);\n    event WETHSet(address);\n    event TotalOSHIStakedUpdated(uint256);\n    event StakeChanged(address, uint256);\n    event StakingGainsWithdrawn(address, uint256[], uint256);\n    event StakerSnapshotsUpdated(address, uint256[], uint256);\n    event F_COLLUpdated(address, uint256);\n    event F_SATUpdated(uint256);\n    event WhitelistCallerSet(address, bool);\n    event SatoshiXappSet(address);\n    event OSHITokenSet(address);\n\n    error NativeTokenTransferFailed();\n\n    struct Snapshot {\n        uint256[1000] F_COLL_Snapshot;\n        uint256 F_SAT_Snapshot;\n    }\n\n    struct Stake {\n        address staker;\n        uint256 amount;\n        LockDuration lockDuration;\n        uint32 endTime;\n    }\n\n    struct StakeData {\n        uint256 lockWeights;\n        uint32[NUMBER_OF_LOCK_DURATIONS] nextUnlockIndex;\n    }\n\n    function initialize(\n        address owner,\n        address _satoshiXApp,\n        address _weth,\n        address _debtToken,\n        address _oshiToken\n    )\n        external;\n    function stake(uint256 _amount, LockDuration _duration) external;\n    function unstake(uint256 _amount) external;\n    function claimReward() external;\n    function claimFee() external;\n    function increaseCollPerUintStaked(uint256 _amount) external;\n    function increaseSATPerUintStaked(uint256 _amount) external;\n    function getPendingCollGain(address _user) external view returns (uint256[] memory);\n    function getPendingSATGain(address _user) external view returns (uint256);\n    function registerTroveManager(ITroveManager _troveManager) external;\n    function removeTroveManager(ITroveManager _troveManager) external;\n    function setAddresses(address _satoshiXApp, address _weth, address _debtToken, address _oshiToken) external;\n    function F_SAT() external view returns (uint256);\n    function F_COLL(uint256) external view returns (uint256);\n    function collForFeeReceiver(uint256) external view returns (uint256);\n    function satForFeeReceiver() external view returns (uint256);\n    function debtToken() external view returns (IDebtToken);\n    function oshiToken() external view returns (IOSHIToken);\n    function collToken(uint256) external view returns (IERC20);\n    function weth() external view returns (IWETH);\n    function satoshiXApp() external view returns (address);\n    function collTokenIndex(address _collToken) external view returns (uint256);\n    function totalOSHIWeightedStaked() external view returns (uint256);\n    function getAvailableUnstakeAmount(address _user) external view returns (uint256);\n    function getSnapshot(address _user) external view returns (Snapshot memory);\n    function getUserStakes(address _user, uint256 _index) external view returns (Stake[] memory);\n    function getStakeData(address _user) external view returns (StakeData memory);\n    function isTroveManagerRegistered(address) external view returns (bool);\n    function setWhitelistCaller(address _caller, bool _status) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"},{"file_path":"src/OSHI/interfaces/IOSHIToken.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\ninterface IOSHIToken is IERC20Metadata {\n    function initialize(address owner) external;\n    function mint(address account, uint256 amount) external;\n    function burn(address account, uint256 amount) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.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 {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"node_modules/@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":"lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashBorrower.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC3156FlashBorrower.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC3156 FlashBorrower, as defined in\n * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].\n */\ninterface IERC3156FlashBorrower {\n    /**\n     * @dev Receive a flash loan.\n     * @param initiator The initiator of the loan.\n     * @param token The loan currency.\n     * @param amount The amount of tokens lent.\n     * @param fee The additional amount of tokens to repay.\n     * @param data Arbitrary data structure, intended to contain user-defined parameters.\n     * @return The keccak256 hash of \"ERC3156FlashBorrower.onFlashLoan\"\n     */\n    function onFlashLoan(\n        address initiator,\n        address token,\n        uint256 amount,\n        uint256 fee,\n        bytes calldata data\n    ) external returns (bytes32);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"src/core/helpers/interfaces/IWETH.sol","source_code":"// SPDX-License-Identifier: MIT\n// solhint-disable-next-line\npragma solidity ^0.8.20;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @title WETH interface\n * @author Term Structure Labs\n * @notice Interface for WETH contract\n */\ninterface IWETH is IERC20 {\n    /// @notice Deposit ETH to get WETH\n    function deposit() external payable;\n\n    /// @notice Withdraw WETH to get ETH\n    function withdraw(uint256) external;\n}\n"},{"file_path":"node_modules/@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":"node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppCoreUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n */\nabstract contract OAppCoreUpgradeable is IOAppCore, OwnableUpgradeable {\n    struct OAppCoreStorage {\n        mapping(uint32 => bytes32) peers;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oappcore\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OAPP_CORE_STORAGE_LOCATION =\n        0x72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900;\n\n    function _getOAppCoreStorage() internal pure returns (OAppCoreStorage storage $) {\n        assembly {\n            $.slot := OAPP_CORE_STORAGE_LOCATION\n        }\n    }\n\n    // The LayerZero endpoint associated with the given OApp\n    ILayerZeroEndpointV2 public immutable endpoint;\n\n    /**\n     * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\n     * @param _endpoint The address of the LOCAL Layer Zero endpoint.\n     */\n    constructor(address _endpoint) {\n        endpoint = ILayerZeroEndpointV2(_endpoint);\n    }\n\n    /**\n     * @dev Initializes the OAppCore with the provided delegate.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppCore_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init_unchained(_delegate);\n    }\n\n    function __OAppCore_init_unchained(address _delegate) internal onlyInitializing {\n        if (_delegate == address(0)) revert InvalidDelegate();\n        endpoint.setDelegate(_delegate);\n    }\n\n    /**\n     * @notice Returns the peer address (OApp instance) associated with a specific endpoint.\n     * @param _eid The endpoint ID.\n     * @return peer The address of the peer associated with the specified endpoint.\n     */\n    function peers(uint32 _eid) public view override returns (bytes32) {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        return $.peers[_eid];\n    }\n\n    /**\n     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @param _peer The address of the peer to be associated with the corresponding endpoint.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n     * @dev Set this to bytes32(0) to remove the peer address.\n     * @dev Peer is a bytes32 to accommodate non-evm chains.\n     */\n    function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        $.peers[_eid] = _peer;\n        emit PeerSet(_eid, _peer);\n    }\n\n    /**\n     * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\n     * ie. the peer is set to bytes32(0).\n     * @param _eid The endpoint ID.\n     * @return peer The address of the peer associated with the specified endpoint.\n     */\n    function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        bytes32 peer = $.peers[_eid];\n        if (peer == bytes32(0)) revert NoPeer(_eid);\n        return peer;\n    }\n\n    /**\n     * @notice Sets the delegate address for the OApp.\n     * @param _delegate The address of the delegate to be set.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\n     */\n    function setDelegate(address _delegate) public onlyOwner {\n        endpoint.setDelegate(_delegate);\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\nimport { SetConfigParam } from \"./IMessageLibManager.sol\";\n\nenum MessageLibType {\n    Send,\n    Receive,\n    SendAndReceive\n}\n\ninterface IMessageLib is IERC165 {\n    function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\n\n    function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\n\n    function isSupportedEid(uint32 _eid) external view returns (bool);\n\n    // message libs of same major version are compatible\n    function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\n\n    function messageLibType() external view returns (MessageLibType);\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppSenderUpgradeable.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 { OAppCoreUpgradeable } from \"./OAppCoreUpgradeable.sol\";\n\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n */\nabstract contract OAppSenderUpgradeable is OAppCoreUpgradeable {\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     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppSender_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init(_delegate);\n    }\n\n    function __OAppSender_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for 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":"node_modules/@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":"lib/openzeppelin-contracts/contracts/utils/Strings.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n    uint8 private constant ADDRESS_LENGTH = 20;\n\n    /**\n     * @dev The `value` string doesn't fit in the specified `length`.\n     */\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            /// @solidity memory-safe-assembly\n            assembly {\n                ptr := add(buffer, add(32, length))\n            }\n            while (true) {\n                ptr--;\n                /// @solidity memory-safe-assembly\n                assembly {\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toStringSigned(int256 value) internal pure returns (string memory) {\n        return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        uint256 localValue = value;\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = HEX_DIGITS[localValue & 0xf];\n            localValue >>= 4;\n        }\n        if (localValue != 0) {\n            revert StringsInsufficientHexLength(value, length);\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n     * representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor(string memory name_, string memory symbol_) {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            _totalSupply += value;\n        } else {\n            uint256 fromBalance = _balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                _balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     * ```\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        _allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},{"file_path":"node_modules/@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":"node_modules/@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":"lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // must be unchecked in order to support `n = type(int256).min`\n            return uint256(n >= 0 ? n : -n);\n        }\n    }\n}\n"},{"file_path":"node_modules/@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":"lib/openzeppelin-contracts/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":"node_modules/@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\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":"lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n    /**\n     * @dev MAY be emitted to signal that the domain could have changed.\n     */\n    event EIP712DomainChanged();\n\n    /**\n     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n     * signature.\n     */\n    function eip712Domain()\n        external\n        view\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        );\n}\n"},{"file_path":"src/core/interfaces/ISortedTroves.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ITroveManager } from \"./ITroveManager.sol\";\n\n/// @title ISortedTroves\n/// @notice Interface for managing a sorted list of troves based on their NICR (Nominal Individual Collateral Ratio).\ninterface ISortedTroves {\n    /// @notice Emitted when a node is added to the list.\n    /// @param _id The address of the node added.\n    /// @param _NICR The NICR of the node added.\n    event NodeAdded(address _id, uint256 _NICR);\n\n    /// @notice Emitted when a node is removed from the list.\n    /// @param _id The address of the node removed.\n    event NodeRemoved(address _id);\n\n    /// @notice Emitted when the Trove Manager is set.\n    /// @param _troveManager The address of the Trove Manager contract.\n    event SetTroveManager(address _troveManager);\n\n    /// @notice Initializes the contract with the given owner.\n    /// @param owner The address of the owner.\n    function initialize(address owner) external;\n\n    /// @notice Inserts a node into the list.\n    /// @param _id The address of the node to insert.\n    /// @param _NICR The NICR of the node to insert.\n    /// @param _prevId The address of the previous node in the list.\n    /// @param _nextId The address of the next node in the list.\n    function insert(address _id, uint256 _NICR, address _prevId, address _nextId) external;\n\n    /// @notice Re-inserts a node into the list with a new NICR.\n    /// @param _id The address of the node to re-insert.\n    /// @param _newNICR The new NICR of the node.\n    /// @param _prevId The address of the previous node in the list.\n    /// @param _nextId The address of the next node in the list.\n    function reInsert(address _id, uint256 _newNICR, address _prevId, address _nextId) external;\n\n    /// @notice Removes a node from the list.\n    /// @param _id The address of the node to remove.\n    function remove(address _id) external;\n\n    /// @notice Sets the configuration for the Trove Manager.\n    /// @param _troveManager The address of the Trove Manager contract.\n    function setConfig(ITroveManager _troveManager) external;\n\n    /// @notice Checks if a node exists in the list.\n    /// @param _id The address of the node to check.\n    /// @return True if the node exists, false otherwise.\n    function contains(address _id) external view returns (bool);\n\n    /// @notice Returns the data of the list.\n    /// @return head The address of the head node.\n    /// @return tail The address of the tail node.\n    /// @return size The current size of the list.\n    function data() external view returns (address head, address tail, uint256 size);\n\n    /// @notice Finds the insert position for a node with a given NICR.\n    /// @param _NICR The NICR of the node to insert.\n    /// @param _prevId The address of the previous node in the list.\n    /// @param _nextId The address of the next node in the list.\n    /// @return The addresses of the previous and next nodes for the insert position.\n    function findInsertPosition(\n        uint256 _NICR,\n        address _prevId,\n        address _nextId\n    )\n        external\n        view\n        returns (address, address);\n\n    /// @notice Gets the first node in the list.\n    /// @return The address of the first node.\n    function getFirst() external view returns (address);\n\n    /// @notice Gets the last node in the list.\n    /// @return The address of the last node.\n    function getLast() external view returns (address);\n\n    /// @notice Gets the next node in the list for a given node.\n    /// @param _id The address of the current node.\n    /// @return The address of the next node.\n    function getNext(address _id) external view returns (address);\n\n    /// @notice Gets the previous node in the list for a given node.\n    /// @param _id The address of the current node.\n    /// @return The address of the previous node.\n    function getPrev(address _id) external view returns (address);\n\n    /// @notice Gets the size of the list.\n    /// @return The current size of the list.\n    function getSize() external view returns (uint256);\n\n    /// @notice Checks if the list is empty.\n    /// @return True if the list is empty, false otherwise.\n    function isEmpty() external view returns (bool);\n\n    /// @notice Gets the Trove Manager contract.\n    /// @return The address of the Trove Manager contract.\n    function troveManager() external view returns (ITroveManager);\n\n    /// @notice Validates the insert position for a node with a given NICR.\n    /// @param _NICR The NICR of the node to insert.\n    /// @param _prevId The address of the previous node in the list.\n    /// @param _nextId The address of the next node in the list.\n    /// @return True if the insert position is valid, false otherwise.\n    function validInsertPosition(uint256 _NICR, address _prevId, address _nextId) external view returns (bool);\n}\n\n// Information for a node in the list\nstruct Node {\n    bool exists;\n    ///< Indicates if the node exists in the list.\n    address nextId;\n    ///< Id of next node (smaller NICR) in the list.\n    address prevId;\n}\n///< Id of previous node (larger NICR) in the list.\n\n// Information for the list\nstruct Data {\n    address head;\n    ///< Head of the list. Also the node in the list with the largest NICR.\n    address tail;\n    ///< Tail of the list. Also the node in the list with the smallest NICR.\n    uint256 size;\n    ///< Current size of the list.\n    mapping(address => Node) nodes;\n}\n///< Track the corresponding ids for each node in the list.\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/precrime/OAppPreCrimeSimulatorUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { IPreCrime } from \"@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IPreCrime.sol\";\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \"@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol\";\n\n/**\n * @title OAppPreCrimeSimulator\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\n */\nabstract contract OAppPreCrimeSimulatorUpgradeable is IOAppPreCrimeSimulator, OwnableUpgradeable {\n    struct OAppPreCrimeSimulatorStorage {\n        // The address of the preCrime implementation.\n        address preCrime;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oappprecrimesimulator\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OAPP_PRE_CRIME_SIMULATOR_STORAGE_LOCATION =\n        0xefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b600;\n\n    function _getOAppPreCrimeSimulatorStorage() internal pure returns (OAppPreCrimeSimulatorStorage storage $) {\n        assembly {\n            $.slot := OAPP_PRE_CRIME_SIMULATOR_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppPreCrimeSimulator_init() internal onlyInitializing {}\n\n    function __OAppPreCrimeSimulator_init_unchained() internal onlyInitializing {}\n\n    function preCrime() external view override returns (address) {\n        OAppPreCrimeSimulatorStorage storage $ = _getOAppPreCrimeSimulatorStorage();\n        return $.preCrime;\n    }\n\n    /**\n     * @dev Retrieves the address of the OApp contract.\n     * @return The address of the OApp contract.\n     *\n     * @dev The simulator contract is the base contract for the OApp by default.\n     * @dev If the simulator is a separate contract, override this function.\n     */\n    function oApp() external view virtual returns (address) {\n        return address(this);\n    }\n\n    /**\n     * @dev Sets the preCrime contract address.\n     * @param _preCrime The address of the preCrime contract.\n     */\n    function setPreCrime(address _preCrime) public virtual onlyOwner {\n        OAppPreCrimeSimulatorStorage storage $ = _getOAppPreCrimeSimulatorStorage();\n        $.preCrime = _preCrime;\n        emit PreCrimeSet(_preCrime);\n    }\n\n    /**\n     * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\n     * @param _packets An array of InboundPacket objects representing received packets to be delivered.\n     *\n     * @dev WARNING: MUST revert at the end with the simulation results.\n     * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\n     * WITHOUT actually executing them.\n     */\n    function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\n        for (uint256 i = 0; i < _packets.length; i++) {\n            InboundPacket calldata packet = _packets[i];\n\n            // Ignore packets that are not from trusted peers.\n            if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\n\n            // @dev Because a verifier is calling this function, it doesnt have access to executor params:\n            //  - address _executor\n            //  - bytes calldata _extraData\n            // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\n            // They are instead stubbed to default values, address(0) and bytes(\"\")\n            // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\n            // which would cause the revert to be ignored.\n            this.lzReceiveSimulate{ value: packet.value }(\n                packet.origin,\n                packet.guid,\n                packet.message,\n                packet.executor,\n                packet.extraData\n            );\n        }\n\n        // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\n        revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\n    }\n\n    /**\n     * @dev Is effectively an internal function because msg.sender must be address(this).\n     * Allows resetting the call stack for 'internal' calls.\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 of the packet.\n     * @param _message The message payload of the packet.\n     * @param _executor The executor address for the packet.\n     * @param _extraData Additional data for the packet.\n     */\n    function lzReceiveSimulate(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) external payable virtual {\n        // @dev Ensure ONLY can be called 'internally'.\n        if (msg.sender != address(this)) revert OnlySelf();\n        _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\n    }\n\n    /**\n     * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\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 GUID of the LayerZero message.\n     * @param _message The LayerZero message.\n     * @param _executor The address of the off-chain executor.\n     * @param _extraData Arbitrary data passed by the msg executor.\n     *\n     * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n     * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n     */\n    function _lzReceiveSimulate(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) internal virtual;\n\n    /**\n     * @dev checks if the specified peer is considered 'trusted' by the OApp.\n     * @param _eid The endpoint Id to check.\n     * @param _peer The peer to check.\n     * @return Whether the peer passed is considered 'trusted' by the OApp.\n     */\n    function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\n}\n"},{"file_path":"node_modules/@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":"src/core/libs/OFTPermitUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOFT, OFTCoreUpgradeable } from \"@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTCoreUpgradeable.sol\";\nimport { ERC20PermitUpgradeable } from\n    \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol\";\n\n/**\n * @title OFT Contract\n * @dev OFT is an ERC-20 token that extends the functionality of the OFTCore contract.\n */\nabstract contract OFTPermitUpgradeable is OFTCoreUpgradeable, ERC20PermitUpgradeable {\n    /**\n     * @dev Constructor for the OFT contract.\n     * @param _lzEndpoint The LayerZero endpoint address.\n     */\n    constructor(address _lzEndpoint) OFTCoreUpgradeable(decimals(), _lzEndpoint) { }\n\n    /**\n     * @dev Initializes the OFT with the provided name, symbol, and delegate.\n     * @param _name The name of the OFT.\n     * @param _symbol The symbol of the OFT.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OFT_init(string memory _name, string memory _symbol, address _delegate) internal onlyInitializing {\n        __ERC20_init(_name, _symbol);\n        __ERC20Permit_init(_name);\n        __OFTCore_init(_delegate);\n    }\n\n    function __OFT_init_unchained() internal onlyInitializing { }\n\n    /**\n     * @dev Retrieves the address of the underlying ERC20 implementation.\n     * @return The address of the OFT token.\n     *\n     * @dev In the case of OFT, address(this) and erc20 are the same contract.\n     */\n    function token() public view returns (address) {\n        return address(this);\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 OFT where the contract IS the token, approval is NOT required.\n     */\n    function approvalRequired() external pure virtual returns (bool) {\n        return false;\n    }\n\n    /**\n     * @dev 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    )\n        internal\n        virtual\n        override\n        returns (uint256 amountSentLD, uint256 amountReceivedLD)\n    {\n        (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n\n        // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90,\n        // therefore amountSentLD CAN differ from amountReceivedLD.\n\n        // @dev Default OFT burns on src.\n        _burn(_from, amountSentLD);\n    }\n\n    /**\n     * @dev 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(\n        address _to,\n        uint256 _amountLD,\n        uint32 /*_srcEid*/\n    )\n        internal\n        virtual\n        override\n        returns (uint256 amountReceivedLD)\n    {\n        if (_to == address(0x0)) _to = address(0xdead); // _mint(...) does not support address(0x0)\n        // @dev Default OFT mints on dst.\n        _mint(_to, _amountLD);\n        // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD.\n        return _amountLD;\n    }\n}\n"},{"file_path":"src/OSHI/interfaces/ICommunityIssuance.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { IOSHIToken } from \"./IOSHIToken.sol\";\n\ninterface ICommunityIssuance {\n    event SetAllocation(address indexed receiver, uint256 amount);\n    event OSHITokenSet(IOSHIToken _oshiToken);\n    event SatoshiXappSet(address _satoshiXApp);\n\n    function transferAllocatedTokens(address receiver, uint256 amount) external;\n    function setAllocated(address[] calldata _recipients, uint256[] calldata _amounts) external;\n    function collectAllocatedTokens(uint256 amount) external;\n    function allocated(address) external view returns (uint256);\n    function collected(address) external view returns (uint256);\n    function satoshiXApp() external view returns (address);\n    function OSHIToken() external view returns (IOSHIToken);\n    function initialize(address owner, IOSHIToken _oshiToken, address _satoshiXApp) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},{"file_path":"node_modules/@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":"lib/openzeppelin-contracts/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":"node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { MessagingFee } from \"./ILayerZeroEndpointV2.sol\";\nimport { IMessageLib } from \"./IMessageLib.sol\";\n\nstruct Packet {\n    uint64 nonce;\n    uint32 srcEid;\n    address sender;\n    uint32 dstEid;\n    bytes32 receiver;\n    bytes32 guid;\n    bytes message;\n}\n\ninterface ISendLib is IMessageLib {\n    function send(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external returns (MessagingFee memory, bytes memory encodedPacket);\n\n    function quote(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external view returns (MessagingFee memory);\n\n    function setTreasury(address _treasury) external;\n\n    function withdrawFee(address _to, uint256 _amount) external;\n\n    function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppOptionsType3.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Struct representing enforced option parameters.\n */\nstruct EnforcedOptionParam {\n    uint32 eid; // Endpoint ID\n    uint16 msgType; // Message Type\n    bytes options; // Additional options\n}\n\n/**\n * @title IOAppOptionsType3\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\n */\ninterface IOAppOptionsType3 {\n    // Custom error message for invalid options\n    error InvalidOptions(bytes options);\n\n    // Event emitted when enforced options are set\n    event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\n\n    /**\n     * @notice Sets enforced options for specific endpoint and message type combinations.\n     * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n     */\n    function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\n\n    /**\n     * @notice Combines options for a given endpoint and message type.\n     * @param _eid The endpoint ID.\n     * @param _msgType The OApp message type.\n     * @param _extraOptions Additional options passed by the caller.\n     * @return options The combination of caller specified options AND enforced options.\n     */\n    function combineOptions(\n        uint32 _eid,\n        uint16 _msgType,\n        bytes calldata _extraOptions\n    ) external view returns (bytes memory options);\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n *     doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n *     token.safeTransferFrom(msg.sender, address(this), value);\n *     ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     *\n     * CAUTION: See Security Considerations above.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.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 { OAppSenderUpgradeable, MessagingFee, MessagingReceipt } from \"./OAppSenderUpgradeable.sol\";\n// @dev Import the 'Origin' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport { OAppReceiverUpgradeable, Origin } from \"./OAppReceiverUpgradeable.sol\";\nimport { OAppCoreUpgradeable } from \"./OAppCoreUpgradeable.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 OAppUpgradeable is OAppSenderUpgradeable, OAppReceiverUpgradeable {\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     */\n    constructor(address _endpoint) OAppCoreUpgradeable(_endpoint) {}\n\n    /**\n     * @dev Initializes the OApp with the provided delegate.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OApp_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init(_delegate);\n        __OAppReceiver_init_unchained();\n        __OAppSender_init_unchained();\n    }\n\n    function __OApp_init_unchained() internal onlyInitializing {}\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(OAppSenderUpgradeable, OAppReceiverUpgradeable)\n        returns (uint64 senderVersion, uint64 receiverVersion)\n    {\n        return (SENDER_VERSION, RECEIVER_VERSION);\n    }\n}\n"},{"file_path":"node_modules/@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":"node_modules/@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":"node_modules/@layerzerolabs/oapp-evm/contracts/precrime/libs/Packet.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\n\n/**\n * @title InboundPacket\n * @dev Structure representing an inbound packet received by the contract.\n */\nstruct InboundPacket {\n    Origin origin; // Origin information of the packet.\n    uint32 dstEid; // Destination endpointId of the packet.\n    address receiver; // Receiver address for the packet.\n    bytes32 guid; // Unique identifier of the packet.\n    uint256 value; // msg.value of the packet.\n    address executor; // Executor address for the packet.\n    bytes message; // Message payload of the packet.\n    bytes extraData; // Additional arbitrary data for the packet.\n}\n\n/**\n * @title PacketDecoder\n * @dev Library for decoding LayerZero packets.\n */\nlibrary PacketDecoder {\n    using PacketV1Codec for bytes;\n\n    /**\n     * @dev Decode an inbound packet from the given packet data.\n     * @param _packet The packet data to decode.\n     * @return packet An InboundPacket struct representing the decoded packet.\n     */\n    function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\n        packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\n        packet.dstEid = _packet.dstEid();\n        packet.receiver = _packet.receiverB20();\n        packet.guid = _packet.guid();\n        packet.message = _packet.message();\n    }\n\n    /**\n     * @dev Decode multiple inbound packets from the given packet data and associated message values.\n     * @param _packets An array of packet data to decode.\n     * @param _packetMsgValues An array of associated message values for each packet.\n     * @return packets An array of InboundPacket structs representing the decoded packets.\n     */\n    function decode(\n        bytes[] calldata _packets,\n        uint256[] memory _packetMsgValues\n    ) internal pure returns (InboundPacket[] memory packets) {\n        packets = new InboundPacket[](_packets.length);\n        for (uint256 i = 0; i < _packets.length; i++) {\n            bytes calldata packet = _packets[i];\n            packets[i] = PacketDecoder.decode(packet);\n            // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\n            packets[i].value = _packetMsgValues[i];\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/NoncesUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract NoncesUpgradeable is Initializable {\n    /**\n     * @dev The nonce used for an `account` is not the expected current nonce.\n     */\n    error InvalidAccountNonce(address account, uint256 currentNonce);\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.Nonces\n    struct NoncesStorage {\n        mapping(address account => uint256) _nonces;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Nonces\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant NoncesStorageLocation = 0x5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb00;\n\n    function _getNoncesStorage() private pure returns (NoncesStorage storage $) {\n        assembly {\n            $.slot := NoncesStorageLocation\n        }\n    }\n\n    function __Nonces_init() internal onlyInitializing {\n    }\n\n    function __Nonces_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns the next unused nonce for an address.\n     */\n    function nonces(address owner) public view virtual returns (uint256) {\n        NoncesStorage storage $ = _getNoncesStorage();\n        return $._nonces[owner];\n    }\n\n    /**\n     * @dev Consumes a nonce.\n     *\n     * Returns the current value and increments nonce.\n     */\n    function _useNonce(address owner) internal virtual returns (uint256) {\n        NoncesStorage storage $ = _getNoncesStorage();\n        // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n        // decremented or reset. This guarantees that the nonce never overflows.\n        unchecked {\n            // It is important to do x++ and not ++x here.\n            return $._nonces[owner]++;\n        }\n    }\n\n    /**\n     * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n     */\n    function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n        uint256 current = _useNonce(owner);\n        if (nonce != current) {\n            revert InvalidAccountNonce(owner, current);\n        }\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppReceiverUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppReceiver.sol\";\nimport { OAppCoreUpgradeable } from \"./OAppCoreUpgradeable.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiverUpgradeable is IOAppReceiver, OAppCoreUpgradeable {\n    // Custom error message for when the caller is not the registered endpoint/\n    error OnlyEndpoint(address addr);\n\n    // @dev The version of the OAppReceiver implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant RECEIVER_VERSION = 2;\n\n    /**\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppReceiver_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init(_delegate);\n    }\n\n    function __OAppReceiver_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n     * ie. this is a RECEIVE only OApp.\n     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\n     */\n    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n        return (0, RECEIVER_VERSION);\n    }\n\n    /**\n     * @notice 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":"src/core/interfaces/ITroveManager.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ICommunityIssuance } from \"../../OSHI/interfaces/ICommunityIssuance.sol\";\nimport { IDebtToken } from \"./IDebtToken.sol\";\nimport { ISortedTroves } from \"./ISortedTroves.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/// @title ITroveManager\n/// @notice Interface for the Trove Manager contract\ninterface ITroveManager {\n    /// @notice Emitted when the base rate is updated\n    /// @param _baseRate The new base rate\n    event BaseRateUpdated(uint256 _baseRate);\n\n    /// @notice Emitted when collateral is sent\n    /// @param _to The address to which the collateral is sent\n    /// @param _amount The amount of collateral sent\n    event CollateralSent(address _to, uint256 _amount);\n\n    /// @notice Emitted when L terms are updated\n    /// @param _L_collateral The updated L_collateral value\n    /// @param _L_debt The updated L_debt value\n    event LTermsUpdated(uint256 _L_collateral, uint256 _L_debt);\n\n    /// @notice Emitted when the last fee operation time is updated\n    /// @param _lastFeeOpTime The updated last fee operation time\n    event LastFeeOpTimeUpdated(uint256 _lastFeeOpTime);\n\n    /// @notice Emitted during a redemption operation\n    /// @param _user The address of the user to operate redeem\n    /// @param _attemptedDebtAmount The attempted debt amount to redeem\n    /// @param _actualDebtAmount The actual debt amount redeemed\n    /// @param _collateralSent The amount of collateral sent\n    /// @param _collateralFee The collateral fee\n    event Redemption(\n        address _user,\n        uint256 _attemptedDebtAmount,\n        uint256 _actualDebtAmount,\n        uint256 _collateralSent,\n        uint256 _collateralFee\n    );\n\n    /// @notice Emitted when system snapshots are updated\n    /// @param _totalStakesSnapshot The total stakes snapshot\n    /// @param _totalCollateralSnapshot The total collateral snapshot\n    event SystemSnapshotsUpdated(uint256 _totalStakesSnapshot, uint256 _totalCollateralSnapshot);\n\n    /// @notice Emitted when total stakes are updated\n    /// @param _newTotalStakes The new total stakes\n    event TotalStakesUpdated(uint256 _newTotalStakes);\n\n    /// @notice Emitted when a trove index is updated\n    /// @param _borrower The address of the borrower\n    /// @param _newIndex The new index of the trove\n    event TroveIndexUpdated(address _borrower, uint256 _newIndex);\n\n    /// @notice Emitted when trove snapshots are updated\n    /// @param _L_collateral The updated L_collateral value\n    /// @param _L_debt The updated L_debt value\n    event TroveSnapshotsUpdated(uint256 _L_collateral, uint256 _L_debt);\n\n    /// @notice Emitted when a trove is updated\n    /// @param _borrower The address of the borrower\n    /// @param _debt The updated debt value\n    /// @param _coll The updated collateral value\n    /// @param _stake The updated stake value\n    /// @param _operation The operation performed on the trove\n    event TroveUpdated(\n        address indexed _borrower, uint256 _debt, uint256 _coll, uint256 _stake, TroveManagerOperation _operation\n    );\n\n    /// @notice Emitted when the configuration is set\n    /// @param _sortedTroves The address of the sorted troves contract\n    /// @param _collateralToken The address of the collateral token\n    /// @param systemDeploymentTime The system deployment time\n    /// @param sunsetting The sunsetting status\n    /// @param activeInterestIndex The active interest index\n    /// @param lastActiveIndexUpdate The last active index update time\n    event SetConfig(\n        address _sortedTroves,\n        address _collateralToken,\n        uint256 systemDeploymentTime,\n        bool sunsetting,\n        uint256 activeInterestIndex,\n        uint256 lastActiveIndexUpdate\n    );\n\n    /// @notice Emitted when a reward is claimed\n    /// @param account The address of the account claiming the reward\n    /// @param recipient The address of the recipient receiving the reward\n    /// @param claimed The amount of reward claimed\n    event RewardClaimed(address indexed account, address indexed recipient, uint256 claimed);\n\n    /// @notice Emitted when the claim start time is set\n    /// @param _startTime The claim start time\n    event ClaimStartTimeSet(uint32 _startTime);\n\n    /// @notice Emitted when interest is collected\n    /// @param _troveManager The address of the trove manager\n    /// @param _amount The amount of interest collected\n    event InterestCollected(address _troveManager, uint256 _amount);\n\n    /// @notice Emitted when collateral is transferred\n    /// @param _recipient The address of the recipient\n    /// @param _amount The amount of collateral transferred\n    event CollateralTransferred(address indexed _recipient, uint256 _amount);\n\n    /// @notice Emitted when collateral is received\n    /// @param _sender The address of the sender\n    /// @param _amount The amount of collateral received\n    event CollateralReceived(address indexed _sender, uint256 _amount);\n\n    /// @notice Emitted when farming parameters are set\n    /// @param _retainPercentage The retain percentage\n    /// @param _refillPercentage The refill percentage\n    event FarmingParamsSet(uint256 _retainPercentage, uint256 _refillPercentage);\n\n    /// @notice Emitted when the vault manager is set\n    /// @param _vaultManager The address of the vault manager\n    event VaultManagerSet(address _vaultManager);\n\n    /// @notice Error thrown when a non-privileged address attempts a privileged action\n    /// @param sender The address of the sender\n    error NotPrivileged(address sender);\n\n    /// @notice Initializes the trove manager\n    /// @param _owner The address of the owner\n    /// @param _gasPool The address of the gas pool\n    /// @param _debtToken The address of the debt token\n    /// @param _communityIssuance The address of the community issuance contract\n    /// @param _satoshiXApp The address of the SatoshiX app\n    /// @param _debtGasCompensation The debt gas compensation\n    function initialize(\n        address _owner,\n        address _gasPool,\n        IDebtToken _debtToken,\n        ICommunityIssuance _communityIssuance,\n        address _satoshiXApp,\n        uint256 _debtGasCompensation\n    )\n        external;\n\n    /// @notice Adds collateral surplus for a borrower\n    /// @param borrower The address of the borrower\n    /// @param collSurplus The amount of collateral surplus\n    function addCollateralSurplus(address borrower, uint256 collSurplus) external;\n\n    /// @notice Applies pending rewards for a borrower\n    /// @param _borrower The address of the borrower\n    /// @return coll The amount of collateral\n    /// @return debt The amount of debt\n    function applyPendingRewards(address _borrower) external returns (uint256 coll, uint256 debt);\n\n    /// @notice Claims collateral for a receiver\n    /// @param _receiver The address of the receiver\n    function claimCollateral(address _receiver) external;\n\n    /// @notice Closes a trove\n    /// @param _borrower The address of the borrower\n    /// @param _receiver The address of the receiver\n    /// @param collAmount The amount of collateral\n    /// @param debtAmount The amount of debt\n    function closeTrove(address _borrower, address _receiver, uint256 collAmount, uint256 debtAmount) external;\n\n    /// @notice Closes a trove by liquidation\n    /// @param _borrower The address of the borrower\n    function closeTroveByLiquidation(address _borrower) external;\n\n    /// @notice Collects interests\n    function collectInterests() external;\n\n    /// @notice Decays the base rate and gets the borrowing fee\n    /// @param _debt The amount of debt\n    /// @return The borrowing fee\n    function decayBaseRateAndGetBorrowingFee(uint256 _debt) external returns (uint256);\n\n    /// @notice Decreases debt and sends collateral\n    /// @param account The address of the account\n    /// @param debt The amount of debt\n    /// @param coll The amount of collateral\n    function decreaseDebtAndSendCollateral(address account, uint256 debt, uint256 coll) external;\n\n    /// @notice Fetches the price\n    /// @return The price\n    function fetchPrice() external returns (uint256);\n\n    /// @notice Finalizes a liquidation\n    /// @param _liquidator The address of the liquidator\n    /// @param _debt The amount of debt\n    /// @param _coll The amount of collateral\n    /// @param _collSurplus The amount of collateral surplus\n    /// @param _debtGasComp The debt gas compensation\n    /// @param _collGasComp The collateral gas compensation\n    function finalizeLiquidation(\n        address _liquidator,\n        uint256 _debt,\n        uint256 _coll,\n        uint256 _collSurplus,\n        uint256 _debtGasComp,\n        uint256 _collGasComp\n    )\n        external;\n\n    /// @notice Gets the entire system balances\n    /// @return The total debt, total collateral, and total stakes\n    function getEntireSystemBalances() external returns (uint256, uint256, uint256);\n\n    /// @notice Moves pending trove rewards to active balances\n    /// @param _debt The amount of debt\n    /// @param _collateral The amount of collateral\n    function movePendingTroveRewardsToActiveBalances(uint256 _debt, uint256 _collateral) external;\n\n    /// @notice Opens a trove\n    /// @param _borrower The address of the borrower\n    /// @param _collateralAmount The amount of collateral\n    /// @param _compositeDebt The composite debt\n    /// @param NICR The nominal individual collateral ratio\n    /// @param _upperHint The upper hint address\n    /// @param _lowerHint The lower hint address\n    /// @return stake The stake\n    /// @return arrayIndex The array index\n    function openTrove(\n        address _borrower,\n        uint256 _collateralAmount,\n        uint256 _compositeDebt,\n        uint256 NICR,\n        address _upperHint,\n        address _lowerHint\n    )\n        external\n        returns (uint256 stake, uint256 arrayIndex);\n\n    /// @notice Redeems collateral\n    /// @param _debtAmount The amount of debt\n    /// @param _firstRedemptionHint The first redemption hint address\n    /// @param _upperPartialRedemptionHint The upper partial redemption hint address\n    /// @param _lowerPartialRedemptionHint The lower partial redemption hint address\n    /// @param _partialRedemptionHintNICR The partial redemption hint NICR\n    /// @param _maxIterations The maximum number of iterations\n    /// @param _maxFeePercentage The maximum fee percentage\n    function redeemCollateral(\n        uint256 _debtAmount,\n        address _firstRedemptionHint,\n        address _upperPartialRedemptionHint,\n        address _lowerPartialRedemptionHint,\n        uint256 _partialRedemptionHintNICR,\n        uint256 _maxIterations,\n        uint256 _maxFeePercentage\n    )\n        external;\n\n    /// @notice Sets the configuration\n    /// @param _sortedTroves The address of the sorted troves contract\n    /// @param _collateralToken The address of the collateral token\n    function setConfig(ISortedTroves _sortedTroves, IERC20 _collateralToken) external;\n\n    /// @notice Sets the parameters\n    /// @param _minuteDecayFactor The minute decay factor\n    /// @param _redemptionFeeFloor The redemption fee floor\n    /// @param _maxRedemptionFee The maximum redemption fee\n    /// @param _borrowingFeeFloor The borrowing fee floor\n    /// @param _maxBorrowingFee The maximum borrowing fee\n    /// @param _interestRateInBPS The interest rate in basis points\n    /// @param _maxSystemDebt The maximum system debt\n    /// @param _MCR The minimum collateral ratio\n    /// @param _rewardRate The reward rate\n    /// @param _claimStartTime The claim start time\n    function setParameters(\n        uint256 _minuteDecayFactor,\n        uint256 _redemptionFeeFloor,\n        uint256 _maxRedemptionFee,\n        uint256 _borrowingFeeFloor,\n        uint256 _maxBorrowingFee,\n        uint256 _interestRateInBPS,\n        uint256 _maxSystemDebt,\n        uint256 _MCR,\n        uint128 _rewardRate,\n        uint32 _claimStartTime\n    )\n        external;\n\n    /// @notice Sets the trove manager reward rate\n    /// @param _newRewardRate The new reward rate\n    function setTMRewardRate(uint128 _newRewardRate) external;\n\n    /// @notice Sets the paused status\n    /// @param _paused The paused status\n    function setPaused(bool _paused) external;\n\n    /// @notice Starts the sunset process\n    function startSunset() external;\n\n    /// @notice Updates balances\n    function updateBalances() external;\n\n    /// @notice Updates a trove from adjustment\n    /// @param _isDebtIncrease Whether the debt is increased\n    /// @param _debtChange The change in debt\n    /// @param _netDebtChange The net change in debt\n    /// @param _isCollIncrease Whether the collateral is increased\n    /// @param _collChange The change in collateral\n    /// @param _upperHint The upper hint address\n    /// @param _lowerHint The lower hint address\n    /// @param _borrower The address of the borrower\n    /// @param _receiver The address of the receiver\n    /// @return The updated debt, collateral, and stake\n    function updateTroveFromAdjustment(\n        bool _isDebtIncrease,\n        uint256 _debtChange,\n        uint256 _netDebtChange,\n        bool _isCollIncrease,\n        uint256 _collChange,\n        address _upperHint,\n        address _lowerHint,\n        address _borrower,\n        address _receiver\n    )\n        external\n        returns (uint256, uint256, uint256);\n\n    /// @notice Gets the bootstrap period\n    /// @return The bootstrap period\n    function BOOTSTRAP_PERIOD() external view returns (uint256);\n\n    /// @notice Gets the L_collateral value\n    /// @return The L_collateral value\n    function L_collateral() external view returns (uint256);\n\n    /// @notice Gets the L_debt value\n    /// @return The L_debt value\n    function L_debt() external view returns (uint256);\n\n    /// @notice Gets the maximum interest rate in basis points\n    /// @return The maximum interest rate in basis points\n    function MAX_INTEREST_RATE_IN_BPS() external view returns (uint256);\n\n    /// @notice Gets the minimum collateral ratio\n    /// @return The minimum collateral ratio\n    function MCR() external view returns (uint256);\n\n    /// @notice Gets the sunsetting interest rate\n    /// @return The sunsetting interest rate\n    function SUNSETTING_INTEREST_RATE() external view returns (uint256);\n\n    /// @notice Gets the trove details for a given address\n    /// @param _borrower The address of the borrower\n    /// @return debt The debt value\n    /// @return coll The collateral value\n    /// @return stake The stake value\n    /// @return status The status of the trove\n    /// @return arrayIndex The array index\n    /// @return activeInterestIndex The active interest index\n    function troves(address _borrower)\n        external\n        view\n        returns (\n            uint256 debt,\n            uint256 coll,\n            uint256 stake,\n            Status status,\n            uint128 arrayIndex,\n            uint256 activeInterestIndex\n        );\n\n    /// @notice Gets the active interest index\n    /// @return The active interest index\n    function activeInterestIndex() external view returns (uint256);\n\n    /// @notice Gets the base rate\n    /// @return The base rate\n    function baseRate() external view returns (uint256);\n\n    /// @notice Gets the SatoshiX app address\n    /// @return The SatoshiX app address\n    function satoshiXApp() external view returns (address);\n\n    /// @notice Gets the borrowing fee floor\n    /// @return The borrowing fee floor\n    function borrowingFeeFloor() external view returns (uint256);\n\n    /// @notice Gets the collateral token\n    /// @return The collateral token\n    function collateralToken() external view returns (IERC20);\n\n    /// @notice Gets the debt token\n    /// @return The debt token\n    function debtToken() external view returns (IDebtToken);\n\n    /// @notice Gets the defaulted collateral\n    /// @return The defaulted collateral\n    function defaultedCollateral() external view returns (uint256);\n\n    /// @notice Gets the defaulted debt\n    /// @return The defaulted debt\n    function defaultedDebt() external view returns (uint256);\n\n    /// @notice Gets the borrowing fee for a given debt amount\n    /// @param _debt The debt amount\n    /// @return The borrowing fee\n    function getBorrowingFee(uint256 _debt) external view returns (uint256);\n\n    /// @notice Gets the borrowing fee with decay for a given debt amount\n    /// @param _debt The debt amount\n    /// @return The borrowing fee with decay\n    function getBorrowingFeeWithDecay(uint256 _debt) external view returns (uint256);\n\n    /// @notice Gets the borrowing rate\n    /// @return The borrowing rate\n    function getBorrowingRate() external view returns (uint256);\n\n    /// @notice Gets the borrowing rate with decay\n    /// @return The borrowing rate with decay\n    function getBorrowingRateWithDecay() external view returns (uint256);\n\n    /// @notice Gets the current individual collateral ratio for a borrower\n    /// @param _borrower The address of the borrower\n    /// @param _price The price\n    /// @return The current individual collateral ratio\n    function getCurrentICR(address _borrower, uint256 _price) external view returns (uint256);\n\n    /// @notice Gets the entire debt and collateral for a borrower\n    /// @param _borrower The address of the borrower\n    /// @return debt The debt value\n    /// @return coll The collateral value\n    /// @return pendingDebtReward The pending debt reward\n    /// @return pendingCollateralReward The pending collateral reward\n    function getEntireDebtAndColl(address _borrower)\n        external\n        view\n        returns (uint256 debt, uint256 coll, uint256 pendingDebtReward, uint256 pendingCollateralReward);\n\n    /// @notice Gets the entire system collateral\n    /// @return The entire system collateral\n    function getEntireSystemColl() external view returns (uint256);\n\n    /// @notice Gets the entire system debt\n    /// @return The entire system debt\n    function getEntireSystemDebt() external view returns (uint256);\n\n    /// @notice Gets the nominal individual collateral ratio for a borrower\n    /// @param _borrower The address of the borrower\n    /// @return The nominal individual collateral ratio\n    function getNominalICR(address _borrower) external view returns (uint256);\n\n    /// @notice Gets the pending collateral and debt rewards for a borrower\n    /// @param _borrower The address of the borrower\n    /// @return The pending collateral reward\n    /// @return The pending debt reward\n    function getPendingCollAndDebtRewards(address _borrower) external view returns (uint256, uint256);\n\n    /// @notice Gets the redemption fee with decay for a given collateral amount\n    /// @param _collateralDrawn The collateral amount\n    /// @return The redemption fee with decay\n    function getRedemptionFeeWithDecay(uint256 _collateralDrawn) external view returns (uint256);\n\n    /// @notice Gets the redemption rate\n    /// @return The redemption rate\n    function getRedemptionRate() external view returns (uint256);\n\n    /// @notice Gets the redemption rate with decay\n    /// @return The redemption rate with decay\n    function getRedemptionRateWithDecay() external view returns (uint256);\n\n    /// @notice Gets the total active collateral\n    /// @return The total active collateral\n    function getTotalActiveCollateral() external view returns (uint256);\n\n    /// @notice Gets the total active debt\n    /// @return The total active debt\n    function getTotalActiveDebt() external view returns (uint256);\n\n    /// @notice Gets the collateral and debt for a borrower's trove\n    /// @param _borrower The address of the borrower\n    /// @return coll The collateral value\n    /// @return debt The debt value\n    function getTroveCollAndDebt(address _borrower) external view returns (uint256 coll, uint256 debt);\n\n    /// @notice Gets the trove from the trove owners array\n    /// @param _index The index\n    /// @return The address of the trove owner\n    function getTroveFromTroveOwnersArray(uint256 _index) external view returns (address);\n\n    /// @notice Gets the count of trove owners\n    /// @return The count of trove owners\n    function getTroveOwnersCount() external view returns (uint256);\n\n    /// @notice Gets the stake for a borrower's trove\n    /// @param _borrower The address of the borrower\n    /// @return The stake value\n    function getTroveStake(address _borrower) external view returns (uint256);\n\n    /// @notice Gets the status of a borrower's trove\n    /// @param _borrower The address of the borrower\n    /// @return The status value\n    function getTroveStatus(address _borrower) external view returns (uint256);\n\n    /// @notice Checks if a borrower has pending rewards\n    /// @param _borrower The address of the borrower\n    /// @return True if the borrower has pending rewards, false otherwise\n    function hasPendingRewards(address _borrower) external view returns (bool);\n\n    /// @notice Gets the interest payable\n    /// @return The interest payable\n    function interestPayable() external view returns (uint256);\n\n    /// @notice Gets the interest rate\n    /// @return The interest rate\n    function interestRate() external view returns (uint256);\n\n    /// @notice Gets the last active index update time\n    /// @return The last active index update time\n    function lastActiveIndexUpdate() external view returns (uint256);\n\n    /// @notice Gets the last collateral error for redistribution\n    /// @return The last collateral error for redistribution\n    function lastCollateralError_Redistribution() external view returns (uint256);\n\n    /// @notice Gets the last debt error for redistribution\n    /// @return The last debt error for redistribution\n    function lastDebtError_Redistribution() external view returns (uint256);\n\n    /// @notice Gets the last fee operation time\n    /// @return The last fee operation time\n    function lastFeeOperationTime() external view returns (uint256);\n\n    /// @notice Gets the maximum borrowing fee\n    /// @return The maximum borrowing fee\n    function maxBorrowingFee() external view returns (uint256);\n\n    /// @notice Gets the maximum redemption fee\n    /// @return The maximum redemption fee\n    function maxRedemptionFee() external view returns (uint256);\n\n    /// @notice Gets the maximum system debt\n    /// @return The maximum system debt\n    function maxSystemDebt() external view returns (uint256);\n\n    /// @notice Gets the minute decay factor\n    /// @return The minute decay factor\n    function minuteDecayFactor() external view returns (uint256);\n\n    /// @notice Checks if the system is paused\n    /// @return True if the system is paused, false otherwise\n    function paused() external view returns (bool);\n\n    /// @notice Gets the redemption fee floor\n    /// @return The redemption fee floor\n    function redemptionFeeFloor() external view returns (uint256);\n\n    /// @notice Gets the reward snapshots for a given address\n    /// @param _borrower The address of the borrower\n    /// @return collateral The collateral value\n    /// @return debt The debt value\n    function rewardSnapshots(address _borrower) external view returns (uint256 collateral, uint256 debt);\n\n    /// @notice Gets the sorted troves contract\n    /// @return The sorted troves contract\n    function sortedTroves() external view returns (ISortedTroves);\n\n    /// @notice Checks if the system is sunsetting\n    /// @return True if the system is sunsetting, false otherwise\n    function sunsetting() external view returns (bool);\n\n    /// @notice Gets the surplus balances for a given address\n    /// @param _borrower The address of the borrower\n    /// @return The surplus balance\n    function surplusBalances(address _borrower) external view returns (uint256);\n\n    /// @notice Gets the system deployment time\n    /// @return The system deployment time\n    function systemDeploymentTime() external view returns (uint256);\n\n    /// @notice Gets the total collateral snapshot\n    /// @return The total collateral snapshot\n    function totalCollateralSnapshot() external view returns (uint256);\n\n    /// @notice Gets the total stakes\n    /// @return The total stakes\n    function totalStakes() external view returns (uint256);\n\n    /// @notice Gets the total stakes snapshot\n    /// @return The total stakes snapshot\n    function totalStakesSnapshot() external view returns (uint256);\n\n    /// @notice Claims a reward for a recipient\n    /// @param _recipient The address of the recipient\n    /// @return The amount of reward claimed\n    function claimReward(address _recipient) external returns (uint256);\n\n    /// @notice Sets the claim start time\n    /// @param _claimStartTime The claim start time\n    function setClaimStartTime(uint32 _claimStartTime) external;\n\n    /// @notice Gets the claimable reward for a given address\n    /// @param _borrower The address of the borrower\n    /// @return The claimable reward\n    function claimableReward(address _borrower) external view returns (uint256);\n\n    /// @notice Checks if the claim start time has been reached\n    /// @return True if the claim start time has been reached, false otherwise\n    function isClaimStart() external view returns (bool);\n\n    /// @notice Gets the reward rate\n    /// @return The reward rate\n    function rewardRate() external view returns (uint128);\n\n    /// @notice Gets the last update time\n    /// @return The last update time\n    function lastUpdate() external view returns (uint256);\n\n    /// @notice Gets the claim start time\n    /// @return The claim start time\n    function claimStartTime() external view returns (uint32);\n\n    /// @notice Transfers collateral to a privileged vault\n    /// @param amount The amount of collateral\n    function transferCollToPrivilegedVault(uint256 amount) external;\n\n    /// @notice Receives collateral from a privileged vault\n    /// @param amount The amount of collateral\n    function receiveCollFromPrivilegedVault(uint256 amount) external;\n\n    /// @notice Sets the farming parameters\n    /// @param retainPercentage The retain percentage\n    /// @param refillPercentage The refill percentage\n    function setFarmingParams(uint256 retainPercentage, uint256 refillPercentage) external;\n\n    /// @notice Sets the vault manager\n    /// @param vaultManager_ The address of the vault manager\n    function setVaultManager(address vaultManager_) external;\n\n    /// @notice Gets the retain percentage\n    /// @return The retain percentage\n    function retainPercentage() external view returns (uint256);\n\n    /// @notice Gets the refill percentage\n    /// @return The refill percentage\n    function refillPercentage() external view returns (uint256);\n\n    /// @notice Gets the farming precision\n    /// @return The farming precision\n    function FARMING_PRECISION() external view returns (uint256);\n}\n\n/// @notice Enum representing the status of a trove\nenum Status {\n    nonExistent,\n    active,\n    closedByOwner,\n    closedByLiquidation,\n    closedByRedemption\n}\n\n/// @notice Enum representing the operations that can be performed on a trove\nenum TroveManagerOperation {\n    open,\n    close,\n    adjust,\n    liquidate,\n    redeemCollateral\n}\n\n/// @notice Struct representing the necessary data for a trove\nstruct Trove {\n    uint256 debt;\n    uint256 coll;\n    uint256 stake;\n    Status status;\n    uint128 arrayIndex;\n    uint256 activeInterestIndex;\n}\n\n/// @notice Struct representing volume data\nstruct VolumeData {\n    uint32 amount;\n    uint32 week;\n    uint32 day;\n}\n\n/// @notice Struct representing redemption totals\nstruct RedemptionTotals {\n    uint256 remainingDebt;\n    uint256 totalDebtToRedeem;\n    uint256 totalCollateralDrawn;\n    uint256 collateralFee;\n    uint256 collateralToSendToRedeemer;\n    uint256 decayedBaseRate;\n    uint256 price;\n    uint256 totalDebtSupplyAtStart;\n}\n\n/// @notice Struct representing single redemption values\nstruct SingleRedemptionValues {\n    uint256 debtLot;\n    uint256 collateralLot;\n    bool cancelledPartial;\n}\n\n/// @notice Struct representing the collateral and debt snapshots for a given active trove\nstruct RewardSnapshot {\n    uint256 collateral;\n    uint256 debt;\n}\n\n/// @notice Struct representing farming parameters\nstruct FarmingParams {\n    uint256 retainPercentage;\n    uint256 refillPercentage;\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error AddressInsufficientBalance(address account);\n\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedInnerCall();\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert AddressInsufficientBalance(address(this));\n        }\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert FailedInnerCall();\n        }\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {FailedInnerCall} error.\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert AddressInsufficientBalance(address(this));\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n     * unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {FailedInnerCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n     */\n    function _revert(bytes memory returndata) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert FailedInnerCall();\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n    /**\n     * @dev Returns the keccak256 digest of an EIP-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing a bytes32 `messageHash` with\n     * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n     * keccak256, although any bytes32 value can be safely used because the final digest will\n     * be re-hashed.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing an arbitrary `message` with\n     * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n        return\n            keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-191 signed data with version\n     * `0x00` (data with intended validator).\n     *\n     * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n     * `validator` address. Then hashing the result.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).\n     *\n     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n     * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(ptr, hex\"19_01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            digest := keccak256(ptr, 0x42)\n        }\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTCoreUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OAppUpgradeable, Origin } from \"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.sol\";\nimport { OAppOptionsType3Upgradeable } from \"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol\";\nimport { IOAppMsgInspector } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppMsgInspector.sol\";\n\nimport { OAppPreCrimeSimulatorUpgradeable } from \"@layerzerolabs/oapp-evm-upgradeable/contracts/precrime/OAppPreCrimeSimulatorUpgradeable.sol\";\n\nimport { IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee } from \"@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol\";\nimport { OFTMsgCodec } from \"@layerzerolabs/oft-evm/contracts/libs/OFTMsgCodec.sol\";\nimport { OFTComposeMsgCodec } from \"@layerzerolabs/oft-evm/contracts/libs/OFTComposeMsgCodec.sol\";\n\n/**\n * @title OFTCore\n * @dev Abstract contract for the OftChain (OFT) token.\n */\nabstract contract OFTCoreUpgradeable is\n    IOFT,\n    OAppUpgradeable,\n    OAppPreCrimeSimulatorUpgradeable,\n    OAppOptionsType3Upgradeable\n{\n    using OFTMsgCodec for bytes;\n    using OFTMsgCodec for bytes32;\n\n    struct OFTCoreStorage {\n        // Address of an optional contract to inspect both 'message' and 'options'\n        address msgInspector;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oftcore\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OFT_CORE_STORAGE_LOCATION =\n        0x41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c00;\n\n    // @notice Provides a conversion rate when swapping between denominations of SD and LD\n    //      - shareDecimals == SD == shared Decimals\n    //      - localDecimals == LD == local decimals\n    // @dev Considers that tokens have different decimal amounts on various chains.\n    // @dev eg.\n    //  For a token\n    //      - locally with 4 decimals --> 1.2345 => uint(12345)\n    //      - remotely with 2 decimals --> 1.23 => uint(123)\n    //      - The conversion rate would be 10 ** (4 - 2) = 100\n    //  @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\n    //  you can only display 1.23 -> uint(123).\n    //  @dev To preserve the dust that would otherwise be lost on that conversion,\n    //  we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\n    uint256 public immutable decimalConversionRate;\n\n    // @notice Msg types that are used to identify the various OFT operations.\n    // @dev This can be extended in child contracts for non-default oft operations\n    // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\n    uint16 public constant SEND = 1;\n    uint16 public constant SEND_AND_CALL = 2;\n\n    event MsgInspectorSet(address inspector);\n\n    function _getOFTCoreStorage() internal pure returns (OFTCoreStorage storage $) {\n        assembly {\n            $.slot := OFT_CORE_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @dev Constructor.\n     * @param _localDecimals The decimals of the token on the local chain (this chain).\n     * @param _endpoint The address of the LayerZero endpoint.\n     */\n    constructor(uint8 _localDecimals, address _endpoint) OAppUpgradeable(_endpoint) {\n        if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\n        decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\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 pure virtual returns (bytes4 interfaceId, uint64 version) {\n        return (type(IOFT).interfaceId, 1);\n    }\n\n    /**\n     * @dev Initializes the OFTCore contract.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OFTCore_init(address _delegate) internal onlyInitializing {\n        __OApp_init(_delegate);\n        __OAppPreCrimeSimulator_init();\n        __OAppOptionsType3_init();\n    }\n\n    function __OFTCore_init_unchained() internal onlyInitializing {}\n\n    function msgInspector() public view returns (address) {\n        OFTCoreStorage storage $ = _getOFTCoreStorage();\n        return $.msgInspector;\n    }\n\n    /**\n     * @dev 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, 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     * For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\n     * ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\n     */\n    function sharedDecimals() public pure virtual returns (uint8) {\n        return 6;\n    }\n\n    /**\n     * @dev Sets the message inspector address for the OFT.\n     * @param _msgInspector The address of the message inspector.\n     *\n     * @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\n     * @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\n     */\n    function setMsgInspector(address _msgInspector) public virtual onlyOwner {\n        OFTCoreStorage storage $ = _getOFTCoreStorage();\n        $.msgInspector = _msgInspector;\n        emit MsgInspectorSet(_msgInspector);\n    }\n\n    /**\n     * @notice Provides a quote for OFT-related operations.\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        uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\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 instance.\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 Builds the options and OFT message to quote in the endpoint.\n        (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n        // @dev Calculates the LayerZero fee for the send() operation.\n        return _quote(_sendParam.dstEid, message, options, _payInLzToken);\n    }\n\n    /**\n     * @dev 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 virtual 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 on the remote OFT instance.\n        (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\n            msg.sender,\n            _sendParam.amountLD,\n            _sendParam.minAmountLD,\n            _sendParam.dstEid\n        );\n\n        // @dev Builds the options and OFT message to quote in the endpoint.\n        (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n        // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\n        msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\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     * @dev Internal function to build the message and options.\n     * @param _sendParam The parameters for the send() operation.\n     * @param _amountLD The amount in local decimals.\n     * @return message The encoded message.\n     * @return options The encoded options.\n     */\n    function _buildMsgAndOptions(\n        SendParam calldata _sendParam,\n        uint256 _amountLD\n    ) internal view virtual returns (bytes memory message, bytes memory options) {\n        bool hasCompose;\n        // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\n        (message, hasCompose) = OFTMsgCodec.encode(\n            _sendParam.to,\n            _toSD(_amountLD),\n            // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\n            // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\n            _sendParam.composeMsg\n        );\n        // @dev Change the msg type depending if its composed or not.\n        uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\n        // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\n        options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\n\n        OFTCoreStorage storage $ = _getOFTCoreStorage();\n\n        // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\n        // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\n        address inspector = $.msgInspector; // caches the msgInspector to avoid potential double storage read\n        if (inspector != address(0)) IOAppMsgInspector(inspector).inspect(message, options);\n    }\n\n    /**\n     * @dev 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    function _lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address /*_executor*/, // @dev unused in the default implementation.\n        bytes calldata /*_extraData*/ // @dev unused in the default implementation.\n    ) internal virtual override {\n        // @dev The src sending chain doesnt 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 the recipient received in local decimals\n        uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _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 listen and process the msg based on the src-chain-callers compose options passed.\n            // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\n            // For default OFT implementation there is only 1 compose msg per lzReceive, thus its 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     * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\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 LayerZero message.\n     * @param _executor The address of the off-chain executor.\n     * @param _extraData Arbitrary data passed by the msg executor.\n     *\n     * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n     * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n     */\n    function _lzReceiveSimulate(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) internal virtual override {\n        _lzReceive(_origin, _guid, _message, _executor, _extraData);\n    }\n\n    /**\n     * @dev Check if the peer is considered 'trusted' by the OApp.\n     * @param _eid The endpoint ID to check.\n     * @param _peer The peer to check.\n     * @return Whether the peer passed is considered 'trusted' by the OApp.\n     *\n     * @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\n     */\n    function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\n        return peers(_eid) == _peer;\n    }\n\n    /**\n     * @dev 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 view virtual returns (uint256 amountLD) {\n        return (_amountLD / decimalConversionRate) * decimalConversionRate;\n    }\n\n    /**\n     * @dev 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 view virtual returns (uint256 amountLD) {\n        return _amountSD * decimalConversionRate;\n    }\n\n    /**\n     * @dev 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 view virtual returns (uint64 amountSD) {\n        return uint64(_amountLD / decimalConversionRate);\n    }\n\n    /**\n     * @dev 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     * @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\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 for the token.\n        amountSentLD = _removeDust(_amountLD);\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     * @dev Internal function to perform a debit operation.\n     * @param _from The address to debit from.\n     * @param _amountLD The amount to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @param _dstEid The destination endpoint ID.\n     * @return amountSentLD The amount sent in local decimals.\n     * @return amountReceivedLD The amount received in local decimals on the remote.\n     *\n     * @dev Defined here but are intended to be overriden depending on the OFT implementation.\n     * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n     */\n    function _debit(\n        address _from,\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 _dstEid\n    ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\n\n    /**\n     * @dev Internal function to perform a credit operation.\n     * @param _to The address to credit.\n     * @param _amountLD The amount to credit in local decimals.\n     * @param _srcEid The source endpoint ID.\n     * @return amountReceivedLD The amount ACTUALLY received in local decimals.\n     *\n     * @dev Defined here but are intended to be overriden depending on the OFT implementation.\n     * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n     */\n    function _credit(\n        address _to,\n        uint256 _amountLD,\n        uint32 _srcEid\n    ) internal virtual returns (uint256 amountReceivedLD);\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_lzEndpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"ERC2612ExpiredSignature","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC2612InvalidSigner","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidDelegate","type":"error"},{"inputs":[],"name":"InvalidEndpointCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidLocalDecimals","type":"error"},{"inputs":[{"internalType":"bytes","name":"options","type":"bytes"}],"name":"InvalidOptions","type":"error"},{"inputs":[],"name":"LzTokenUnavailable","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"NoPeer","type":"error"},{"inputs":[{"internalType":"uint256","name":"msgValue","type":"uint256"}],"name":"NotEnoughNative","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"OnlyEndpoint","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"}],"name":"OnlyPeer","type":"error"},{"inputs":[],"name":"OnlySelf","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":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"name":"SimulationResult","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"}],"name":"SlippageExceeded","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroValue","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"indexed":false,"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"EnforcedOptionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"inspector","type":"address"}],"name":"MsgInspectorSet","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"peer","type":"bytes32"}],"name":"PeerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"preCrimeAddress","type":"address"}],"name":"PreCrimeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEBT_GAS_COMPENSATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FLASH_LOAN_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND_AND_CALL","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"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"}],"name":"allowInitializePath","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approvalRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burnWithGasCompensation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint16","name":"_msgType","type":"uint16"},{"internalType":"bytes","name":"_extraOptions","type":"bytes"}],"name":"combineOptions","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimalConversionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"deny","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITroveManager","name":"_troveManager","type":"address"}],"name":"enableTroveManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpointV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint16","name":"_msgType","type":"uint16"}],"name":"enforcedOptions","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"flashFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC3156FlashBorrower","name":"receiver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashLoan","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gasPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_gasPool","type":"address"},{"internalType":"address","name":"_satoshiXApp","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"debtGasCompensation_","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"","type":"tuple"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"address","name":"_sender","type":"address"}],"name":"isComposeMsgSender","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"isPeer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"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":"uint32","name":"dstEid","type":"uint32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"executor","type":"address"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct InboundPacket[]","name":"_packets","type":"tuple[]"}],"name":"lzReceiveAndRevert","outputs":[],"stateMutability":"payable","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":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceiveSimulate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"maxFlashLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintWithGasCompensation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"msgInspector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nextNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oApp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oAppVersion","outputs":[{"internalType":"uint64","name":"senderVersion","type":"uint64"},{"internalType":"uint64","name":"receiverVersion","type":"uint64"}],"stateMutability":"pure","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":[{"internalType":"uint32","name":"_eid","type":"uint32"}],"name":"peers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"preCrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[{"internalType":"address","name":"usr","type":"address"}],"name":"rely","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"returnFromPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"satoshiXApp","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"},{"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":"_sender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sendToXApp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"setEnforcedOptions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_msgInspector","type":"address"}],"name":"setMsgInspector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"setPeer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_preCrime","type":"address"}],"name":"setPreCrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITroveManager","name":"","type":"address"}],"name":"troveManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":"0000000000000000000000001a44076050125825900e736c501f859c50fe728c"}