{"file_path":"src/base/Roles/CrossChain/MultiChainLayerZeroTellerWithMultiAssetSupport.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\nimport { MultiChainTellerBase, MultiChainTellerBase_MessagesNotAllowedFrom } from \"./MultiChainTellerBase.sol\";\nimport { BridgeData, ERC20 } from \"./CrossChainTellerBase.sol\";\nimport { OAppAuth, MessagingFee, Origin, MessagingReceipt } from \"./OAppAuth/OAppAuth.sol\";\n\nimport { OptionsBuilder } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol\";\n\n/**\n * @title MultiChainLayerZeroTellerWithMultiAssetSupport\n * @notice LayerZero implementation of MultiChainTeller\n */\ncontract MultiChainLayerZeroTellerWithMultiAssetSupport is MultiChainTellerBase, OAppAuth {\n    using OptionsBuilder for bytes;\n\n    error MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidToken();\n\n    constructor(\n        address _owner,\n        address _vault,\n        address _accountant,\n        address _endpoint\n    )\n        MultiChainTellerBase(_owner, _vault, _accountant)\n        OAppAuth(_endpoint, _owner)\n    { }\n\n    /**\n     * @notice function override to return the fee quote\n     * @param shareAmount to be sent as a message\n     * @param data Bridge data\n     */\n    function _quote(uint256 shareAmount, BridgeData calldata data) internal view override returns (uint256) {\n        bytes memory _message = abi.encode(shareAmount, data.destinationChainReceiver);\n        bytes memory _options = OptionsBuilder.newOptions().addExecutorLzReceiveOption(data.messageGas, 0);\n\n        if (address(data.bridgeFeeToken) != NATIVE) {\n            revert MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidToken();\n        }\n\n        MessagingFee memory fee = _quote(data.chainSelector, _message, _options, false);\n\n        return fee.nativeFee;\n    }\n\n    /**\n     * @notice Called when data is received from the protocol. It overrides the equivalent function in the parent\n     * contract.\n     * Protocol messages are defined as packets, comprised of the following parameters.\n     * @param _origin A struct containing information about where the packet came from.\n     * @param _guid A global unique identifier for tracking the packet.\n     * @param payload Encoded message.\n     */\n    function _lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata payload,\n        address, // Executor address as specified by the OApp.\n        bytes calldata // Any extra data or options to trigger on receipt.\n    )\n        internal\n        override\n    {\n        _beforeReceive();\n\n        if (!selectorToChains[_origin.srcEid].allowMessagesFrom) {\n            revert MultiChainTellerBase_MessagesNotAllowedFrom(_origin.srcEid);\n        }\n\n        // Decode the payload to get the message\n        (uint256 shareAmount, address receiver) = abi.decode(payload, (uint256, address));\n        vault.enter(address(0), ERC20(address(0)), 0, receiver, shareAmount);\n\n        _afterReceive(shareAmount, receiver, _guid);\n    }\n\n    /**\n     * @notice bridge override to allow bridge logic to be done for bridge() and depositAndBridge()\n     * @param shareAmount to be moved across chain\n     * @param data BridgeData\n     */\n    function _bridge(uint256 shareAmount, BridgeData calldata data) internal override returns (bytes32) {\n        if (address(data.bridgeFeeToken) != NATIVE) {\n            revert MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidToken();\n        }\n\n        bytes memory _payload = abi.encode(shareAmount, data.destinationChainReceiver);\n        bytes memory _options = OptionsBuilder.newOptions().addExecutorLzReceiveOption(data.messageGas, 0);\n\n        MessagingReceipt memory receipt = _lzSend(\n            data.chainSelector,\n            _payload,\n            _options,\n            // Fee in native gas and ZRO token.\n            MessagingFee(msg.value, 0),\n            // Refund address in case of failed source message.\n            payable(msg.sender)\n        );\n\n        return receipt.guid;\n    }\n}\n","deployed_bytecode":"0x608060405260043610610254575f3560e01c80637bb4122e1161013f578063bf7e214f116100b3578063e329820811610078578063e329820814610800578063e83931af1461081f578063f2fde38b1461083e578063fbfa77cf1461085d578063ff7bd03d14610890578063ffc19a01146108af575f80fd5b8063bf7e214f14610759578063bfe1a0f214610778578063ca5eb5e11461078b578063d555f368146107aa578063de35f5cb146107c9575f80fd5b80639a94d3d0116101045780639a94d3d01461068b5780639d574420146106b65780639fdb11b6146106d5578063a69559d1146106fb578063b187bd261461070e578063bb0b6a531461072e575f80fd5b80637bb4122e146105d55780637d25a05e146105f457806382413eac1461062b5780638456cb59146106595780638da5cb5b1461066d575f80fd5b80633d935d9e116101d65780634a5e42b11161019b5780634a5e42b1146104bc5780634f129c53146104db5780634fb3ccc51461051957806355a2d64d146105645780635e280f11146105835780637a9e5e4b146105b6575f80fd5b80633d935d9e1461042c5780633e64ce991461044b5780633f4ba83a1461046a57806345ad60631461047e57806346b563f41461049d575f80fd5b8063202eac571161021c578063202eac571461030a5780632264e93014610329578063298410e5146103485780633400288b146103675780633d4bd6fe14610386575f80fd5b80630efe6a8b1461025857806312056e2d1461028a57806313137d65146102ab57806317442b70146102be5780631899ea81146102df575b5f80fd5b348015610263575f80fd5b50610277610272366004612e13565b6108ce565b6040519081526020015b60405180910390f35b348015610295575f80fd5b506102a96102a4366004612e59565b6109d7565b005b6102a96102b9366004612ece565b610a62565b3480156102c9575f80fd5b5060408051600181526002602082015201610281565b3480156102ea575f80fd5b506102776102f9366004612f66565b60066020525f908152604090205481565b348015610315575f80fd5b506102a9610324366004612f99565b610b1d565b348015610334575f80fd5b506102a9610343366004612fce565b610be0565b348015610353575f80fd5b506102a9610362366004612f66565b610caf565b348015610372575f80fd5b506102a9610381366004612ff8565b610d2b565b348015610391575f80fd5b506103eb6103a0366004613020565b60076020525f90815260409020805460019091015460ff808316926101008104909116916001600160a01b0362010000830416916001600160401b03600160b01b9091048116911685565b60408051951515865293151560208601526001600160a01b03909216928401929092526001600160401b03918216606084015216608082015260a001610281565b348015610437575f80fd5b50610277610446366004613039565b610d6a565b348015610456575f80fd5b506102776104653660046130a1565b610fbe565b348015610475575f80fd5b506102a96111ed565b348015610489575f80fd5b506102a9610498366004613020565b611255565b3480156104a8575f80fd5b506102a96104b73660046130e8565b6112de565b3480156104c7575f80fd5b506102a96104d6366004612f66565b61149c565b3480156104e6575f80fd5b506105096104f5366004612f66565b60036020525f908152604090205460ff1681565b6040519015158152602001610281565b348015610524575f80fd5b5061054c7f000000000000000000000000bb2faa1e1d6183ee3c4177476ce0d70cbd55a38881565b6040516001600160a01b039091168152602001610281565b34801561056f575f80fd5b506102a961057e366004613020565b611515565b34801561058e575f80fd5b5061054c7f000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb3681565b3480156105c1575f80fd5b506102a96105d0366004612f66565b6115b1565b3480156105e0575f80fd5b506102a96105ef366004613155565b611695565b3480156105ff575f80fd5b5061061361060e366004612ff8565b61185a565b6040516001600160401b039091168152602001610281565b348015610636575f80fd5b506105096106453660046131d1565b6001600160a01b0381163014949350505050565b348015610664575f80fd5b506102a9611862565b348015610678575f80fd5b505f5461054c906001600160a01b031681565b348015610696575f80fd5b506102776106a5366004613228565b60056020525f908152604090205481565b3480156106c1575f80fd5b506102776106d03660046130a1565b6118d0565b3480156106e0575f80fd5b5060045461061390600160601b90046001600160401b031681565b61027761070936600461324f565b6119be565b348015610719575f80fd5b5060045461050990600160a01b900460ff1681565b348015610739575f80fd5b50610277610748366004613020565b60086020525f908152604090205481565b348015610764575f80fd5b5060015461054c906001600160a01b031681565b6102a9610786366004613292565b611ac5565b348015610796575f80fd5b506102a96107a5366004612f66565b611ba5565b3480156107b5575f80fd5b506102a96107c4366004613020565b611c4f565b3480156107d4575f80fd5b506004546107e8906001600160601b031681565b6040516001600160601b039091168152602001610281565b34801561080b575f80fd5b506102a961081a3660046132f0565b611ccf565b34801561082a575f80fd5b506102a9610839366004612f66565b611dc7565b348015610849575f80fd5b506102a9610858366004612f66565b611e02565b348015610868575f80fd5b5061054c7f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f81565b34801561089b575f80fd5b506105096108aa366004613336565b611e7d565b3480156108ba575f80fd5b506102776108c936600461324f565b611eb1565b5f6108e4335f356001600160e01b031916611ec3565b6109095760405162461bcd60e51b815260040161090090613350565b60405180910390fd5b60025460011461092b5760405162461bcd60e51b815260040161090090613376565b60028055600454600160a01b900460ff161561095a5760405163e0f9e71d60e01b815260040160405180910390fd5b6001600160a01b0384165f9081526003602052604090205460ff166109925760405163645fd19f60e11b815260040160405180910390fd5b61099e84848433611f69565b90506109cb338585846004600c9054906101000a90046001600160401b03166001600160401b03166120ec565b60016002559392505050565b6109ec335f356001600160e01b031916611ec3565b610a085760405162461bcd60e51b815260040161090090613350565b6203f480816001600160401b03161115610a3557604051631fac010160e21b815260040160405180910390fd5b600480546001600160401b03909216600160601b0267ffffffffffffffff60601b19909216919091179055565b7f000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb366001600160a01b03163314610aad576040516391ac5e4f60e01b8152336004820152602401610900565b60208701803590610ac790610ac2908a613020565b612225565b14610b0557610ad96020880188613020565b60405163309afaf360e21b815263ffffffff909116600482015260208801356024820152604401610900565b610b1487878787878787612260565b50505050505050565b610b32335f356001600160e01b031916611ec3565b610b4e5760405162461bcd60e51b815260040161090090613350565b63ffffffff82165f908152600760205260409081902080546001600160a01b038416620100000261ff01600160b01b031990911617600117815590517fe925de263dcdbdc20307c9ab92758ed8cc0edf3d173dad4a3aa54c070f27a54390610bd3908590859063ffffffff9290921682526001600160a01b0316602082015260400190565b60405180910390a1505050565b610bf5335f356001600160e01b031916611ec3565b610c115760405162461bcd60e51b815260040161090090613350565b806001600160401b03165f03610c3a576040516323f0e08b60e11b815260040160405180910390fd5b63ffffffff82165f81815260076020908152604091829020805467ffffffffffffffff60b01b1916600160b01b6001600160401b038716908102919091178255835194855291840191909152917f53d0cf6aa4c6d5098568da88caa5cbffc1601722f79a7a01d6611d19d6046d2b9101610bd3565b610cc4335f356001600160e01b031916611ec3565b610ce05760405162461bcd60e51b815260040161090090613350565b6001600160a01b0381165f81815260036020526040808220805460ff19166001179055517f0e3c58ebfb2e7465fbb1c32e6b4f40c3c4f5ca77e8218a386aff8617831260d79190a250565b610d40335f356001600160e01b031916611ec3565b610d5c5760405162461bcd60e51b815260040161090090613350565b610d66828261236e565b5050565b5f610d80335f356001600160e01b031916611ec3565b610d9c5760405162461bcd60e51b815260040161090090613350565b600254600114610dbe5760405162461bcd60e51b815260040161090090613376565b60028055600454600160a01b900460ff1615610ded5760405163e0f9e71d60e01b815260040160405180910390fd5b6001600160a01b0388165f9081526003602052604090205460ff16610e255760405163645fd19f60e11b815260040160405180910390fd5b60405163d505accf60e01b81523360048201526001600160a01b037f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f81166024830152604482018990526064820187905260ff8616608483015260a4820185905260c4820184905289169063d505accf9060e4015f604051808303815f87803b158015610eb0575f80fd5b505af1925050508015610ec1575060015b610f7557604051636eb1769f60e11b81523360048201526001600160a01b037f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f811660248301528891908a169063dd62ed3e90604401602060405180830381865afa158015610f32573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f56919061339a565b1015610f75576040516301b8851f60e41b815260040160405180910390fd5b610f8188888833611f69565b9050610fae338989846004600c9054906101000a90046001600160401b03166001600160401b03166120ec565b6001600255979650505050505050565b5f610fd4335f356001600160e01b031916611ec3565b610ff05760405162461bcd60e51b815260040161090090613350565b6001600160a01b0385165f9081526003602052604090205460ff166110285760405163645fd19f60e11b815260040160405180910390fd5b835f0361104857604051630ea3153160e21b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b0386811660048301526110fe917f000000000000000000000000bb2faa1e1d6183ee3c4177476ce0d70cbd55a3889091169063820973da90602401602060405180830381865afa1580156110b2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d6919061339a565b85907f00000000000000000000000000000000000000000000000000000000000f42406123bb565b905082811015611121576040516302620f6160e61b815260040160405180910390fd5b6040516318457e6160e01b81526001600160a01b037f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f16906318457e61906111759085908990869033908b906004016133b1565b5f604051808303815f87803b15801561118c575f80fd5b505af115801561119e573d5f803e3d5ffd5b50505050846001600160a01b03167fdcc60b41ff1c604459e6aa4a7299817416b19fc586a392f111646e26597c4af9856040516111dd91815260200190565b60405180910390a2949350505050565b611202335f356001600160e01b031916611ec3565b61121e5760405162461bcd60e51b815260040161090090613350565b6004805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933905f90a1565b61126a335f356001600160e01b031916611ec3565b6112865760405162461bcd60e51b815260040161090090613350565b63ffffffff81165f81815260076020908152604091829020805461ff0019168155915192835290917fc45af64a13a09ef916a1114c59589294ec9c3095f2bfbbb093a7a96656858ded91015b60405180910390a15050565b6112f3335f356001600160e01b031916611ec3565b61130f5760405162461bcd60e51b815260040161090090613350565b8061131a83426133f8565b111561133957604051634c1eef1760e11b815260040160405180910390fd5b604080516001600160a01b038089166020830152871691810191909152606081018590526080810184905260a0810183905260c081018290525f9060e00160408051601f1981840301815291815281516020928301205f8b8152600590935291205490915081146113bd5760405163fa174ecb60e01b815260040160405180910390fd5b5f8881526005602052604080822091909155516318457e6160e01b81526001600160a01b037f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f16906318457e6190611421908a908a908a9083908b906004016133b1565b5f604051808303815f87803b158015611438575f80fd5b505af115801561144a573d5f803e3d5ffd5b50505050866001600160a01b0316887faf98ea774275cadfa3e477a7b52cba03e01197445a76bd5d0d561608708c36248360405161148a91815260200190565b60405180910390a35050505050505050565b6114b1335f356001600160e01b031916611ec3565b6114cd5760405162461bcd60e51b815260040161090090613350565b6001600160a01b0381165f81815260036020526040808220805460ff19169055517f37803e2125c48ee96c38ddf04e826daf335b0e1603579040fd275aba6d06b6fc9190a250565b61152a335f356001600160e01b031916611ec3565b6115465760405162461bcd60e51b815260040161090090613350565b63ffffffff81165f8181526007602090815260409182902080546001600160f01b0319168155600101805467ffffffffffffffff1916905590519182527f11a9d1a77f76361ed131c19b1dc5758504c51dbde2e49fc973a0ef9577ad13d5910160405180910390a150565b5f546001600160a01b0316331480611642575060015460405163b700961360e01b81526001600160a01b039091169063b70096139061160390339030906001600160e01b03195f35169060040161340b565b602060405180830381865afa15801561161e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116429190613438565b61164a575f80fd5b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b76389980198905f90a350565b6116aa335f356001600160e01b031916611ec3565b6116c65760405162461bcd60e51b815260040161090090613350565b8380156116da57506001600160401b038216155b156116f8576040516323f0e08b60e11b815260040160405180910390fd5b6040805160a081018252861515815285151560208083019182526001600160a01b038088168486019081526001600160401b03808916606087019081528882166080880190815263ffffffff8f165f908152600790965294889020965187549651935191518316600160b01b0267ffffffffffffffff60b01b199290951662010000029190911662010000600160f01b03199315156101000261ff00199215159290921661ffff199097169690961717919091169390931717835551600190920180549290911667ffffffffffffffff19909216919091179055517f92ca48f4323e5539c637c7a03bd3e43941aa078e4f165e1d02c7e309317c429c9061184a9088908890889088908890889063ffffffff969096168652931515602086015291151560408501526001600160a01b031660608401526001600160401b0390811660808401521660a082015260c00190565b60405180910390a1505050505050565b5f5b92915050565b611877335f356001600160e01b031916611ec3565b6118935760405162461bcd60e51b815260040161090090613350565b6004805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752905f90a1565b5f6118e6335f356001600160e01b031916611ec3565b6119025760405162461bcd60e51b815260040161090090613350565b6002546001146119245760405162461bcd60e51b815260040161090090613376565b600280556001600160a01b0385165f9081526003602052604090205460ff166119605760405163645fd19f60e11b815260040160405180910390fd5b61196c85858585611f69565b9050846001600160a01b03167f6f9b974223f85a1ae805c33b8b519039e2435481d949db1110de151a94d587af856040516119a991815260200190565b60405180910390a26001600255949350505050565b5f6119d4335f356001600160e01b031916611ec3565b6119f05760405162461bcd60e51b815260040161090090613350565b600454600160a01b900460ff1615611a1b5760405163e0f9e71d60e01b815260040160405180910390fd5b611a24826123d6565b611a2d33611dc7565b6040516318457e6160e01b81526001600160a01b037f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f16906318457e6190611a81905f908190819033908a906004016133b1565b5f604051808303815f87803b158015611a98575f80fd5b505af1158015611aaa573d5f803e3d5ffd5b50505050611ab88383612582565b905061185c83838361269c565b611ada335f356001600160e01b031916611ec3565b611af65760405162461bcd60e51b815260040161090090613350565b600254600114611b185760405162461bcd60e51b815260040161090090613376565b600280556001600160a01b0384165f9081526003602052604090205460ff16611b545760405163645fd19f60e11b815260040160405180910390fd5b5f611b6185858533611f69565b9050611b8e338686846004600c9054906101000a90046001600160401b03166001600160401b03166120ec565b611b9881836119be565b5050600160025550505050565b611bba335f356001600160e01b031916611ec3565b611bd65760405162461bcd60e51b815260040161090090613350565b60405163ca5eb5e160e01b81526001600160a01b0382811660048301527f000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb36169063ca5eb5e1906024015f604051808303815f87803b158015611c36575f80fd5b505af1158015611c48573d5f803e3d5ffd5b5050505050565b611c64335f356001600160e01b031916611ec3565b611c805760405162461bcd60e51b815260040161090090613350565b63ffffffff81165f81815260076020908152604091829020805460ff19168155915192835290917f1cb867ed6a020e020ea220d4f48bb8e36552abf9095e093e377d33933f2b31e491016112d2565b611ce4335f356001600160e01b031916611ec3565b611d005760405162461bcd60e51b815260040161090090613350565b806001600160401b03165f03611d29576040516323f0e08b60e11b815260040160405180910390fd5b63ffffffff83165f8181526007602090815260409182902080546001600160401b038616600160b01b0267ffffffffffffffff60b01b196001600160a01b038916620100008102610100600160b01b0319909416939093176101001716178255835194855291840191909152917f34fe916485e02ec88e487b0e611e5c9bacabba9e3eaae7a900aa08be8197d419910160405180910390a150505050565b6001600160a01b0381165f90815260066020526040902054421015611dff5760405163f64059db60e01b815260040160405180910390fd5b50565b611e17335f356001600160e01b031916611ec3565b611e335760405162461bcd60e51b815260040161090090613350565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b5f602082018035906008908390611e949086613020565b63ffffffff16815260208101919091526040015f20541492915050565b5f611ebc83836126f3565b9392505050565b6001545f906001600160a01b03168015801590611f4a575060405163b700961360e01b81526001600160a01b0382169063b700961390611f0b9087903090889060040161340b565b602060405180830381865afa158015611f26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f4a9190613438565b80611f6157505f546001600160a01b038581169116145b949350505050565b5f835f03611f8a5760405163259be69560e11b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b038681166004830152612040917f00000000000000000000000000000000000000000000000000000000000f4240917f000000000000000000000000bb2faa1e1d6183ee3c4177476ce0d70cbd55a388169063820973da90602401602060405180830381865afa158015612014573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612038919061339a565b8691906123bb565b9050828110156120635760405163097b2ad560e31b815260040160405180910390fd5b604051631ceb5d1960e11b81526001600160a01b037f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f16906339d6ba32906120b790339089908990889088906004016133b1565b5f604051808303815f87803b1580156120ce575f80fd5b505af11580156120e0573d5f803e3d5ffd5b50505050949350505050565b6120f68142613453565b6001600160a01b038681165f81815260066020908152604091829020949094556004548151948501929092529187169183019190915260608201859052608082018490524260a083015260c082018390526001600160601b03169060e00160408051601f1981840301815291815281516020928301205f848152600590935290822055600480546001600160601b03169161219083613466565b91906101000a8154816001600160601b0302191690836001600160601b0316021790555050846001600160a01b0316866001600160a01b0316827fe96d7872363f475d18b2f5390caaa5eaa96b2d38e42c62afe4ac08ebd2b13c3a87874288604051612215949392919093845260208401929092526040830152606082015260800190565b60405180910390a4505050505050565b63ffffffff81165f908152600860205260408120548061185c5760405163f6ff4fb760e01b815263ffffffff84166004820152602401610900565b6122686127b6565b60075f61227860208a018a613020565b63ffffffff16815260208101919091526040015f205460ff166122c4576122a26020880188613020565b604051635408978f60e11b815263ffffffff9091166004820152602401610900565b5f806122d28688018861348b565b604051631ceb5d1960e11b815291935091506001600160a01b037f000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f16906339d6ba329061232b905f9081908190879089906004016133b1565b5f604051808303815f87803b158015612342575f80fd5b505af1158015612354573d5f803e3d5ffd5b5050505061236382828a6127e3565b505050505050505050565b63ffffffff82165f81815260086020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91016112d2565b5f825f1904841183021582026123cf575f80fd5b5091020490565b5f6007816123e76020850185613020565b63ffffffff16815260208082019290925260409081015f20815160a081018352815460ff8082161515835261010082041615159482018590526201000081046001600160a01b031693820193909352600160b01b9092046001600160401b039081166060840152600190910154166080820152915061248f5761246d6020830183613020565b604051630a8acb5760e21b815263ffffffff9091166004820152602401610900565b60408101516001600160a01b03166124ba5760405163098a923160e41b815260040160405180910390fd5b5f6124cb6040840160208501612f66565b6001600160a01b0316036124f25760405163f4a986cb60e01b815260040160405180910390fd5b80606001516001600160401b03168260600160208101906125139190612e59565b6001600160401b0316111561253b57604051636e33764360e11b815260040160405180910390fd5b6080808201516001600160401b03169061255a90840160608501612e59565b6001600160401b03161015610d6657604051637abded0b60e11b815260040160405180910390fd5b5f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6125a86060840160408501612f66565b6001600160a01b0316146125cf57604051634e4f206760e01b815260040160405180910390fd5b5f836125e16040850160208601612f66565b6040516020016126049291909182526001600160a01b0316602082015260400190565b60408051601f1981840301815291905290505f61266161262a6080860160608701612e59565b6001600160401b03165f61265a60408051600360f01b602082015281516002818303018152602290910190915290565b919061282c565b90505f6126916126746020870187613020565b848460405180604001604052803481526020015f81525033612891565b519695505050505050565b7fe0ec62d39b054dc2fd626dbc271483735df6e6fa1ef8389754bf8ab27a75eab281846126cf6040860160208701612f66565b6040805193845260208401929092526001600160a01b031690820152606001610bd3565b5f80836127066040850160208601612f66565b6040516020016127299291909182526001600160a01b0316602082015260400190565b60408051601f1981840301815291905290505f61274f61262a6080860160608701612e59565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6127766060860160408701612f66565b6001600160a01b03161461279d57604051634e4f206760e01b815260040160405180910390fd5b5f6126916127ae6020870187613020565b84845f612997565b600454600160a01b900460ff16156127e15760405163e0f9e71d60e01b815260040160405180910390fd5b565b60408051828152602081018590526001600160a01b038416918101919091527fb944fddc61d7fedb8b736790454ba972000703b0d21c7481d6dbf95b7c2cc2f190606001610bd3565b606083600361283b825f612a75565b61ffff161461286e5761284e815f612a75565b604051633a51740d60e01b815261ffff9091166004820152602401610900565b5f6128798585612ad1565b905061288786600183612b53565b9695505050505050565b612899612dbc565b5f6128a6845f0151612bbc565b6020850151909150156128c0576128c08460200151612be3565b7f000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb366001600160a01b0316632637a450826040518060a001604052808b63ffffffff1681526020016129108c612225565b81526020018a81526020018981526020015f8960200151111515815250866040518463ffffffff1660e01b815260040161294b9291906134fb565b60806040518083038185885af1158015612967573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061298c91906135cb565b979650505050505050565b604080518082019091525f80825260208201527f000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb366001600160a01b031663ddc28c586040518060a001604052808863ffffffff1681526020016129f989612225565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401612a2e9291906134fb565b6040805180830381865afa158015612a48573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612a6c919061363c565b95945050505050565b5f612a81826002613453565b83511015612ac85760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610900565b50016002015190565b60606fffffffffffffffffffffffffffffffff821615612b2257604080516001600160801b0319608086811b8216602084015285901b16603082015201604051602081830303815290604052611ebc565b6040516001600160801b0319608085901b166020820152603001604051602081830303815290604052905092915050565b6060836003612b62825f612a75565b61ffff1614612b755761284e815f612a75565b846001612b828551612cc2565b612b8d906001613656565b8686604051602001612ba3959493929190613678565b6040516020818303038152906040529150509392505050565b5f813414612bdf576040516304fb820960e51b8152346004820152602401610900565b5090565b5f7f000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb366001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c40573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c6491906136de565b90506001600160a01b038116612c8d576040516329b99a9560e11b815260040160405180910390fd5b610d666001600160a01b038216337f000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb3685612cf0565b5f61ffff821115612bdf576040516306dfcc6560e41b81526010600482015260248101839052604401610900565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612d4a908590612d50565b50505050565b5f8060205f8451602086015f885af180612d6f576040513d5f823e3d81fd5b50505f513d91508115612d86578060011415612d93565b6001600160a01b0384163b155b15612d4a57604051635274afe760e01b81526001600160a01b0385166004820152602401610900565b60405180606001604052805f80191681526020015f6001600160401b03168152602001612dfa60405180604001604052805f81526020015f81525090565b905290565b6001600160a01b0381168114611dff575f80fd5b5f805f60608486031215612e25575f80fd5b8335612e3081612dff565b95602085013595506040909401359392505050565b6001600160401b0381168114611dff575f80fd5b5f60208284031215612e69575f80fd5b8135611ebc81612e45565b5f60608284031215612e84575f80fd5b50919050565b5f8083601f840112612e9a575f80fd5b5081356001600160401b03811115612eb0575f80fd5b602083019150836020828501011115612ec7575f80fd5b9250929050565b5f805f805f805f60e0888a031215612ee4575f80fd5b612eee8989612e74565b96506060880135955060808801356001600160401b0380821115612f10575f80fd5b612f1c8b838c01612e8a565b909750955060a08a01359150612f3182612dff565b90935060c08901359080821115612f46575f80fd5b50612f538a828b01612e8a565b989b979a50959850939692959293505050565b5f60208284031215612f76575f80fd5b8135611ebc81612dff565b803563ffffffff81168114612f94575f80fd5b919050565b5f8060408385031215612faa575f80fd5b612fb383612f81565b91506020830135612fc381612dff565b809150509250929050565b5f8060408385031215612fdf575f80fd5b612fe883612f81565b91506020830135612fc381612e45565b5f8060408385031215613009575f80fd5b61301283612f81565b946020939093013593505050565b5f60208284031215613030575f80fd5b611ebc82612f81565b5f805f805f805f60e0888a03121561304f575f80fd5b873561305a81612dff565b9650602088013595506040880135945060608801359350608088013560ff81168114613084575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f805f80608085870312156130b4575f80fd5b84356130bf81612dff565b9350602085013592506040850135915060608501356130dd81612dff565b939692955090935050565b5f805f805f805f60e0888a0312156130fe575f80fd5b87359650602088013561311081612dff565b9550604088013561312081612dff565b969995985095966060810135965060808101359560a0820135955060c0909101359350915050565b8015158114611dff575f80fd5b5f805f805f8060c0878903121561316a575f80fd5b61317387612f81565b9550602087013561318381613148565b9450604087013561319381613148565b935060608701356131a381612dff565b925060808701356131b381612e45565b915060a08701356131c381612e45565b809150509295509295509295565b5f805f8060a085870312156131e4575f80fd5b6131ee8686612e74565b935060608501356001600160401b03811115613208575f80fd5b61321487828801612e8a565b90945092505060808501356130dd81612dff565b5f60208284031215613238575f80fd5b5035919050565b5f60a08284031215612e84575f80fd5b5f8060408385031215613260575f80fd5b8235915060208301356001600160401b0381111561327c575f80fd5b6132888582860161323f565b9150509250929050565b5f805f80608085870312156132a5575f80fd5b84356132b081612dff565b9350602085013592506040850135915060608501356001600160401b038111156132d8575f80fd5b6132e48782880161323f565b91505092959194509250565b5f805f60608486031215613302575f80fd5b61330b84612f81565b9250602084013561331b81612dff565b9150604084013561332b81612e45565b809150509250925092565b5f60608284031215613346575f80fd5b611ebc8383612e74565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b6020808252600a90820152695245454e5452414e435960b01b604082015260600190565b5f602082840312156133aa575f80fd5b5051919050565b6001600160a01b039586168152938516602085015260408401929092529092166060820152608081019190915260a00190565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561185c5761185c6133e4565b6001600160a01b0393841681529190921660208201526001600160e01b0319909116604082015260600190565b5f60208284031215613448575f80fd5b8151611ebc81613148565b8082018082111561185c5761185c6133e4565b5f6001600160601b03808316818103613481576134816133e4565b6001019392505050565b5f806040838503121561349c575f80fd5b823591506020830135612fc381612dff565b5f5b838110156134c85781810151838201526020016134b0565b50505f910152565b5f81518084526134e78160208601602086016134ae565b601f01601f19169290920160200192915050565b6040815263ffffffff8351166040820152602083015160608201525f604084015160a0608084015261353060e08401826134d0565b90506060850151603f198483030160a085015261354d82826134d0565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b5f60408284031215613583575f80fd5b604051604081018181106001600160401b03821117156135b157634e487b7160e01b5f52604160045260245ffd5b604052825181526020928301519281019290925250919050565b5f608082840312156135db575f80fd5b604051606081018181106001600160401b038211171561360957634e487b7160e01b5f52604160045260245ffd5b60405282518152602083015161361e81612e45565b60208201526136308460408501613573565b60408201529392505050565b5f6040828403121561364c575f80fd5b611ebc8383613573565b61ffff818116838216019080821115613671576136716133e4565b5092915050565b5f8651613689818460208b016134ae565b6001600160f81b031960f888811b82169285019283526001600160f01b031960f089901b16600184015286901b16600382015283516136cf8160048401602088016134ae565b01600401979650505050505050565b5f602082840312156136ee575f80fd5b8151611ebc81612dff56fea26469706673582212202217d2ef181455ff322fd5943f99cad7ead64276d2f0951c74a53affa656484764736f6c63430008150033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"github_repository_metadata":null,"compiler_settings":{"evmVersion":"shanghai","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"":["*"],"*":["*"]}},"remappings":["@axelar-network/=node_modules/@axelar-network/","@balancer-labs/v2-interfaces/=lib/ion-protocol/lib/balancer-v2-monorepo/pkg/interfaces/","@balancer-labs/v2-pool-stable/=lib/ion-protocol/lib/balancer-v2-monorepo/pkg/pool-stable/","@chainlink/=node_modules/@chainlink/","@ds-test/=lib/forge-std/lib/ds-test/src/","@eth-optimism/=node_modules/@eth-optimism/","@forge-std/=lib/forge-std/src/","@ion-protocol/=lib/ion-protocol/src/","@layerzerolabs/=node_modules/@layerzerolabs/","@openzeppelin/=lib/openzeppelin-contracts/","@solmate/=lib/solmate/src/","@uniswap/v3-core/=lib/ion-protocol/lib/v3-core/","@uniswap/v3-periphery/=lib/ion-protocol/lib/v3-periphery/","balancer-v2-monorepo/=lib/ion-protocol/lib/","chainlink/=lib/ion-protocol/lib/chainlink/","createx/=lib/createx/src/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-safe/=lib/ion-protocol/lib/forge-safe/","forge-std/=lib/forge-std/src/","halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/","hardhat-deploy/=node_modules/hardhat-deploy/","ion-protocol/=lib/ion-protocol/","openzeppelin-contracts-upgradeable/=lib/ion-protocol/lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin/=lib/createx/lib/openzeppelin-contracts/contracts/","pendle-core-v2-public/=lib/ion-protocol/lib/pendle-core-v2-public/contracts/","solady/=lib/ion-protocol/lib/solady/","solarray/=lib/ion-protocol/lib/solarray/src/","solidity-bytes-utils/=node_modules/solidity-bytes-utils/","solidity-stringutils/=lib/ion-protocol/lib/forge-safe/lib/surl/lib/solidity-stringutils/","solmate/=lib/solmate/src/","surl/=lib/ion-protocol/lib/forge-safe/lib/surl/","v3-core/=lib/ion-protocol/lib/v3-core/","v3-periphery/=lib/v3-periphery/contracts/"]},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0x04354e44ed31022716e77eC6320C04Eda153010c",{"internalType":"address","name":"_owner","type":"address"}],["0xdddD73F5Df1F0DC31373357beAC77545dC5A6f3F",{"internalType":"address","name":"_vault","type":"address"}],["0xbB2fAA1e1D6183EE3c4177476ce0d70CBd55A388",{"internalType":"address","name":"_accountant","type":"address"}],["0xC1b15d3B262bEeC0e3565C11C9e0F6134BdaCB36",{"internalType":"address","name":"_endpoint","type":"address"}]],"compiler_version":"v0.8.21+commit.d9974bed","is_verified_via_verifier_alliance":false,"verified_at":"2026-09-01T17:31:34.728756Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x61010060405260016002819055600480546001600160601b03191690911790553480156200002b575f80fd5b5060405162003bac38038062003bac8339810160408190526200004e9162000237565b5f80546001600160a01b0386166001600160a01b03199182168117835560018054909216909155604051839287928492849283928a928a928592859285928592859285928592909133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908490a36040516001600160a01b0382169033907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b76389980198905f90a350506001600160a01b03821660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa1580156200013d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000163919062000291565b6200017090600a620003c9565b60c0526001600160a01b0390811660a0528a811660e05289169750620001b1965050505050505057604051632d618d8160e21b815260040160405180910390fd5b60e05160405163ca5eb5e160e01b81526001600160a01b0383811660048301529091169063ca5eb5e1906024015f604051808303815f87803b158015620001f6575f80fd5b505af115801562000209573d5f803e3d5ffd5b505050505050505050505050620003d9565b80516001600160a01b038116811462000232575f80fd5b919050565b5f805f80608085870312156200024b575f80fd5b62000256856200021b565b935062000266602086016200021b565b925062000276604086016200021b565b915062000286606086016200021b565b905092959194509250565b5f60208284031215620002a2575f80fd5b815160ff81168114620002b3575f80fd5b9392505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200030e57815f1904821115620002f257620002f2620002ba565b808516156200030057918102915b93841c9390800290620002d3565b509250929050565b5f826200032657506001620003c3565b816200033457505f620003c3565b81600181146200034d5760028114620003585762000378565b6001915050620003c3565b60ff8411156200036c576200036c620002ba565b50506001821b620003c3565b5060208310610133831016604e8410600b84101617156200039d575081810a620003c3565b620003a98383620002ce565b805f1904821115620003bf57620003bf620002ba565b0290505b92915050565b5f620002b360ff84168362000316565b60805160a05160c05160e05161372f6200047d5f395f818161059401528181610a6401528181611bf5015281816128c2015281816129ac01528181612be60152612c9d01525f81816110da0152611fad01525f818161052a0152818161106b0152611fcf01525f818161086e01528181610e4201528181610ee201528181611138015281816113e401528181611a440152818161207a01526122ee015261372f5ff3fe608060405260043610610254575f3560e01c80637bb4122e1161013f578063bf7e214f116100b3578063e329820811610078578063e329820814610800578063e83931af1461081f578063f2fde38b1461083e578063fbfa77cf1461085d578063ff7bd03d14610890578063ffc19a01146108af575f80fd5b8063bf7e214f14610759578063bfe1a0f214610778578063ca5eb5e11461078b578063d555f368146107aa578063de35f5cb146107c9575f80fd5b80639a94d3d0116101045780639a94d3d01461068b5780639d574420146106b65780639fdb11b6146106d5578063a69559d1146106fb578063b187bd261461070e578063bb0b6a531461072e575f80fd5b80637bb4122e146105d55780637d25a05e146105f457806382413eac1461062b5780638456cb59146106595780638da5cb5b1461066d575f80fd5b80633d935d9e116101d65780634a5e42b11161019b5780634a5e42b1146104bc5780634f129c53146104db5780634fb3ccc51461051957806355a2d64d146105645780635e280f11146105835780637a9e5e4b146105b6575f80fd5b80633d935d9e1461042c5780633e64ce991461044b5780633f4ba83a1461046a57806345ad60631461047e57806346b563f41461049d575f80fd5b8063202eac571161021c578063202eac571461030a5780632264e93014610329578063298410e5146103485780633400288b146103675780633d4bd6fe14610386575f80fd5b80630efe6a8b1461025857806312056e2d1461028a57806313137d65146102ab57806317442b70146102be5780631899ea81146102df575b5f80fd5b348015610263575f80fd5b50610277610272366004612e13565b6108ce565b6040519081526020015b60405180910390f35b348015610295575f80fd5b506102a96102a4366004612e59565b6109d7565b005b6102a96102b9366004612ece565b610a62565b3480156102c9575f80fd5b5060408051600181526002602082015201610281565b3480156102ea575f80fd5b506102776102f9366004612f66565b60066020525f908152604090205481565b348015610315575f80fd5b506102a9610324366004612f99565b610b1d565b348015610334575f80fd5b506102a9610343366004612fce565b610be0565b348015610353575f80fd5b506102a9610362366004612f66565b610caf565b348015610372575f80fd5b506102a9610381366004612ff8565b610d2b565b348015610391575f80fd5b506103eb6103a0366004613020565b60076020525f90815260409020805460019091015460ff808316926101008104909116916001600160a01b0362010000830416916001600160401b03600160b01b9091048116911685565b60408051951515865293151560208601526001600160a01b03909216928401929092526001600160401b03918216606084015216608082015260a001610281565b348015610437575f80fd5b50610277610446366004613039565b610d6a565b348015610456575f80fd5b506102776104653660046130a1565b610fbe565b348015610475575f80fd5b506102a96111ed565b348015610489575f80fd5b506102a9610498366004613020565b611255565b3480156104a8575f80fd5b506102a96104b73660046130e8565b6112de565b3480156104c7575f80fd5b506102a96104d6366004612f66565b61149c565b3480156104e6575f80fd5b506105096104f5366004612f66565b60036020525f908152604090205460ff1681565b6040519015158152602001610281565b348015610524575f80fd5b5061054c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610281565b34801561056f575f80fd5b506102a961057e366004613020565b611515565b34801561058e575f80fd5b5061054c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105c1575f80fd5b506102a96105d0366004612f66565b6115b1565b3480156105e0575f80fd5b506102a96105ef366004613155565b611695565b3480156105ff575f80fd5b5061061361060e366004612ff8565b61185a565b6040516001600160401b039091168152602001610281565b348015610636575f80fd5b506105096106453660046131d1565b6001600160a01b0381163014949350505050565b348015610664575f80fd5b506102a9611862565b348015610678575f80fd5b505f5461054c906001600160a01b031681565b348015610696575f80fd5b506102776106a5366004613228565b60056020525f908152604090205481565b3480156106c1575f80fd5b506102776106d03660046130a1565b6118d0565b3480156106e0575f80fd5b5060045461061390600160601b90046001600160401b031681565b61027761070936600461324f565b6119be565b348015610719575f80fd5b5060045461050990600160a01b900460ff1681565b348015610739575f80fd5b50610277610748366004613020565b60086020525f908152604090205481565b348015610764575f80fd5b5060015461054c906001600160a01b031681565b6102a9610786366004613292565b611ac5565b348015610796575f80fd5b506102a96107a5366004612f66565b611ba5565b3480156107b5575f80fd5b506102a96107c4366004613020565b611c4f565b3480156107d4575f80fd5b506004546107e8906001600160601b031681565b6040516001600160601b039091168152602001610281565b34801561080b575f80fd5b506102a961081a3660046132f0565b611ccf565b34801561082a575f80fd5b506102a9610839366004612f66565b611dc7565b348015610849575f80fd5b506102a9610858366004612f66565b611e02565b348015610868575f80fd5b5061054c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561089b575f80fd5b506105096108aa366004613336565b611e7d565b3480156108ba575f80fd5b506102776108c936600461324f565b611eb1565b5f6108e4335f356001600160e01b031916611ec3565b6109095760405162461bcd60e51b815260040161090090613350565b60405180910390fd5b60025460011461092b5760405162461bcd60e51b815260040161090090613376565b60028055600454600160a01b900460ff161561095a5760405163e0f9e71d60e01b815260040160405180910390fd5b6001600160a01b0384165f9081526003602052604090205460ff166109925760405163645fd19f60e11b815260040160405180910390fd5b61099e84848433611f69565b90506109cb338585846004600c9054906101000a90046001600160401b03166001600160401b03166120ec565b60016002559392505050565b6109ec335f356001600160e01b031916611ec3565b610a085760405162461bcd60e51b815260040161090090613350565b6203f480816001600160401b03161115610a3557604051631fac010160e21b815260040160405180910390fd5b600480546001600160401b03909216600160601b0267ffffffffffffffff60601b19909216919091179055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610aad576040516391ac5e4f60e01b8152336004820152602401610900565b60208701803590610ac790610ac2908a613020565b612225565b14610b0557610ad96020880188613020565b60405163309afaf360e21b815263ffffffff909116600482015260208801356024820152604401610900565b610b1487878787878787612260565b50505050505050565b610b32335f356001600160e01b031916611ec3565b610b4e5760405162461bcd60e51b815260040161090090613350565b63ffffffff82165f908152600760205260409081902080546001600160a01b038416620100000261ff01600160b01b031990911617600117815590517fe925de263dcdbdc20307c9ab92758ed8cc0edf3d173dad4a3aa54c070f27a54390610bd3908590859063ffffffff9290921682526001600160a01b0316602082015260400190565b60405180910390a1505050565b610bf5335f356001600160e01b031916611ec3565b610c115760405162461bcd60e51b815260040161090090613350565b806001600160401b03165f03610c3a576040516323f0e08b60e11b815260040160405180910390fd5b63ffffffff82165f81815260076020908152604091829020805467ffffffffffffffff60b01b1916600160b01b6001600160401b038716908102919091178255835194855291840191909152917f53d0cf6aa4c6d5098568da88caa5cbffc1601722f79a7a01d6611d19d6046d2b9101610bd3565b610cc4335f356001600160e01b031916611ec3565b610ce05760405162461bcd60e51b815260040161090090613350565b6001600160a01b0381165f81815260036020526040808220805460ff19166001179055517f0e3c58ebfb2e7465fbb1c32e6b4f40c3c4f5ca77e8218a386aff8617831260d79190a250565b610d40335f356001600160e01b031916611ec3565b610d5c5760405162461bcd60e51b815260040161090090613350565b610d66828261236e565b5050565b5f610d80335f356001600160e01b031916611ec3565b610d9c5760405162461bcd60e51b815260040161090090613350565b600254600114610dbe5760405162461bcd60e51b815260040161090090613376565b60028055600454600160a01b900460ff1615610ded5760405163e0f9e71d60e01b815260040160405180910390fd5b6001600160a01b0388165f9081526003602052604090205460ff16610e255760405163645fd19f60e11b815260040160405180910390fd5b60405163d505accf60e01b81523360048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152604482018990526064820187905260ff8616608483015260a4820185905260c4820184905289169063d505accf9060e4015f604051808303815f87803b158015610eb0575f80fd5b505af1925050508015610ec1575060015b610f7557604051636eb1769f60e11b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660248301528891908a169063dd62ed3e90604401602060405180830381865afa158015610f32573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f56919061339a565b1015610f75576040516301b8851f60e41b815260040160405180910390fd5b610f8188888833611f69565b9050610fae338989846004600c9054906101000a90046001600160401b03166001600160401b03166120ec565b6001600255979650505050505050565b5f610fd4335f356001600160e01b031916611ec3565b610ff05760405162461bcd60e51b815260040161090090613350565b6001600160a01b0385165f9081526003602052604090205460ff166110285760405163645fd19f60e11b815260040160405180910390fd5b835f0361104857604051630ea3153160e21b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b0386811660048301526110fe917f00000000000000000000000000000000000000000000000000000000000000009091169063820973da90602401602060405180830381865afa1580156110b2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d6919061339a565b85907f00000000000000000000000000000000000000000000000000000000000000006123bb565b905082811015611121576040516302620f6160e61b815260040160405180910390fd5b6040516318457e6160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906318457e61906111759085908990869033908b906004016133b1565b5f604051808303815f87803b15801561118c575f80fd5b505af115801561119e573d5f803e3d5ffd5b50505050846001600160a01b03167fdcc60b41ff1c604459e6aa4a7299817416b19fc586a392f111646e26597c4af9856040516111dd91815260200190565b60405180910390a2949350505050565b611202335f356001600160e01b031916611ec3565b61121e5760405162461bcd60e51b815260040161090090613350565b6004805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933905f90a1565b61126a335f356001600160e01b031916611ec3565b6112865760405162461bcd60e51b815260040161090090613350565b63ffffffff81165f81815260076020908152604091829020805461ff0019168155915192835290917fc45af64a13a09ef916a1114c59589294ec9c3095f2bfbbb093a7a96656858ded91015b60405180910390a15050565b6112f3335f356001600160e01b031916611ec3565b61130f5760405162461bcd60e51b815260040161090090613350565b8061131a83426133f8565b111561133957604051634c1eef1760e11b815260040160405180910390fd5b604080516001600160a01b038089166020830152871691810191909152606081018590526080810184905260a0810183905260c081018290525f9060e00160408051601f1981840301815291815281516020928301205f8b8152600590935291205490915081146113bd5760405163fa174ecb60e01b815260040160405180910390fd5b5f8881526005602052604080822091909155516318457e6160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906318457e6190611421908a908a908a9083908b906004016133b1565b5f604051808303815f87803b158015611438575f80fd5b505af115801561144a573d5f803e3d5ffd5b50505050866001600160a01b0316887faf98ea774275cadfa3e477a7b52cba03e01197445a76bd5d0d561608708c36248360405161148a91815260200190565b60405180910390a35050505050505050565b6114b1335f356001600160e01b031916611ec3565b6114cd5760405162461bcd60e51b815260040161090090613350565b6001600160a01b0381165f81815260036020526040808220805460ff19169055517f37803e2125c48ee96c38ddf04e826daf335b0e1603579040fd275aba6d06b6fc9190a250565b61152a335f356001600160e01b031916611ec3565b6115465760405162461bcd60e51b815260040161090090613350565b63ffffffff81165f8181526007602090815260409182902080546001600160f01b0319168155600101805467ffffffffffffffff1916905590519182527f11a9d1a77f76361ed131c19b1dc5758504c51dbde2e49fc973a0ef9577ad13d5910160405180910390a150565b5f546001600160a01b0316331480611642575060015460405163b700961360e01b81526001600160a01b039091169063b70096139061160390339030906001600160e01b03195f35169060040161340b565b602060405180830381865afa15801561161e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116429190613438565b61164a575f80fd5b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b76389980198905f90a350565b6116aa335f356001600160e01b031916611ec3565b6116c65760405162461bcd60e51b815260040161090090613350565b8380156116da57506001600160401b038216155b156116f8576040516323f0e08b60e11b815260040160405180910390fd5b6040805160a081018252861515815285151560208083019182526001600160a01b038088168486019081526001600160401b03808916606087019081528882166080880190815263ffffffff8f165f908152600790965294889020965187549651935191518316600160b01b0267ffffffffffffffff60b01b199290951662010000029190911662010000600160f01b03199315156101000261ff00199215159290921661ffff199097169690961717919091169390931717835551600190920180549290911667ffffffffffffffff19909216919091179055517f92ca48f4323e5539c637c7a03bd3e43941aa078e4f165e1d02c7e309317c429c9061184a9088908890889088908890889063ffffffff969096168652931515602086015291151560408501526001600160a01b031660608401526001600160401b0390811660808401521660a082015260c00190565b60405180910390a1505050505050565b5f5b92915050565b611877335f356001600160e01b031916611ec3565b6118935760405162461bcd60e51b815260040161090090613350565b6004805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752905f90a1565b5f6118e6335f356001600160e01b031916611ec3565b6119025760405162461bcd60e51b815260040161090090613350565b6002546001146119245760405162461bcd60e51b815260040161090090613376565b600280556001600160a01b0385165f9081526003602052604090205460ff166119605760405163645fd19f60e11b815260040160405180910390fd5b61196c85858585611f69565b9050846001600160a01b03167f6f9b974223f85a1ae805c33b8b519039e2435481d949db1110de151a94d587af856040516119a991815260200190565b60405180910390a26001600255949350505050565b5f6119d4335f356001600160e01b031916611ec3565b6119f05760405162461bcd60e51b815260040161090090613350565b600454600160a01b900460ff1615611a1b5760405163e0f9e71d60e01b815260040160405180910390fd5b611a24826123d6565b611a2d33611dc7565b6040516318457e6160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906318457e6190611a81905f908190819033908a906004016133b1565b5f604051808303815f87803b158015611a98575f80fd5b505af1158015611aaa573d5f803e3d5ffd5b50505050611ab88383612582565b905061185c83838361269c565b611ada335f356001600160e01b031916611ec3565b611af65760405162461bcd60e51b815260040161090090613350565b600254600114611b185760405162461bcd60e51b815260040161090090613376565b600280556001600160a01b0384165f9081526003602052604090205460ff16611b545760405163645fd19f60e11b815260040160405180910390fd5b5f611b6185858533611f69565b9050611b8e338686846004600c9054906101000a90046001600160401b03166001600160401b03166120ec565b611b9881836119be565b5050600160025550505050565b611bba335f356001600160e01b031916611ec3565b611bd65760405162461bcd60e51b815260040161090090613350565b60405163ca5eb5e160e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e1906024015f604051808303815f87803b158015611c36575f80fd5b505af1158015611c48573d5f803e3d5ffd5b5050505050565b611c64335f356001600160e01b031916611ec3565b611c805760405162461bcd60e51b815260040161090090613350565b63ffffffff81165f81815260076020908152604091829020805460ff19168155915192835290917f1cb867ed6a020e020ea220d4f48bb8e36552abf9095e093e377d33933f2b31e491016112d2565b611ce4335f356001600160e01b031916611ec3565b611d005760405162461bcd60e51b815260040161090090613350565b806001600160401b03165f03611d29576040516323f0e08b60e11b815260040160405180910390fd5b63ffffffff83165f8181526007602090815260409182902080546001600160401b038616600160b01b0267ffffffffffffffff60b01b196001600160a01b038916620100008102610100600160b01b0319909416939093176101001716178255835194855291840191909152917f34fe916485e02ec88e487b0e611e5c9bacabba9e3eaae7a900aa08be8197d419910160405180910390a150505050565b6001600160a01b0381165f90815260066020526040902054421015611dff5760405163f64059db60e01b815260040160405180910390fd5b50565b611e17335f356001600160e01b031916611ec3565b611e335760405162461bcd60e51b815260040161090090613350565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b5f602082018035906008908390611e949086613020565b63ffffffff16815260208101919091526040015f20541492915050565b5f611ebc83836126f3565b9392505050565b6001545f906001600160a01b03168015801590611f4a575060405163b700961360e01b81526001600160a01b0382169063b700961390611f0b9087903090889060040161340b565b602060405180830381865afa158015611f26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f4a9190613438565b80611f6157505f546001600160a01b038581169116145b949350505050565b5f835f03611f8a5760405163259be69560e11b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b038681166004830152612040917f0000000000000000000000000000000000000000000000000000000000000000917f0000000000000000000000000000000000000000000000000000000000000000169063820973da90602401602060405180830381865afa158015612014573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612038919061339a565b8691906123bb565b9050828110156120635760405163097b2ad560e31b815260040160405180910390fd5b604051631ceb5d1960e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906339d6ba32906120b790339089908990889088906004016133b1565b5f604051808303815f87803b1580156120ce575f80fd5b505af11580156120e0573d5f803e3d5ffd5b50505050949350505050565b6120f68142613453565b6001600160a01b038681165f81815260066020908152604091829020949094556004548151948501929092529187169183019190915260608201859052608082018490524260a083015260c082018390526001600160601b03169060e00160408051601f1981840301815291815281516020928301205f848152600590935290822055600480546001600160601b03169161219083613466565b91906101000a8154816001600160601b0302191690836001600160601b0316021790555050846001600160a01b0316866001600160a01b0316827fe96d7872363f475d18b2f5390caaa5eaa96b2d38e42c62afe4ac08ebd2b13c3a87874288604051612215949392919093845260208401929092526040830152606082015260800190565b60405180910390a4505050505050565b63ffffffff81165f908152600860205260408120548061185c5760405163f6ff4fb760e01b815263ffffffff84166004820152602401610900565b6122686127b6565b60075f61227860208a018a613020565b63ffffffff16815260208101919091526040015f205460ff166122c4576122a26020880188613020565b604051635408978f60e11b815263ffffffff9091166004820152602401610900565b5f806122d28688018861348b565b604051631ceb5d1960e11b815291935091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906339d6ba329061232b905f9081908190879089906004016133b1565b5f604051808303815f87803b158015612342575f80fd5b505af1158015612354573d5f803e3d5ffd5b5050505061236382828a6127e3565b505050505050505050565b63ffffffff82165f81815260086020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91016112d2565b5f825f1904841183021582026123cf575f80fd5b5091020490565b5f6007816123e76020850185613020565b63ffffffff16815260208082019290925260409081015f20815160a081018352815460ff8082161515835261010082041615159482018590526201000081046001600160a01b031693820193909352600160b01b9092046001600160401b039081166060840152600190910154166080820152915061248f5761246d6020830183613020565b604051630a8acb5760e21b815263ffffffff9091166004820152602401610900565b60408101516001600160a01b03166124ba5760405163098a923160e41b815260040160405180910390fd5b5f6124cb6040840160208501612f66565b6001600160a01b0316036124f25760405163f4a986cb60e01b815260040160405180910390fd5b80606001516001600160401b03168260600160208101906125139190612e59565b6001600160401b0316111561253b57604051636e33764360e11b815260040160405180910390fd5b6080808201516001600160401b03169061255a90840160608501612e59565b6001600160401b03161015610d6657604051637abded0b60e11b815260040160405180910390fd5b5f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6125a86060840160408501612f66565b6001600160a01b0316146125cf57604051634e4f206760e01b815260040160405180910390fd5b5f836125e16040850160208601612f66565b6040516020016126049291909182526001600160a01b0316602082015260400190565b60408051601f1981840301815291905290505f61266161262a6080860160608701612e59565b6001600160401b03165f61265a60408051600360f01b602082015281516002818303018152602290910190915290565b919061282c565b90505f6126916126746020870187613020565b848460405180604001604052803481526020015f81525033612891565b519695505050505050565b7fe0ec62d39b054dc2fd626dbc271483735df6e6fa1ef8389754bf8ab27a75eab281846126cf6040860160208701612f66565b6040805193845260208401929092526001600160a01b031690820152606001610bd3565b5f80836127066040850160208601612f66565b6040516020016127299291909182526001600160a01b0316602082015260400190565b60408051601f1981840301815291905290505f61274f61262a6080860160608701612e59565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6127766060860160408701612f66565b6001600160a01b03161461279d57604051634e4f206760e01b815260040160405180910390fd5b5f6126916127ae6020870187613020565b84845f612997565b600454600160a01b900460ff16156127e15760405163e0f9e71d60e01b815260040160405180910390fd5b565b60408051828152602081018590526001600160a01b038416918101919091527fb944fddc61d7fedb8b736790454ba972000703b0d21c7481d6dbf95b7c2cc2f190606001610bd3565b606083600361283b825f612a75565b61ffff161461286e5761284e815f612a75565b604051633a51740d60e01b815261ffff9091166004820152602401610900565b5f6128798585612ad1565b905061288786600183612b53565b9695505050505050565b612899612dbc565b5f6128a6845f0151612bbc565b6020850151909150156128c0576128c08460200151612be3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff1681526020016129108c612225565b81526020018a81526020018981526020015f8960200151111515815250866040518463ffffffff1660e01b815260040161294b9291906134fb565b60806040518083038185885af1158015612967573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061298c91906135cb565b979650505050505050565b604080518082019091525f80825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff1681526020016129f989612225565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401612a2e9291906134fb565b6040805180830381865afa158015612a48573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612a6c919061363c565b95945050505050565b5f612a81826002613453565b83511015612ac85760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610900565b50016002015190565b60606fffffffffffffffffffffffffffffffff821615612b2257604080516001600160801b0319608086811b8216602084015285901b16603082015201604051602081830303815290604052611ebc565b6040516001600160801b0319608085901b166020820152603001604051602081830303815290604052905092915050565b6060836003612b62825f612a75565b61ffff1614612b755761284e815f612a75565b846001612b828551612cc2565b612b8d906001613656565b8686604051602001612ba3959493929190613678565b6040516020818303038152906040529150509392505050565b5f813414612bdf576040516304fb820960e51b8152346004820152602401610900565b5090565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c40573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c6491906136de565b90506001600160a01b038116612c8d576040516329b99a9560e11b815260040160405180910390fd5b610d666001600160a01b038216337f000000000000000000000000000000000000000000000000000000000000000085612cf0565b5f61ffff821115612bdf576040516306dfcc6560e41b81526010600482015260248101839052604401610900565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612d4a908590612d50565b50505050565b5f8060205f8451602086015f885af180612d6f576040513d5f823e3d81fd5b50505f513d91508115612d86578060011415612d93565b6001600160a01b0384163b155b15612d4a57604051635274afe760e01b81526001600160a01b0385166004820152602401610900565b60405180606001604052805f80191681526020015f6001600160401b03168152602001612dfa60405180604001604052805f81526020015f81525090565b905290565b6001600160a01b0381168114611dff575f80fd5b5f805f60608486031215612e25575f80fd5b8335612e3081612dff565b95602085013595506040909401359392505050565b6001600160401b0381168114611dff575f80fd5b5f60208284031215612e69575f80fd5b8135611ebc81612e45565b5f60608284031215612e84575f80fd5b50919050565b5f8083601f840112612e9a575f80fd5b5081356001600160401b03811115612eb0575f80fd5b602083019150836020828501011115612ec7575f80fd5b9250929050565b5f805f805f805f60e0888a031215612ee4575f80fd5b612eee8989612e74565b96506060880135955060808801356001600160401b0380821115612f10575f80fd5b612f1c8b838c01612e8a565b909750955060a08a01359150612f3182612dff565b90935060c08901359080821115612f46575f80fd5b50612f538a828b01612e8a565b989b979a50959850939692959293505050565b5f60208284031215612f76575f80fd5b8135611ebc81612dff565b803563ffffffff81168114612f94575f80fd5b919050565b5f8060408385031215612faa575f80fd5b612fb383612f81565b91506020830135612fc381612dff565b809150509250929050565b5f8060408385031215612fdf575f80fd5b612fe883612f81565b91506020830135612fc381612e45565b5f8060408385031215613009575f80fd5b61301283612f81565b946020939093013593505050565b5f60208284031215613030575f80fd5b611ebc82612f81565b5f805f805f805f60e0888a03121561304f575f80fd5b873561305a81612dff565b9650602088013595506040880135945060608801359350608088013560ff81168114613084575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f805f80608085870312156130b4575f80fd5b84356130bf81612dff565b9350602085013592506040850135915060608501356130dd81612dff565b939692955090935050565b5f805f805f805f60e0888a0312156130fe575f80fd5b87359650602088013561311081612dff565b9550604088013561312081612dff565b969995985095966060810135965060808101359560a0820135955060c0909101359350915050565b8015158114611dff575f80fd5b5f805f805f8060c0878903121561316a575f80fd5b61317387612f81565b9550602087013561318381613148565b9450604087013561319381613148565b935060608701356131a381612dff565b925060808701356131b381612e45565b915060a08701356131c381612e45565b809150509295509295509295565b5f805f8060a085870312156131e4575f80fd5b6131ee8686612e74565b935060608501356001600160401b03811115613208575f80fd5b61321487828801612e8a565b90945092505060808501356130dd81612dff565b5f60208284031215613238575f80fd5b5035919050565b5f60a08284031215612e84575f80fd5b5f8060408385031215613260575f80fd5b8235915060208301356001600160401b0381111561327c575f80fd5b6132888582860161323f565b9150509250929050565b5f805f80608085870312156132a5575f80fd5b84356132b081612dff565b9350602085013592506040850135915060608501356001600160401b038111156132d8575f80fd5b6132e48782880161323f565b91505092959194509250565b5f805f60608486031215613302575f80fd5b61330b84612f81565b9250602084013561331b81612dff565b9150604084013561332b81612e45565b809150509250925092565b5f60608284031215613346575f80fd5b611ebc8383612e74565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b6020808252600a90820152695245454e5452414e435960b01b604082015260600190565b5f602082840312156133aa575f80fd5b5051919050565b6001600160a01b039586168152938516602085015260408401929092529092166060820152608081019190915260a00190565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561185c5761185c6133e4565b6001600160a01b0393841681529190921660208201526001600160e01b0319909116604082015260600190565b5f60208284031215613448575f80fd5b8151611ebc81613148565b8082018082111561185c5761185c6133e4565b5f6001600160601b03808316818103613481576134816133e4565b6001019392505050565b5f806040838503121561349c575f80fd5b823591506020830135612fc381612dff565b5f5b838110156134c85781810151838201526020016134b0565b50505f910152565b5f81518084526134e78160208601602086016134ae565b601f01601f19169290920160200192915050565b6040815263ffffffff8351166040820152602083015160608201525f604084015160a0608084015261353060e08401826134d0565b90506060850151603f198483030160a085015261354d82826134d0565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b5f60408284031215613583575f80fd5b604051604081018181106001600160401b03821117156135b157634e487b7160e01b5f52604160045260245ffd5b604052825181526020928301519281019290925250919050565b5f608082840312156135db575f80fd5b604051606081018181106001600160401b038211171561360957634e487b7160e01b5f52604160045260245ffd5b60405282518152602083015161361e81612e45565b60208201526136308460408501613573565b60408201529392505050565b5f6040828403121561364c575f80fd5b611ebc8383613573565b61ffff818116838216019080821115613671576136716133e4565b5092915050565b5f8651613689818460208b016134ae565b6001600160f81b031960f888811b82169285019283526001600160f01b031960f089901b16600184015286901b16600382015283516136cf8160048401602088016134ae565b01600401979650505050505050565b5f602082840312156136ee575f80fd5b8151611ebc81612dff56fea26469706673582212202217d2ef181455ff322fd5943f99cad7ead64276d2f0951c74a53affa656484764736f6c6343000815003300000000000000000000000004354e44ed31022716e77ec6320c04eda153010c000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f000000000000000000000000bb2faa1e1d6183ee3c4177476ce0d70cbd55a388000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb36","name":"MultiChainLayerZeroTellerWithMultiAssetSupport","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":"src/interfaces/IRateProvider.sol","source_code":"// SPDX-License-Identifier: GPL-3.0-or-later\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\npragma solidity ^0.8.0;\n\ninterface IRateProvider {\n    function getRate() external view returns (uint256);\n}\n"},{"file_path":"src/interfaces/BeforeTransferHook.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\ninterface BeforeTransferHook {\n    function beforeTransfer(address from) external view;\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/utils/ERC721Holder.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\n\n/**\n * @dev Implementation of the {IERC721Receiver} interface.\n *\n * Accepts all token transfers.\n * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or\n * {IERC721-setApprovalForAll}.\n */\nabstract contract ERC721Holder is IERC721Receiver {\n    /**\n     * @dev See {IERC721Receiver-onERC721Received}.\n     *\n     * Always returns `IERC721Receiver.onERC721Received.selector`.\n     */\n    function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n        return this.onERC721Received.selector;\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-oapp-v2/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":"src/base/Roles/CrossChain/OAppAuth/OAppAuthSender.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 {\n    MessagingParams,\n    MessagingFee,\n    MessagingReceipt\n} from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { OAppAuthCore } from \"./OAppAuthCore.sol\";\n\n/**\n * @title OAppAuthSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n *\n * @dev This Auth version of OAppCore uses solmate's Auth instead of OZ's Ownable for compatibility purposes\n */\nabstract contract OAppAuthSender is OAppAuthCore {\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\n     * 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    )\n        internal\n        view\n        virtual\n        returns (MessagingFee memory fee)\n    {\n        return endpoint.quote(\n            MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken), 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    )\n        internal\n        virtual\n        returns (MessagingReceipt memory receipt)\n    {\n        // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the\n        // endpoint.\n        uint256 messageValue = _payNative(_fee.nativeFee);\n        if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n        // solhint-disable-next-line check-send-result\n        return endpoint.send{ value: messageValue }(\n            MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0), _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/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 {IERC1363} from \"../../../interfaces/IERC1363.sol\";\nimport {Address} from \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    /**\n     * @dev An operation with an ERC-20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev 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 Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            safeTransfer(token, to, value);\n        } else if (!token.transferAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferFromAndCallRelaxed(\n        IERC1363 token,\n        address from,\n        address to,\n        uint256 value,\n        bytes memory data\n    ) internal {\n        if (to.code.length == 0) {\n            safeTransferFrom(token, from, to, value);\n        } else if (!token.transferFromAndCall(from, to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n     * once without retrying, and relies on the returned value to be true.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            forceApprove(token, to, value);\n        } else if (!token.approveAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            // bubble errors\n            if iszero(success) {\n                let ptr := mload(0x40)\n                returndatacopy(ptr, 0, returndatasize())\n                revert(ptr, returndatasize())\n            }\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n\n        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        bool success;\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n    }\n}\n"},{"file_path":"src/base/Roles/TellerWithMultiAssetSupport.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\nimport { ERC20 } from \"@solmate/tokens/ERC20.sol\";\nimport { WETH } from \"@solmate/tokens/WETH.sol\";\nimport { BoringVault } from \"src/base/BoringVault.sol\";\nimport { AccountantWithRateProviders } from \"src/base/Roles/AccountantWithRateProviders.sol\";\nimport { FixedPointMathLib } from \"@solmate/utils/FixedPointMathLib.sol\";\nimport { SafeTransferLib } from \"@solmate/utils/SafeTransferLib.sol\";\nimport { BeforeTransferHook } from \"src/interfaces/BeforeTransferHook.sol\";\nimport { Auth, Authority } from \"@solmate/auth/Auth.sol\";\nimport { ReentrancyGuard } from \"@solmate/utils/ReentrancyGuard.sol\";\n\n/**\n * @title TellerWithMultiAssetSupport\n * @custom:security-contact security@molecularlabs.io\n */\ncontract TellerWithMultiAssetSupport is Auth, BeforeTransferHook, ReentrancyGuard {\n    using FixedPointMathLib for uint256;\n    using SafeTransferLib for ERC20;\n    using SafeTransferLib for WETH;\n\n    // ========================================= CONSTANTS =========================================\n\n    /**\n     * @notice Native address used to tell the contract to handle native asset deposits.\n     */\n    address internal constant NATIVE = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n    /**\n     * @notice The maximum possible share lock period.\n     */\n    uint256 internal constant MAX_SHARE_LOCK_PERIOD = 3 days;\n\n    // ========================================= STATE =========================================\n\n    /**\n     * @notice Mapping ERC20s to an isSupported bool.\n     */\n    mapping(ERC20 => bool) public isSupported;\n\n    /**\n     * @notice The deposit nonce used to map to a deposit hash.\n     */\n    uint96 public depositNonce = 1;\n\n    /**\n     * @notice After deposits, shares are locked to the msg.sender's address\n     *         for `shareLockPeriod`.\n     * @dev During this time all transfers from msg.sender will revert, and\n     *      deposits are refundable.\n     */\n    uint64 public shareLockPeriod;\n\n    /**\n     * @notice Used to pause calls to `deposit` and `depositWithPermit`.\n     */\n    bool public isPaused;\n\n    /**\n     * @dev Maps deposit nonce to keccak256(address receiver, address depositAsset, uint256 depositAmount, uint256\n     * shareAmount, uint256 timestamp, uint256 shareLockPeriod).\n     */\n    mapping(uint256 => bytes32) public publicDepositHistory;\n\n    /**\n     * @notice Maps user address to the time their shares will be unlocked.\n     */\n    mapping(address => uint256) public shareUnlockTime;\n\n    //============================== ERRORS ===============================\n\n    error TellerWithMultiAssetSupport__ShareLockPeriodTooLong();\n    error TellerWithMultiAssetSupport__SharesAreLocked();\n    error TellerWithMultiAssetSupport__SharesAreUnLocked();\n    error TellerWithMultiAssetSupport__BadDepositHash();\n    error TellerWithMultiAssetSupport__AssetNotSupported();\n    error TellerWithMultiAssetSupport__ZeroAssets();\n    error TellerWithMultiAssetSupport__MinimumMintNotMet();\n    error TellerWithMultiAssetSupport__MinimumAssetsNotMet();\n    error TellerWithMultiAssetSupport__PermitFailedAndAllowanceTooLow();\n    error TellerWithMultiAssetSupport__ZeroShares();\n    error TellerWithMultiAssetSupport__Paused();\n\n    //============================== EVENTS ===============================\n\n    event Paused();\n    event Unpaused();\n    event AssetAdded(address indexed asset);\n    event AssetRemoved(address indexed asset);\n    event Deposit(\n        uint256 indexed nonce,\n        address indexed receiver,\n        address indexed depositAsset,\n        uint256 depositAmount,\n        uint256 shareAmount,\n        uint256 depositTimestamp,\n        uint256 shareLockPeriodAtTimeOfDeposit\n    );\n    event BulkDeposit(address indexed asset, uint256 depositAmount);\n    event BulkWithdraw(address indexed asset, uint256 shareAmount);\n    event DepositRefunded(uint256 indexed nonce, bytes32 depositHash, address indexed user);\n\n    //============================== IMMUTABLES ===============================\n\n    /**\n     * @notice The BoringVault this contract is working with.\n     */\n    BoringVault public immutable vault;\n\n    /**\n     * @notice The AccountantWithRateProviders this contract is working with.\n     */\n    AccountantWithRateProviders public immutable accountant;\n\n    /**\n     * @notice One share of the BoringVault.\n     */\n    uint256 internal immutable ONE_SHARE;\n\n    constructor(address _owner, address _vault, address _accountant) Auth(_owner, Authority(address(0))) {\n        vault = BoringVault(payable(_vault));\n        ONE_SHARE = 10 ** vault.decimals();\n        accountant = AccountantWithRateProviders(_accountant);\n    }\n\n    // ========================================= ADMIN FUNCTIONS =========================================\n\n    /**\n     * @notice Pause this contract, which prevents future calls to `deposit` and `depositWithPermit`.\n     * @dev Requires auth.\n     */\n    function pause() external requiresAuth {\n        isPaused = true;\n        emit Paused();\n    }\n\n    /**\n     * @notice Unpause this contract, which allows future calls to `deposit` and `depositWithPermit`.\n     * @dev Requires auth.\n     */\n    function unpause() external requiresAuth {\n        isPaused = false;\n        emit Unpaused();\n    }\n\n    /**\n     * @notice Adds this asset as a deposit asset.\n     * @dev The accountant must also support pricing this asset, else the `deposit` call will revert.\n     * @dev Requires auth.\n     */\n    function addAsset(ERC20 asset) external requiresAuth {\n        isSupported[asset] = true;\n        emit AssetAdded(address(asset));\n    }\n\n    /**\n     * @notice Removes this asset as a deposit asset.\n     * @dev Requires auth.\n     */\n    function removeAsset(ERC20 asset) external requiresAuth {\n        isSupported[asset] = false;\n        emit AssetRemoved(address(asset));\n    }\n\n    /**\n     * @notice Sets the share lock period.\n     * @dev This not only locks shares to the user address, but also serves as the pending deposit period, where\n     * deposits can be reverted.\n     * @dev If a new shorter share lock period is set, users with pending share locks could make a new deposit to\n     * receive 1 wei shares,\n     *      and have their shares unlock sooner than their original deposit allows. This state would allow for the user\n     * deposit to be refunded,\n     *      but only if they have not transferred their shares out of there wallet. This is an accepted limitation, and\n     * should be known when decreasing\n     *      the share lock period.\n     * @dev Requires auth.\n     */\n    function setShareLockPeriod(uint64 _shareLockPeriod) external requiresAuth {\n        if (_shareLockPeriod > MAX_SHARE_LOCK_PERIOD) revert TellerWithMultiAssetSupport__ShareLockPeriodTooLong();\n        shareLockPeriod = _shareLockPeriod;\n    }\n\n    // ========================================= BeforeTransferHook FUNCTIONS =========================================\n\n    /**\n     * @notice Implement beforeTransfer hook to check if shares are locked.\n     */\n    function beforeTransfer(address from) public view {\n        if (shareUnlockTime[from] > block.timestamp) revert TellerWithMultiAssetSupport__SharesAreLocked();\n    }\n\n    // ========================================= REVERT DEPOSIT FUNCTIONS =========================================\n\n    /**\n     * @notice Allows DEPOSIT_REFUNDER_ROLE to revert a pending deposit.\n     * @dev Once a deposit share lock period has passed, it can no longer be reverted.\n     * @dev It is possible the admin does not setup the BoringVault to call the transfer hook,\n     *      but this contract can still be saving share lock state. In the event this happens\n     *      deposits are still refundable if the user has not transferred their shares.\n     *      But there is no guarantee that the user has not transferred their shares.\n     * @dev Requires auth.\n     */\n    function refundDeposit(\n        uint256 nonce,\n        address receiver,\n        address depositAsset,\n        uint256 depositAmount,\n        uint256 shareAmount,\n        uint256 depositTimestamp,\n        uint256 shareLockUpPeriodAtTimeOfDeposit\n    )\n        external\n        requiresAuth\n    {\n        if ((block.timestamp - depositTimestamp) > shareLockUpPeriodAtTimeOfDeposit) {\n            // Shares are already unlocked, so we can not revert deposit.\n            revert TellerWithMultiAssetSupport__SharesAreUnLocked();\n        }\n        bytes32 depositHash = keccak256(\n            abi.encode(\n                receiver, depositAsset, depositAmount, shareAmount, depositTimestamp, shareLockUpPeriodAtTimeOfDeposit\n            )\n        );\n        if (publicDepositHistory[nonce] != depositHash) revert TellerWithMultiAssetSupport__BadDepositHash();\n\n        // Delete hash to prevent refund gas.\n        delete publicDepositHistory[nonce];\n\n        // Burn shares and refund assets to receiver.\n        vault.exit(receiver, ERC20(depositAsset), depositAmount, receiver, shareAmount);\n\n        emit DepositRefunded(nonce, depositHash, receiver);\n    }\n\n    // ========================================= USER FUNCTIONS =========================================\n\n    /**\n     * @notice Allows users to deposit into the BoringVault, if this contract is not paused.\n     * @dev Publicly callable.\n     */\n    function deposit(\n        ERC20 depositAsset,\n        uint256 depositAmount,\n        uint256 minimumMint\n    )\n        external\n        requiresAuth\n        nonReentrant\n        returns (uint256 shares)\n    {\n        if (isPaused) revert TellerWithMultiAssetSupport__Paused();\n        if (!isSupported[depositAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();\n\n        shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender);\n\n        _afterPublicDeposit(msg.sender, depositAsset, depositAmount, shares, shareLockPeriod);\n    }\n\n    /**\n     * @notice Allows users to deposit into BoringVault using permit.\n     * @dev Publicly callable.\n     */\n    function depositWithPermit(\n        ERC20 depositAsset,\n        uint256 depositAmount,\n        uint256 minimumMint,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    )\n        external\n        requiresAuth\n        nonReentrant\n        returns (uint256 shares)\n    {\n        if (isPaused) revert TellerWithMultiAssetSupport__Paused();\n        if (!isSupported[depositAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();\n\n        // solhint-disable-next-line no-empty-blocks\n        try depositAsset.permit(msg.sender, address(vault), depositAmount, deadline, v, r, s) { }\n        catch {\n            if (depositAsset.allowance(msg.sender, address(vault)) < depositAmount) {\n                revert TellerWithMultiAssetSupport__PermitFailedAndAllowanceTooLow();\n            }\n        }\n        shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender);\n\n        _afterPublicDeposit(msg.sender, depositAsset, depositAmount, shares, shareLockPeriod);\n    }\n\n    /**\n     * @notice Allows on ramp role to deposit into this contract.\n     * @dev Does NOT support native deposits.\n     * @dev Requires auth.\n     */\n    function bulkDeposit(\n        ERC20 depositAsset,\n        uint256 depositAmount,\n        uint256 minimumMint,\n        address to\n    )\n        external\n        requiresAuth\n        nonReentrant\n        returns (uint256 shares)\n    {\n        if (!isSupported[depositAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();\n\n        shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, to);\n        emit BulkDeposit(address(depositAsset), depositAmount);\n    }\n\n    /**\n     * @notice Allows off ramp role to withdraw from this contract.\n     * @dev Requires auth.\n     */\n    function bulkWithdraw(\n        ERC20 withdrawAsset,\n        uint256 shareAmount,\n        uint256 minimumAssets,\n        address to\n    )\n        external\n        requiresAuth\n        returns (uint256 assetsOut)\n    {\n        if (!isSupported[withdrawAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();\n\n        if (shareAmount == 0) revert TellerWithMultiAssetSupport__ZeroShares();\n        assetsOut = shareAmount.mulDivDown(accountant.getRateInQuoteSafe(withdrawAsset), ONE_SHARE);\n        if (assetsOut < minimumAssets) revert TellerWithMultiAssetSupport__MinimumAssetsNotMet();\n        vault.exit(to, withdrawAsset, assetsOut, msg.sender, shareAmount);\n        emit BulkWithdraw(address(withdrawAsset), shareAmount);\n    }\n\n    // ========================================= INTERNAL HELPER FUNCTIONS =========================================\n\n    /**\n     * @notice Implements a common ERC20 deposit into BoringVault.\n     */\n    function _erc20Deposit(\n        ERC20 depositAsset,\n        uint256 depositAmount,\n        uint256 minimumMint,\n        address to\n    )\n        internal\n        returns (uint256 shares)\n    {\n        if (depositAmount == 0) revert TellerWithMultiAssetSupport__ZeroAssets();\n        shares = depositAmount.mulDivDown(ONE_SHARE, accountant.getRateInQuoteSafe(depositAsset));\n        if (shares < minimumMint) revert TellerWithMultiAssetSupport__MinimumMintNotMet();\n        vault.enter(msg.sender, depositAsset, depositAmount, to, shares);\n    }\n\n    /**\n     * @notice Handle share lock logic, and event.\n     */\n    function _afterPublicDeposit(\n        address user,\n        ERC20 depositAsset,\n        uint256 depositAmount,\n        uint256 shares,\n        uint256 currentShareLockPeriod\n    )\n        internal\n    {\n        shareUnlockTime[user] = block.timestamp + currentShareLockPeriod;\n\n        uint256 nonce = depositNonce;\n        publicDepositHistory[nonce] =\n            keccak256(abi.encode(user, depositAsset, depositAmount, shares, block.timestamp, currentShareLockPeriod));\n        depositNonce++;\n        emit Deposit(nonce, user, address(depositAsset), depositAmount, shares, block.timestamp, currentShareLockPeriod);\n    }\n}\n"},{"file_path":"src/base/Roles/CrossChain/CrossChainTellerBase.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\nimport { TellerWithMultiAssetSupport } from \"../TellerWithMultiAssetSupport.sol\";\nimport { ERC20 } from \"@solmate/tokens/ERC20.sol\";\n\nstruct BridgeData {\n    uint32 chainSelector;\n    address destinationChainReceiver;\n    ERC20 bridgeFeeToken;\n    uint64 messageGas;\n    bytes data;\n}\n\n/**\n * @title CrossChainTellerBase\n * @notice Base contract for the CrossChainTeller, includes functions to overload with specific bridge method\n */\nabstract contract CrossChainTellerBase is TellerWithMultiAssetSupport {\n    event MessageSent(bytes32 messageId, uint256 shareAmount, address to);\n    event MessageReceived(bytes32 messageId, uint256 shareAmount, address to);\n\n    constructor(\n        address _owner,\n        address _vault,\n        address _accountant\n    )\n        TellerWithMultiAssetSupport(_owner, _vault, _accountant)\n    { }\n\n    /**\n     * @notice function to deposit into the vault AND bridge crosschain in 1 call\n     * @param depositAsset ERC20 to deposit\n     * @param depositAmount amount of deposit asset to deposit\n     * @param minimumMint minimum required shares to receive\n     * @param data Bridge Data\n     */\n    function depositAndBridge(\n        ERC20 depositAsset,\n        uint256 depositAmount,\n        uint256 minimumMint,\n        BridgeData calldata data\n    )\n        external\n        payable\n        requiresAuth\n        nonReentrant\n    {\n        if (!isSupported[depositAsset]) {\n            revert TellerWithMultiAssetSupport__AssetNotSupported();\n        }\n\n        uint256 shareAmount = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender);\n        _afterPublicDeposit(msg.sender, depositAsset, depositAmount, shareAmount, shareLockPeriod);\n        bridge(shareAmount, data);\n    }\n\n    /**\n     * @notice Preview fee required to bridge shares in a given feeToken.\n     */\n    function previewFee(uint256 shareAmount, BridgeData calldata data) external view returns (uint256 fee) {\n        return _quote(shareAmount, data);\n    }\n\n    /**\n     * @notice bridging code to be done without deposit, for users who already have vault tokens\n     * @param shareAmount to bridge\n     * @param data bridge data\n     */\n    function bridge(\n        uint256 shareAmount,\n        BridgeData calldata data\n    )\n        public\n        payable\n        requiresAuth\n        returns (bytes32 messageId)\n    {\n        if (isPaused) revert TellerWithMultiAssetSupport__Paused();\n\n        _beforeBridge(data);\n\n        // Since shares are directly burned, call `beforeTransfer` to enforce before transfer hooks.\n        beforeTransfer(msg.sender);\n\n        // Burn shares from sender\n        vault.exit(address(0), ERC20(address(0)), 0, msg.sender, shareAmount);\n\n        messageId = _bridge(shareAmount, data);\n        _afterBridge(shareAmount, data, messageId);\n    }\n\n    /**\n     * @notice the virtual bridge function to be overridden\n     * @param data bridge data\n     * @return messageId\n     */\n    function _bridge(uint256 shareAmount, BridgeData calldata data) internal virtual returns (bytes32);\n\n    /**\n     * @notice the virtual function to override to get bridge fees\n     * @param shareAmount to send\n     * @param data bridge data\n     */\n    function _quote(uint256 shareAmount, BridgeData calldata data) internal view virtual returns (uint256);\n\n    /**\n     * @notice after bridge code, just an emit but can be overridden\n     * @notice the before bridge hook to perform additional checks\n     * @param data bridge data\n     */\n    function _beforeBridge(BridgeData calldata data) internal virtual;\n\n    /**\n     * @notice after bridge code, just an emit but can be overridden\n     * @param shareAmount share amount burned\n     * @param data bridge data\n     * @param messageId message id returned when bridged\n     */\n    function _afterBridge(uint256 shareAmount, BridgeData calldata data, bytes32 messageId) internal virtual {\n        emit MessageSent(messageId, shareAmount, data.destinationChainReceiver);\n    }\n\n    /**\n     * @notice a before receive hook to call some logic before a receive is processed\n     */\n    function _beforeReceive() internal virtual {\n        if (isPaused) revert TellerWithMultiAssetSupport__Paused();\n    }\n\n    /**\n     * @notice a hook to execute after receiving\n     * @param shareAmount the shareAmount that was minted\n     * @param destinationChainReceiver the receiver of the shares\n     * @param messageId the message ID\n     */\n    function _afterReceive(uint256 shareAmount, address destinationChainReceiver, bytes32 messageId) internal virtual {\n        emit MessageReceived(messageId, shareAmount, destinationChainReceiver);\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/utils/ERC1155Holder.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165, ERC165} from \"../../../utils/introspection/ERC165.sol\";\nimport {IERC1155Receiver} from \"../IERC1155Receiver.sol\";\n\n/**\n * @dev Simple implementation of `IERC1155Receiver` that will allow a contract to hold ERC-1155 tokens.\n *\n * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be\n * stuck.\n */\nabstract contract ERC1155Holder is ERC165, IERC1155Receiver {\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    function onERC1155Received(\n        address,\n        address,\n        uint256,\n        uint256,\n        bytes memory\n    ) public virtual override returns (bytes4) {\n        return this.onERC1155Received.selector;\n    }\n\n    function onERC1155BatchReceived(\n        address,\n        address,\n        uint256[] memory,\n        uint256[] memory,\n        bytes memory\n    ) public virtual override returns (bytes4) {\n        return this.onERC1155BatchReceived.selector;\n    }\n}\n"},{"file_path":"src/base/Roles/AccountantWithRateProviders.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\nimport { FixedPointMathLib } from \"@solmate/utils/FixedPointMathLib.sol\";\nimport { IRateProvider } from \"src/interfaces/IRateProvider.sol\";\nimport { ERC20 } from \"@solmate/tokens/ERC20.sol\";\nimport { SafeTransferLib } from \"@solmate/utils/SafeTransferLib.sol\";\nimport { BoringVault } from \"src/base/BoringVault.sol\";\nimport { Auth, Authority } from \"@solmate/auth/Auth.sol\";\n\n/**\n * @title AccountantWithRateProviders\n * @custom:security-contact security@molecularlabs.io\n */\ncontract AccountantWithRateProviders is Auth, IRateProvider {\n    using FixedPointMathLib for uint256;\n    using SafeTransferLib for ERC20;\n\n    // ========================================= STRUCTS =========================================\n\n    /**\n     * @param payoutAddress the address `claimFees` sends fees to\n     * @param feesOwedInBase total pending fees owed in terms of base\n     * @param totalSharesLastUpdate total amount of shares the last exchange rate update\n     * @param exchangeRate the current exchange rate in terms of base\n     * @param allowedExchangeRateChangeUpper the max allowed change to exchange rate from an update\n     * @param allowedExchangeRateChangeLower the min allowed change to exchange rate from an update\n     * @param lastUpdateTimestamp the block timestamp of the last exchange rate update\n     * @param isPaused whether or not this contract is paused\n     * @param minimumUpdateDelayInSeconds the minimum amount of time that must pass between\n     *        exchange rate updates, such that the update won't trigger the contract to be paused\n     * @param managementFee the management fee\n     */\n    struct AccountantState {\n        address payoutAddress;\n        uint128 feesOwedInBase;\n        uint128 totalSharesLastUpdate;\n        uint96 exchangeRate;\n        uint16 allowedExchangeRateChangeUpper;\n        uint16 allowedExchangeRateChangeLower;\n        uint64 lastUpdateTimestamp;\n        bool isPaused;\n        uint32 minimumUpdateDelayInSeconds;\n        uint16 managementFee;\n    }\n\n    /**\n     * @param isPeggedToBase whether or not the asset is 1:1 with the base asset\n     * @param rateProvider the rate provider for this asset if `isPeggedToBase` is false\n     */\n    struct RateProviderData {\n        bool isPeggedToBase;\n        IRateProvider rateProvider;\n    }\n\n    // ========================================= STATE =========================================\n\n    /**\n     * @notice Store the accountant state in 3 packed slots.\n     */\n    AccountantState public accountantState;\n\n    /**\n     * @notice Maps ERC20s to their RateProviderData.\n     */\n    mapping(ERC20 => RateProviderData) public rateProviderData;\n\n    //============================== ERRORS ===============================\n\n    error AccountantWithRateProviders__UpperBoundTooSmall();\n    error AccountantWithRateProviders__LowerBoundTooLarge();\n    error AccountantWithRateProviders__ManagementFeeTooLarge();\n    error AccountantWithRateProviders__Paused();\n    error AccountantWithRateProviders__ZeroFeesOwed();\n    error AccountantWithRateProviders__OnlyCallableByBoringVault();\n    error AccountantWithRateProviders__UpdateDelayTooLarge();\n\n    //============================== EVENTS ===============================\n\n    event Paused();\n    event Unpaused();\n    event DelayInSecondsUpdated(uint32 oldDelay, uint32 newDelay);\n    event UpperBoundUpdated(uint16 oldBound, uint16 newBound);\n    event LowerBoundUpdated(uint16 oldBound, uint16 newBound);\n    event ManagementFeeUpdated(uint16 oldFee, uint16 newFee);\n    event PayoutAddressUpdated(address oldPayout, address newPayout);\n    event RateProviderUpdated(address asset, bool isPegged, address rateProvider);\n    event ExchangeRateUpdated(uint96 oldRate, uint96 newRate, uint64 currentTime);\n    event FeesClaimed(address indexed feeAsset, uint256 amount);\n\n    //============================== IMMUTABLES ===============================\n\n    /**\n     * @notice The base asset rates are provided in.\n     */\n    ERC20 public immutable base;\n\n    /**\n     * @notice The decimals rates are provided in.\n     */\n    uint8 public immutable decimals;\n\n    /**\n     * @notice The BoringVault this accountant is working with.\n     *         Used to determine share supply for fee calculation.\n     */\n    BoringVault public immutable vault;\n\n    /**\n     * @notice One share of the BoringVault.\n     */\n    uint256 internal immutable ONE_SHARE;\n\n    constructor(\n        address _owner,\n        address _vault,\n        address payoutAddress,\n        uint96 startingExchangeRate,\n        address _base,\n        uint16 allowedExchangeRateChangeUpper,\n        uint16 allowedExchangeRateChangeLower,\n        uint32 minimumUpdateDelayInSeconds,\n        uint16 managementFee\n    )\n        Auth(_owner, Authority(address(0)))\n    {\n        base = ERC20(_base);\n        decimals = ERC20(_base).decimals();\n        vault = BoringVault(payable(_vault));\n        ONE_SHARE = 10 ** vault.decimals();\n        accountantState = AccountantState({\n            payoutAddress: payoutAddress,\n            feesOwedInBase: 0,\n            totalSharesLastUpdate: uint128(vault.totalSupply()),\n            exchangeRate: startingExchangeRate,\n            allowedExchangeRateChangeUpper: allowedExchangeRateChangeUpper,\n            allowedExchangeRateChangeLower: allowedExchangeRateChangeLower,\n            lastUpdateTimestamp: uint64(block.timestamp),\n            isPaused: false,\n            minimumUpdateDelayInSeconds: minimumUpdateDelayInSeconds,\n            managementFee: managementFee\n        });\n    }\n\n    // ========================================= ADMIN FUNCTIONS =========================================\n    /**\n     * @notice Pause this contract, which prevents future calls to `updateExchangeRate`, and any safe rate\n     *         calls will revert.\n     * @dev Requires auth.\n     */\n    function pause() external requiresAuth {\n        accountantState.isPaused = true;\n        emit Paused();\n    }\n\n    /**\n     * @notice Unpause this contract, which allows future calls to `updateExchangeRate`, and any safe rate\n     *         calls will stop reverting.\n     * @dev Requires auth.\n     */\n    function unpause() external requiresAuth {\n        accountantState.isPaused = false;\n        emit Unpaused();\n    }\n\n    /**\n     * @notice Update the minimum time delay between `updateExchangeRate` calls.\n     * @dev There are no input requirements, as it is possible the admin would want\n     *      the exchange rate updated as frequently as needed.\n     * @dev Requires auth.\n     */\n    function updateDelay(uint32 minimumUpdateDelayInSeconds) external requiresAuth {\n        if (minimumUpdateDelayInSeconds > 14 days) revert AccountantWithRateProviders__UpdateDelayTooLarge();\n        uint32 oldDelay = accountantState.minimumUpdateDelayInSeconds;\n        accountantState.minimumUpdateDelayInSeconds = minimumUpdateDelayInSeconds;\n        emit DelayInSecondsUpdated(oldDelay, minimumUpdateDelayInSeconds);\n    }\n\n    /**\n     * @notice Update the allowed upper bound change of exchange rate between `updateExchangeRateCalls`.\n     * @dev Requires auth.\n     */\n    function updateUpper(uint16 allowedExchangeRateChangeUpper) external requiresAuth {\n        if (allowedExchangeRateChangeUpper < 1e4) revert AccountantWithRateProviders__UpperBoundTooSmall();\n        uint16 oldBound = accountantState.allowedExchangeRateChangeUpper;\n        accountantState.allowedExchangeRateChangeUpper = allowedExchangeRateChangeUpper;\n        emit UpperBoundUpdated(oldBound, allowedExchangeRateChangeUpper);\n    }\n\n    /**\n     * @notice Update the allowed lower bound change of exchange rate between `updateExchangeRateCalls`.\n     * @dev Requires auth.\n     */\n    function updateLower(uint16 allowedExchangeRateChangeLower) external requiresAuth {\n        if (allowedExchangeRateChangeLower > 1e4) revert AccountantWithRateProviders__LowerBoundTooLarge();\n        uint16 oldBound = accountantState.allowedExchangeRateChangeLower;\n        accountantState.allowedExchangeRateChangeLower = allowedExchangeRateChangeLower;\n        emit LowerBoundUpdated(oldBound, allowedExchangeRateChangeLower);\n    }\n\n    /**\n     * @notice Update the management fee to a new value.\n     * @dev Requires auth.\n     */\n    function updateManagementFee(uint16 managementFee) external requiresAuth {\n        if (managementFee > 0.2e4) revert AccountantWithRateProviders__ManagementFeeTooLarge();\n        uint16 oldFee = accountantState.managementFee;\n        accountantState.managementFee = managementFee;\n        emit ManagementFeeUpdated(oldFee, managementFee);\n    }\n\n    /**\n     * @notice Update the payout address fees are sent to.\n     * @dev Requires auth.\n     */\n    function updatePayoutAddress(address payoutAddress) external requiresAuth {\n        address oldPayout = accountantState.payoutAddress;\n        accountantState.payoutAddress = payoutAddress;\n        emit PayoutAddressUpdated(oldPayout, payoutAddress);\n    }\n\n    /**\n     * @notice Update the rate provider data for a specific `asset`.\n     * @dev Rate providers must return rates in terms of `base` or\n     * an asset pegged to base and they must use the same decimals\n     * as `asset`.\n     * @dev Requires auth.\n     */\n    function setRateProviderData(ERC20 asset, bool isPeggedToBase, address rateProvider) external requiresAuth {\n        rateProviderData[asset] =\n            RateProviderData({ isPeggedToBase: isPeggedToBase, rateProvider: IRateProvider(rateProvider) });\n        emit RateProviderUpdated(address(asset), isPeggedToBase, rateProvider);\n    }\n\n    // ========================================= UPDATE EXCHANGE RATE/FEES FUNCTIONS\n    // =========================================\n\n    /**\n     * @notice Updates this contract exchangeRate.\n     * @dev If new exchange rate is outside of accepted bounds, or if not enough time has passed, this\n     *      will pause the contract, and this function will NOT calculate fees owed.\n     * @dev Requires auth.\n     */\n    function updateExchangeRate(uint96 newExchangeRate) external requiresAuth {\n        AccountantState storage state = accountantState;\n        if (state.isPaused) revert AccountantWithRateProviders__Paused();\n        uint64 currentTime = uint64(block.timestamp);\n        uint256 currentExchangeRate = state.exchangeRate;\n        uint256 currentTotalShares = vault.totalSupply();\n        if (\n            currentTime < state.lastUpdateTimestamp + state.minimumUpdateDelayInSeconds\n                || newExchangeRate > currentExchangeRate.mulDivDown(state.allowedExchangeRateChangeUpper, 1e4)\n                || newExchangeRate < currentExchangeRate.mulDivDown(state.allowedExchangeRateChangeLower, 1e4)\n        ) {\n            // Instead of reverting, pause the contract. This way the exchange rate updater is able to update the\n            // exchange rate\n            // to a better value, and pause it.\n            state.isPaused = true;\n        } else {\n            // Only update fees if we are not paused.\n            // Update fee accounting.\n            uint256 shareSupplyToUse = currentTotalShares;\n            // Use the minimum between current total supply and total supply for last update.\n            if (state.totalSharesLastUpdate < shareSupplyToUse) {\n                shareSupplyToUse = state.totalSharesLastUpdate;\n            }\n\n            // Determine management fees owned.\n            uint256 timeDelta = currentTime - state.lastUpdateTimestamp;\n            uint256 minimumAssets = newExchangeRate > currentExchangeRate\n                ? shareSupplyToUse.mulDivDown(currentExchangeRate, ONE_SHARE)\n                : shareSupplyToUse.mulDivDown(newExchangeRate, ONE_SHARE);\n            uint256 managementFeesAnnual = minimumAssets.mulDivDown(state.managementFee, 1e4);\n            uint256 newFeesOwedInBase = managementFeesAnnual.mulDivDown(timeDelta, 365 days);\n\n            state.feesOwedInBase += uint128(newFeesOwedInBase);\n        }\n\n        state.exchangeRate = newExchangeRate;\n        state.totalSharesLastUpdate = uint128(currentTotalShares);\n        state.lastUpdateTimestamp = currentTime;\n\n        emit ExchangeRateUpdated(uint96(currentExchangeRate), newExchangeRate, currentTime);\n    }\n\n    /**\n     * @notice Claim pending fees.\n     * @dev This function must be called by the BoringVault.\n     * @dev This function will lose precision if the exchange rate\n     *      decimals is greater than the feeAsset's decimals.\n     */\n    function claimFees(ERC20 feeAsset) external {\n        if (msg.sender != address(vault)) revert AccountantWithRateProviders__OnlyCallableByBoringVault();\n\n        AccountantState storage state = accountantState;\n        if (state.isPaused) revert AccountantWithRateProviders__Paused();\n        if (state.feesOwedInBase == 0) revert AccountantWithRateProviders__ZeroFeesOwed();\n\n        // Determine amount of fees owed in feeAsset.\n        uint256 feesOwedInFeeAsset;\n        RateProviderData memory data = rateProviderData[feeAsset];\n        if (address(feeAsset) == address(base)) {\n            feesOwedInFeeAsset = state.feesOwedInBase;\n        } else {\n            uint8 feeAssetDecimals = ERC20(feeAsset).decimals();\n            uint256 feesOwedInBaseUsingFeeAssetDecimals =\n                changeDecimals(state.feesOwedInBase, decimals, feeAssetDecimals);\n            if (data.isPeggedToBase) {\n                feesOwedInFeeAsset = feesOwedInBaseUsingFeeAssetDecimals;\n            } else {\n                uint256 rate = data.rateProvider.getRate();\n                feesOwedInFeeAsset = feesOwedInBaseUsingFeeAssetDecimals.mulDivDown(10 ** feeAssetDecimals, rate);\n            }\n        }\n        // Zero out fees owed.\n        state.feesOwedInBase = 0;\n        // Transfer fee asset to payout address.\n        feeAsset.safeTransferFrom(msg.sender, state.payoutAddress, feesOwedInFeeAsset);\n\n        emit FeesClaimed(address(feeAsset), feesOwedInFeeAsset);\n    }\n\n    // ========================================= RATE FUNCTIONS =========================================\n\n    /**\n     * @notice Get this BoringVault's current rate in the base.\n     */\n    function getRate() public view returns (uint256 rate) {\n        rate = accountantState.exchangeRate;\n    }\n\n    /**\n     * @notice Get this BoringVault's current rate in the base.\n     * @dev Revert if paused.\n     */\n    function getRateSafe() external view returns (uint256 rate) {\n        if (accountantState.isPaused) revert AccountantWithRateProviders__Paused();\n        rate = getRate();\n    }\n\n    /**\n     * @notice Get this BoringVault's current rate in the provided quote.\n     * @dev `quote` must have its RateProviderData set, else this will revert.\n     * @dev This function will lose precision if the exchange rate\n     *      decimals is greater than the quote's decimals.\n     */\n    function getRateInQuote(ERC20 quote) public view returns (uint256 rateInQuote) {\n        if (address(quote) == address(base)) {\n            rateInQuote = accountantState.exchangeRate;\n        } else {\n            RateProviderData memory data = rateProviderData[quote];\n            uint8 quoteDecimals = ERC20(quote).decimals();\n            uint256 exchangeRateInQuoteDecimals = changeDecimals(accountantState.exchangeRate, decimals, quoteDecimals);\n            if (data.isPeggedToBase) {\n                rateInQuote = exchangeRateInQuoteDecimals;\n            } else {\n                uint256 quoteRate = data.rateProvider.getRate();\n                uint256 oneQuote = 10 ** quoteDecimals;\n                rateInQuote = oneQuote.mulDivDown(exchangeRateInQuoteDecimals, quoteRate);\n            }\n        }\n    }\n\n    /**\n     * @notice Get this BoringVault's current rate in the provided quote.\n     * @dev `quote` must have its RateProviderData set, else this will revert.\n     * @dev Revert if paused.\n     */\n    function getRateInQuoteSafe(ERC20 quote) external view returns (uint256 rateInQuote) {\n        if (accountantState.isPaused) revert AccountantWithRateProviders__Paused();\n        rateInQuote = getRateInQuote(quote);\n    }\n\n    // ========================================= INTERNAL HELPER FUNCTIONS =========================================\n    /**\n     * @notice Used to change the decimals of precision used for an amount.\n     */\n    function changeDecimals(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256) {\n        if (fromDecimals == toDecimals) {\n            return amount;\n        } else if (fromDecimals < toDecimals) {\n            return amount * 10 ** (toDecimals - fromDecimals);\n        } else {\n            return amount / 10 ** (fromDecimals - toDecimals);\n        }\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OptionsBuilder.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { BytesLib } from \"solidity-bytes-utils/contracts/BytesLib.sol\";\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\nimport { DVNOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol\";\n\n/**\n * @title OptionsBuilder\n * @dev Library for building and encoding various message options.\n */\nlibrary OptionsBuilder {\n    using SafeCast for uint256;\n    using BytesLib for bytes;\n\n    // Constants for options types\n    uint16 internal constant TYPE_1 = 1; // legacy options type 1\n    uint16 internal constant TYPE_2 = 2; // legacy options type 2\n    uint16 internal constant TYPE_3 = 3;\n\n    // Custom error message\n    error InvalidSize(uint256 max, uint256 actual);\n    error InvalidOptionType(uint16 optionType);\n\n    // Modifier to ensure only options of type 3 are used\n    modifier onlyType3(bytes memory _options) {\n        if (_options.toUint16(0) != TYPE_3) revert InvalidOptionType(_options.toUint16(0));\n        _;\n    }\n\n    /**\n     * @dev Creates a new options container with type 3.\n     * @return options The newly created options container.\n     */\n    function newOptions() internal pure returns (bytes memory) {\n        return abi.encodePacked(TYPE_3);\n    }\n\n    /**\n     * @dev Adds an executor LZ receive option to the existing options.\n     * @param _options The existing options container.\n     * @param _gas The gasLimit used on the lzReceive() function in the OApp.\n     * @param _value The msg.value passed to the lzReceive() function in the OApp.\n     * @return options The updated options container.\n     *\n     * @dev When multiples of this option are added, they are summed by the executor\n     * eg. if (_gas: 200k, and _value: 1 ether) AND (_gas: 100k, _value: 0.5 ether) are sent in an option to the LayerZeroEndpoint,\n     * that becomes (300k, 1.5 ether) when the message is executed on the remote lzReceive() function.\n     */\n    function addExecutorLzReceiveOption(\n        bytes memory _options,\n        uint128 _gas,\n        uint128 _value\n    ) internal pure onlyType3(_options) returns (bytes memory) {\n        bytes memory option = ExecutorOptions.encodeLzReceiveOption(_gas, _value);\n        return addExecutorOption(_options, ExecutorOptions.OPTION_TYPE_LZRECEIVE, option);\n    }\n\n    /**\n     * @dev Adds an executor native drop option to the existing options.\n     * @param _options The existing options container.\n     * @param _amount The amount for the native value that is airdropped to the 'receiver'.\n     * @param _receiver The receiver address for the native drop option.\n     * @return options The updated options container.\n     *\n     * @dev When multiples of this option are added, they are summed by the executor on the remote chain.\n     */\n    function addExecutorNativeDropOption(\n        bytes memory _options,\n        uint128 _amount,\n        bytes32 _receiver\n    ) internal pure onlyType3(_options) returns (bytes memory) {\n        bytes memory option = ExecutorOptions.encodeNativeDropOption(_amount, _receiver);\n        return addExecutorOption(_options, ExecutorOptions.OPTION_TYPE_NATIVE_DROP, option);\n    }\n\n    /**\n     * @dev Adds an executor LZ compose option to the existing options.\n     * @param _options The existing options container.\n     * @param _index The index for the lzCompose() function call.\n     * @param _gas The gasLimit for the lzCompose() function call.\n     * @param _value The msg.value for the lzCompose() function call.\n     * @return options The updated options container.\n     *\n     * @dev When multiples of this option are added, they are summed PER index by the executor on the remote chain.\n     * @dev If the OApp sends N lzCompose calls on the remote, you must provide N incremented indexes starting with 0.\n     * ie. When your remote OApp composes (N = 3) messages, you must set this option for index 0,1,2\n     */\n    function addExecutorLzComposeOption(\n        bytes memory _options,\n        uint16 _index,\n        uint128 _gas,\n        uint128 _value\n    ) internal pure onlyType3(_options) returns (bytes memory) {\n        bytes memory option = ExecutorOptions.encodeLzComposeOption(_index, _gas, _value);\n        return addExecutorOption(_options, ExecutorOptions.OPTION_TYPE_LZCOMPOSE, option);\n    }\n\n    /**\n     * @dev Adds an executor ordered execution option to the existing options.\n     * @param _options The existing options container.\n     * @return options The updated options container.\n     */\n    function addExecutorOrderedExecutionOption(\n        bytes memory _options\n    ) internal pure onlyType3(_options) returns (bytes memory) {\n        return addExecutorOption(_options, ExecutorOptions.OPTION_TYPE_ORDERED_EXECUTION, bytes(\"\"));\n    }\n\n    /**\n     * @dev Adds a DVN pre-crime option to the existing options.\n     * @param _options The existing options container.\n     * @param _dvnIdx The DVN index for the pre-crime option.\n     * @return options The updated options container.\n     */\n    function addDVNPreCrimeOption(\n        bytes memory _options,\n        uint8 _dvnIdx\n    ) internal pure onlyType3(_options) returns (bytes memory) {\n        return addDVNOption(_options, _dvnIdx, DVNOptions.OPTION_TYPE_PRECRIME, bytes(\"\"));\n    }\n\n    /**\n     * @dev Adds an executor option to the existing options.\n     * @param _options The existing options container.\n     * @param _optionType The type of the executor option.\n     * @param _option The encoded data for the executor option.\n     * @return options The updated options container.\n     */\n    function addExecutorOption(\n        bytes memory _options,\n        uint8 _optionType,\n        bytes memory _option\n    ) internal pure onlyType3(_options) returns (bytes memory) {\n        return\n            abi.encodePacked(\n                _options,\n                ExecutorOptions.WORKER_ID,\n                _option.length.toUint16() + 1, // +1 for optionType\n                _optionType,\n                _option\n            );\n    }\n\n    /**\n     * @dev Adds a DVN option to the existing options.\n     * @param _options The existing options container.\n     * @param _dvnIdx The DVN index for the DVN option.\n     * @param _optionType The type of the DVN option.\n     * @param _option The encoded data for the DVN option.\n     * @return options The updated options container.\n     */\n    function addDVNOption(\n        bytes memory _options,\n        uint8 _dvnIdx,\n        uint8 _optionType,\n        bytes memory _option\n    ) internal pure onlyType3(_options) returns (bytes memory) {\n        return\n            abi.encodePacked(\n                _options,\n                DVNOptions.WORKER_ID,\n                _option.length.toUint16() + 2, // +2 for optionType and dvnIdx\n                _dvnIdx,\n                _optionType,\n                _option\n            );\n    }\n\n    /**\n     * @dev Encodes legacy options of type 1.\n     * @param _executionGas The gasLimit value passed to lzReceive().\n     * @return legacyOptions The encoded legacy options.\n     */\n    function encodeLegacyOptionsType1(uint256 _executionGas) internal pure returns (bytes memory) {\n        if (_executionGas > type(uint128).max) revert InvalidSize(type(uint128).max, _executionGas);\n        return abi.encodePacked(TYPE_1, _executionGas);\n    }\n\n    /**\n     * @dev Encodes legacy options of type 2.\n     * @param _executionGas The gasLimit value passed to lzReceive().\n     * @param _nativeForDst The amount of native air dropped to the receiver.\n     * @param _receiver The _nativeForDst receiver address.\n     * @return legacyOptions The encoded legacy options of type 2.\n     */\n    function encodeLegacyOptionsType2(\n        uint256 _executionGas,\n        uint256 _nativeForDst,\n        bytes memory _receiver // @dev Use bytes instead of bytes32 in legacy type 2 for _receiver.\n    ) internal pure returns (bytes memory) {\n        if (_executionGas > type(uint128).max) revert InvalidSize(type(uint128).max, _executionGas);\n        if (_nativeForDst > type(uint128).max) revert InvalidSize(type(uint128).max, _nativeForDst);\n        if (_receiver.length > 32) revert InvalidSize(32, _receiver.length);\n        return abi.encodePacked(TYPE_2, _executionGas, _nativeForDst, _receiver);\n    }\n}\n"},{"file_path":"lib/solmate/src/tokens/WETH.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\nimport {ERC20} from \"./ERC20.sol\";\n\nimport {SafeTransferLib} from \"../utils/SafeTransferLib.sol\";\n\n/// @notice Minimalist and modern Wrapped Ether implementation.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/WETH.sol)\n/// @author Inspired by WETH9 (https://github.com/dapphub/ds-weth/blob/master/src/weth9.sol)\ncontract WETH is ERC20(\"Wrapped Ether\", \"WETH\", 18) {\n    using SafeTransferLib for address;\n\n    event Deposit(address indexed from, uint256 amount);\n\n    event Withdrawal(address indexed to, uint256 amount);\n\n    function deposit() public payable virtual {\n        _mint(msg.sender, msg.value);\n\n        emit Deposit(msg.sender, msg.value);\n    }\n\n    function withdraw(uint256 amount) public virtual {\n        _burn(msg.sender, amount);\n\n        emit Withdrawal(msg.sender, amount);\n\n        msg.sender.safeTransferETH(amount);\n    }\n\n    receive() external payable virtual {\n        deposit();\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { CalldataBytesLib } from \"../../libs/CalldataBytesLib.sol\";\n\nlibrary ExecutorOptions {\n    using CalldataBytesLib for bytes;\n\n    uint8 internal constant WORKER_ID = 1;\n\n    uint8 internal constant OPTION_TYPE_LZRECEIVE = 1;\n    uint8 internal constant OPTION_TYPE_NATIVE_DROP = 2;\n    uint8 internal constant OPTION_TYPE_LZCOMPOSE = 3;\n    uint8 internal constant OPTION_TYPE_ORDERED_EXECUTION = 4;\n\n    error Executor_InvalidLzReceiveOption();\n    error Executor_InvalidNativeDropOption();\n    error Executor_InvalidLzComposeOption();\n\n    /// @dev decode the next executor option from the options starting from the specified cursor\n    /// @param _options [executor_id][executor_option][executor_id][executor_option]...\n    ///        executor_option = [option_size][option_type][option]\n    ///        option_size = len(option_type) + len(option)\n    ///        executor_id: uint8, option_size: uint16, option_type: uint8, option: bytes\n    /// @param _cursor the cursor to start decoding from\n    /// @return optionType the type of the option\n    /// @return option the option of the executor\n    /// @return cursor the cursor to start decoding the next executor option\n    function nextExecutorOption(\n        bytes calldata _options,\n        uint256 _cursor\n    ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n        unchecked {\n            // skip worker id\n            cursor = _cursor + 1;\n\n            // read option size\n            uint16 size = _options.toU16(cursor);\n            cursor += 2;\n\n            // read option type\n            optionType = _options.toU8(cursor);\n\n            // startCursor and endCursor are used to slice the option from _options\n            uint256 startCursor = cursor + 1; // skip option type\n            uint256 endCursor = cursor + size;\n            option = _options[startCursor:endCursor];\n            cursor += size;\n        }\n    }\n\n    function decodeLzReceiveOption(bytes calldata _option) internal pure returns (uint128 gas, uint128 value) {\n        if (_option.length != 16 && _option.length != 32) revert Executor_InvalidLzReceiveOption();\n        gas = _option.toU128(0);\n        value = _option.length == 32 ? _option.toU128(16) : 0;\n    }\n\n    function decodeNativeDropOption(bytes calldata _option) internal pure returns (uint128 amount, bytes32 receiver) {\n        if (_option.length != 48) revert Executor_InvalidNativeDropOption();\n        amount = _option.toU128(0);\n        receiver = _option.toB32(16);\n    }\n\n    function decodeLzComposeOption(\n        bytes calldata _option\n    ) internal pure returns (uint16 index, uint128 gas, uint128 value) {\n        if (_option.length != 18 && _option.length != 34) revert Executor_InvalidLzComposeOption();\n        index = _option.toU16(0);\n        gas = _option.toU128(2);\n        value = _option.length == 34 ? _option.toU128(18) : 0;\n    }\n\n    function encodeLzReceiveOption(uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n        return _value == 0 ? abi.encodePacked(_gas) : abi.encodePacked(_gas, _value);\n    }\n\n    function encodeNativeDropOption(uint128 _amount, bytes32 _receiver) internal pure returns (bytes memory) {\n        return abi.encodePacked(_amount, _receiver);\n    }\n\n    function encodeLzComposeOption(uint16 _index, uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n        return _value == 0 ? abi.encodePacked(_index, _gas) : abi.encodePacked(_index, _gas, _value);\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\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 ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},{"file_path":"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 ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"},{"file_path":"src/base/Roles/CrossChain/MultiChainTellerBase.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\nimport { CrossChainTellerBase, BridgeData } from \"./CrossChainTellerBase.sol\";\n\nstruct Chain {\n    bool allowMessagesFrom;\n    bool allowMessagesTo;\n    address targetTeller;\n    uint64 messageGasLimit;\n    uint64 minimumMessageGas;\n}\n\nerror MultiChainTellerBase_MessagesNotAllowedFrom(uint32 chainSelector);\nerror MultiChainTellerBase_MessagesNotAllowedFromSender(uint256 chainSelector, address sender);\nerror MultiChainTellerBase_MessagesNotAllowedTo(uint256 chainSelector);\nerror MultiChainTellerBase_TargetTellerIsZeroAddress();\nerror MultiChainTellerBase_DestinationChainReceiverIsZeroAddress();\nerror MultiChainTellerBase_ZeroMessageGasLimit();\nerror MultiChainTellerBase_GasLimitExceeded();\nerror MultiChainTellerBase_GasTooLow();\n\n/**\n * @title MultiChainTellerBase\n * @notice Base contract for the MultiChainTellers,\n * We've noticed that many bridge options are L1 -> L2 only, which are quite simple IE Optimism Messenger\n * While others like LZ that can contact many bridges, contain lots of additional complexity to manage the configuration\n * for these chains\n * To keep this separated we are using this MultiChain syntax for the > 2 chain messaging while only CrossChain for 2\n * chain messengers like OP\n */\nabstract contract MultiChainTellerBase is CrossChainTellerBase {\n    event ChainAdded(\n        uint256 chainSelector,\n        bool allowMessagesFrom,\n        bool allowMessagesTo,\n        address targetTeller,\n        uint64 messageGasLimit,\n        uint64 messageGasMin\n    );\n    event ChainRemoved(uint256 chainSelector);\n    event ChainAllowMessagesFrom(uint256 chainSelector, address targetTeller);\n    event ChainAllowMessagesTo(uint256 chainSelector, address targetTeller);\n    event ChainStopMessagesFrom(uint256 chainSelector);\n    event ChainStopMessagesTo(uint256 chainSelector);\n    event ChainSetGasLimit(uint256 chainSelector, uint64 messageGasLimit);\n\n    mapping(uint32 => Chain) public selectorToChains;\n\n    constructor(\n        address _owner,\n        address _vault,\n        address _accountant\n    )\n        CrossChainTellerBase(_owner, _vault, _accountant)\n    { }\n\n    /**\n     * @dev Callable by OWNER_ROLE.\n     * @notice adds an acceptable chain to bridge to\n     * @param chainSelector chainSelector of chain\n     * @param allowMessagesFrom allow messages from this chain\n     * @param allowMessagesTo allow messages to the chain\n     * @param targetTeller address of the target teller on this chain\n     * @param messageGasLimit to pass to bridge\n     * @param messageGasMin to require a minimum provided gas for this chain\n     */\n    function addChain(\n        uint32 chainSelector,\n        bool allowMessagesFrom,\n        bool allowMessagesTo,\n        address targetTeller,\n        uint64 messageGasLimit,\n        uint64 messageGasMin\n    )\n        external\n        requiresAuth\n    {\n        if (allowMessagesTo && messageGasLimit == 0) {\n            revert MultiChainTellerBase_ZeroMessageGasLimit();\n        }\n        selectorToChains[chainSelector] =\n            Chain(allowMessagesFrom, allowMessagesTo, targetTeller, messageGasLimit, messageGasMin);\n\n        emit ChainAdded(chainSelector, allowMessagesFrom, allowMessagesTo, targetTeller, messageGasLimit, messageGasMin);\n    }\n\n    /**\n     * @dev Callable by OWNER_ROLE.\n     * @notice block messages from a particular chain\n     * @param chainSelector of chain\n     */\n    function stopMessagesFromChain(uint32 chainSelector) external requiresAuth {\n        Chain storage chain = selectorToChains[chainSelector];\n        chain.allowMessagesFrom = false;\n\n        emit ChainStopMessagesFrom(chainSelector);\n    }\n\n    /**\n     * @dev Callable by OWNER_ROLE.\n     * @notice allow messages from a particular chain\n     * @param chainSelector of chain\n     */\n    function allowMessagesFromChain(uint32 chainSelector, address targetTeller) external requiresAuth {\n        Chain storage chain = selectorToChains[chainSelector];\n        chain.allowMessagesFrom = true;\n        chain.targetTeller = targetTeller;\n\n        emit ChainAllowMessagesFrom(chainSelector, targetTeller);\n    }\n\n    /**\n     * @dev Callable by OWNER_ROLE.\n     * @notice Remove a chain from the teller.\n     * @dev Callable by OWNER_ROLE.\n     */\n    function removeChain(uint32 chainSelector) external requiresAuth {\n        delete selectorToChains[chainSelector];\n\n        emit ChainRemoved(chainSelector);\n    }\n\n    /**\n     * @dev Callable by OWNER_ROLE.\n     * @notice Allow messages to a chain.\n     */\n    function allowMessagesToChain(\n        uint32 chainSelector,\n        address targetTeller,\n        uint64 messageGasLimit\n    )\n        external\n        requiresAuth\n    {\n        if (messageGasLimit == 0) {\n            revert MultiChainTellerBase_ZeroMessageGasLimit();\n        }\n        Chain storage chain = selectorToChains[chainSelector];\n        chain.allowMessagesTo = true;\n        chain.targetTeller = targetTeller;\n        chain.messageGasLimit = messageGasLimit;\n\n        emit ChainAllowMessagesTo(chainSelector, targetTeller);\n    }\n\n    /**\n     * @dev Callable by OWNER_ROLE.\n     * @notice Stop messages to a chain.\n     */\n    function stopMessagesToChain(uint32 chainSelector) external requiresAuth {\n        Chain storage chain = selectorToChains[chainSelector];\n        chain.allowMessagesTo = false;\n\n        emit ChainStopMessagesTo(chainSelector);\n    }\n\n    /**\n     * @dev Callable by OWNER_ROLE.\n     * @notice Set the gas limit for messages to a chain.\n     */\n    function setChainGasLimit(uint32 chainSelector, uint64 messageGasLimit) external requiresAuth {\n        if (messageGasLimit == 0) {\n            revert MultiChainTellerBase_ZeroMessageGasLimit();\n        }\n        Chain storage chain = selectorToChains[chainSelector];\n        chain.messageGasLimit = messageGasLimit;\n\n        emit ChainSetGasLimit(chainSelector, messageGasLimit);\n    }\n\n    /**\n     * @notice override beforeBridge to check Chain struct\n     * @param data bridge data\n     */\n    function _beforeBridge(BridgeData calldata data) internal override {\n        Chain memory chain = selectorToChains[data.chainSelector];\n\n        if (!chain.allowMessagesTo) {\n            revert MultiChainTellerBase_MessagesNotAllowedTo(data.chainSelector);\n        }\n\n        if (chain.targetTeller == address(0)) {\n            revert MultiChainTellerBase_TargetTellerIsZeroAddress();\n        }\n\n        if (data.destinationChainReceiver == address(0)) {\n            revert MultiChainTellerBase_DestinationChainReceiverIsZeroAddress();\n        }\n\n        if (data.messageGas > chain.messageGasLimit) {\n            revert MultiChainTellerBase_GasLimitExceeded();\n        }\n\n        if (data.messageGas < chain.minimumMessageGas) {\n            revert MultiChainTellerBase_GasTooLow();\n        }\n    }\n}\n"},{"file_path":"src/base/BoringVault.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { ERC721Holder } from \"@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol\";\nimport { ERC1155Holder } from \"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol\";\nimport { FixedPointMathLib } from \"@solmate/utils/FixedPointMathLib.sol\";\nimport { SafeTransferLib } from \"@solmate/utils/SafeTransferLib.sol\";\nimport { ERC20 } from \"@solmate/tokens/ERC20.sol\";\nimport { BeforeTransferHook } from \"src/interfaces/BeforeTransferHook.sol\";\nimport { Auth, Authority } from \"@solmate/auth/Auth.sol\";\n\n/**\n * @title BoringVault\n * @custom:security-contact security@molecularlabs.io\n */\ncontract BoringVault is ERC20, Auth, ERC721Holder, ERC1155Holder {\n    using Address for address;\n    using SafeTransferLib for ERC20;\n    using FixedPointMathLib for uint256;\n\n    // ========================================= STATE =========================================\n\n    /**\n     * @notice Contract responsible for implementing `beforeTransfer`.\n     */\n    BeforeTransferHook public hook;\n\n    //============================== EVENTS ===============================\n\n    event Enter(address indexed from, address indexed asset, uint256 amount, address indexed to, uint256 shares);\n    event Exit(address indexed to, address indexed asset, uint256 amount, address indexed from, uint256 shares);\n\n    //============================== CONSTRUCTOR ===============================\n\n    constructor(\n        address _owner,\n        string memory _name,\n        string memory _symbol,\n        uint8 _decimals\n    )\n        ERC20(_name, _symbol, _decimals)\n        Auth(_owner, Authority(address(0)))\n    { }\n\n    //============================== MANAGE ===============================\n\n    /**\n     * @notice Allows manager to make an arbitrary function call from this contract.\n     * @dev Requires auth.\n     */\n    function manage(\n        address target,\n        bytes calldata data,\n        uint256 value\n    )\n        external\n        requiresAuth\n        returns (bytes memory result)\n    {\n        result = target.functionCallWithValue(data, value);\n    }\n\n    /**\n     * @notice Allows manager to make arbitrary function calls from this contract.\n     * @dev Requires auth.\n     */\n    function manage(\n        address[] calldata targets,\n        bytes[] calldata data,\n        uint256[] calldata values\n    )\n        external\n        requiresAuth\n        returns (bytes[] memory results)\n    {\n        uint256 targetsLength = targets.length;\n        results = new bytes[](targetsLength);\n        for (uint256 i; i < targetsLength; ++i) {\n            results[i] = targets[i].functionCallWithValue(data[i], values[i]);\n        }\n    }\n\n    //============================== ENTER ===============================\n\n    /**\n     * @notice Allows minter to mint shares, in exchange for assets.\n     * @dev If assetAmount is zero, no assets are transferred in.\n     * @dev Callable by MINTER_ROLE.\n     */\n    function enter(\n        address from,\n        ERC20 asset,\n        uint256 assetAmount,\n        address to,\n        uint256 shareAmount\n    )\n        external\n        requiresAuth\n    {\n        // Transfer assets in\n        if (assetAmount > 0) asset.safeTransferFrom(from, address(this), assetAmount);\n\n        // Mint shares.\n        _mint(to, shareAmount);\n\n        emit Enter(from, address(asset), assetAmount, to, shareAmount);\n    }\n\n    //============================== EXIT ===============================\n\n    /**\n     * @notice Allows burner to burn shares, in exchange for assets.\n     * @dev If assetAmount is zero, no assets are transferred out.\n     * @dev Callable by BURNER_ROLE.\n     */\n    function exit(\n        address to,\n        ERC20 asset,\n        uint256 assetAmount,\n        address from,\n        uint256 shareAmount\n    )\n        external\n        requiresAuth\n    {\n        // Burn shares.\n        _burn(from, shareAmount);\n\n        // Transfer assets out.\n        if (assetAmount > 0) asset.safeTransfer(to, assetAmount);\n\n        emit Exit(to, address(asset), assetAmount, from, shareAmount);\n    }\n\n    //============================== BEFORE TRANSFER HOOK ===============================\n    /**\n     * @notice Sets the share locker.\n     * @notice If set to zero address, the share locker logic is disabled.\n     * @dev Callable by OWNER_ROLE.\n     */\n    function setBeforeTransferHook(address _hook) external requiresAuth {\n        hook = BeforeTransferHook(_hook);\n    }\n\n    /**\n     * @notice Check if from addresses shares are locked, reverting if so.\n     */\n    function _callBeforeTransfer(address from) internal view {\n        if (address(hook) != address(0)) hook.beforeTransfer(from);\n    }\n\n    function transfer(address to, uint256 amount) public override returns (bool) {\n        _callBeforeTransfer(msg.sender);\n        return super.transfer(to, amount);\n    }\n\n    function transferFrom(address from, address to, uint256 amount) public override returns (bool) {\n        _callBeforeTransfer(from);\n        return super.transferFrom(from, to, amount);\n    }\n\n    //============================== RECEIVE ===============================\n\n    receive() external payable { }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1363.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n    /*\n     * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n     * 0xb0202a11 ===\n     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n     */\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @param data Additional data with no specified format, sent in call to `spender`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary CalldataBytesLib {\n    function toU8(bytes calldata _bytes, uint256 _start) internal pure returns (uint8) {\n        return uint8(_bytes[_start]);\n    }\n\n    function toU16(bytes calldata _bytes, uint256 _start) internal pure returns (uint16) {\n        unchecked {\n            uint256 end = _start + 2;\n            return uint16(bytes2(_bytes[_start:end]));\n        }\n    }\n\n    function toU32(bytes calldata _bytes, uint256 _start) internal pure returns (uint32) {\n        unchecked {\n            uint256 end = _start + 4;\n            return uint32(bytes4(_bytes[_start:end]));\n        }\n    }\n\n    function toU64(bytes calldata _bytes, uint256 _start) internal pure returns (uint64) {\n        unchecked {\n            uint256 end = _start + 8;\n            return uint64(bytes8(_bytes[_start:end]));\n        }\n    }\n\n    function toU128(bytes calldata _bytes, uint256 _start) internal pure returns (uint128) {\n        unchecked {\n            uint256 end = _start + 16;\n            return uint128(bytes16(_bytes[_start:end]));\n        }\n    }\n\n    function toU256(bytes calldata _bytes, uint256 _start) internal pure returns (uint256) {\n        unchecked {\n            uint256 end = _start + 32;\n            return uint256(bytes32(_bytes[_start:end]));\n        }\n    }\n\n    function toAddr(bytes calldata _bytes, uint256 _start) internal pure returns (address) {\n        unchecked {\n            uint256 end = _start + 20;\n            return address(bytes20(_bytes[_start:end]));\n        }\n    }\n\n    function toB32(bytes calldata _bytes, uint256 _start) internal pure returns (bytes32) {\n        unchecked {\n            uint256 end = _start + 32;\n            return bytes32(_bytes[_start:end]);\n        }\n    }\n}\n"},{"file_path":"node_modules/solidity-bytes-utils/contracts/BytesLib.sol","source_code":"// SPDX-License-Identifier: Unlicense\n/*\n * @title Solidity Bytes Arrays Utils\n * @author Gonçalo Sá <goncalo.sa@consensys.net>\n *\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\n *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\n */\npragma solidity >=0.8.0 <0.9.0;\n\n\nlibrary BytesLib {\n    function concat(\n        bytes memory _preBytes,\n        bytes memory _postBytes\n    )\n        internal\n        pure\n        returns (bytes memory)\n    {\n        bytes memory tempBytes;\n\n        assembly {\n            // Get a location of some free memory and store it in tempBytes as\n            // Solidity does for memory variables.\n            tempBytes := mload(0x40)\n\n            // Store the length of the first bytes array at the beginning of\n            // the memory for tempBytes.\n            let length := mload(_preBytes)\n            mstore(tempBytes, length)\n\n            // Maintain a memory counter for the current write location in the\n            // temp bytes array by adding the 32 bytes for the array length to\n            // the starting location.\n            let mc := add(tempBytes, 0x20)\n            // Stop copying when the memory counter reaches the length of the\n            // first bytes array.\n            let end := add(mc, length)\n\n            for {\n                // Initialize a copy counter to the start of the _preBytes data,\n                // 32 bytes into its memory.\n                let cc := add(_preBytes, 0x20)\n            } lt(mc, end) {\n                // Increase both counters by 32 bytes each iteration.\n                mc := add(mc, 0x20)\n                cc := add(cc, 0x20)\n            } {\n                // Write the _preBytes data into the tempBytes memory 32 bytes\n                // at a time.\n                mstore(mc, mload(cc))\n            }\n\n            // Add the length of _postBytes to the current length of tempBytes\n            // and store it as the new length in the first 32 bytes of the\n            // tempBytes memory.\n            length := mload(_postBytes)\n            mstore(tempBytes, add(length, mload(tempBytes)))\n\n            // Move the memory counter back from a multiple of 0x20 to the\n            // actual end of the _preBytes data.\n            mc := end\n            // Stop copying when the memory counter reaches the new combined\n            // length of the arrays.\n            end := add(mc, length)\n\n            for {\n                let cc := add(_postBytes, 0x20)\n            } lt(mc, end) {\n                mc := add(mc, 0x20)\n                cc := add(cc, 0x20)\n            } {\n                mstore(mc, mload(cc))\n            }\n\n            // Update the free-memory pointer by padding our last write location\n            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n            // next 32 byte block, then round down to the nearest multiple of\n            // 32. If the sum of the length of the two arrays is zero then add\n            // one before rounding down to leave a blank 32 bytes (the length block with 0).\n            mstore(0x40, and(\n              add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n              not(31) // Round down to the nearest 32 bytes.\n            ))\n        }\n\n        return tempBytes;\n    }\n\n    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\n        assembly {\n            // Read the first 32 bytes of _preBytes storage, which is the length\n            // of the array. (We don't need to use the offset into the slot\n            // because arrays use the entire slot.)\n            let fslot := sload(_preBytes.slot)\n            // Arrays of 31 bytes or less have an even value in their slot,\n            // while longer arrays have an odd value. The actual length is\n            // the slot divided by two for odd values, and the lowest order\n            // byte divided by two for even values.\n            // If the slot is even, bitwise and the slot with 255 and divide by\n            // two to get the length. If the slot is odd, bitwise and the slot\n            // with -1 and divide by two.\n            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n            let mlength := mload(_postBytes)\n            let newlength := add(slength, mlength)\n            // slength can contain both the length and contents of the array\n            // if length < 32 bytes so let's prepare for that\n            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n            switch add(lt(slength, 32), lt(newlength, 32))\n            case 2 {\n                // Since the new array still fits in the slot, we just need to\n                // update the contents of the slot.\n                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n                sstore(\n                    _preBytes.slot,\n                    // all the modifications to the slot are inside this\n                    // next block\n                    add(\n                        // we can just add to the slot contents because the\n                        // bytes we want to change are the LSBs\n                        fslot,\n                        add(\n                            mul(\n                                div(\n                                    // load the bytes from memory\n                                    mload(add(_postBytes, 0x20)),\n                                    // zero all bytes to the right\n                                    exp(0x100, sub(32, mlength))\n                                ),\n                                // and now shift left the number of bytes to\n                                // leave space for the length in the slot\n                                exp(0x100, sub(32, newlength))\n                            ),\n                            // increase length by the double of the memory\n                            // bytes length\n                            mul(mlength, 2)\n                        )\n                    )\n                )\n            }\n            case 1 {\n                // The stored value fits in the slot, but the combined value\n                // will exceed it.\n                // get the keccak hash to get the contents of the array\n                mstore(0x0, _preBytes.slot)\n                let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n                // save new length\n                sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n                // The contents of the _postBytes array start 32 bytes into\n                // the structure. Our first read should obtain the `submod`\n                // bytes that can fit into the unused space in the last word\n                // of the stored array. To get this, we read 32 bytes starting\n                // from `submod`, so the data we read overlaps with the array\n                // contents by `submod` bytes. Masking the lowest-order\n                // `submod` bytes allows us to add that value directly to the\n                // stored value.\n\n                let submod := sub(32, slength)\n                let mc := add(_postBytes, submod)\n                let end := add(_postBytes, mlength)\n                let mask := sub(exp(0x100, submod), 1)\n\n                sstore(\n                    sc,\n                    add(\n                        and(\n                            fslot,\n                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\n                        ),\n                        and(mload(mc), mask)\n                    )\n                )\n\n                for {\n                    mc := add(mc, 0x20)\n                    sc := add(sc, 1)\n                } lt(mc, end) {\n                    sc := add(sc, 1)\n                    mc := add(mc, 0x20)\n                } {\n                    sstore(sc, mload(mc))\n                }\n\n                mask := exp(0x100, sub(mc, end))\n\n                sstore(sc, mul(div(mload(mc), mask), mask))\n            }\n            default {\n                // get the keccak hash to get the contents of the array\n                mstore(0x0, _preBytes.slot)\n                // Start copying to the last used word of the stored array.\n                let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n                // save new length\n                sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n                // Copy over the first `submod` bytes of the new data as in\n                // case 1 above.\n                let slengthmod := mod(slength, 32)\n                let mlengthmod := mod(mlength, 32)\n                let submod := sub(32, slengthmod)\n                let mc := add(_postBytes, submod)\n                let end := add(_postBytes, mlength)\n                let mask := sub(exp(0x100, submod), 1)\n\n                sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n                for {\n                    sc := add(sc, 1)\n                    mc := add(mc, 0x20)\n                } lt(mc, end) {\n                    sc := add(sc, 1)\n                    mc := add(mc, 0x20)\n                } {\n                    sstore(sc, mload(mc))\n                }\n\n                mask := exp(0x100, sub(mc, end))\n\n                sstore(sc, mul(div(mload(mc), mask), mask))\n            }\n        }\n    }\n\n    function slice(\n        bytes memory _bytes,\n        uint256 _start,\n        uint256 _length\n    )\n        internal\n        pure\n        returns (bytes memory)\n    {\n        require(_length + 31 >= _length, \"slice_overflow\");\n        require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n        bytes memory tempBytes;\n\n        assembly {\n            switch iszero(_length)\n            case 0 {\n                // Get a location of some free memory and store it in tempBytes as\n                // Solidity does for memory variables.\n                tempBytes := mload(0x40)\n\n                // The first word of the slice result is potentially a partial\n                // word read from the original array. To read it, we calculate\n                // the length of that partial word and start copying that many\n                // bytes into the array. The first word we copy will start with\n                // data we don't care about, but the last `lengthmod` bytes will\n                // land at the beginning of the contents of the new array. When\n                // we're done copying, we overwrite the full first word with\n                // the actual length of the slice.\n                let lengthmod := and(_length, 31)\n\n                // The multiplication in the next line is necessary\n                // because when slicing multiples of 32 bytes (lengthmod == 0)\n                // the following copy loop was copying the origin's length\n                // and then ending prematurely not copying everything it should.\n                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n                let end := add(mc, _length)\n\n                for {\n                    // The multiplication in the next line has the same exact purpose\n                    // as the one above.\n                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n                } lt(mc, end) {\n                    mc := add(mc, 0x20)\n                    cc := add(cc, 0x20)\n                } {\n                    mstore(mc, mload(cc))\n                }\n\n                mstore(tempBytes, _length)\n\n                //update free-memory pointer\n                //allocating the array padded to 32 bytes like the compiler does now\n                mstore(0x40, and(add(mc, 31), not(31)))\n            }\n            //if we want a zero-length slice let's just return a zero-length array\n            default {\n                tempBytes := mload(0x40)\n                //zero out the 32 bytes slice we are about to return\n                //we need to do it because Solidity does not garbage collect\n                mstore(tempBytes, 0)\n\n                mstore(0x40, add(tempBytes, 0x20))\n            }\n        }\n\n        return tempBytes;\n    }\n\n    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n        require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\n        address tempAddress;\n\n        assembly {\n            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n        }\n\n        return tempAddress;\n    }\n\n    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\n        require(_bytes.length >= _start + 1 , \"toUint8_outOfBounds\");\n        uint8 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x1), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\n        require(_bytes.length >= _start + 2, \"toUint16_outOfBounds\");\n        uint16 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x2), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\n        require(_bytes.length >= _start + 4, \"toUint32_outOfBounds\");\n        uint32 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x4), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\n        require(_bytes.length >= _start + 8, \"toUint64_outOfBounds\");\n        uint64 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x8), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\n        require(_bytes.length >= _start + 12, \"toUint96_outOfBounds\");\n        uint96 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0xc), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n        require(_bytes.length >= _start + 16, \"toUint128_outOfBounds\");\n        uint128 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x10), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n        require(_bytes.length >= _start + 32, \"toUint256_outOfBounds\");\n        uint256 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x20), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\n        require(_bytes.length >= _start + 32, \"toBytes32_outOfBounds\");\n        bytes32 tempBytes32;\n\n        assembly {\n            tempBytes32 := mload(add(add(_bytes, 0x20), _start))\n        }\n\n        return tempBytes32;\n    }\n\n    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n        bool success = true;\n\n        assembly {\n            let length := mload(_preBytes)\n\n            // if lengths don't match the arrays are not equal\n            switch eq(length, mload(_postBytes))\n            case 1 {\n                // cb is a circuit breaker in the for loop since there's\n                //  no said feature for inline assembly loops\n                // cb = 1 - don't breaker\n                // cb = 0 - break\n                let cb := 1\n\n                let mc := add(_preBytes, 0x20)\n                let end := add(mc, length)\n\n                for {\n                    let cc := add(_postBytes, 0x20)\n                // the next line is the loop condition:\n                // while(uint256(mc < end) + cb == 2)\n                } eq(add(lt(mc, end), cb), 2) {\n                    mc := add(mc, 0x20)\n                    cc := add(cc, 0x20)\n                } {\n                    // if any of these checks fails then arrays are not equal\n                    if iszero(eq(mload(mc), mload(cc))) {\n                        // unsuccess:\n                        success := 0\n                        cb := 0\n                    }\n                }\n            }\n            default {\n                // unsuccess:\n                success := 0\n            }\n        }\n\n        return success;\n    }\n\n    function equal_nonAligned(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n        bool success = true;\n\n        assembly {\n            let length := mload(_preBytes)\n\n            // if lengths don't match the arrays are not equal\n            switch eq(length, mload(_postBytes))\n            case 1 {\n                // cb is a circuit breaker in the for loop since there's\n                //  no said feature for inline assembly loops\n                // cb = 1 - don't breaker\n                // cb = 0 - break\n                let cb := 1\n\n                let endMinusWord := add(_preBytes, length)\n                let mc := add(_preBytes, 0x20)\n                let cc := add(_postBytes, 0x20)\n\n                for {\n                // the next line is the loop condition:\n                // while(uint256(mc < endWord) + cb == 2)\n                } eq(add(lt(mc, endMinusWord), cb), 2) {\n                    mc := add(mc, 0x20)\n                    cc := add(cc, 0x20)\n                } {\n                    // if any of these checks fails then arrays are not equal\n                    if iszero(eq(mload(mc), mload(cc))) {\n                        // unsuccess:\n                        success := 0\n                        cb := 0\n                    }\n                }\n\n                // Only if still successful\n                // For <1 word tail bytes\n                if gt(success, 0) {\n                    // Get the remainder of length/32\n                    // length % 32 = AND(length, 32 - 1)\n                    let numTailBytes := and(length, 0x1f)\n                    let mcRem := mload(mc)\n                    let ccRem := mload(cc)\n                    for {\n                        let i := 0\n                    // the next line is the loop condition:\n                    // while(uint256(i < numTailBytes) + cb == 2)\n                    } eq(add(lt(i, numTailBytes), cb), 2) {\n                        i := add(i, 1)\n                    } {\n                        if iszero(eq(byte(i, mcRem), byte(i, ccRem))) {\n                            // unsuccess:\n                            success := 0\n                            cb := 0\n                        }\n                    }\n                }\n            }\n            default {\n                // unsuccess:\n                success := 0\n            }\n        }\n\n        return success;\n    }\n\n    function equalStorage(\n        bytes storage _preBytes,\n        bytes memory _postBytes\n    )\n        internal\n        view\n        returns (bool)\n    {\n        bool success = true;\n\n        assembly {\n            // we know _preBytes_offset is 0\n            let fslot := sload(_preBytes.slot)\n            // Decode the length of the stored array like in concatStorage().\n            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n            let mlength := mload(_postBytes)\n\n            // if lengths don't match the arrays are not equal\n            switch eq(slength, mlength)\n            case 1 {\n                // slength can contain both the length and contents of the array\n                // if length < 32 bytes so let's prepare for that\n                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n                if iszero(iszero(slength)) {\n                    switch lt(slength, 32)\n                    case 1 {\n                        // blank the last byte which is the length\n                        fslot := mul(div(fslot, 0x100), 0x100)\n\n                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n                            // unsuccess:\n                            success := 0\n                        }\n                    }\n                    default {\n                        // cb is a circuit breaker in the for loop since there's\n                        //  no said feature for inline assembly loops\n                        // cb = 1 - don't breaker\n                        // cb = 0 - break\n                        let cb := 1\n\n                        // get the keccak hash to get the contents of the array\n                        mstore(0x0, _preBytes.slot)\n                        let sc := keccak256(0x0, 0x20)\n\n                        let mc := add(_postBytes, 0x20)\n                        let end := add(mc, mlength)\n\n                        // the next line is the loop condition:\n                        // while(uint256(mc < end) + cb == 2)\n                        for {} eq(add(lt(mc, end), cb), 2) {\n                            sc := add(sc, 1)\n                            mc := add(mc, 0x20)\n                        } {\n                            if iszero(eq(sload(sc), mload(mc))) {\n                                // unsuccess:\n                                success := 0\n                                cb := 0\n                            }\n                        }\n                    }\n                }\n            }\n            default {\n                // unsuccess:\n                success := 0\n            }\n        }\n\n        return success;\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-oapp-v2/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":"lib/solmate/src/utils/ReentrancyGuard.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Gas optimized reentrancy protection for smart contracts.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)\nabstract contract ReentrancyGuard {\n    uint256 private locked = 1;\n\n    modifier nonReentrant() virtual {\n        require(locked == 1, \"REENTRANCY\");\n\n        locked = 2;\n\n        _;\n\n        locked = 1;\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-oapp-v2/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":"node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol","source_code":"// SPDX-License-Identifier: MIT\n\n// modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/BitMaps.sol\npragma solidity ^0.8.20;\n\ntype BitMap256 is uint256;\n\nusing BitMaps for BitMap256 global;\n\nlibrary BitMaps {\n    /**\n     * @dev Returns whether the bit at `index` is set.\n     */\n    function get(BitMap256 bitmap, uint8 index) internal pure returns (bool) {\n        uint256 mask = 1 << index;\n        return BitMap256.unwrap(bitmap) & mask != 0;\n    }\n\n    /**\n     * @dev Sets the bit at `index`.\n     */\n    function set(BitMap256 bitmap, uint8 index) internal pure returns (BitMap256) {\n        uint256 mask = 1 << index;\n        return BitMap256.wrap(BitMap256.unwrap(bitmap) | mask);\n    }\n}\n"},{"file_path":"src/base/Roles/CrossChain/OAppAuth/OAppAuth.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 { MessagingFee, MessagingReceipt } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol\";\n// @dev Import the 'Origin' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport { Origin } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\";\n\nimport { OAppAuthCore } from \"./OAppAuthCore.sol\";\nimport { OAppAuthReceiver } from \"./OAppAuthReceiver.sol\";\nimport { OAppAuthSender } from \"./OAppAuthSender.sol\";\n\n/**\n * @title OAppAuth\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver\n * functionality.\n *\n * @dev This Auth version of OAppCore uses solmate's Auth instead of OZ's Ownable for compatibility purposes\n */\nabstract contract OAppAuth is OAppAuthSender, OAppAuthReceiver {\n    /**\n     * @dev Constructor to initialize the OApp with the provided endpoint and owner.\n     * @param _endpoint The address of the LOCAL LayerZero endpoint.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     */\n    constructor(address _endpoint, address _delegate) OAppAuthCore(_endpoint, _delegate) { }\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol implementation.\n     * @return receiverVersion The version of the OAppReceiver.sol implementation.\n     */\n    function oAppVersion()\n        public\n        pure\n        virtual\n        override(OAppAuthSender, OAppAuthReceiver)\n        returns (uint64 senderVersion, uint64 receiverVersion)\n    {\n        return (SENDER_VERSION, RECEIVER_VERSION);\n    }\n}\n"},{"file_path":"src/base/Roles/CrossChain/OAppAuth/OAppAuthReceiver.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppReceiver.sol\";\nimport { OAppAuthCore } from \"./OAppAuthCore.sol\";\n\n/**\n * @title OAppAuthReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n *\n * @dev This Auth version of OAppCore uses solmate's Auth instead of OZ's Ownable for compatibility purposes\n */\nabstract contract OAppAuthReceiver is IOAppReceiver, OAppAuthCore {\n    // Custom error message for when the caller is not the registered endpoint/\n    error OnlyEndpoint(address addr);\n\n    // @dev The version of the OAppReceiver implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant RECEIVER_VERSION = 2;\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n     * ie. this is a RECEIVE only OApp.\n     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct\n     * 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    )\n        public\n        view\n        virtual\n        returns (bool)\n    {\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    )\n        public\n        payable\n        virtual\n    {\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    )\n        internal\n        virtual;\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n    /**\n     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n     * by `operator` from `from`, this function is called.\n     *\n     * It must return its Solidity selector to confirm the token transfer.\n     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n     * reverted.\n     *\n     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n     */\n    function onERC721Received(\n        address operator,\n        address from,\n        uint256 tokenId,\n        bytes calldata data\n    ) external returns (bytes4);\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":"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/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":"lib/solmate/src/utils/FixedPointMathLib.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Arithmetic library with operations for fixed-point numbers.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)\n/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)\nlibrary FixedPointMathLib {\n    /*//////////////////////////////////////////////////////////////\n                    SIMPLIFIED FIXED POINT OPERATIONS\n    //////////////////////////////////////////////////////////////*/\n\n    uint256 internal constant MAX_UINT256 = 2**256 - 1;\n\n    uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.\n\n    function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {\n        return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.\n    }\n\n    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {\n        return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.\n    }\n\n    function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {\n        return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.\n    }\n\n    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {\n        return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                    LOW LEVEL FIXED POINT OPERATIONS\n    //////////////////////////////////////////////////////////////*/\n\n    function mulDivDown(\n        uint256 x,\n        uint256 y,\n        uint256 denominator\n    ) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))\n            if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {\n                revert(0, 0)\n            }\n\n            // Divide x * y by the denominator.\n            z := div(mul(x, y), denominator)\n        }\n    }\n\n    function mulDivUp(\n        uint256 x,\n        uint256 y,\n        uint256 denominator\n    ) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))\n            if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {\n                revert(0, 0)\n            }\n\n            // If x * y modulo the denominator is strictly greater than 0,\n            // 1 is added to round up the division of x * y by the denominator.\n            z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator))\n        }\n    }\n\n    function rpow(\n        uint256 x,\n        uint256 n,\n        uint256 scalar\n    ) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            switch x\n            case 0 {\n                switch n\n                case 0 {\n                    // 0 ** 0 = 1\n                    z := scalar\n                }\n                default {\n                    // 0 ** n = 0\n                    z := 0\n                }\n            }\n            default {\n                switch mod(n, 2)\n                case 0 {\n                    // If n is even, store scalar in z for now.\n                    z := scalar\n                }\n                default {\n                    // If n is odd, store x in z for now.\n                    z := x\n                }\n\n                // Shifting right by 1 is like dividing by 2.\n                let half := shr(1, scalar)\n\n                for {\n                    // Shift n right by 1 before looping to halve it.\n                    n := shr(1, n)\n                } n {\n                    // Shift n right by 1 each iteration to halve it.\n                    n := shr(1, n)\n                } {\n                    // Revert immediately if x ** 2 would overflow.\n                    // Equivalent to iszero(eq(div(xx, x), x)) here.\n                    if shr(128, x) {\n                        revert(0, 0)\n                    }\n\n                    // Store x squared.\n                    let xx := mul(x, x)\n\n                    // Round to the nearest number.\n                    let xxRound := add(xx, half)\n\n                    // Revert if xx + half overflowed.\n                    if lt(xxRound, xx) {\n                        revert(0, 0)\n                    }\n\n                    // Set x to scaled xxRound.\n                    x := div(xxRound, scalar)\n\n                    // If n is even:\n                    if mod(n, 2) {\n                        // Compute z * x.\n                        let zx := mul(z, x)\n\n                        // If z * x overflowed:\n                        if iszero(eq(div(zx, x), z)) {\n                            // Revert if x is non-zero.\n                            if iszero(iszero(x)) {\n                                revert(0, 0)\n                            }\n                        }\n\n                        // Round to the nearest number.\n                        let zxRound := add(zx, half)\n\n                        // Revert if zx + half overflowed.\n                        if lt(zxRound, zx) {\n                            revert(0, 0)\n                        }\n\n                        // Return properly scaled zxRound.\n                        z := div(zxRound, scalar)\n                    }\n                }\n            }\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        GENERAL NUMBER UTILITIES\n    //////////////////////////////////////////////////////////////*/\n\n    function sqrt(uint256 x) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let y := x // We start y at x, which will help us make our initial estimate.\n\n            z := 181 // The \"correct\" value is 1, but this saves a multiplication later.\n\n            // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad\n            // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.\n\n            // We check y >= 2^(k + 8) but shift right by k bits\n            // each branch to ensure that if x >= 256, then y >= 256.\n            if iszero(lt(y, 0x10000000000000000000000000000000000)) {\n                y := shr(128, y)\n                z := shl(64, z)\n            }\n            if iszero(lt(y, 0x1000000000000000000)) {\n                y := shr(64, y)\n                z := shl(32, z)\n            }\n            if iszero(lt(y, 0x10000000000)) {\n                y := shr(32, y)\n                z := shl(16, z)\n            }\n            if iszero(lt(y, 0x1000000)) {\n                y := shr(16, y)\n                z := shl(8, z)\n            }\n\n            // Goal was to get z*z*y within a small factor of x. More iterations could\n            // get y in a tighter range. Currently, we will have y in [256, 256*2^16).\n            // We ensured y >= 256 so that the relative difference between y and y+1 is small.\n            // That's not possible if x < 256 but we can just verify those cases exhaustively.\n\n            // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.\n            // Correctness can be checked exhaustively for x < 256, so we assume y >= 256.\n            // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.\n\n            // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range\n            // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.\n\n            // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate\n            // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.\n\n            // There is no overflow risk here since y < 2^136 after the first branch above.\n            z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.\n\n            // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n            z := shr(1, add(z, div(x, z)))\n\n            // If x+1 is a perfect square, the Babylonian method cycles between\n            // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.\n            // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division\n            // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.\n            // If you don't care whether the floor or ceil square root is returned, you can remove this statement.\n            z := sub(z, lt(div(x, z), z))\n        }\n    }\n\n    function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Mod x by y. Note this will return\n            // 0 instead of reverting if y is zero.\n            z := mod(x, y)\n        }\n    }\n\n    function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Divide x by y. Note this will return\n            // 0 instead of reverting if y is zero.\n            r := div(x, y)\n        }\n    }\n\n    function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Add 1 to x * y if x % y > 0. Note this will\n            // return 0 instead of reverting if y is zero.\n            z := add(gt(mod(x, y), 0), div(x, y))\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":"lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { BytesLib } from \"solidity-bytes-utils/contracts/BytesLib.sol\";\n\nimport { BitMap256 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\nlibrary DVNOptions {\n    using CalldataBytesLib for bytes;\n    using BytesLib for bytes;\n\n    uint8 internal constant WORKER_ID = 2;\n    uint8 internal constant OPTION_TYPE_PRECRIME = 1;\n\n    error DVN_InvalidDVNIdx();\n    error DVN_InvalidDVNOptions(uint256 cursor);\n\n    /// @dev group dvn options by its idx\n    /// @param _options [dvn_id][dvn_option][dvn_id][dvn_option]...\n    ///        dvn_option = [option_size][dvn_idx][option_type][option]\n    ///        option_size = len(dvn_idx) + len(option_type) + len(option)\n    ///        dvn_id: uint8, dvn_idx: uint8, option_size: uint16, option_type: uint8, option: bytes\n    /// @return dvnOptions the grouped options, still share the same format of _options\n    /// @return dvnIndices the dvn indices\n    function groupDVNOptionsByIdx(\n        bytes memory _options\n    ) internal pure returns (bytes[] memory dvnOptions, uint8[] memory dvnIndices) {\n        if (_options.length == 0) return (dvnOptions, dvnIndices);\n\n        uint8 numDVNs = getNumDVNs(_options);\n\n        // if there is only 1 dvn, we can just return the whole options\n        if (numDVNs == 1) {\n            dvnOptions = new bytes[](1);\n            dvnOptions[0] = _options;\n\n            dvnIndices = new uint8[](1);\n            dvnIndices[0] = _options.toUint8(3); // dvn idx\n            return (dvnOptions, dvnIndices);\n        }\n\n        // otherwise, we need to group the options by dvn_idx\n        dvnIndices = new uint8[](numDVNs);\n        dvnOptions = new bytes[](numDVNs);\n        unchecked {\n            uint256 cursor = 0;\n            uint256 start = 0;\n            uint8 lastDVNIdx = 255; // 255 is an invalid dvn_idx\n\n            while (cursor < _options.length) {\n                ++cursor; // skip worker_id\n\n                // optionLength asserted in getNumDVNs (skip check)\n                uint16 optionLength = _options.toUint16(cursor);\n                cursor += 2;\n\n                // dvnIdx asserted in getNumDVNs (skip check)\n                uint8 dvnIdx = _options.toUint8(cursor);\n\n                // dvnIdx must equal to the lastDVNIdx for the first option\n                // so it is always skipped in the first option\n                // this operation slices out options whenever the scan finds a different lastDVNIdx\n                if (lastDVNIdx == 255) {\n                    lastDVNIdx = dvnIdx;\n                } else if (dvnIdx != lastDVNIdx) {\n                    uint256 len = cursor - start - 3; // 3 is for worker_id and option_length\n                    bytes memory opt = _options.slice(start, len);\n                    _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, opt);\n\n                    // reset the start and lastDVNIdx\n                    start += len;\n                    lastDVNIdx = dvnIdx;\n                }\n\n                cursor += optionLength;\n            }\n\n            // skip check the cursor here because the cursor is asserted in getNumDVNs\n            // if we have reached the end of the options, we need to process the last dvn\n            uint256 size = cursor - start;\n            bytes memory op = _options.slice(start, size);\n            _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, op);\n\n            // revert dvnIndices to start from 0\n            for (uint8 i = 0; i < numDVNs; ++i) {\n                --dvnIndices[i];\n            }\n        }\n    }\n\n    function _insertDVNOptions(\n        bytes[] memory _dvnOptions,\n        uint8[] memory _dvnIndices,\n        uint8 _dvnIdx,\n        bytes memory _newOptions\n    ) internal pure {\n        // dvnIdx starts from 0 but default value of dvnIndices is 0,\n        // so we tell if the slot is empty by adding 1 to dvnIdx\n        if (_dvnIdx == 255) revert DVN_InvalidDVNIdx();\n        uint8 dvnIdxAdj = _dvnIdx + 1;\n\n        for (uint256 j = 0; j < _dvnIndices.length; ++j) {\n            uint8 index = _dvnIndices[j];\n            if (dvnIdxAdj == index) {\n                _dvnOptions[j] = abi.encodePacked(_dvnOptions[j], _newOptions);\n                break;\n            } else if (index == 0) {\n                // empty slot, that means it is the first time we see this dvn\n                _dvnIndices[j] = dvnIdxAdj;\n                _dvnOptions[j] = _newOptions;\n                break;\n            }\n        }\n    }\n\n    /// @dev get the number of unique dvns\n    /// @param _options the format is the same as groupDVNOptionsByIdx\n    function getNumDVNs(bytes memory _options) internal pure returns (uint8 numDVNs) {\n        uint256 cursor = 0;\n        BitMap256 bitmap;\n\n        // find number of unique dvn_idx\n        unchecked {\n            while (cursor < _options.length) {\n                ++cursor; // skip worker_id\n\n                uint16 optionLength = _options.toUint16(cursor);\n                cursor += 2;\n                if (optionLength < 2) revert DVN_InvalidDVNOptions(cursor); // at least 1 byte for dvn_idx and 1 byte for option_type\n\n                uint8 dvnIdx = _options.toUint8(cursor);\n\n                // if dvnIdx is not set, increment numDVNs\n                // max num of dvns is 255, 255 is an invalid dvn_idx\n                // The order of the dvnIdx is not required to be sequential, as enforcing the order may weaken\n                // the composability of the options. e.g. if we refrain from enforcing the order, an OApp that has\n                // already enforced certain options can append additional options to the end of the enforced\n                // ones without restrictions.\n                if (dvnIdx == 255) revert DVN_InvalidDVNIdx();\n                if (!bitmap.get(dvnIdx)) {\n                    ++numDVNs;\n                    bitmap = bitmap.set(dvnIdx);\n                }\n\n                cursor += optionLength;\n            }\n        }\n        if (cursor != _options.length) revert DVN_InvalidDVNOptions(cursor);\n    }\n\n    /// @dev decode the next dvn option from _options starting from the specified cursor\n    /// @param _options the format is the same as groupDVNOptionsByIdx\n    /// @param _cursor the cursor to start decoding\n    /// @return optionType the type of the option\n    /// @return option the option\n    /// @return cursor the cursor to start decoding the next option\n    function nextDVNOption(\n        bytes calldata _options,\n        uint256 _cursor\n    ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n        unchecked {\n            // skip worker id\n            cursor = _cursor + 1;\n\n            // read option size\n            uint16 size = _options.toU16(cursor);\n            cursor += 2;\n\n            // read option type\n            optionType = _options.toU8(cursor + 1); // skip dvn_idx\n\n            // startCursor and endCursor are used to slice the option from _options\n            uint256 startCursor = cursor + 2; // skip option type and dvn_idx\n            uint256 endCursor = cursor + size;\n            option = _options[startCursor:endCursor];\n            cursor += size;\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/Errors.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"},{"file_path":"lib/solmate/src/auth/Auth.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Provides a flexible and updatable auth pattern which is completely separate from application logic.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)\n/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)\nabstract contract Auth {\n    event OwnershipTransferred(address indexed user, address indexed newOwner);\n\n    event AuthorityUpdated(address indexed user, Authority indexed newAuthority);\n\n    address public owner;\n\n    Authority public authority;\n\n    constructor(address _owner, Authority _authority) {\n        owner = _owner;\n        authority = _authority;\n\n        emit OwnershipTransferred(msg.sender, _owner);\n        emit AuthorityUpdated(msg.sender, _authority);\n    }\n\n    modifier requiresAuth() virtual {\n        require(isAuthorized(msg.sender, msg.sig), \"UNAUTHORIZED\");\n\n        _;\n    }\n\n    function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {\n        Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.\n\n        // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be\n        // aware that this makes protected functions uncallable even to the owner if the authority is out of order.\n        return (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) || user == owner;\n    }\n\n    function setAuthority(Authority newAuthority) public virtual {\n        // We check if the caller is the owner first because we want to ensure they can\n        // always swap out the authority even if it's reverting or using up a lot of gas.\n        require(msg.sender == owner || authority.canCall(msg.sender, address(this), msg.sig));\n\n        authority = newAuthority;\n\n        emit AuthorityUpdated(msg.sender, newAuthority);\n    }\n\n    function transferOwnership(address newOwner) public virtual requiresAuth {\n        owner = newOwner;\n\n        emit OwnershipTransferred(msg.sender, newOwner);\n    }\n}\n\n/// @notice A generic interface for a contract which provides authorization data to an Auth instance.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)\n/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)\ninterface Authority {\n    function canCall(\n        address user,\n        address target,\n        bytes4 functionSig\n    ) external view returns (bool);\n}\n"},{"file_path":"lib/solmate/src/utils/SafeTransferLib.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\nimport {ERC20} from \"../tokens/ERC20.sol\";\n\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\n/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.\n/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.\nlibrary SafeTransferLib {\n    /*//////////////////////////////////////////////////////////////\n                             ETH OPERATIONS\n    //////////////////////////////////////////////////////////////*/\n\n    function safeTransferETH(address to, uint256 amount) internal {\n        bool success;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Transfer the ETH and store if it succeeded or not.\n            success := call(gas(), to, amount, 0, 0, 0, 0)\n        }\n\n        require(success, \"ETH_TRANSFER_FAILED\");\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                            ERC20 OPERATIONS\n    //////////////////////////////////////////////////////////////*/\n\n    function safeTransferFrom(\n        ERC20 token,\n        address from,\n        address to,\n        uint256 amount\n    ) internal {\n        bool success;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Get a pointer to some free memory.\n            let freeMemoryPointer := mload(0x40)\n\n            // Write the abi-encoded calldata into memory, beginning with the function selector.\n            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n            mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the \"from\" argument.\n            mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the \"to\" argument.\n            mstore(add(freeMemoryPointer, 68), amount) // Append the \"amount\" argument. Masking not required as it's a full 32 byte type.\n\n            success := and(\n                // Set success to whether the call reverted, if not we check it either\n                // returned exactly 1 (can't just be non-zero data), or had no return data.\n                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\n                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.\n                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\n                // Counterintuitively, this call must be positioned second to the or() call in the\n                // surrounding and() call or else returndatasize() will be zero during the computation.\n                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)\n            )\n        }\n\n        require(success, \"TRANSFER_FROM_FAILED\");\n    }\n\n    function safeTransfer(\n        ERC20 token,\n        address to,\n        uint256 amount\n    ) internal {\n        bool success;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Get a pointer to some free memory.\n            let freeMemoryPointer := mload(0x40)\n\n            // Write the abi-encoded calldata into memory, beginning with the function selector.\n            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\n            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the \"to\" argument.\n            mstore(add(freeMemoryPointer, 36), amount) // Append the \"amount\" argument. Masking not required as it's a full 32 byte type.\n\n            success := and(\n                // Set success to whether the call reverted, if not we check it either\n                // returned exactly 1 (can't just be non-zero data), or had no return data.\n                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\n                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\n                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\n                // Counterintuitively, this call must be positioned second to the or() call in the\n                // surrounding and() call or else returndatasize() will be zero during the computation.\n                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\n            )\n        }\n\n        require(success, \"TRANSFER_FAILED\");\n    }\n\n    function safeApprove(\n        ERC20 token,\n        address to,\n        uint256 amount\n    ) internal {\n        bool success;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Get a pointer to some free memory.\n            let freeMemoryPointer := mload(0x40)\n\n            // Write the abi-encoded calldata into memory, beginning with the function selector.\n            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)\n            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the \"to\" argument.\n            mstore(add(freeMemoryPointer, 36), amount) // Append the \"amount\" argument. Masking not required as it's a full 32 byte type.\n\n            success := and(\n                // Set success to whether the call reverted, if not we check it either\n                // returned exactly 1 (can't just be non-zero data), or had no return data.\n                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\n                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\n                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\n                // Counterintuitively, this call must be positioned second to the or() call in the\n                // surrounding and() call or else returndatasize() will be zero during the computation.\n                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\n            )\n        }\n\n        require(success, \"APPROVE_FAILED\");\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/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":"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/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"./interfaces/IOAppReceiver.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\n    // Custom error message for when the caller is not the registered endpoint/\n    error OnlyEndpoint(address addr);\n\n    // @dev The version of the OAppReceiver implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant RECEIVER_VERSION = 2;\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n     * ie. this is a RECEIVE only OApp.\n     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\n     */\n    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n        return (0, RECEIVER_VERSION);\n    }\n\n    /**\n     * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n     * @dev _origin The origin information containing the source endpoint and sender address.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address on the src chain.\n     *  - nonce: The nonce of the message.\n     * @dev _message The lzReceive payload.\n     * @param _sender The sender address.\n     * @return isSender Is a valid sender.\n     *\n     * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\n     * @dev The default sender IS the OAppReceiver implementer.\n     */\n    function isComposeMsgSender(\n        Origin calldata /*_origin*/,\n        bytes calldata /*_message*/,\n        address _sender\n    ) public view virtual returns (bool) {\n        return _sender == address(this);\n    }\n\n    /**\n     * @notice Checks if the path initialization is allowed based on the provided origin.\n     * @param origin The origin information containing the source endpoint and sender address.\n     * @return Whether the path has been initialized.\n     *\n     * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\n     * @dev This defaults to assuming if a peer has been set, its initialized.\n     * Can be overridden by the OApp if there is other logic to determine this.\n     */\n    function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\n        return peers[origin.srcEid] == origin.sender;\n    }\n\n    /**\n     * @notice Retrieves the next nonce for a given source endpoint and sender address.\n     * @dev _srcEid The source endpoint ID.\n     * @dev _sender The sender address.\n     * @return nonce The next nonce.\n     *\n     * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\n     * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\n     * @dev This is also enforced by the OApp.\n     * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\n     */\n    function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\n        return 0;\n    }\n\n    /**\n     * @dev Entry point for receiving messages or packets from the endpoint.\n     * @param _origin The origin information containing the source endpoint and sender address.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address on the src chain.\n     *  - nonce: The nonce of the message.\n     * @param _guid The unique identifier for the received LayerZero message.\n     * @param _message The payload of the received message.\n     * @param _executor The address of the executor for the received message.\n     * @param _extraData Additional arbitrary data provided by the corresponding executor.\n     *\n     * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\n     */\n    function lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) public payable virtual {\n        // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\n        if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\n\n        // Ensure that the sender matches the expected peer for the source endpoint.\n        if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\n\n        // Call the internal OApp implementation of lzReceive.\n        _lzReceive(_origin, _guid, _message, _executor, _extraData);\n    }\n\n    /**\n     * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\n     */\n    function _lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) internal virtual;\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},{"file_path":"lib/solmate/src/tokens/ERC20.sol","source_code":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\nabstract contract ERC20 {\n    /*//////////////////////////////////////////////////////////////\n                                 EVENTS\n    //////////////////////////////////////////////////////////////*/\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n\n    event Approval(address indexed owner, address indexed spender, uint256 amount);\n\n    /*//////////////////////////////////////////////////////////////\n                            METADATA STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    string public name;\n\n    string public symbol;\n\n    uint8 public immutable decimals;\n\n    /*//////////////////////////////////////////////////////////////\n                              ERC20 STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    uint256 public totalSupply;\n\n    mapping(address => uint256) public balanceOf;\n\n    mapping(address => mapping(address => uint256)) public allowance;\n\n    /*//////////////////////////////////////////////////////////////\n                            EIP-2612 STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    uint256 internal immutable INITIAL_CHAIN_ID;\n\n    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\n\n    mapping(address => uint256) public nonces;\n\n    /*//////////////////////////////////////////////////////////////\n                               CONSTRUCTOR\n    //////////////////////////////////////////////////////////////*/\n\n    constructor(\n        string memory _name,\n        string memory _symbol,\n        uint8 _decimals\n    ) {\n        name = _name;\n        symbol = _symbol;\n        decimals = _decimals;\n\n        INITIAL_CHAIN_ID = block.chainid;\n        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               ERC20 LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    function approve(address spender, uint256 amount) public virtual returns (bool) {\n        allowance[msg.sender][spender] = amount;\n\n        emit Approval(msg.sender, spender, amount);\n\n        return true;\n    }\n\n    function transfer(address to, uint256 amount) public virtual returns (bool) {\n        balanceOf[msg.sender] -= amount;\n\n        // Cannot overflow because the sum of all user\n        // balances can't exceed the max uint256 value.\n        unchecked {\n            balanceOf[to] += amount;\n        }\n\n        emit Transfer(msg.sender, to, amount);\n\n        return true;\n    }\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) public virtual returns (bool) {\n        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\n\n        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\n\n        balanceOf[from] -= amount;\n\n        // Cannot overflow because the sum of all user\n        // balances can't exceed the max uint256 value.\n        unchecked {\n            balanceOf[to] += amount;\n        }\n\n        emit Transfer(from, to, amount);\n\n        return true;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                             EIP-2612 LOGIC\n    //////////////////////////////////////////////////////////////*/\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        require(deadline >= block.timestamp, \"PERMIT_DEADLINE_EXPIRED\");\n\n        // Unchecked because the only math done is incrementing\n        // the owner's nonce which cannot realistically overflow.\n        unchecked {\n            address recoveredAddress = ecrecover(\n                keccak256(\n                    abi.encodePacked(\n                        \"\\x19\\x01\",\n                        DOMAIN_SEPARATOR(),\n                        keccak256(\n                            abi.encode(\n                                keccak256(\n                                    \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n                                ),\n                                owner,\n                                spender,\n                                value,\n                                nonces[owner]++,\n                                deadline\n                            )\n                        )\n                    )\n                ),\n                v,\n                r,\n                s\n            );\n\n            require(recoveredAddress != address(0) && recoveredAddress == owner, \"INVALID_SIGNER\");\n\n            allowance[recoveredAddress][spender] = value;\n        }\n\n        emit Approval(owner, spender, value);\n    }\n\n    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\n        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\n    }\n\n    function computeDomainSeparator() internal view virtual returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"),\n                    keccak256(bytes(name)),\n                    keccak256(\"1\"),\n                    block.chainid,\n                    address(this)\n                )\n            );\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        INTERNAL MINT/BURN LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    function _mint(address to, uint256 amount) internal virtual {\n        totalSupply += amount;\n\n        // Cannot overflow because the sum of all user\n        // balances can't exceed the max uint256 value.\n        unchecked {\n            balanceOf[to] += amount;\n        }\n\n        emit Transfer(address(0), to, amount);\n    }\n\n    function _burn(address from, uint256 amount) internal virtual {\n        balanceOf[from] -= amount;\n\n        // Cannot underflow because a user's balance\n        // will never be larger than the total supply.\n        unchecked {\n            totalSupply -= amount;\n        }\n\n        emit Transfer(from, address(0), amount);\n    }\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\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\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 Errors.InsufficientBalance(address(this).balance, amount);\n        }\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert Errors.FailedCall();\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     * {Errors.FailedCall} 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 Errors.InsufficientBalance(address(this).balance, value);\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 {Errors.FailedCall}) in case\n     * of an 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 {Errors.FailedCall} 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 {Errors.FailedCall}.\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 Errors.FailedCall();\n        }\n    }\n}\n"},{"file_path":"node_modules/@layerzerolabs/lz-evm-oapp-v2/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":"src/base/Roles/CrossChain/OAppAuth/OAppAuthCore.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Auth } from \"@solmate/auth/Auth.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppAuthCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n *\n * @dev This Auth version of OAppCore uses solmate's Auth instead of OZ's Ownable for compatibility purposes\n */\nabstract contract OAppAuthCore is IOAppCore, Auth {\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     * @notice this contract replaces the OZ Ownable onlyOwner with Solmate requiresAuth\n     */\n    function setPeer(uint32 _eid, bytes32 _peer) public virtual requiresAuth {\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\n     * contract.\n     *\n     * @notice this contract replaces the OZ Ownable onlyOwner with Solmate requiresAuth\n     */\n    function setDelegate(address _delegate) public requiresAuth {\n        endpoint.setDelegate(_delegate);\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n    /**\n     * @dev Handles the receipt of a single ERC-1155 token type. This function is\n     * called at the end of a `safeTransferFrom` after the balance has been updated.\n     *\n     * NOTE: To accept the transfer, this must return\n     * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n     * (i.e. 0xf23a6e61, or its own function selector).\n     *\n     * @param operator The address which initiated the transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param id The ID of the token being transferred\n     * @param value The amount of tokens being transferred\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n     */\n    function onERC1155Received(\n        address operator,\n        address from,\n        uint256 id,\n        uint256 value,\n        bytes calldata data\n    ) external returns (bytes4);\n\n    /**\n     * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n     * is called at the end of a `safeBatchTransferFrom` after the balances have\n     * been updated.\n     *\n     * NOTE: To accept the transfer(s), this must return\n     * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n     * (i.e. 0xbc197c81, or its own function selector).\n     *\n     * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param ids An array containing ids of each token being transferred (order and length must match values array)\n     * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n     */\n    function onERC1155BatchReceived(\n        address operator,\n        address from,\n        uint256[] calldata ids,\n        uint256[] calldata values,\n        bytes calldata data\n    ) external returns (bytes4);\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_accountant","type":"address"},{"internalType":"address","name":"_endpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidDelegate","type":"error"},{"inputs":[],"name":"InvalidEndpointCall","type":"error"},{"inputs":[{"internalType":"uint16","name":"optionType","type":"uint16"}],"name":"InvalidOptionType","type":"error"},{"inputs":[],"name":"LzTokenUnavailable","type":"error"},{"inputs":[],"name":"MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidToken","type":"error"},{"inputs":[],"name":"MultiChainTellerBase_DestinationChainReceiverIsZeroAddress","type":"error"},{"inputs":[],"name":"MultiChainTellerBase_GasLimitExceeded","type":"error"},{"inputs":[],"name":"MultiChainTellerBase_GasTooLow","type":"error"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"}],"name":"MultiChainTellerBase_MessagesNotAllowedFrom","type":"error"},{"inputs":[{"internalType":"uint256","name":"chainSelector","type":"uint256"}],"name":"MultiChainTellerBase_MessagesNotAllowedTo","type":"error"},{"inputs":[],"name":"MultiChainTellerBase_TargetTellerIsZeroAddress","type":"error"},{"inputs":[],"name":"MultiChainTellerBase_ZeroMessageGasLimit","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":[{"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":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__AssetNotSupported","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__BadDepositHash","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__MinimumAssetsNotMet","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__MinimumMintNotMet","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__Paused","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__PermitFailedAndAllowanceTooLow","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__ShareLockPeriodTooLong","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__SharesAreLocked","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__SharesAreUnLocked","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__ZeroAssets","type":"error"},{"inputs":[],"name":"TellerWithMultiAssetSupport__ZeroShares","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"AssetAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"AssetRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"}],"name":"BulkDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"}],"name":"BulkWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainSelector","type":"uint256"},{"indexed":false,"internalType":"bool","name":"allowMessagesFrom","type":"bool"},{"indexed":false,"internalType":"bool","name":"allowMessagesTo","type":"bool"},{"indexed":false,"internalType":"address","name":"targetTeller","type":"address"},{"indexed":false,"internalType":"uint64","name":"messageGasLimit","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"messageGasMin","type":"uint64"}],"name":"ChainAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainSelector","type":"uint256"},{"indexed":false,"internalType":"address","name":"targetTeller","type":"address"}],"name":"ChainAllowMessagesFrom","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainSelector","type":"uint256"},{"indexed":false,"internalType":"address","name":"targetTeller","type":"address"}],"name":"ChainAllowMessagesTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainSelector","type":"uint256"}],"name":"ChainRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainSelector","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"messageGasLimit","type":"uint64"}],"name":"ChainSetGasLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainSelector","type":"uint256"}],"name":"ChainStopMessagesFrom","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainSelector","type":"uint256"}],"name":"ChainStopMessagesTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"depositAsset","type":"address"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shareLockPeriodAtTimeOfDeposit","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"depositHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DepositRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"messageId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"MessageReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"messageId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"MessageSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"Paused","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":[],"name":"Unpaused","type":"event"},{"inputs":[],"name":"accountant","outputs":[{"internalType":"contract AccountantWithRateProviders","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"}],"name":"addAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"},{"internalType":"bool","name":"allowMessagesFrom","type":"bool"},{"internalType":"bool","name":"allowMessagesTo","type":"bool"},{"internalType":"address","name":"targetTeller","type":"address"},{"internalType":"uint64","name":"messageGasLimit","type":"uint64"},{"internalType":"uint64","name":"messageGasMin","type":"uint64"}],"name":"addChain","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":"origin","type":"tuple"}],"name":"allowInitializePath","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"},{"internalType":"address","name":"targetTeller","type":"address"}],"name":"allowMessagesFromChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"},{"internalType":"address","name":"targetTeller","type":"address"},{"internalType":"uint64","name":"messageGasLimit","type":"uint64"}],"name":"allowMessagesToChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"authority","outputs":[{"internalType":"contract Authority","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"}],"name":"beforeTransfer","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shareAmount","type":"uint256"},{"components":[{"internalType":"uint32","name":"chainSelector","type":"uint32"},{"internalType":"address","name":"destinationChainReceiver","type":"address"},{"internalType":"contract ERC20","name":"bridgeFeeToken","type":"address"},{"internalType":"uint64","name":"messageGas","type":"uint64"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BridgeData","name":"data","type":"tuple"}],"name":"bridge","outputs":[{"internalType":"bytes32","name":"messageId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"depositAsset","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"minimumMint","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"bulkDeposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"withdrawAsset","type":"address"},{"internalType":"uint256","name":"shareAmount","type":"uint256"},{"internalType":"uint256","name":"minimumAssets","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"bulkWithdraw","outputs":[{"internalType":"uint256","name":"assetsOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"depositAsset","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"minimumMint","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"depositAsset","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"minimumMint","type":"uint256"},{"components":[{"internalType":"uint32","name":"chainSelector","type":"uint32"},{"internalType":"address","name":"destinationChainReceiver","type":"address"},{"internalType":"contract ERC20","name":"bridgeFeeToken","type":"address"},{"internalType":"uint64","name":"messageGas","type":"uint64"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BridgeData","name":"data","type":"tuple"}],"name":"depositAndBridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"depositNonce","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"depositAsset","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"minimumMint","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":"depositWithPermit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpointV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"","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":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"name":"isSupported","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":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nextNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"peers","outputs":[{"internalType":"bytes32","name":"peer","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shareAmount","type":"uint256"},{"components":[{"internalType":"uint32","name":"chainSelector","type":"uint32"},{"internalType":"address","name":"destinationChainReceiver","type":"address"},{"internalType":"contract ERC20","name":"bridgeFeeToken","type":"address"},{"internalType":"uint64","name":"messageGas","type":"uint64"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BridgeData","name":"data","type":"tuple"}],"name":"previewFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"publicDepositHistory","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"depositAsset","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"shareAmount","type":"uint256"},{"internalType":"uint256","name":"depositTimestamp","type":"uint256"},{"internalType":"uint256","name":"shareLockUpPeriodAtTimeOfDeposit","type":"uint256"}],"name":"refundDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"}],"name":"removeAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"}],"name":"removeChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"selectorToChains","outputs":[{"internalType":"bool","name":"allowMessagesFrom","type":"bool"},{"internalType":"bool","name":"allowMessagesTo","type":"bool"},{"internalType":"address","name":"targetTeller","type":"address"},{"internalType":"uint64","name":"messageGasLimit","type":"uint64"},{"internalType":"uint64","name":"minimumMessageGas","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"},{"internalType":"uint64","name":"messageGasLimit","type":"uint64"}],"name":"setChainGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","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":"uint64","name":"_shareLockPeriod","type":"uint64"}],"name":"setShareLockPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shareLockPeriod","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"shareUnlockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"}],"name":"stopMessagesFromChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"chainSelector","type":"uint32"}],"name":"stopMessagesToChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract BoringVault","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"package_name":null,"constructor_args":"00000000000000000000000004354e44ed31022716e77ec6320c04eda153010c000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f000000000000000000000000bb2faa1e1d6183ee3c4177476ce0d70cbd55a388000000000000000000000000c1b15d3b262beec0e3565c11c9e0f6134bdacb36"}