{"file_path":"contracts/StableCoinAdapter.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: LZBL-1.2\npragma solidity ^0.8.22;\n\nimport { MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable } from \"./oft-evm-upgradeable-with-fee/MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable.sol\";\n\ncontract StableCoinAdapter is MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable {\n    constructor(address _token, address _lzEndpoint) MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable(_token, _lzEndpoint) {\n        _disableInitializers();\n    }\n\n    function initialize(address _delegate) public initializer {\n        __MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable_init(_delegate);\n        __Ownable_init(_delegate);\n    }\n}","deployed_bytecode":"0x6080604052600436106102725760003560e01c80637d25a05e1161014f578063bcae25a4116100c1578063d045a0dc1161007a578063d045a0dc146108e6578063d4243885146108f9578063e1a4521814610919578063f2fde38b1461092f578063fc0c546a1461094f578063ff7bd03d1461098257600080fd5b8063bcae25a414610817578063bd815db01461083d578063c272198d14610850578063c4d66de814610885578063c7c7f5b3146108a5578063ca5eb5e1146108c657600080fd5b80639f68b964116101135780639f68b9641461071b578063ab99095d1461072f578063b731ea0a14610782578063b98bd07014610797578063bb0b6a53146107b7578063bc70b354146107f757600080fd5b80637d25a05e1461064c57806382413eac14610687578063857749b0146106b65780638da5cb5b146106d2578063963efcaa146106e757600080fd5b80634488b652116101e85780635bf9c226116101ac5780635bf9c226146105615780635e280f111461058f57806360b71d4e146105c35780636db7bcdb146105f75780636fc1b31e14610617578063715018a61461063757600080fd5b80634488b6521461048d57806346f943e9146104ad57806352ae2879146104cd5780635535d461146104e05780635a0dfe4d1461050d57600080fd5b8063164e68de1161023a578063164e68de1461034057806317442b70146103605780631f5e1334146103825780633194c180146103975780633400288b146104405780633b6f743b1461046057600080fd5b80630d35b41514610277578063111ecdad146102af57806313137d65146102dc578063134d4f25146102f1578063156a0d0f14610319575b600080fd5b34801561028357600080fd5b50610297610292366004612988565b6109a2565b6040516102a693929190612a0c565b60405180910390f35b3480156102bb57600080fd5b506102c4610a73565b6040516001600160a01b0390911681526020016102a6565b6102ef6102ea366004612b14565b610aa8565b005b3480156102fd57600080fd5b50610306600281565b60405161ffff90911681526020016102a6565b34801561032557600080fd5b506040805162b9270b60e21b815260016020820152016102a6565b34801561034c57600080fd5b506102ef61035b366004612bb3565b610b68565b34801561036c57600080fd5b50604080516001815260026020820152016102a6565b34801561038e57600080fd5b50610306600181565b3480156103a357600080fd5b5061041f6103b2366004612be9565b6040805180820182526000808252602091820181905263ffffffff9390931683527f0cb173d183337e25fab6cb85705c15aad6a58cb1d552ed71b9bc628c8a3de80181529181902081518083019092525461ffff8116825262010000900460ff1615159181019190915290565b60408051825161ffff168152602092830151151592810192909252016102a6565b34801561044c57600080fd5b506102ef61045b366004612c04565b610c35565b34801561046c57600080fd5b5061048061047b366004612c3c565b610ca2565b6040516102a69190612c8d565b34801561049957600080fd5b506102ef6104a8366004612cb6565b610d0b565b3480156104b957600080fd5b506102ef6104c8366004612d61565b610d92565b3480156104d957600080fd5b50306102c4565b3480156104ec57600080fd5b506105006104fb366004612e3b565b610da6565b6040516102a69190612e6e565b34801561051957600080fd5b50610551610528366004612c04565b63ffffffff91909116600090815260008051602061394d83398151915260205260409020541490565b60405190151581526020016102a6565b34801561056d57600080fd5b5061058161057c366004612c04565b610e81565b6040519081526020016102a6565b34801561059b57600080fd5b506102c47f0000000000000000000000001a44076050125825900e736c501f859c50fe728c81565b3480156105cf57600080fd5b507f4abebe5a7833807a903fad38d08b3addaf1d18bf2da978cb4ed490908875da0054610581565b34801561060357600080fd5b506102ef610612366004612e81565b610ec4565b34801561062357600080fd5b506102ef610632366004612bb3565b610f98565b34801561064357600080fd5b506102ef61100c565b34801561065857600080fd5b5061066f610667366004612c04565b600092915050565b6040516001600160401b0390911681526020016102a6565b34801561069357600080fd5b506105516106a2366004612ec8565b6001600160a01b0381163014949350505050565b3480156106c257600080fd5b50604051600681526020016102a6565b3480156106de57600080fd5b506102c4611020565b3480156106f357600080fd5b506105817f000000000000000000000000000000000000000000000000000000e8d4a5100081565b34801561072757600080fd5b506001610551565b34801561073b57600080fd5b5061074f61074a366004612be9565b611049565b6040516102a691908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561078e57600080fd5b506102c46110cc565b3480156107a357600080fd5b506102ef6107b2366004612f72565b6110f5565b3480156107c357600080fd5b506105816107d2366004612be9565b63ffffffff16600090815260008051602061394d833981519152602052604090205490565b34801561080357600080fd5b50610500610812366004612fb3565b611276565b34801561082357600080fd5b5060008051602061392d8339815191525461ffff16610306565b6102ef61084b366004612f72565b61140c565b34801561085c57600080fd5b5061087061086b366004612be9565b6115a3565b604080519283526020830191909152016102a6565b34801561089157600080fd5b506102ef6108a0366004612bb3565b611613565b6108b86108b3366004613013565b61172a565b6040516102a6929190613075565b3480156108d257600080fd5b506102ef6108e1366004612bb3565b611825565b6102ef6108f4366004612b14565b6118ab565b34801561090557600080fd5b506102ef610914366004612bb3565b6118da565b34801561092557600080fd5b5061030661271081565b34801561093b57600080fd5b506102ef61094a366004612bb3565b61194e565b34801561095b57600080fd5b507f000000000000000000000000f9fb20b8e097904f0ab7d12e9dbee88f2dcd0f166102c4565b34801561098e57600080fd5b5061055161099d3660046130c7565b611989565b604080518082019091526000808252602082015260606109d5604051806040016040528060008152602001600081525090565b60408051808201825260008082526001600160401b03602080840182905284518381529081019094529195509182610a30565b604080518082019091526000815260606020820152815260200190600190039081610a085790505b509350600080610a55604089013560608a0135610a5060208c018c612be9565b6119a7565b60408051808201909152918252602082015296989597505050505050565b6000807f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c005b546001600160a01b031692915050565b7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b03163314610af8576040516391ac5e4f60e01b81523360048201526024015b60405180910390fd5b60208701803590610b1290610b0d908a612be9565b6119f8565b14610b5057610b246020880188612be9565b60405163309afaf360e21b815263ffffffff909116600482015260208801356024820152604401610aef565b610b5f87878787878787611a4a565b50505050505050565b610b70611bb1565b7f4abebe5a7833807a903fad38d08b3addaf1d18bf2da978cb4ed490908875da0080546000819003610bb557604051630d00db4d60e31b815260040160405180910390fd5b60008255610bed6001600160a01b037f000000000000000000000000f9fb20b8e097904f0ab7d12e9dbee88f2dcd0f16168483611be3565b826001600160a01b03167f78473f3f373f7673597f4f0fa5873cb4d375fea6d4339ad6b56dbd411513cb3f82604051610c2891815260200190565b60405180910390a2505050565b610c3d611bb1565b63ffffffff8216600081815260008051602061394d833981519152602081815260409283902085905582519384528301849052917f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91015b60405180910390a1505050565b60408051808201909152600080825260208201526000610cd260408501356060860135610a506020880188612be9565b915050600080610ce28684611c47565b9092509050610cff610cf76020880188612be9565b838388611d8c565b93505050505b92915050565b610d13611bb1565b61271061ffff82161115610d3a5760405163c6cc5d7f60e01b815260040160405180910390fd5b60008051602061392d833981519152805461ffff191661ffff831690811782556040519081527f9283ddc0c2b59320e00b0ae4a992b110df098c38e3b6ea1d92fe7a6d3504be9b906020015b60405180910390a15050565b610d9a611bb1565b610da381611e6d565b50565b63ffffffff821660009081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff8616855290915290912080546060929190610dfa906130e3565b80601f0160208091040260200160405190810160405280929190818152602001828054610e26906130e3565b8015610e735780601f10610e4857610100808354040283529160200191610e73565b820191906000526020600020905b815481529060010190602001808311610e5657829003601f168201915b505050505091505092915050565b600080610e8d84611f77565b905061ffff811615610eb957612710610eaa61ffff83168561312d565b610eb49190613144565b610ebc565b60005b949350505050565b610ecc611bb1565b61271061ffff83161115610ef35760405163c6cc5d7f60e01b815260040160405180910390fd5b600060008051602061392d83398151915260408051808201825261ffff868116808352861515602080850182815263ffffffff8c16600081815260018a0184528890209651875492511515620100000262ffffff1990931696169590951717909455845192835292820152918201529091507f56f0bca120766dba5aeeb89a1cf629c3495dc497c82f426d4e4d58c54b72764c9060600160405180910390a150505050565b610fa0611bb1565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c0080546001600160a01b0319166001600160a01b03831690811782556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d441419790602001610d86565b611014611bb1565b61101e6000611ff6565b565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300610a98565b6110746040518060800160405280600081526020016000815260200160008152602001600081525090565b5063ffffffff16600090815260008051602061396d8339815191526020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b6000807fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b600610a98565b6110fd611bb1565b7f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea000060005b828110156112445761116384848381811061113e5761113e613166565b9050602002810190611150919061317c565b61115e90604081019061319c565b612067565b83838281811061117557611175613166565b9050602002810190611187919061317c565b61119590604081019061319c565b8360008787868181106111aa576111aa613166565b90506020028101906111bc919061317c565b6111ca906020810190612be9565b63ffffffff1663ffffffff16815260200190815260200160002060008787868181106111f8576111f8613166565b905060200281019061120a919061317c565b61121b906040810190602001612cb6565b61ffff16815260208101919091526040016000209161123b91908361322a565b50600101611121565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b6748383604051610c95929190613312565b63ffffffff841660009081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff881685529091528220805460609391906112c9906130e3565b80601f01602080910402602001604051908101604052809291908181526020018280546112f5906130e3565b80156113425780601f1061131757610100808354040283529160200191611342565b820191906000526020600020905b81548152906001019060200180831161132557829003601f168201915b5050505050905080516000036113935784848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ebc945050505050565b60008490036113a5579150610ebc9050565b600284106113ef576113b78585612067565b806113c585600281896133f6565b6040516020016113d793929190613420565b60405160208183030381529060405292505050610ebc565b8484604051639a6d49cd60e01b8152600401610aef929190613448565b60005b81811015611522573683838381811061142a5761142a613166565b905060200281019061143c919061345c565b905061147c61144e6020830183612be9565b602083013563ffffffff91909116600090815260008051602061394d83398151915260205260409020541490565b611486575061151a565b3063d045a0dc60c08301358360a08101356114a561010083018361319c565b6114b6610100890160e08a01612bb3565b6114c46101208a018a61319c565b6040518963ffffffff1660e01b81526004016114e69796959493929190613488565b6000604051808303818588803b1580156114ff57600080fd5b505af1158015611513573d6000803e3d6000fd5b5050505050505b60010161140f565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa158015611561573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611589919081019061350e565b604051638351eea760e01b8152600401610aef9190612e6e565b63ffffffff8116600090815260008051602061396d8339815191526020818152604080842081516080810183528154808252600183015494820185905260028301549382018490526003909201546060820181905286959491936116089392916120a9565b935093505050915091565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03166000811580156116585750825b90506000826001600160401b031660011480156116745750303b155b905081158015611682575080155b156116a05760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156116ca57845460ff60401b1916600160401b1785555b6116d386612124565b6116dc86612145565b831561172257845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b611732612929565b604080518082019091526000808252602082015260008061176933604089013560608a013561176460208c018c612be9565b612156565b9150915060008061177a8984611c47565b90925090506117a661178f60208b018b612be9565b83836117a0368d90038d018d6135a1565b8b61225d565b60408051808201909152858152602080820186905282519298509096503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a906117f4908d018d612be9565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b61182d611bb1565b60405163ca5eb5e160e01b81526001600160a01b0382811660048301527f0000000000000000000000001a44076050125825900e736c501f859c50fe728c169063ca5eb5e190602401600060405180830381600087803b15801561189057600080fd5b505af11580156118a4573d6000803e3d6000fd5b5050505050565b3330146118cb5760405163029a949d60e31b815260040160405180910390fd5b610b5f87878787878787610b50565b6118e2611bb1565b7fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b60080546001600160a01b0319166001600160a01b03831690811782556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001610d86565b611956611bb1565b6001600160a01b03811661198057604051631e4fbdf760e01b815260006004820152602401610aef565b610da381611ff6565b6000602082018035906119a0906107d29085612be9565b1492915050565b826000806119b58484610e81565b90506119c2818703612368565b9150848210156119ef576040516371c4efed60e01b81526004810183905260248101869052604401610aef565b50935093915050565b63ffffffff8116600090815260008051602061394d8339815191526020819052604082205480611a435760405163f6ff4fb760e01b815263ffffffff85166004820152602401610aef565b9392505050565b6000611a5c611a59878761239f565b90565b90506000611a8882611a76611a718a8a6123b7565b6123da565b611a8360208d018d612be9565b61240f565b90506028861115611b4f576000611ac5611aa860608c0160408d016135d3565b611ab560208d018d612be9565b84611ac08c8c6124b9565b612504565b604051633e5ac80960e11b81529091506001600160a01b037f0000000000000000000000001a44076050125825900e736c501f859c50fe728c1690637cb5901290611b1b9086908d9060009087906004016135f0565b600060405180830381600087803b158015611b3557600080fd5b505af1158015611b49573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c611b8860208d018d612be9565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b33611bba611020565b6001600160a01b03161461101e5760405163118cdaa760e01b8152336004820152602401610aef565b6040516001600160a01b03838116602483015260448201839052611c4291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612536565b505050565b6060806000611ca48560200135611c5d866125ad565b611c6a60a089018961319c565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506125d992505050565b9093509050600081611cb7576001611cba565b60025b9050611cda611ccc6020880188612be9565b8261081260808a018a61319c565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c008054919450906001600160a01b03168015611d815760405163043a78eb60e01b81526001600160a01b0382169063043a78eb90611d3e908990899060040161362b565b602060405180830381865afa158015611d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7f9190613650565b505b505050509250929050565b60408051808201909152600080825260208201527f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b031663ddc28c586040518060a001604052808863ffffffff168152602001611def896119f8565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401611e2492919061366d565b6040805180830381865afa158015611e40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e649190613716565b95945050505050565b60008051602061396d83398151915260005b8251811015611f47576000826000016000858481518110611ea257611ea2613166565b60200260200101516000015163ffffffff1663ffffffff1681526020019081526020016000209050611ef2848381518110611edf57611edf613166565b6020026020010151600001516000612653565b838281518110611f0457611f04613166565b6020026020010151602001518160020181905550838281518110611f2a57611f2a613166565b602090810291909101015160400151600390910155600101611e7f565b507fe888347665897e637801f36c5129f510657276178c89022bc5fa0246dbc19de182604051610d869190613732565b63ffffffff811660009081527f0cb173d183337e25fab6cb85705c15aad6a58cb1d552ed71b9bc628c8a3de8016020908152604080832081518083019092525461ffff8116825262010000900460ff16151591810182905260008051602061392d83398151915291611fee57815461ffff16610ebc565b519392505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b600061207660028284866133f6565b61207f91613791565b60f01c905060038114611c42578282604051639a6d49cd60e01b8152600401610aef929190613448565b600080806120b786426137c1565b905060008085116120c95760016120cb565b845b6120d5838861312d565b6120df9190613144565b9050808811156120f8576120f381896137c1565b6120fb565b60005b9350838611156121145761210f84876137c1565b612117565b60005b9250505094509492505050565b61212c6126db565b61213581612724565b61213d612735565b610da3612735565b61214d6126db565b610da38161273d565b6000806121648585856119a7565b90925090506121738382612653565b6121a86001600160a01b037f000000000000000000000000f9fb20b8e097904f0ab7d12e9dbee88f2dcd0f1616873085612745565b604051630852cd8d60e31b8152600481018290527f000000000000000000000000f9fb20b8e097904f0ab7d12e9dbee88f2dcd0f166001600160a01b0316906342966c6890602401600060405180830381600087803b15801561220a57600080fd5b505af115801561221e573d6000803e3d6000fd5b5050505080821115612254577f4abebe5a7833807a903fad38d08b3addaf1d18bf2da978cb4ed490908875da0080548284030190555b94509492505050565b612265612929565b6000612274846000015161277e565b60208501519091501561228e5761228e84602001516127a6565b7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b0316632637a450826040518060a001604052808b63ffffffff1681526020016122de8c6119f8565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b815260040161231a92919061366d565b60806040518083038185885af1158015612338573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061235d91906137d4565b979650505050505050565b60007f000000000000000000000000000000000000000000000000000000e8d4a510006123958184613144565b610d05919061312d565b60006123ae60208284866133f6565b611a439161381e565b60006123c76028602084866133f6565b6123d09161383c565b60c01c9392505050565b6000610d057f000000000000000000000000000000000000000000000000000000e8d4a510006001600160401b03841661312d565b60006001600160a01b0384166124255761dead93505b61242f828461288c565b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018590527f000000000000000000000000f9fb20b8e097904f0ab7d12e9dbee88f2dcd0f1616906340c10f1990604401600060405180830381600087803b15801561249957600080fd5b505af11580156124ad573d6000803e3d6000fd5b50949695505050505050565b60606124c882602881866133f6565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b60608484848460405160200161251d949392919061386a565b6040516020818303038152906040529050949350505050565b600080602060008451602086016000885af180612559576040513d6000823e3d81fd5b50506000513d9150811561257157806001141561257e565b6001600160a01b0384163b155b156125a757604051635274afe760e01b81526001600160a01b0385166004820152602401610aef565b50505050565b6000610d057f000000000000000000000000000000000000000000000000000000e8d4a5100083613144565b805160609015158061262257848460405160200161260e92919091825260c01b6001600160c01b031916602082015260280190565b604051602081830303815290604052612649565b8484338560405160200161263994939291906138b9565b6040516020818303038152906040525b9150935093915050565b600060008051602061396d83398151915263ffffffff8416600090815260208290526040812080546001820154600283015460038401549596509294849361269c9392916120a9565b91509150808511156126c15760405163a74c1c5f60e01b815260040160405180910390fd5b6126cb85836138fc565b8355505042600190910155505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661101e57604051631afcd79f60e31b815260040160405180910390fd5b61272c6126db565b610da3816128d6565b61101e6126db565b6119566126db565b6040516001600160a01b0384811660248301528381166044830152606482018390526125a79186918216906323b872dd90608401611c10565b60008134146127a2576040516304fb820960e51b8152346004820152602401610aef565b5090565b60007f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282a919061390f565b90506001600160a01b038116612853576040516329b99a9560e11b815260040160405180910390fd5b6128886001600160a01b038216337f0000000000000000000000001a44076050125825900e736c501f859c50fe728c85612745565b5050565b63ffffffff8216600090815260008051602061396d8339815191526020819052604090912080548310156128cc5780546128c79084906137c1565b6128cf565b60005b9055505050565b6128de6126db565b612135816128ea6126db565b612135816128f66126db565b610da3816129026126db565b6001600160a01b03811661182d57604051632d618d8160e21b815260040160405180910390fd5b60405180606001604052806000801916815260200160006001600160401b0316815260200161296b604051806040016040528060008152602001600081525090565b905290565b600060e0828403121561298257600080fd5b50919050565b60006020828403121561299a57600080fd5b81356001600160401b038111156129b057600080fd5b610ebc84828501612970565b60005b838110156129d75781810151838201526020016129bf565b50506000910152565b600081518084526129f88160208601602086016129bc565b601f01601f19169290920160200192915050565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b83811015612a875788870360bf19018552815180518852830151838801879052612a74878901826129e0565b9750509382019390820190600101612a48565b50508751606088015250505060208501516080850152509050610ebc565b60006060828403121561298257600080fd5b60008083601f840112612ac957600080fd5b5081356001600160401b03811115612ae057600080fd5b602083019150836020828501011115612af857600080fd5b9250929050565b6001600160a01b0381168114610da357600080fd5b600080600080600080600060e0888a031215612b2f57600080fd5b612b398989612aa5565b96506060880135955060808801356001600160401b0380821115612b5c57600080fd5b612b688b838c01612ab7565b909750955060a08a01359150612b7d82612aff565b90935060c08901359080821115612b9357600080fd5b50612ba08a828b01612ab7565b989b979a50959850939692959293505050565b600060208284031215612bc557600080fd5b8135611a4381612aff565b803563ffffffff81168114612be457600080fd5b919050565b600060208284031215612bfb57600080fd5b611a4382612bd0565b60008060408385031215612c1757600080fd5b612c2083612bd0565b946020939093013593505050565b8015158114610da357600080fd5b60008060408385031215612c4f57600080fd5b82356001600160401b03811115612c6557600080fd5b612c7185828601612970565b9250506020830135612c8281612c2e565b809150509250929050565b815181526020808301519082015260408101610d05565b803561ffff81168114612be457600080fd5b600060208284031215612cc857600080fd5b611a4382612ca4565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715612d0957612d09612cd1565b60405290565b604080519081016001600160401b0381118282101715612d0957612d09612cd1565b604051601f8201601f191681016001600160401b0381118282101715612d5957612d59612cd1565b604052919050565b60006020808385031215612d7457600080fd5b82356001600160401b0380821115612d8b57600080fd5b818501915085601f830112612d9f57600080fd5b813581811115612db157612db1612cd1565b612dbf848260051b01612d31565b81815284810192506060918202840185019188831115612dde57600080fd5b938501935b82851015612e2f5780858a031215612dfb5760008081fd5b612e03612ce7565b612e0c86612bd0565b815285870135878201526040808701359082015284529384019392850192612de3565b50979650505050505050565b60008060408385031215612e4e57600080fd5b612e5783612bd0565b9150612e6560208401612ca4565b90509250929050565b602081526000611a4360208301846129e0565b600080600060608486031215612e9657600080fd5b612e9f84612bd0565b9250612ead60208501612ca4565b91506040840135612ebd81612c2e565b809150509250925092565b60008060008060a08587031215612ede57600080fd5b612ee88686612aa5565b935060608501356001600160401b03811115612f0357600080fd5b612f0f87828801612ab7565b9094509250506080850135612f2381612aff565b939692955090935050565b60008083601f840112612f4057600080fd5b5081356001600160401b03811115612f5757600080fd5b6020830191508360208260051b8501011115612af857600080fd5b60008060208385031215612f8557600080fd5b82356001600160401b03811115612f9b57600080fd5b612fa785828601612f2e565b90969095509350505050565b60008060008060608587031215612fc957600080fd5b612fd285612bd0565b9350612fe060208601612ca4565b925060408501356001600160401b03811115612ffb57600080fd5b61300787828801612ab7565b95989497509550505050565b6000806000838503608081121561302957600080fd5b84356001600160401b0381111561303f57600080fd5b61304b87828801612970565b9450506040601f198201121561306057600080fd5b506020840191506060840135612ebd81612aff565b600060c082019050835182526001600160401b03602085015116602083015260408401516130b0604084018280518252602090810151910152565b5082516080830152602083015160a0830152611a43565b6000606082840312156130d957600080fd5b611a438383612aa5565b600181811c908216806130f757607f821691505b60208210810361298257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610d0557610d05613117565b60008261316157634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60008235605e1983360301811261319257600080fd5b9190910192915050565b6000808335601e198436030181126131b357600080fd5b8301803591506001600160401b038211156131cd57600080fd5b602001915036819003821315612af857600080fd5b601f821115611c42576000816000526020600020601f850160051c8101602086101561320b5750805b601f850160051c820191505b8181101561172257828155600101613217565b6001600160401b0383111561324157613241612cd1565b6132558361324f83546130e3565b836131e2565b6000601f84116001811461328957600085156132715750838201355b600019600387901b1c1916600186901b1783556118a4565b600083815260209020601f19861690835b828110156132ba578685013582556020948501946001909201910161329a565b50868210156132d75760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208082528181018390526000906040808401600586901b8501820187855b888110156133e857878303603f190184528135368b9003605e1901811261335757600080fd5b8a01606063ffffffff61336983612bd0565b16855261ffff61337a898401612ca4565b168886015286820135601e1983360301811261339557600080fd5b9091018781019190356001600160401b038111156133b257600080fd5b8036038313156133c157600080fd5b81888701526133d382870182856132e9565b96890196955050509186019150600101613331565b509098975050505050505050565b6000808585111561340657600080fd5b8386111561341357600080fd5b5050820193919092039150565b600084516134328184602089016129bc565b8201838582376000930192835250909392505050565b602081526000610ebc6020830184866132e9565b6000823561013e1983360301811261319257600080fd5b6001600160401b0381168114610da357600080fd5b63ffffffff61349689612bd0565b16815260208801356020820152600060408901356134b381613473565b6001600160401b03811660408401525087606083015260e060808301526134de60e0830187896132e9565b6001600160a01b03861660a084015282810360c08401526135008185876132e9565b9a9950505050505050505050565b60006020828403121561352057600080fd5b81516001600160401b038082111561353757600080fd5b818401915084601f83011261354b57600080fd5b81518181111561355d5761355d612cd1565b613570601f8201601f1916602001612d31565b915080825285602082850101111561358757600080fd5b6135988160208401602086016129bc565b50949350505050565b6000604082840312156135b357600080fd5b6135bb612d0f565b82358152602083013560208201528091505092915050565b6000602082840312156135e557600080fd5b8135611a4381613473565b60018060a01b038516815283602082015261ffff8316604082015260806060820152600061362160808301846129e0565b9695505050505050565b60408152600061363e60408301856129e0565b8281036020840152611e6481856129e0565b60006020828403121561366257600080fd5b8151611a4381612c2e565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a060808401526136a360e08401826129e0565b90506060850151603f198483030160a08501526136c082826129e0565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b6000604082840312156136f857600080fd5b613700612d0f565b9050815181526020820151602082015292915050565b60006040828403121561372857600080fd5b611a4383836136e6565b602080825282518282018190526000919060409081850190868401855b82811015613784578151805163ffffffff1685528681015187860152850151858501526060909301929085019060010161374f565b5091979650505050505050565b6001600160f01b031981358181169160028510156137b95780818660020360031b1b83161692505b505092915050565b81810381811115610d0557610d05613117565b6000608082840312156137e657600080fd5b6137ee612ce7565b82518152602083015161380081613473565b602082015261381284604085016136e6565b60408201529392505050565b80356020831015610d0557600019602084900360031b1b1692915050565b6001600160c01b031981358181169160088510156137b95760089490940360031b84901b1690921692915050565b6001600160401b0360c01b8560c01b16815263ffffffff60e01b8460e01b16600882015282600c820152600082516138a981602c8501602087016129bc565b91909101602c0195945050505050565b8481526001600160401b0360c01b8460c01b166020820152826028820152600082516138ec8160488501602087016129bc565b9190910160480195945050505050565b80820180821115610d0557610d05613117565b60006020828403121561392157600080fd5b8151611a4381612aff56fe0cb173d183337e25fab6cb85705c15aad6a58cb1d552ed71b9bc628c8a3de80072ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900fc4b3847e0649a09792d4c694ef28e20c43dde62a8b3de98eff85ccb4e1f3000a264697066735822122039b832561d2940e7138a1a2e044c4c45becb0f7b6916d5f3e411536bdfcb8aae64736f6c63430008160033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"optimizer":{"enabled":true,"runs":200},"outputSelection":{}},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0xf9FB20B8E097904f0aB7d12e9DbeE88f2dcd0F16",{"internalType":"address","name":"_token","type":"address"}],["0x1a44076050125825900e736c501f859c50fE728c",{"internalType":"address","name":"_lzEndpoint","type":"address"}]],"compiler_version":"v0.8.22+commit.4fc1097e","is_verified_via_verifier_alliance":false,"verified_at":"2025-03-28T14:04:45.615618Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60e06040523480156200001157600080fd5b5060405162003de138038062003de18339810160408190526200003491620001e3565b81818181816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000077573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009d91906200021b565b6001600160a01b03821660805281600660ff83161015620000d1576040516301e9714b60e41b815260040160405180910390fd5b620000de6006836200025d565b620000eb90600a6200037c565b60a0525050506001600160a01b031660c052506200010a905062000112565b50506200038d565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620001635760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620001c35780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b80516001600160a01b0381168114620001de57600080fd5b919050565b60008060408385031215620001f757600080fd5b6200020283620001c6565b91506200021260208401620001c6565b90509250929050565b6000602082840312156200022e57600080fd5b815160ff811681146200024057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111562000279576200027962000247565b92915050565b600181815b80851115620002c0578160001904821115620002a457620002a462000247565b80851615620002b257918102915b93841c939080029062000284565b509250929050565b600082620002d95750600162000279565b81620002e85750600062000279565b81600181146200030157600281146200030c576200032c565b600191505062000279565b60ff84111562000320576200032062000247565b50506001821b62000279565b5060208310610133831016604e8410600b841016171562000351575081810a62000279565b6200035d83836200027f565b806000190482111562000374576200037462000247565b029392505050565b60006200024060ff841683620002c8565b60805160a05160c0516139c26200041f6000396000818161095e01528181610bc601528181612180015281816121be01526124550152600081816106f90152818161236c015281816123e101526125b40152600081816105a101528181610aaa0152818161184c01528181611adf01528181611da201528181612290015281816127aa015261286301526139c26000f3fe6080604052600436106102725760003560e01c80637d25a05e1161014f578063bcae25a4116100c1578063d045a0dc1161007a578063d045a0dc146108e6578063d4243885146108f9578063e1a4521814610919578063f2fde38b1461092f578063fc0c546a1461094f578063ff7bd03d1461098257600080fd5b8063bcae25a414610817578063bd815db01461083d578063c272198d14610850578063c4d66de814610885578063c7c7f5b3146108a5578063ca5eb5e1146108c657600080fd5b80639f68b964116101135780639f68b9641461071b578063ab99095d1461072f578063b731ea0a14610782578063b98bd07014610797578063bb0b6a53146107b7578063bc70b354146107f757600080fd5b80637d25a05e1461064c57806382413eac14610687578063857749b0146106b65780638da5cb5b146106d2578063963efcaa146106e757600080fd5b80634488b652116101e85780635bf9c226116101ac5780635bf9c226146105615780635e280f111461058f57806360b71d4e146105c35780636db7bcdb146105f75780636fc1b31e14610617578063715018a61461063757600080fd5b80634488b6521461048d57806346f943e9146104ad57806352ae2879146104cd5780635535d461146104e05780635a0dfe4d1461050d57600080fd5b8063164e68de1161023a578063164e68de1461034057806317442b70146103605780631f5e1334146103825780633194c180146103975780633400288b146104405780633b6f743b1461046057600080fd5b80630d35b41514610277578063111ecdad146102af57806313137d65146102dc578063134d4f25146102f1578063156a0d0f14610319575b600080fd5b34801561028357600080fd5b50610297610292366004612988565b6109a2565b6040516102a693929190612a0c565b60405180910390f35b3480156102bb57600080fd5b506102c4610a73565b6040516001600160a01b0390911681526020016102a6565b6102ef6102ea366004612b14565b610aa8565b005b3480156102fd57600080fd5b50610306600281565b60405161ffff90911681526020016102a6565b34801561032557600080fd5b506040805162b9270b60e21b815260016020820152016102a6565b34801561034c57600080fd5b506102ef61035b366004612bb3565b610b68565b34801561036c57600080fd5b50604080516001815260026020820152016102a6565b34801561038e57600080fd5b50610306600181565b3480156103a357600080fd5b5061041f6103b2366004612be9565b6040805180820182526000808252602091820181905263ffffffff9390931683527f0cb173d183337e25fab6cb85705c15aad6a58cb1d552ed71b9bc628c8a3de80181529181902081518083019092525461ffff8116825262010000900460ff1615159181019190915290565b60408051825161ffff168152602092830151151592810192909252016102a6565b34801561044c57600080fd5b506102ef61045b366004612c04565b610c35565b34801561046c57600080fd5b5061048061047b366004612c3c565b610ca2565b6040516102a69190612c8d565b34801561049957600080fd5b506102ef6104a8366004612cb6565b610d0b565b3480156104b957600080fd5b506102ef6104c8366004612d61565b610d92565b3480156104d957600080fd5b50306102c4565b3480156104ec57600080fd5b506105006104fb366004612e3b565b610da6565b6040516102a69190612e6e565b34801561051957600080fd5b50610551610528366004612c04565b63ffffffff91909116600090815260008051602061394d83398151915260205260409020541490565b60405190151581526020016102a6565b34801561056d57600080fd5b5061058161057c366004612c04565b610e81565b6040519081526020016102a6565b34801561059b57600080fd5b506102c47f000000000000000000000000000000000000000000000000000000000000000081565b3480156105cf57600080fd5b507f4abebe5a7833807a903fad38d08b3addaf1d18bf2da978cb4ed490908875da0054610581565b34801561060357600080fd5b506102ef610612366004612e81565b610ec4565b34801561062357600080fd5b506102ef610632366004612bb3565b610f98565b34801561064357600080fd5b506102ef61100c565b34801561065857600080fd5b5061066f610667366004612c04565b600092915050565b6040516001600160401b0390911681526020016102a6565b34801561069357600080fd5b506105516106a2366004612ec8565b6001600160a01b0381163014949350505050565b3480156106c257600080fd5b50604051600681526020016102a6565b3480156106de57600080fd5b506102c4611020565b3480156106f357600080fd5b506105817f000000000000000000000000000000000000000000000000000000000000000081565b34801561072757600080fd5b506001610551565b34801561073b57600080fd5b5061074f61074a366004612be9565b611049565b6040516102a691908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561078e57600080fd5b506102c46110cc565b3480156107a357600080fd5b506102ef6107b2366004612f72565b6110f5565b3480156107c357600080fd5b506105816107d2366004612be9565b63ffffffff16600090815260008051602061394d833981519152602052604090205490565b34801561080357600080fd5b50610500610812366004612fb3565b611276565b34801561082357600080fd5b5060008051602061392d8339815191525461ffff16610306565b6102ef61084b366004612f72565b61140c565b34801561085c57600080fd5b5061087061086b366004612be9565b6115a3565b604080519283526020830191909152016102a6565b34801561089157600080fd5b506102ef6108a0366004612bb3565b611613565b6108b86108b3366004613013565b61172a565b6040516102a6929190613075565b3480156108d257600080fd5b506102ef6108e1366004612bb3565b611825565b6102ef6108f4366004612b14565b6118ab565b34801561090557600080fd5b506102ef610914366004612bb3565b6118da565b34801561092557600080fd5b5061030661271081565b34801561093b57600080fd5b506102ef61094a366004612bb3565b61194e565b34801561095b57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102c4565b34801561098e57600080fd5b5061055161099d3660046130c7565b611989565b604080518082019091526000808252602082015260606109d5604051806040016040528060008152602001600081525090565b60408051808201825260008082526001600160401b03602080840182905284518381529081019094529195509182610a30565b604080518082019091526000815260606020820152815260200190600190039081610a085790505b509350600080610a55604089013560608a0135610a5060208c018c612be9565b6119a7565b60408051808201909152918252602082015296989597505050505050565b6000807f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c005b546001600160a01b031692915050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610af8576040516391ac5e4f60e01b81523360048201526024015b60405180910390fd5b60208701803590610b1290610b0d908a612be9565b6119f8565b14610b5057610b246020880188612be9565b60405163309afaf360e21b815263ffffffff909116600482015260208801356024820152604401610aef565b610b5f87878787878787611a4a565b50505050505050565b610b70611bb1565b7f4abebe5a7833807a903fad38d08b3addaf1d18bf2da978cb4ed490908875da0080546000819003610bb557604051630d00db4d60e31b815260040160405180910390fd5b60008255610bed6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168483611be3565b826001600160a01b03167f78473f3f373f7673597f4f0fa5873cb4d375fea6d4339ad6b56dbd411513cb3f82604051610c2891815260200190565b60405180910390a2505050565b610c3d611bb1565b63ffffffff8216600081815260008051602061394d833981519152602081815260409283902085905582519384528301849052917f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91015b60405180910390a1505050565b60408051808201909152600080825260208201526000610cd260408501356060860135610a506020880188612be9565b915050600080610ce28684611c47565b9092509050610cff610cf76020880188612be9565b838388611d8c565b93505050505b92915050565b610d13611bb1565b61271061ffff82161115610d3a5760405163c6cc5d7f60e01b815260040160405180910390fd5b60008051602061392d833981519152805461ffff191661ffff831690811782556040519081527f9283ddc0c2b59320e00b0ae4a992b110df098c38e3b6ea1d92fe7a6d3504be9b906020015b60405180910390a15050565b610d9a611bb1565b610da381611e6d565b50565b63ffffffff821660009081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff8616855290915290912080546060929190610dfa906130e3565b80601f0160208091040260200160405190810160405280929190818152602001828054610e26906130e3565b8015610e735780601f10610e4857610100808354040283529160200191610e73565b820191906000526020600020905b815481529060010190602001808311610e5657829003601f168201915b505050505091505092915050565b600080610e8d84611f77565b905061ffff811615610eb957612710610eaa61ffff83168561312d565b610eb49190613144565b610ebc565b60005b949350505050565b610ecc611bb1565b61271061ffff83161115610ef35760405163c6cc5d7f60e01b815260040160405180910390fd5b600060008051602061392d83398151915260408051808201825261ffff868116808352861515602080850182815263ffffffff8c16600081815260018a0184528890209651875492511515620100000262ffffff1990931696169590951717909455845192835292820152918201529091507f56f0bca120766dba5aeeb89a1cf629c3495dc497c82f426d4e4d58c54b72764c9060600160405180910390a150505050565b610fa0611bb1565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c0080546001600160a01b0319166001600160a01b03831690811782556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d441419790602001610d86565b611014611bb1565b61101e6000611ff6565b565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300610a98565b6110746040518060800160405280600081526020016000815260200160008152602001600081525090565b5063ffffffff16600090815260008051602061396d8339815191526020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b6000807fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b600610a98565b6110fd611bb1565b7f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea000060005b828110156112445761116384848381811061113e5761113e613166565b9050602002810190611150919061317c565b61115e90604081019061319c565b612067565b83838281811061117557611175613166565b9050602002810190611187919061317c565b61119590604081019061319c565b8360008787868181106111aa576111aa613166565b90506020028101906111bc919061317c565b6111ca906020810190612be9565b63ffffffff1663ffffffff16815260200190815260200160002060008787868181106111f8576111f8613166565b905060200281019061120a919061317c565b61121b906040810190602001612cb6565b61ffff16815260208101919091526040016000209161123b91908361322a565b50600101611121565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b6748383604051610c95929190613312565b63ffffffff841660009081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff881685529091528220805460609391906112c9906130e3565b80601f01602080910402602001604051908101604052809291908181526020018280546112f5906130e3565b80156113425780601f1061131757610100808354040283529160200191611342565b820191906000526020600020905b81548152906001019060200180831161132557829003601f168201915b5050505050905080516000036113935784848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ebc945050505050565b60008490036113a5579150610ebc9050565b600284106113ef576113b78585612067565b806113c585600281896133f6565b6040516020016113d793929190613420565b60405160208183030381529060405292505050610ebc565b8484604051639a6d49cd60e01b8152600401610aef929190613448565b60005b81811015611522573683838381811061142a5761142a613166565b905060200281019061143c919061345c565b905061147c61144e6020830183612be9565b602083013563ffffffff91909116600090815260008051602061394d83398151915260205260409020541490565b611486575061151a565b3063d045a0dc60c08301358360a08101356114a561010083018361319c565b6114b6610100890160e08a01612bb3565b6114c46101208a018a61319c565b6040518963ffffffff1660e01b81526004016114e69796959493929190613488565b6000604051808303818588803b1580156114ff57600080fd5b505af1158015611513573d6000803e3d6000fd5b5050505050505b60010161140f565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa158015611561573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611589919081019061350e565b604051638351eea760e01b8152600401610aef9190612e6e565b63ffffffff8116600090815260008051602061396d8339815191526020818152604080842081516080810183528154808252600183015494820185905260028301549382018490526003909201546060820181905286959491936116089392916120a9565b935093505050915091565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03166000811580156116585750825b90506000826001600160401b031660011480156116745750303b155b905081158015611682575080155b156116a05760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156116ca57845460ff60401b1916600160401b1785555b6116d386612124565b6116dc86612145565b831561172257845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b611732612929565b604080518082019091526000808252602082015260008061176933604089013560608a013561176460208c018c612be9565b612156565b9150915060008061177a8984611c47565b90925090506117a661178f60208b018b612be9565b83836117a0368d90038d018d6135a1565b8b61225d565b60408051808201909152858152602080820186905282519298509096503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a906117f4908d018d612be9565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b61182d611bb1565b60405163ca5eb5e160e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e190602401600060405180830381600087803b15801561189057600080fd5b505af11580156118a4573d6000803e3d6000fd5b5050505050565b3330146118cb5760405163029a949d60e31b815260040160405180910390fd5b610b5f87878787878787610b50565b6118e2611bb1565b7fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b60080546001600160a01b0319166001600160a01b03831690811782556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001610d86565b611956611bb1565b6001600160a01b03811661198057604051631e4fbdf760e01b815260006004820152602401610aef565b610da381611ff6565b6000602082018035906119a0906107d29085612be9565b1492915050565b826000806119b58484610e81565b90506119c2818703612368565b9150848210156119ef576040516371c4efed60e01b81526004810183905260248101869052604401610aef565b50935093915050565b63ffffffff8116600090815260008051602061394d8339815191526020819052604082205480611a435760405163f6ff4fb760e01b815263ffffffff85166004820152602401610aef565b9392505050565b6000611a5c611a59878761239f565b90565b90506000611a8882611a76611a718a8a6123b7565b6123da565b611a8360208d018d612be9565b61240f565b90506028861115611b4f576000611ac5611aa860608c0160408d016135d3565b611ab560208d018d612be9565b84611ac08c8c6124b9565b612504565b604051633e5ac80960e11b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb5901290611b1b9086908d9060009087906004016135f0565b600060405180830381600087803b158015611b3557600080fd5b505af1158015611b49573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c611b8860208d018d612be9565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b33611bba611020565b6001600160a01b03161461101e5760405163118cdaa760e01b8152336004820152602401610aef565b6040516001600160a01b03838116602483015260448201839052611c4291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612536565b505050565b6060806000611ca48560200135611c5d866125ad565b611c6a60a089018961319c565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506125d992505050565b9093509050600081611cb7576001611cba565b60025b9050611cda611ccc6020880188612be9565b8261081260808a018a61319c565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c008054919450906001600160a01b03168015611d815760405163043a78eb60e01b81526001600160a01b0382169063043a78eb90611d3e908990899060040161362b565b602060405180830381865afa158015611d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7f9190613650565b505b505050509250929050565b60408051808201909152600080825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff168152602001611def896119f8565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401611e2492919061366d565b6040805180830381865afa158015611e40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e649190613716565b95945050505050565b60008051602061396d83398151915260005b8251811015611f47576000826000016000858481518110611ea257611ea2613166565b60200260200101516000015163ffffffff1663ffffffff1681526020019081526020016000209050611ef2848381518110611edf57611edf613166565b6020026020010151600001516000612653565b838281518110611f0457611f04613166565b6020026020010151602001518160020181905550838281518110611f2a57611f2a613166565b602090810291909101015160400151600390910155600101611e7f565b507fe888347665897e637801f36c5129f510657276178c89022bc5fa0246dbc19de182604051610d869190613732565b63ffffffff811660009081527f0cb173d183337e25fab6cb85705c15aad6a58cb1d552ed71b9bc628c8a3de8016020908152604080832081518083019092525461ffff8116825262010000900460ff16151591810182905260008051602061392d83398151915291611fee57815461ffff16610ebc565b519392505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b600061207660028284866133f6565b61207f91613791565b60f01c905060038114611c42578282604051639a6d49cd60e01b8152600401610aef929190613448565b600080806120b786426137c1565b905060008085116120c95760016120cb565b845b6120d5838861312d565b6120df9190613144565b9050808811156120f8576120f381896137c1565b6120fb565b60005b9350838611156121145761210f84876137c1565b612117565b60005b9250505094509492505050565b61212c6126db565b61213581612724565b61213d612735565b610da3612735565b61214d6126db565b610da38161273d565b6000806121648585856119a7565b90925090506121738382612653565b6121a86001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016873085612745565b604051630852cd8d60e31b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c6890602401600060405180830381600087803b15801561220a57600080fd5b505af115801561221e573d6000803e3d6000fd5b5050505080821115612254577f4abebe5a7833807a903fad38d08b3addaf1d18bf2da978cb4ed490908875da0080548284030190555b94509492505050565b612265612929565b6000612274846000015161277e565b60208501519091501561228e5761228e84602001516127a6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff1681526020016122de8c6119f8565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b815260040161231a92919061366d565b60806040518083038185885af1158015612338573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061235d91906137d4565b979650505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006123958184613144565b610d05919061312d565b60006123ae60208284866133f6565b611a439161381e565b60006123c76028602084866133f6565b6123d09161383c565b60c01c9392505050565b6000610d057f00000000000000000000000000000000000000000000000000000000000000006001600160401b03841661312d565b60006001600160a01b0384166124255761dead93505b61242f828461288c565b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018590527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561249957600080fd5b505af11580156124ad573d6000803e3d6000fd5b50949695505050505050565b60606124c882602881866133f6565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b60608484848460405160200161251d949392919061386a565b6040516020818303038152906040529050949350505050565b600080602060008451602086016000885af180612559576040513d6000823e3d81fd5b50506000513d9150811561257157806001141561257e565b6001600160a01b0384163b155b156125a757604051635274afe760e01b81526001600160a01b0385166004820152602401610aef565b50505050565b6000610d057f000000000000000000000000000000000000000000000000000000000000000083613144565b805160609015158061262257848460405160200161260e92919091825260c01b6001600160c01b031916602082015260280190565b604051602081830303815290604052612649565b8484338560405160200161263994939291906138b9565b6040516020818303038152906040525b9150935093915050565b600060008051602061396d83398151915263ffffffff8416600090815260208290526040812080546001820154600283015460038401549596509294849361269c9392916120a9565b91509150808511156126c15760405163a74c1c5f60e01b815260040160405180910390fd5b6126cb85836138fc565b8355505042600190910155505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661101e57604051631afcd79f60e31b815260040160405180910390fd5b61272c6126db565b610da3816128d6565b61101e6126db565b6119566126db565b6040516001600160a01b0384811660248301528381166044830152606482018390526125a79186918216906323b872dd90608401611c10565b60008134146127a2576040516304fb820960e51b8152346004820152602401610aef565b5090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282a919061390f565b90506001600160a01b038116612853576040516329b99a9560e11b815260040160405180910390fd5b6128886001600160a01b038216337f000000000000000000000000000000000000000000000000000000000000000085612745565b5050565b63ffffffff8216600090815260008051602061396d8339815191526020819052604090912080548310156128cc5780546128c79084906137c1565b6128cf565b60005b9055505050565b6128de6126db565b612135816128ea6126db565b612135816128f66126db565b610da3816129026126db565b6001600160a01b03811661182d57604051632d618d8160e21b815260040160405180910390fd5b60405180606001604052806000801916815260200160006001600160401b0316815260200161296b604051806040016040528060008152602001600081525090565b905290565b600060e0828403121561298257600080fd5b50919050565b60006020828403121561299a57600080fd5b81356001600160401b038111156129b057600080fd5b610ebc84828501612970565b60005b838110156129d75781810151838201526020016129bf565b50506000910152565b600081518084526129f88160208601602086016129bc565b601f01601f19169290920160200192915050565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b83811015612a875788870360bf19018552815180518852830151838801879052612a74878901826129e0565b9750509382019390820190600101612a48565b50508751606088015250505060208501516080850152509050610ebc565b60006060828403121561298257600080fd5b60008083601f840112612ac957600080fd5b5081356001600160401b03811115612ae057600080fd5b602083019150836020828501011115612af857600080fd5b9250929050565b6001600160a01b0381168114610da357600080fd5b600080600080600080600060e0888a031215612b2f57600080fd5b612b398989612aa5565b96506060880135955060808801356001600160401b0380821115612b5c57600080fd5b612b688b838c01612ab7565b909750955060a08a01359150612b7d82612aff565b90935060c08901359080821115612b9357600080fd5b50612ba08a828b01612ab7565b989b979a50959850939692959293505050565b600060208284031215612bc557600080fd5b8135611a4381612aff565b803563ffffffff81168114612be457600080fd5b919050565b600060208284031215612bfb57600080fd5b611a4382612bd0565b60008060408385031215612c1757600080fd5b612c2083612bd0565b946020939093013593505050565b8015158114610da357600080fd5b60008060408385031215612c4f57600080fd5b82356001600160401b03811115612c6557600080fd5b612c7185828601612970565b9250506020830135612c8281612c2e565b809150509250929050565b815181526020808301519082015260408101610d05565b803561ffff81168114612be457600080fd5b600060208284031215612cc857600080fd5b611a4382612ca4565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715612d0957612d09612cd1565b60405290565b604080519081016001600160401b0381118282101715612d0957612d09612cd1565b604051601f8201601f191681016001600160401b0381118282101715612d5957612d59612cd1565b604052919050565b60006020808385031215612d7457600080fd5b82356001600160401b0380821115612d8b57600080fd5b818501915085601f830112612d9f57600080fd5b813581811115612db157612db1612cd1565b612dbf848260051b01612d31565b81815284810192506060918202840185019188831115612dde57600080fd5b938501935b82851015612e2f5780858a031215612dfb5760008081fd5b612e03612ce7565b612e0c86612bd0565b815285870135878201526040808701359082015284529384019392850192612de3565b50979650505050505050565b60008060408385031215612e4e57600080fd5b612e5783612bd0565b9150612e6560208401612ca4565b90509250929050565b602081526000611a4360208301846129e0565b600080600060608486031215612e9657600080fd5b612e9f84612bd0565b9250612ead60208501612ca4565b91506040840135612ebd81612c2e565b809150509250925092565b60008060008060a08587031215612ede57600080fd5b612ee88686612aa5565b935060608501356001600160401b03811115612f0357600080fd5b612f0f87828801612ab7565b9094509250506080850135612f2381612aff565b939692955090935050565b60008083601f840112612f4057600080fd5b5081356001600160401b03811115612f5757600080fd5b6020830191508360208260051b8501011115612af857600080fd5b60008060208385031215612f8557600080fd5b82356001600160401b03811115612f9b57600080fd5b612fa785828601612f2e565b90969095509350505050565b60008060008060608587031215612fc957600080fd5b612fd285612bd0565b9350612fe060208601612ca4565b925060408501356001600160401b03811115612ffb57600080fd5b61300787828801612ab7565b95989497509550505050565b6000806000838503608081121561302957600080fd5b84356001600160401b0381111561303f57600080fd5b61304b87828801612970565b9450506040601f198201121561306057600080fd5b506020840191506060840135612ebd81612aff565b600060c082019050835182526001600160401b03602085015116602083015260408401516130b0604084018280518252602090810151910152565b5082516080830152602083015160a0830152611a43565b6000606082840312156130d957600080fd5b611a438383612aa5565b600181811c908216806130f757607f821691505b60208210810361298257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610d0557610d05613117565b60008261316157634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60008235605e1983360301811261319257600080fd5b9190910192915050565b6000808335601e198436030181126131b357600080fd5b8301803591506001600160401b038211156131cd57600080fd5b602001915036819003821315612af857600080fd5b601f821115611c42576000816000526020600020601f850160051c8101602086101561320b5750805b601f850160051c820191505b8181101561172257828155600101613217565b6001600160401b0383111561324157613241612cd1565b6132558361324f83546130e3565b836131e2565b6000601f84116001811461328957600085156132715750838201355b600019600387901b1c1916600186901b1783556118a4565b600083815260209020601f19861690835b828110156132ba578685013582556020948501946001909201910161329a565b50868210156132d75760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208082528181018390526000906040808401600586901b8501820187855b888110156133e857878303603f190184528135368b9003605e1901811261335757600080fd5b8a01606063ffffffff61336983612bd0565b16855261ffff61337a898401612ca4565b168886015286820135601e1983360301811261339557600080fd5b9091018781019190356001600160401b038111156133b257600080fd5b8036038313156133c157600080fd5b81888701526133d382870182856132e9565b96890196955050509186019150600101613331565b509098975050505050505050565b6000808585111561340657600080fd5b8386111561341357600080fd5b5050820193919092039150565b600084516134328184602089016129bc565b8201838582376000930192835250909392505050565b602081526000610ebc6020830184866132e9565b6000823561013e1983360301811261319257600080fd5b6001600160401b0381168114610da357600080fd5b63ffffffff61349689612bd0565b16815260208801356020820152600060408901356134b381613473565b6001600160401b03811660408401525087606083015260e060808301526134de60e0830187896132e9565b6001600160a01b03861660a084015282810360c08401526135008185876132e9565b9a9950505050505050505050565b60006020828403121561352057600080fd5b81516001600160401b038082111561353757600080fd5b818401915084601f83011261354b57600080fd5b81518181111561355d5761355d612cd1565b613570601f8201601f1916602001612d31565b915080825285602082850101111561358757600080fd5b6135988160208401602086016129bc565b50949350505050565b6000604082840312156135b357600080fd5b6135bb612d0f565b82358152602083013560208201528091505092915050565b6000602082840312156135e557600080fd5b8135611a4381613473565b60018060a01b038516815283602082015261ffff8316604082015260806060820152600061362160808301846129e0565b9695505050505050565b60408152600061363e60408301856129e0565b8281036020840152611e6481856129e0565b60006020828403121561366257600080fd5b8151611a4381612c2e565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a060808401526136a360e08401826129e0565b90506060850151603f198483030160a08501526136c082826129e0565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b6000604082840312156136f857600080fd5b613700612d0f565b9050815181526020820151602082015292915050565b60006040828403121561372857600080fd5b611a4383836136e6565b602080825282518282018190526000919060409081850190868401855b82811015613784578151805163ffffffff1685528681015187860152850151858501526060909301929085019060010161374f565b5091979650505050505050565b6001600160f01b031981358181169160028510156137b95780818660020360031b1b83161692505b505092915050565b81810381811115610d0557610d05613117565b6000608082840312156137e657600080fd5b6137ee612ce7565b82518152602083015161380081613473565b602082015261381284604085016136e6565b60408201529392505050565b80356020831015610d0557600019602084900360031b1b1692915050565b6001600160c01b031981358181169160088510156137b95760089490940360031b84901b1690921692915050565b6001600160401b0360c01b8560c01b16815263ffffffff60e01b8460e01b16600882015282600c820152600082516138a981602c8501602087016129bc565b91909101602c0195945050505050565b8481526001600160401b0360c01b8460c01b166020820152826028820152600082516138ec8160488501602087016129bc565b9190910160480195945050505050565b80820180821115610d0557610d05613117565b60006020828403121561392157600080fd5b8151611a4381612aff56fe0cb173d183337e25fab6cb85705c15aad6a58cb1d552ed71b9bc628c8a3de80072ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900fc4b3847e0649a09792d4c694ef28e20c43dde62a8b3de98eff85ccb4e1f3000a264697066735822122039b832561d2940e7138a1a2e044c4c45becb0f7b6916d5f3e411536bdfcb8aae64736f6c63430008160033000000000000000000000000f9fb20b8e097904f0ab7d12e9dbee88f2dcd0f160000000000000000000000001a44076050125825900e736c501f859c50fe728c","name":"StableCoinAdapter","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"@openzeppelin/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":"@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":"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\n// solhint-disable-next-line no-unused-import\nimport { InboundPacket, Origin } from \"../libs/Packet.sol\";\n\n/**\n * @title IOAppPreCrimeSimulator Interface\n * @dev Interface for the preCrime simulation functionality in an OApp.\n */\ninterface IOAppPreCrimeSimulator {\n    // @dev simulation result used in PreCrime implementation\n    error SimulationResult(bytes result);\n    error OnlySelf();\n\n    /**\n     * @dev Emitted when the preCrime contract address is set.\n     * @param preCrimeAddress The address of the preCrime contract.\n     */\n    event PreCrimeSet(address preCrimeAddress);\n\n    /**\n     * @dev Retrieves the address of the preCrime contract implementation.\n     * @return The address of the preCrime contract.\n     */\n    function preCrime() external view returns (address);\n\n    /**\n     * @dev Retrieves the address of the OApp contract.\n     * @return The address of the OApp contract.\n     */\n    function oApp() external view returns (address);\n\n    /**\n     * @dev Sets the preCrime contract address.\n     * @param _preCrime The address of the preCrime contract.\n     */\n    function setPreCrime(address _preCrime) external;\n\n    /**\n     * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\n     * @param _packets An array of LayerZero InboundPacket objects representing received packets.\n     */\n    function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\n\n    /**\n     * @dev checks if the specified peer is considered 'trusted' by the OApp.\n     * @param _eid The endpoint Id to check.\n     * @param _peer The peer to check.\n     * @return Whether the peer passed is considered 'trusted' by the OApp.\n     */\n    function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppReceiver.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ILayerZeroReceiver, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\n\ninterface IOAppReceiver is ILayerZeroReceiver {\n    /**\n     * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n     * @param _origin The origin information containing the source endpoint and sender address.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address on the src chain.\n     *  - nonce: The nonce of the message.\n     * @param _message The lzReceive payload.\n     * @param _sender The sender address.\n     * @return isSender Is a valid sender.\n     *\n     * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\n     * @dev The default sender IS the OAppReceiver implementer.\n     */\n    function isComposeMsgSender(\n        Origin calldata _origin,\n        bytes calldata _message,\n        address _sender\n    ) external view returns (bool isSender);\n}\n"},{"file_path":"contracts/oft-evm-upgradeable-with-fee/MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable.sol","source_code":"// SPDX-LICENSE-IDENTIFIER: UNLICENSED\npragma solidity ^0.8.20;\n\nimport { IERC20, SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport { OFTAdapterUpgradeable } from \"@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTAdapterUpgradeable.sol\";\nimport { FeeUpgradeable } from \"./FeeUpgradeable.sol\";\nimport { IMintableAndSelfBurnable } from \"./interfaces/IMintableAndSelfBurnable.sol\";\nimport { RateLimiterUpgradeable } from \"./RateLimiterUpgradeable.sol\";\n\n/**\n * @title MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable\n * @notice MintAndBurnOFTAdapter with fees, upgradeable logic and rate limits.\n */\nabstract contract MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable is OFTAdapterUpgradeable, FeeUpgradeable, RateLimiterUpgradeable {\n    using SafeERC20 for IERC20;\n\n    struct OFTFeeAdapterStorage {\n        uint256 feeBalance;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.mintandburnoftadapterwithfeeandratelimit\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OFT_FEE_ADAPTER_STORAGE_LOCATION =\n        0x4abebe5a7833807a903fad38d08b3addaf1d18bf2da978cb4ed490908875da00;\n\n    function _getOFTFeeAdapterStorage() internal pure returns (OFTFeeAdapterStorage storage $) {\n        assembly {\n            $.slot := OFT_FEE_ADAPTER_STORAGE_LOCATION\n        }\n    }\n\n    function feeBalance() public view returns (uint256) {\n        OFTFeeAdapterStorage storage $ = _getOFTFeeAdapterStorage();\n        return $.feeBalance;\n    }\n\n    error NoFeesToWithdraw();\n    event FeeWithdrawn(address indexed to, uint256 amountLD);\n\n    /**\n     * @dev Constructor for initializing the contract with token and endpoint addresses.\n     * @param _token The address of the token.\n     * @param _lzEndpoint The address of the LayerZero endpoint.\n     */\n    constructor(address _token, address _lzEndpoint) OFTAdapterUpgradeable(_token, _lzEndpoint) {}\n\n    /**\n     * @dev Initializes the MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable contract.\n     * @param _delegate The address of the LayerZero delegate.\n     */\n    function __MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable_init(address _delegate) internal onlyInitializing {\n        __OFTAdapter_init(_delegate);\n        __FeeUpgradeable_init();\n        __RateLimiterUpgradeable_init();\n    }\n\n    /**\n     * @dev Unchained initialization function for the contract.\n     */\n    function __MintAndBurnOFTAdapterWithFeeAndRateLimitUpgradeable_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @notice Sets the Rate Limit.\n     * @param _rateLimitConfigs A `RateLimitConfig` struct representing the rate limit configuration.\n     * - `dstEid`: The destination endpoint id.\n     * - `limit`: This represents the maximum allowed amount within a given window.\n     * - `window`: Defines the duration of the rate limiting window.\n     */\n    function setRateLimits(RateLimiterUpgradeable.RateLimitConfig[] memory _rateLimitConfigs) external virtual onlyOwner {\n        _setRateLimits(_rateLimitConfigs);\n    }\n\n    /**\n     * @notice Withdraws accumulated fees to a specified address.\n     * @param _to The address to which the fees will be withdrawn.\n     */\n    function withdrawFees(address _to) external onlyOwner {\n        // @dev doesn't allow owner to pull from the locked assets of the contract,\n        // only from accumulated fees\n        OFTFeeAdapterStorage storage $ = _getOFTFeeAdapterStorage();\n        uint256 balance = $.feeBalance;\n        if (balance == 0) revert NoFeesToWithdraw();\n\n        $.feeBalance = 0;\n        innerToken.safeTransfer(_to, balance);\n        emit FeeWithdrawn(_to, balance);\n    }\n\n    /**\n     * @dev Calculates the amount to be sent and received after applying fees and checking for slippage.\n     * @param _amountLD The amount of tokens to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @param _dstEid The destination chain ID.\n     * @return amountSentLD The amount sent in local decimals.\n     * @return amountReceivedLD The amount received in local decimals on the remote.\n     */\n    function _debitView(\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 _dstEid\n    ) internal view virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n        amountSentLD = _amountLD;\n\n        // @dev Apply the fee, then de-dust the amount afterwards.\n        // This means the fee is taken from the amount before the dust is removed.\n        uint256 fee = getFee(_dstEid, _amountLD);\n        unchecked {\n            amountReceivedLD = _removeDust(_amountLD - fee);\n        }\n\n        // @dev Check for slippage.\n        if (amountReceivedLD < _minAmountLD) {\n            revert SlippageExceeded(amountReceivedLD, _minAmountLD);\n        }\n    }\n\n    /**\n     * @dev Transfers the full amount from the sender's balance to the contract,\n     *      then burns the amount minus the fee from the contract leaving the fee locked in the contract.\n     * @param _from The address to debit from.\n     * @param _amountLD The amount of tokens to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @param _dstEid The destination chain ID.\n     * @return amountSentLD The amount sent in local decimals.\n     * @return amountReceivedLD The amount received in local decimals on the remote.\n     */\n    function _debit(\n        address _from,\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 _dstEid\n    ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n        (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n        _outflow(_dstEid, amountReceivedLD);\n\n        innerToken.safeTransferFrom(_from, address(this), amountSentLD);\n\n        IMintableAndSelfBurnable(address(innerToken)).burn(amountReceivedLD);\n\n        if (amountSentLD > amountReceivedLD) {\n            // @dev Increment the total fees that can be withdrawn.\n            //      Fees include the dust resulting from the de-dust operation.\n            OFTFeeAdapterStorage storage $ = _getOFTFeeAdapterStorage();\n            unchecked {\n                $.feeBalance += (amountSentLD - amountReceivedLD);\n            }\n        }\n    }\n\n    /**\n     * @dev Credits tokens to the specified address.\n     * @param _to The address to credit the tokens to.\n     * @param _amountLD The amount of tokens to credit in local decimals.\n     * @dev _srcEid The source chain ID.\n     * @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n     */\n    function _credit(\n        address _to,\n        uint256 _amountLD,\n        uint32 _srcEid\n    ) internal virtual override returns (uint256 amountReceivedLD) {\n        if (_to == address(0x0)) _to = address(0xdead);\n\n        _inflow(_srcEid, _amountLD);\n\n        IMintableAndSelfBurnable(address(innerToken)).mint(_to, _amountLD);\n        // @dev In the case of NON-default OFTAdapter, the amountLD MIGHT not be == amountReceivedLD.\n        return _amountLD;\n    }\n}"},{"file_path":"@layerzerolabs/oft-evm/contracts/libs/OFTMsgCodec.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTMsgCodec {\n    // Offset constants for encoding and decoding OFT messages\n    uint8 private constant SEND_TO_OFFSET = 32;\n    uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n    /**\n     * @dev Encodes an OFT LayerZero message.\n     * @param _sendTo The recipient address.\n     * @param _amountShared The amount in shared decimals.\n     * @param _composeMsg The composed message.\n     * @return _msg The encoded message.\n     * @return hasCompose A boolean indicating whether the message has a composed payload.\n     */\n    function encode(\n        bytes32 _sendTo,\n        uint64 _amountShared,\n        bytes memory _composeMsg\n    ) internal view returns (bytes memory _msg, bool hasCompose) {\n        hasCompose = _composeMsg.length > 0;\n        // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n        _msg = hasCompose\n            ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(msg.sender), _composeMsg)\n            : abi.encodePacked(_sendTo, _amountShared);\n    }\n\n    /**\n     * @dev Checks if the OFT message is composed.\n     * @param _msg The OFT message.\n     * @return A boolean indicating whether the message is composed.\n     */\n    function isComposed(bytes calldata _msg) internal pure returns (bool) {\n        return _msg.length > SEND_AMOUNT_SD_OFFSET;\n    }\n\n    /**\n     * @dev Retrieves the recipient address from the OFT message.\n     * @param _msg The OFT message.\n     * @return The recipient address.\n     */\n    function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n        return bytes32(_msg[:SEND_TO_OFFSET]);\n    }\n\n    /**\n     * @dev Retrieves the amount in shared decimals from the OFT message.\n     * @param _msg The OFT message.\n     * @return The amount in shared decimals.\n     */\n    function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n        return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the composed message from the OFT message.\n     * @param _msg The OFT message.\n     * @return The composed message.\n     */\n    function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n        return _msg[SEND_AMOUNT_SD_OFFSET:];\n    }\n\n    /**\n     * @dev Converts an address to bytes32.\n     * @param _addr The address to convert.\n     * @return The bytes32 representation of the address.\n     */\n    function addressToBytes32(address _addr) internal pure returns (bytes32) {\n        return bytes32(uint256(uint160(_addr)));\n    }\n\n    /**\n     * @dev Converts bytes32 to an address.\n     * @param _b The bytes32 value to convert.\n     * @return The address representation of bytes32.\n     */\n    function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n        return address(uint160(uint256(_b)));\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppReceiverUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppReceiver.sol\";\nimport { OAppCoreUpgradeable } from \"./OAppCoreUpgradeable.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiverUpgradeable is IOAppReceiver, OAppCoreUpgradeable {\n    // Custom error message for when the caller is not the registered endpoint/\n    error OnlyEndpoint(address addr);\n\n    // @dev The version of the OAppReceiver implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant RECEIVER_VERSION = 2;\n\n    /**\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppReceiver_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init(_delegate);\n    }\n\n    function __OAppReceiver_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n     * ie. this is a RECEIVE only OApp.\n     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\n     */\n    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n        return (0, RECEIVER_VERSION);\n    }\n\n    /**\n     * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n     * @dev _origin The origin information containing the source endpoint and sender address.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address on the src chain.\n     *  - nonce: The nonce of the message.\n     * @dev _message The lzReceive payload.\n     * @param _sender The sender address.\n     * @return isSender Is a valid sender.\n     *\n     * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\n     * @dev The default sender IS the OAppReceiver implementer.\n     */\n    function isComposeMsgSender(\n        Origin calldata /*_origin*/,\n        bytes calldata /*_message*/,\n        address _sender\n    ) public view virtual returns (bool) {\n        return _sender == address(this);\n    }\n\n    /**\n     * @notice Checks if the path initialization is allowed based on the provided origin.\n     * @param origin The origin information containing the source endpoint and sender address.\n     * @return Whether the path has been initialized.\n     *\n     * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\n     * @dev This defaults to assuming if a peer has been set, its initialized.\n     * Can be overridden by the OApp if there is other logic to determine this.\n     */\n    function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\n        return peers(origin.srcEid) == origin.sender;\n    }\n\n    /**\n     * @notice Retrieves the next nonce for a given source endpoint and sender address.\n     * @dev _srcEid The source endpoint ID.\n     * @dev _sender The sender address.\n     * @return nonce The next nonce.\n     *\n     * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\n     * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\n     * @dev This is also enforced by the OApp.\n     * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\n     */\n    function nextNonce(uint32, /*_srcEid*/ bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\n        return 0;\n    }\n\n    /**\n     * @dev Entry point for receiving messages or packets from the endpoint.\n     * @param _origin The origin information containing the source endpoint and sender address.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address on the src chain.\n     *  - nonce: The nonce of the message.\n     * @param _guid The unique identifier for the received LayerZero message.\n     * @param _message The payload of the received message.\n     * @param _executor The address of the executor for the received message.\n     * @param _extraData Additional arbitrary data provided by the corresponding executor.\n     *\n     * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\n     */\n    function lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) public payable virtual {\n        // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\n        if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\n\n        // Ensure that the sender matches the expected peer for the source endpoint.\n        if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\n\n        // Call the internal OApp implementation of lzReceive.\n        _lzReceive(_origin, _guid, _message, _executor, _extraData);\n    }\n\n    /**\n     * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\n     */\n    function _lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) internal virtual;\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingComposer {\n    event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\n    event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\n    event LzComposeAlert(\n        address indexed from,\n        address indexed to,\n        address indexed executor,\n        bytes32 guid,\n        uint16 index,\n        uint256 gas,\n        uint256 value,\n        bytes message,\n        bytes extraData,\n        bytes reason\n    );\n\n    function composeQueue(\n        address _from,\n        address _to,\n        bytes32 _guid,\n        uint16 _index\n    ) external view returns (bytes32 messageHash);\n\n    function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\n\n    function lzCompose(\n        address _from,\n        address _to,\n        bytes32 _guid,\n        uint16 _index,\n        bytes calldata _message,\n        bytes calldata _extraData\n    ) external payable;\n}\n"},{"file_path":"@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTCoreUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OAppUpgradeable, Origin } from \"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.sol\";\nimport { OAppOptionsType3Upgradeable } from \"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol\";\nimport { IOAppMsgInspector } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppMsgInspector.sol\";\n\nimport { OAppPreCrimeSimulatorUpgradeable } from \"@layerzerolabs/oapp-evm-upgradeable/contracts/precrime/OAppPreCrimeSimulatorUpgradeable.sol\";\n\nimport { IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee } from \"@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol\";\nimport { OFTMsgCodec } from \"@layerzerolabs/oft-evm/contracts/libs/OFTMsgCodec.sol\";\nimport { OFTComposeMsgCodec } from \"@layerzerolabs/oft-evm/contracts/libs/OFTComposeMsgCodec.sol\";\n\n/**\n * @title OFTCore\n * @dev Abstract contract for the OftChain (OFT) token.\n */\nabstract contract OFTCoreUpgradeable is\n    IOFT,\n    OAppUpgradeable,\n    OAppPreCrimeSimulatorUpgradeable,\n    OAppOptionsType3Upgradeable\n{\n    using OFTMsgCodec for bytes;\n    using OFTMsgCodec for bytes32;\n\n    struct OFTCoreStorage {\n        // Address of an optional contract to inspect both 'message' and 'options'\n        address msgInspector;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oftcore\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OFT_CORE_STORAGE_LOCATION =\n        0x41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c00;\n\n    // @notice Provides a conversion rate when swapping between denominations of SD and LD\n    //      - shareDecimals == SD == shared Decimals\n    //      - localDecimals == LD == local decimals\n    // @dev Considers that tokens have different decimal amounts on various chains.\n    // @dev eg.\n    //  For a token\n    //      - locally with 4 decimals --> 1.2345 => uint(12345)\n    //      - remotely with 2 decimals --> 1.23 => uint(123)\n    //      - The conversion rate would be 10 ** (4 - 2) = 100\n    //  @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\n    //  you can only display 1.23 -> uint(123).\n    //  @dev To preserve the dust that would otherwise be lost on that conversion,\n    //  we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\n    uint256 public immutable decimalConversionRate;\n\n    // @notice Msg types that are used to identify the various OFT operations.\n    // @dev This can be extended in child contracts for non-default oft operations\n    // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\n    uint16 public constant SEND = 1;\n    uint16 public constant SEND_AND_CALL = 2;\n\n    event MsgInspectorSet(address inspector);\n\n    function _getOFTCoreStorage() internal pure returns (OFTCoreStorage storage $) {\n        assembly {\n            $.slot := OFT_CORE_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @dev Constructor.\n     * @param _localDecimals The decimals of the token on the local chain (this chain).\n     * @param _endpoint The address of the LayerZero endpoint.\n     */\n    constructor(uint8 _localDecimals, address _endpoint) OAppUpgradeable(_endpoint) {\n        if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\n        decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\n    }\n\n    /**\n     * @notice Retrieves interfaceID and the version of the OFT.\n     * @return interfaceId The interface ID.\n     * @return version The version.\n     *\n     * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n     * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n     * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n     * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n     */\n    function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\n        return (type(IOFT).interfaceId, 1);\n    }\n\n    /**\n     * @dev Initializes the OFTCore contract.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OFTCore_init(address _delegate) internal onlyInitializing {\n        __OApp_init(_delegate);\n        __OAppPreCrimeSimulator_init();\n        __OAppOptionsType3_init();\n    }\n\n    function __OFTCore_init_unchained() internal onlyInitializing {}\n\n    function msgInspector() public view returns (address) {\n        OFTCoreStorage storage $ = _getOFTCoreStorage();\n        return $.msgInspector;\n    }\n\n    /**\n     * @dev Retrieves the shared decimals of the OFT.\n     * @return The shared decimals of the OFT.\n     *\n     * @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap\n     * Lowest common decimal denominator between chains.\n     * Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\n     * For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\n     * ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\n     */\n    function sharedDecimals() public pure virtual returns (uint8) {\n        return 6;\n    }\n\n    /**\n     * @dev Sets the message inspector address for the OFT.\n     * @param _msgInspector The address of the message inspector.\n     *\n     * @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\n     * @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\n     */\n    function setMsgInspector(address _msgInspector) public virtual onlyOwner {\n        OFTCoreStorage storage $ = _getOFTCoreStorage();\n        $.msgInspector = _msgInspector;\n        emit MsgInspectorSet(_msgInspector);\n    }\n\n    /**\n     * @notice Provides a quote for OFT-related operations.\n     * @param _sendParam The parameters for the send operation.\n     * @return oftLimit The OFT limit information.\n     * @return oftFeeDetails The details of OFT fees.\n     * @return oftReceipt The OFT receipt information.\n     */\n    function quoteOFT(\n        SendParam calldata _sendParam\n    )\n        external\n        view\n        virtual\n        returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\n    {\n        uint256 minAmountLD = 0; // Unused in the default implementation.\n        uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\n        oftLimit = OFTLimit(minAmountLD, maxAmountLD);\n\n        // Unused in the default implementation; reserved for future complex fee details.\n        oftFeeDetails = new OFTFeeDetail[](0);\n\n        // @dev This is the same as the send() operation, but without the actual send.\n        // - amountSentLD is the amount in local decimals that would be sent from the sender.\n        // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.\n        // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\n        (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\n            _sendParam.amountLD,\n            _sendParam.minAmountLD,\n            _sendParam.dstEid\n        );\n        oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n    }\n\n    /**\n     * @notice Provides a quote for the send() operation.\n     * @param _sendParam The parameters for the send() operation.\n     * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n     * @return msgFee The calculated LayerZero messaging fee from the send() operation.\n     *\n     * @dev MessagingFee: LayerZero msg fee\n     *  - nativeFee: The native fee.\n     *  - lzTokenFee: The lzToken fee.\n     */\n    function quoteSend(\n        SendParam calldata _sendParam,\n        bool _payInLzToken\n    ) external view virtual returns (MessagingFee memory msgFee) {\n        // @dev mock the amount to receive, this is the same operation used in the send().\n        // The quote is as similar as possible to the actual send() operation.\n        (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\n\n        // @dev Builds the options and OFT message to quote in the endpoint.\n        (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n        // @dev Calculates the LayerZero fee for the send() operation.\n        return _quote(_sendParam.dstEid, message, options, _payInLzToken);\n    }\n\n    /**\n     * @dev Executes the send operation.\n     * @param _sendParam The parameters for the send operation.\n     * @param _fee The calculated fee for the send() operation.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param _refundAddress The address to receive any excess funds.\n     * @return msgReceipt The receipt for the send operation.\n     * @return oftReceipt The OFT receipt information.\n     *\n     * @dev MessagingReceipt: LayerZero msg receipt\n     *  - guid: The unique identifier for the sent message.\n     *  - nonce: The nonce of the sent message.\n     *  - fee: The LayerZero fee incurred for the message.\n     */\n    function send(\n        SendParam calldata _sendParam,\n        MessagingFee calldata _fee,\n        address _refundAddress\n    ) external payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n        // @dev Applies the token transfers regarding this send() operation.\n        // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\n        // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.\n        (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\n            msg.sender,\n            _sendParam.amountLD,\n            _sendParam.minAmountLD,\n            _sendParam.dstEid\n        );\n\n        // @dev Builds the options and OFT message to quote in the endpoint.\n        (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n        // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\n        msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\n        // @dev Formulate the OFT receipt.\n        oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n\n        emit OFTSent(msgReceipt.guid, _sendParam.dstEid, msg.sender, amountSentLD, amountReceivedLD);\n    }\n\n    /**\n     * @dev Internal function to build the message and options.\n     * @param _sendParam The parameters for the send() operation.\n     * @param _amountLD The amount in local decimals.\n     * @return message The encoded message.\n     * @return options The encoded options.\n     */\n    function _buildMsgAndOptions(\n        SendParam calldata _sendParam,\n        uint256 _amountLD\n    ) internal view virtual returns (bytes memory message, bytes memory options) {\n        bool hasCompose;\n        // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\n        (message, hasCompose) = OFTMsgCodec.encode(\n            _sendParam.to,\n            _toSD(_amountLD),\n            // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\n            // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\n            _sendParam.composeMsg\n        );\n        // @dev Change the msg type depending if its composed or not.\n        uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\n        // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\n        options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\n\n        OFTCoreStorage storage $ = _getOFTCoreStorage();\n\n        // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\n        // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\n        address inspector = $.msgInspector; // caches the msgInspector to avoid potential double storage read\n        if (inspector != address(0)) IOAppMsgInspector(inspector).inspect(message, options);\n    }\n\n    /**\n     * @dev Internal function to handle the receive on the LayerZero endpoint.\n     * @param _origin The origin information.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address from the src chain.\n     *  - nonce: The nonce of the LayerZero message.\n     * @param _guid The unique identifier for the received LayerZero message.\n     * @param _message The encoded message.\n     * @dev _executor The address of the executor.\n     * @dev _extraData Additional data.\n     */\n    function _lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address /*_executor*/, // @dev unused in the default implementation.\n        bytes calldata /*_extraData*/ // @dev unused in the default implementation.\n    ) internal virtual override {\n        // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)\n        // Thus everything is bytes32() encoded in flight.\n        address toAddress = _message.sendTo().bytes32ToAddress();\n        // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals\n        uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);\n\n        if (_message.isComposed()) {\n            // @dev Proprietary composeMsg format for the OFT.\n            bytes memory composeMsg = OFTComposeMsgCodec.encode(\n                _origin.nonce,\n                _origin.srcEid,\n                amountReceivedLD,\n                _message.composeMsg()\n            );\n\n            // @dev Stores the lzCompose payload that will be executed in a separate tx.\n            // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\n            // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.\n            // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\n            // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.\n            endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\n        }\n\n        emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\n    }\n\n    /**\n     * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n     * @param _origin The origin information.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address from the src chain.\n     *  - nonce: The nonce of the LayerZero message.\n     * @param _guid The unique identifier for the received LayerZero message.\n     * @param _message The LayerZero message.\n     * @param _executor The address of the off-chain executor.\n     * @param _extraData Arbitrary data passed by the msg executor.\n     *\n     * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n     * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n     */\n    function _lzReceiveSimulate(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) internal virtual override {\n        _lzReceive(_origin, _guid, _message, _executor, _extraData);\n    }\n\n    /**\n     * @dev Check if the peer is considered 'trusted' by the OApp.\n     * @param _eid The endpoint ID to check.\n     * @param _peer The peer to check.\n     * @return Whether the peer passed is considered 'trusted' by the OApp.\n     *\n     * @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\n     */\n    function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\n        return peers(_eid) == _peer;\n    }\n\n    /**\n     * @dev Internal function to remove dust from the given local decimal amount.\n     * @param _amountLD The amount in local decimals.\n     * @return amountLD The amount after removing dust.\n     *\n     * @dev Prevents the loss of dust when moving amounts between chains with different decimals.\n     * @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\n     */\n    function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {\n        return (_amountLD / decimalConversionRate) * decimalConversionRate;\n    }\n\n    /**\n     * @dev Internal function to convert an amount from shared decimals into local decimals.\n     * @param _amountSD The amount in shared decimals.\n     * @return amountLD The amount in local decimals.\n     */\n    function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {\n        return _amountSD * decimalConversionRate;\n    }\n\n    /**\n     * @dev Internal function to convert an amount from local decimals into shared decimals.\n     * @param _amountLD The amount in local decimals.\n     * @return amountSD The amount in shared decimals.\n     */\n    function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {\n        return uint64(_amountLD / decimalConversionRate);\n    }\n\n    /**\n     * @dev Internal function to mock the amount mutation from a OFT debit() operation.\n     * @param _amountLD The amount to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @dev _dstEid The destination endpoint ID.\n     * @return amountSentLD The amount sent, in local decimals.\n     * @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\n     *\n     * @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\n     */\n    function _debitView(\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 /*_dstEid*/\n    ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n        // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.\n        amountSentLD = _removeDust(_amountLD);\n        // @dev The amount to send is the same as amount received in the default implementation.\n        amountReceivedLD = amountSentLD;\n\n        // @dev Check for slippage.\n        if (amountReceivedLD < _minAmountLD) {\n            revert SlippageExceeded(amountReceivedLD, _minAmountLD);\n        }\n    }\n\n    /**\n     * @dev Internal function to perform a debit operation.\n     * @param _from The address to debit from.\n     * @param _amountLD The amount to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @param _dstEid The destination endpoint ID.\n     * @return amountSentLD The amount sent in local decimals.\n     * @return amountReceivedLD The amount received in local decimals on the remote.\n     *\n     * @dev Defined here but are intended to be overriden depending on the OFT implementation.\n     * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n     */\n    function _debit(\n        address _from,\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 _dstEid\n    ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\n\n    /**\n     * @dev Internal function to perform a credit operation.\n     * @param _to The address to credit.\n     * @param _amountLD The amount to credit in local decimals.\n     * @param _srcEid The source endpoint ID.\n     * @return amountReceivedLD The amount ACTUALLY received in local decimals.\n     *\n     * @dev Defined here but are intended to be overriden depending on the OFT implementation.\n     * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n     */\n    function _credit(\n        address _to,\n        uint256 _amountLD,\n        uint32 _srcEid\n    ) internal virtual returns (uint256 amountReceivedLD);\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingContext {\n    function isSendingMessage() external view returns (bool);\n\n    function getSendContext() external view returns (uint32 dstEid, address sender);\n}\n"},{"file_path":"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppCoreUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n */\nabstract contract OAppCoreUpgradeable is IOAppCore, OwnableUpgradeable {\n    struct OAppCoreStorage {\n        mapping(uint32 => bytes32) peers;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oappcore\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OAPP_CORE_STORAGE_LOCATION =\n        0x72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900;\n\n    function _getOAppCoreStorage() internal pure returns (OAppCoreStorage storage $) {\n        assembly {\n            $.slot := OAPP_CORE_STORAGE_LOCATION\n        }\n    }\n\n    // The LayerZero endpoint associated with the given OApp\n    ILayerZeroEndpointV2 public immutable endpoint;\n\n    /**\n     * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\n     * @param _endpoint The address of the LOCAL Layer Zero endpoint.\n     */\n    constructor(address _endpoint) {\n        endpoint = ILayerZeroEndpointV2(_endpoint);\n    }\n\n    /**\n     * @dev Initializes the OAppCore with the provided delegate.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppCore_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init_unchained(_delegate);\n    }\n\n    function __OAppCore_init_unchained(address _delegate) internal onlyInitializing {\n        if (_delegate == address(0)) revert InvalidDelegate();\n        endpoint.setDelegate(_delegate);\n    }\n\n    /**\n     * @notice Returns the peer address (OApp instance) associated with a specific endpoint.\n     * @param _eid The endpoint ID.\n     * @return peer The address of the peer associated with the specified endpoint.\n     */\n    function peers(uint32 _eid) public view override returns (bytes32) {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        return $.peers[_eid];\n    }\n\n    /**\n     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @param _peer The address of the peer to be associated with the corresponding endpoint.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n     * @dev Set this to bytes32(0) to remove the peer address.\n     * @dev Peer is a bytes32 to accommodate non-evm chains.\n     */\n    function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        $.peers[_eid] = _peer;\n        emit PeerSet(_eid, _peer);\n    }\n\n    /**\n     * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\n     * ie. the peer is set to bytes32(0).\n     * @param _eid The endpoint ID.\n     * @return peer The address of the peer associated with the specified endpoint.\n     */\n    function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\n        OAppCoreStorage storage $ = _getOAppCoreStorage();\n        bytes32 peer = $.peers[_eid];\n        if (peer == bytes32(0)) revert NoPeer(_eid);\n        return peer;\n    }\n\n    /**\n     * @notice Sets the delegate address for the OApp.\n     * @param _delegate The address of the delegate to be set.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\n     */\n    function setDelegate(address _delegate) public onlyOwner {\n        endpoint.setDelegate(_delegate);\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\nimport { SetConfigParam } from \"./IMessageLibManager.sol\";\n\nenum MessageLibType {\n    Send,\n    Receive,\n    SendAndReceive\n}\n\ninterface IMessageLib is IERC165 {\n    function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\n\n    function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\n\n    function isSupportedEid(uint32 _eid) external view returns (bool);\n\n    // message libs of same major version are compatible\n    function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\n\n    function messageLibType() external view returns (MessageLibType);\n}\n"},{"file_path":"contracts/oft-evm-upgradeable-with-fee/interfaces/IMintableAndSelfBurnable.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.20;\n\ninterface IMintableAndSelfBurnable {\n    function mint(address account, uint256 value) external;\n    function burn(uint256 value) external;\n}"},{"file_path":"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppSenderUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20, IERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { OAppCoreUpgradeable } from \"./OAppCoreUpgradeable.sol\";\n\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n */\nabstract contract OAppSenderUpgradeable is OAppCoreUpgradeable {\n    using SafeERC20 for IERC20;\n\n    // Custom error messages\n    error NotEnoughNative(uint256 msgValue);\n    error LzTokenUnavailable();\n\n    // @dev The version of the OAppSender implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant SENDER_VERSION = 1;\n\n    /**\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppSender_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init(_delegate);\n    }\n\n    function __OAppSender_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n     * ie. this is a SEND only OApp.\n     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n     */\n    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n        return (SENDER_VERSION, 0);\n    }\n\n    /**\n     * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n     * @param _dstEid The destination endpoint ID.\n     * @param _message The message payload.\n     * @param _options Additional options for the message.\n     * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n     * @return fee The calculated MessagingFee for the message.\n     *      - nativeFee: The native fee for the message.\n     *      - lzTokenFee: The LZ token fee for the message.\n     */\n    function _quote(\n        uint32 _dstEid,\n        bytes memory _message,\n        bytes memory _options,\n        bool _payInLzToken\n    ) internal view virtual returns (MessagingFee memory fee) {\n        return\n            endpoint.quote(\n                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n                address(this)\n            );\n    }\n\n    /**\n     * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n     * @param _dstEid The destination endpoint ID.\n     * @param _message The message payload.\n     * @param _options Additional options for the message.\n     * @param _fee The calculated LayerZero fee for the message.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n     * @return receipt The receipt for the sent message.\n     *      - guid: The unique identifier for the sent message.\n     *      - nonce: The nonce of the sent message.\n     *      - fee: The LayerZero fee incurred for the message.\n     */\n    function _lzSend(\n        uint32 _dstEid,\n        bytes memory _message,\n        bytes memory _options,\n        MessagingFee memory _fee,\n        address _refundAddress\n    ) internal virtual returns (MessagingReceipt memory receipt) {\n        // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n        uint256 messageValue = _payNative(_fee.nativeFee);\n        if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n        return\n            // solhint-disable-next-line check-send-result\n            endpoint.send{ value: messageValue }(\n                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n                _refundAddress\n            );\n    }\n\n    /**\n     * @dev Internal function to pay the native fee associated with the message.\n     * @param _nativeFee The native fee to be paid.\n     * @return nativeFee The amount of native currency paid.\n     *\n     * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n     * this will need to be overridden because msg.value would contain multiple lzFees.\n     * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n     * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n     * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n     */\n    function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n        if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n        return _nativeFee;\n    }\n\n    /**\n     * @dev Internal function to pay the LZ token fee associated with the message.\n     * @param _lzTokenFee The LZ token fee to be paid.\n     *\n     * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n     * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n     */\n    function _payLzToken(uint256 _lzTokenFee) internal virtual {\n        // @dev Cannot cache the token because it is not immutable in the endpoint.\n        address lzToken = endpoint.lzToken();\n        if (lzToken == address(0)) revert LzTokenUnavailable();\n\n        // Pay LZ token fee by sending tokens to the endpoint.\n        IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    /**\n     * @dev An operation with an ERC-20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        forceApprove(token, spender, oldAllowance + value);\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n     * value, non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n        unchecked {\n            uint256 currentAllowance = token.allowance(address(this), spender);\n            if (currentAllowance < requestedDecrease) {\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n            }\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     *\n     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n     * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n     * set here.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            safeTransfer(token, to, value);\n        } else if (!token.transferAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferFromAndCallRelaxed(\n        IERC1363 token,\n        address from,\n        address to,\n        uint256 value,\n        bytes memory data\n    ) internal {\n        if (to.code.length == 0) {\n            safeTransferFrom(token, from, to, value);\n        } else if (!token.transferFromAndCall(from, to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n     * once without retrying, and relies on the returned value to be true.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            forceApprove(token, to, value);\n        } else if (!token.approveAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            // bubble errors\n            if iszero(success) {\n                let ptr := mload(0x40)\n                returndatacopy(ptr, 0, returndatasize())\n                revert(ptr, returndatasize())\n            }\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n\n        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        bool success;\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n    }\n}\n"},{"file_path":"@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { MessagingReceipt, MessagingFee } from \"@layerzerolabs/oapp-evm/contracts/oapp/OAppSender.sol\";\n\n/**\n * @dev Struct representing token parameters for the OFT send() operation.\n */\nstruct SendParam {\n    uint32 dstEid; // Destination endpoint ID.\n    bytes32 to; // Recipient address.\n    uint256 amountLD; // Amount to send in local decimals.\n    uint256 minAmountLD; // Minimum amount to send in local decimals.\n    bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\n    bytes composeMsg; // The composed message for the send() operation.\n    bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\n}\n\n/**\n * @dev Struct representing OFT limit information.\n * @dev These amounts can change dynamically and are up the specific oft implementation.\n */\nstruct OFTLimit {\n    uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\n    uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\n}\n\n/**\n * @dev Struct representing OFT receipt information.\n */\nstruct OFTReceipt {\n    uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\n    // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\n    uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\n}\n\n/**\n * @dev Struct representing OFT fee details.\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\n */\nstruct OFTFeeDetail {\n    int256 feeAmountLD; // Amount of the fee in local decimals.\n    string description; // Description of the fee.\n}\n\n/**\n * @title IOFT\n * @dev Interface for the OftChain (OFT) token.\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\n * @dev This specific interface ID is '0x02e49c2c'.\n */\ninterface IOFT {\n    // Custom error messages\n    error InvalidLocalDecimals();\n    error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\n\n    // Events\n    event OFTSent(\n        bytes32 indexed guid, // GUID of the OFT message.\n        uint32 dstEid, // Destination Endpoint ID.\n        address indexed fromAddress, // Address of the sender on the src chain.\n        uint256 amountSentLD, // Amount of tokens sent in local decimals.\n        uint256 amountReceivedLD // Amount of tokens received in local decimals.\n    );\n    event OFTReceived(\n        bytes32 indexed guid, // GUID of the OFT message.\n        uint32 srcEid, // Source Endpoint ID.\n        address indexed toAddress, // Address of the recipient on the dst chain.\n        uint256 amountReceivedLD // Amount of tokens received in local decimals.\n    );\n\n    /**\n     * @notice Retrieves interfaceID and the version of the OFT.\n     * @return interfaceId The interface ID.\n     * @return version The version.\n     *\n     * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n     * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n     * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n     * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n     */\n    function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\n\n    /**\n     * @notice Retrieves the address of the token associated with the OFT.\n     * @return token The address of the ERC20 token implementation.\n     */\n    function token() external view returns (address);\n\n    /**\n     * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n     * @return requiresApproval Needs approval of the underlying token implementation.\n     *\n     * @dev Allows things like wallet implementers to determine integration requirements,\n     * without understanding the underlying token implementation.\n     */\n    function approvalRequired() external view returns (bool);\n\n    /**\n     * @notice Retrieves the shared decimals of the OFT.\n     * @return sharedDecimals The shared decimals of the OFT.\n     */\n    function sharedDecimals() external view returns (uint8);\n\n    /**\n     * @notice Provides the fee breakdown and settings data for an OFT. Unused in the default implementation.\n     * @param _sendParam The parameters for the send operation.\n     * @return limit The OFT limit information.\n     * @return oftFeeDetails The details of OFT fees.\n     * @return receipt The OFT receipt information.\n     */\n    function quoteOFT(\n        SendParam calldata _sendParam\n    ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\n\n    /**\n     * @notice Provides a quote for the send() operation.\n     * @param _sendParam The parameters for the send() operation.\n     * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n     * @return fee The calculated LayerZero messaging fee from the send() operation.\n     *\n     * @dev MessagingFee: LayerZero msg fee\n     *  - nativeFee: The native fee.\n     *  - lzTokenFee: The lzToken fee.\n     */\n    function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\n\n    /**\n     * @notice Executes the send() operation.\n     * @param _sendParam The parameters for the send operation.\n     * @param _fee The fee information supplied by the caller.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\n     * @return receipt The LayerZero messaging receipt from the send() operation.\n     * @return oftReceipt The OFT receipt information.\n     *\n     * @dev MessagingReceipt: LayerZero msg receipt\n     *  - guid: The unique identifier for the sent message.\n     *  - nonce: The nonce of the sent message.\n     *  - fee: The LayerZero fee incurred for the message.\n     */\n    function send(\n        SendParam calldata _sendParam,\n        MessagingFee calldata _fee,\n        address _refundAddress\n    ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppMsgInspector.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @title IOAppMsgInspector\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\n */\ninterface IOAppMsgInspector {\n    // Custom error message for inspection failure\n    error InspectionFailed(bytes message, bytes options);\n\n    /**\n     * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\n     * @param _message The message payload to be inspected.\n     * @param _options Additional options or parameters for inspection.\n     * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\n     *\n     * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\n     */\n    function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/OAppSender.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20, IERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n */\nabstract contract OAppSender is OAppCore {\n    using SafeERC20 for IERC20;\n\n    // Custom error messages\n    error NotEnoughNative(uint256 msgValue);\n    error LzTokenUnavailable();\n\n    // @dev The version of the OAppSender implementation.\n    // @dev Version is bumped when changes are made to this contract.\n    uint64 internal constant SENDER_VERSION = 1;\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     *\n     * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n     * ie. this is a SEND only OApp.\n     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n     */\n    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n        return (SENDER_VERSION, 0);\n    }\n\n    /**\n     * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n     * @param _dstEid The destination endpoint ID.\n     * @param _message The message payload.\n     * @param _options Additional options for the message.\n     * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n     * @return fee The calculated MessagingFee for the message.\n     *      - nativeFee: The native fee for the message.\n     *      - lzTokenFee: The LZ token fee for the message.\n     */\n    function _quote(\n        uint32 _dstEid,\n        bytes memory _message,\n        bytes memory _options,\n        bool _payInLzToken\n    ) internal view virtual returns (MessagingFee memory fee) {\n        return\n            endpoint.quote(\n                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n                address(this)\n            );\n    }\n\n    /**\n     * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n     * @param _dstEid The destination endpoint ID.\n     * @param _message The message payload.\n     * @param _options Additional options for the message.\n     * @param _fee The calculated LayerZero fee for the message.\n     *      - nativeFee: The native fee.\n     *      - lzTokenFee: The lzToken fee.\n     * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n     * @return receipt The receipt for the sent message.\n     *      - guid: The unique identifier for the sent message.\n     *      - nonce: The nonce of the sent message.\n     *      - fee: The LayerZero fee incurred for the message.\n     */\n    function _lzSend(\n        uint32 _dstEid,\n        bytes memory _message,\n        bytes memory _options,\n        MessagingFee memory _fee,\n        address _refundAddress\n    ) internal virtual returns (MessagingReceipt memory receipt) {\n        // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n        uint256 messageValue = _payNative(_fee.nativeFee);\n        if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n        return\n            // solhint-disable-next-line check-send-result\n            endpoint.send{ value: messageValue }(\n                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n                _refundAddress\n            );\n    }\n\n    /**\n     * @dev Internal function to pay the native fee associated with the message.\n     * @param _nativeFee The native fee to be paid.\n     * @return nativeFee The amount of native currency paid.\n     *\n     * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n     * this will need to be overridden because msg.value would contain multiple lzFees.\n     * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n     * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n     * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n     */\n    function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n        if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n        return _nativeFee;\n    }\n\n    /**\n     * @dev Internal function to pay the LZ token fee associated with the message.\n     * @param _lzTokenFee The LZ token fee to be paid.\n     *\n     * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n     * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n     */\n    function _payLzToken(uint256 _lzTokenFee) internal virtual {\n        // @dev Cannot cache the token because it is not immutable in the endpoint.\n        address lzToken = endpoint.lzToken();\n        if (lzToken == address(0)) revert LzTokenUnavailable();\n\n        // Pay LZ token fee by sending tokens to the endpoint.\n        IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { MessagingFee } from \"./ILayerZeroEndpointV2.sol\";\nimport { IMessageLib } from \"./IMessageLib.sol\";\n\nstruct Packet {\n    uint64 nonce;\n    uint32 srcEid;\n    address sender;\n    uint32 dstEid;\n    bytes32 receiver;\n    bytes32 guid;\n    bytes message;\n}\n\ninterface ISendLib is IMessageLib {\n    function send(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external returns (MessagingFee memory, bytes memory encodedPacket);\n\n    function quote(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external view returns (MessagingFee memory);\n\n    function setTreasury(address _treasury) external;\n\n    function withdrawFee(address _to, uint256 _amount) external;\n\n    function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\n}\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC1363.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.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":"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary AddressCast {\n    error AddressCast_InvalidSizeForAddress();\n    error AddressCast_InvalidAddress();\n\n    function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\n        if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\n        result = bytes32(_addressBytes);\n        unchecked {\n            uint256 offset = 32 - _addressBytes.length;\n            result = result >> (offset * 8);\n        }\n    }\n\n    function toBytes32(address _address) internal pure returns (bytes32 result) {\n        result = bytes32(uint256(uint160(_address)));\n    }\n\n    function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\n        if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\n        result = new bytes(_size);\n        unchecked {\n            uint256 offset = 256 - _size * 8;\n            assembly {\n                mstore(add(result, 32), shl(offset, _addressBytes32))\n            }\n        }\n    }\n\n    function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\n        result = address(uint160(uint256(_addressBytes32)));\n    }\n\n    function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\n        if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\n        result = address(bytes20(_addressBytes));\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { ILayerZeroEndpointV2 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\n/**\n * @title IOAppCore\n */\ninterface IOAppCore {\n    // Custom error messages\n    error OnlyPeer(uint32 eid, bytes32 sender);\n    error NoPeer(uint32 eid);\n    error InvalidEndpointCall();\n    error InvalidDelegate();\n\n    // Event emitted when a peer (OApp) is set for a corresponding endpoint\n    event PeerSet(uint32 eid, bytes32 peer);\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol contract.\n     * @return receiverVersion The version of the OAppReceiver.sol contract.\n     */\n    function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\n\n    /**\n     * @notice Retrieves the LayerZero endpoint associated with the OApp.\n     * @return iEndpoint The LayerZero endpoint as an interface.\n     */\n    function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\n\n    /**\n     * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\n     */\n    function peers(uint32 _eid) external view returns (bytes32 peer);\n\n    /**\n     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @param _peer The address of the peer to be associated with the corresponding endpoint.\n     */\n    function setPeer(uint32 _eid, bytes32 _peer) external;\n\n    /**\n     * @notice Sets the delegate address for the OApp Core.\n     * @param _delegate The address of the delegate to be set.\n     */\n    function setDelegate(address _delegate) external;\n}\n"},{"file_path":"@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTAdapterUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IERC20Metadata, IERC20 } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IOFT, OFTCoreUpgradeable } from \"./OFTCoreUpgradeable.sol\";\n\n/**\n * @title OFTAdapter Contract\n * @dev OFTAdapter is a contract that adapts an ERC-20 token to the OFT functionality.\n *\n * @dev For existing ERC20 tokens, this can be used to convert the token to crosschain compatibility.\n * @dev WARNING: ONLY 1 of these should exist for a given global mesh,\n * unless you make a NON-default implementation of OFT and needs to be done very carefully.\n * @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n * IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n * a pre/post balance check will need to be done to calculate the amountSentLD/amountReceivedLD.\n */\nabstract contract OFTAdapterUpgradeable is OFTCoreUpgradeable {\n    using SafeERC20 for IERC20;\n\n    IERC20 internal immutable innerToken;\n\n    /**\n     * @dev Constructor for the OFTAdapter contract.\n     * @param _token The address of the ERC-20 token to be adapted.\n     * @param _lzEndpoint The LayerZero endpoint address.\n     * @dev _token must implement the IERC20 interface, and include a decimals() function.\n     */\n    constructor(\n        address _token,\n        address _lzEndpoint\n    ) OFTCoreUpgradeable(IERC20Metadata(_token).decimals(), _lzEndpoint) {\n        innerToken = IERC20(_token);\n    }\n\n    /**\n     * @dev Initializes the OFTAdapter with the provided delegate.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OFTAdapter_init(address _delegate) internal onlyInitializing {\n        __OFTCore_init(_delegate);\n    }\n\n    function __OFTAdapter_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @dev Retrieves the address of the underlying ERC20 implementation.\n     * @return The address of the adapted ERC-20 token.\n     *\n     * @dev In the case of OFTAdapter, address(this) and erc20 are NOT the same contract.\n     */\n    function token() public view returns (address) {\n        return address(innerToken);\n    }\n\n    /**\n     * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n     * @return requiresApproval Needs approval of the underlying token implementation.\n     *\n     * @dev In the case of default OFTAdapter, approval is required.\n     * @dev In non-default OFTAdapter contracts with something like mint and burn privileges, it would NOT need approval.\n     */\n    function approvalRequired() external pure virtual returns (bool) {\n        return true;\n    }\n\n    /**\n     * @dev Burns tokens from the sender's specified balance, ie. pull method.\n     * @param _from The address to debit from.\n     * @param _amountLD The amount of tokens to send in local decimals.\n     * @param _minAmountLD The minimum amount to send in local decimals.\n     * @param _dstEid The destination chain ID.\n     * @return amountSentLD The amount sent in local decimals.\n     * @return amountReceivedLD The amount received in local decimals on the remote.\n     *\n     * @dev msg.sender will need to approve this _amountLD of tokens to be locked inside of the contract.\n     * @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n     * IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n     * a pre/post balance check will need to be done to calculate the amountReceivedLD.\n     */\n    function _debit(\n        address _from,\n        uint256 _amountLD,\n        uint256 _minAmountLD,\n        uint32 _dstEid\n    ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n        (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n        // @dev Lock tokens by moving them into this contract from the caller.\n        innerToken.safeTransferFrom(_from, address(this), amountSentLD);\n    }\n\n    /**\n     * @dev Credits tokens to the specified address.\n     * @param _to The address to credit the tokens to.\n     * @param _amountLD The amount of tokens to credit in local decimals.\n     * @dev _srcEid The source chain ID.\n     * @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n     *\n     * @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n     * IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n     * a pre/post balance check will need to be done to calculate the amountReceivedLD.\n     */\n    function _credit(\n        address _to,\n        uint256 _amountLD,\n        uint32 /*_srcEid*/\n    ) internal virtual override returns (uint256 amountReceivedLD) {\n        // @dev Unlock the tokens and transfer to the recipient.\n        innerToken.safeTransfer(_to, _amountLD);\n        // @dev In the case of NON-default OFTAdapter, the amountLD MIGHT not be == amountReceivedLD.\n        return _amountLD;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},{"file_path":"@layerzerolabs/oapp-evm-upgradeable/contracts/precrime/OAppPreCrimeSimulatorUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { IPreCrime } from \"@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IPreCrime.sol\";\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \"@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol\";\n\n/**\n * @title OAppPreCrimeSimulator\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\n */\nabstract contract OAppPreCrimeSimulatorUpgradeable is IOAppPreCrimeSimulator, OwnableUpgradeable {\n    struct OAppPreCrimeSimulatorStorage {\n        // The address of the preCrime implementation.\n        address preCrime;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oappprecrimesimulator\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OAPP_PRE_CRIME_SIMULATOR_STORAGE_LOCATION =\n        0xefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b600;\n\n    function _getOAppPreCrimeSimulatorStorage() internal pure returns (OAppPreCrimeSimulatorStorage storage $) {\n        assembly {\n            $.slot := OAPP_PRE_CRIME_SIMULATOR_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppPreCrimeSimulator_init() internal onlyInitializing {}\n\n    function __OAppPreCrimeSimulator_init_unchained() internal onlyInitializing {}\n\n    function preCrime() external view override returns (address) {\n        OAppPreCrimeSimulatorStorage storage $ = _getOAppPreCrimeSimulatorStorage();\n        return $.preCrime;\n    }\n\n    /**\n     * @dev Retrieves the address of the OApp contract.\n     * @return The address of the OApp contract.\n     *\n     * @dev The simulator contract is the base contract for the OApp by default.\n     * @dev If the simulator is a separate contract, override this function.\n     */\n    function oApp() external view virtual returns (address) {\n        return address(this);\n    }\n\n    /**\n     * @dev Sets the preCrime contract address.\n     * @param _preCrime The address of the preCrime contract.\n     */\n    function setPreCrime(address _preCrime) public virtual onlyOwner {\n        OAppPreCrimeSimulatorStorage storage $ = _getOAppPreCrimeSimulatorStorage();\n        $.preCrime = _preCrime;\n        emit PreCrimeSet(_preCrime);\n    }\n\n    /**\n     * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\n     * @param _packets An array of InboundPacket objects representing received packets to be delivered.\n     *\n     * @dev WARNING: MUST revert at the end with the simulation results.\n     * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\n     * WITHOUT actually executing them.\n     */\n    function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\n        for (uint256 i = 0; i < _packets.length; i++) {\n            InboundPacket calldata packet = _packets[i];\n\n            // Ignore packets that are not from trusted peers.\n            if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\n\n            // @dev Because a verifier is calling this function, it doesnt have access to executor params:\n            //  - address _executor\n            //  - bytes calldata _extraData\n            // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\n            // They are instead stubbed to default values, address(0) and bytes(\"\")\n            // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\n            // which would cause the revert to be ignored.\n            this.lzReceiveSimulate{ value: packet.value }(\n                packet.origin,\n                packet.guid,\n                packet.message,\n                packet.executor,\n                packet.extraData\n            );\n        }\n\n        // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\n        revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\n    }\n\n    /**\n     * @dev Is effectively an internal function because msg.sender must be address(this).\n     * Allows resetting the call stack for 'internal' calls.\n     * @param _origin The origin information containing the source endpoint and sender address.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address on the src chain.\n     *  - nonce: The nonce of the message.\n     * @param _guid The unique identifier of the packet.\n     * @param _message The message payload of the packet.\n     * @param _executor The executor address for the packet.\n     * @param _extraData Additional data for the packet.\n     */\n    function lzReceiveSimulate(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) external payable virtual {\n        // @dev Ensure ONLY can be called 'internally'.\n        if (msg.sender != address(this)) revert OnlySelf();\n        _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\n    }\n\n    /**\n     * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n     * @param _origin The origin information.\n     *  - srcEid: The source chain endpoint ID.\n     *  - sender: The sender address from the src chain.\n     *  - nonce: The nonce of the LayerZero message.\n     * @param _guid The GUID of the LayerZero message.\n     * @param _message The LayerZero message.\n     * @param _executor The address of the off-chain executor.\n     * @param _extraData Arbitrary data passed by the msg executor.\n     *\n     * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n     * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n     */\n    function _lzReceiveSimulate(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) internal virtual;\n\n    /**\n     * @dev checks if the specified peer is considered 'trusted' by the OApp.\n     * @param _eid The endpoint Id to check.\n     * @param _peer The peer to check.\n     * @return Whether the peer passed is considered 'trusted' by the OApp.\n     */\n    function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\n}\n"},{"file_path":"contracts/oft-evm-upgradeable-with-fee/FeeUpgradeable.sol","source_code":"// SPDX-LICENSE-IDENTIFIER: UNLICENSED\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nimport { FeeConfig, IFee } from \"@layerzerolabs/oft-evm/contracts/interfaces/IFee.sol\";\n\n/**\n * @title FeeUpgradeable\n * @notice Implements fee configuration and calculation.\n */\nabstract contract FeeUpgradeable is IFee, Initializable, OwnableUpgradeable {\n    uint16 public constant BPS_DENOMINATOR = 10_000;\n\n    struct FeeStorage {\n        uint16 defaultFeeBps;\n        mapping(uint32 => FeeConfig) feeBps;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.fee\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant FEE_STORAGE_LOCATION = 0x0cb173d183337e25fab6cb85705c15aad6a58cb1d552ed71b9bc628c8a3de800;\n\n    /**\n     * @dev The init function is intentionally left empty and does not initialize Ownable.\n     * This is to ensure that Ownable can be initialized in the child contract to accommodate\n     * potential different versions of Ownable that might be used.\n     */\n    function __FeeUpgradeable_init() internal onlyInitializing {}\n\n    function __FeeUpgradeable_init_unchained() internal onlyInitializing {}\n\n    function _getFeeStorage() internal pure returns (FeeStorage storage $) {\n        assembly {\n            $.slot := FEE_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @dev Sets the default fee basis points (BPS) for all destinations.\n     */\n    function setDefaultFeeBps(uint16 _feeBps) external onlyOwner {\n        if (_feeBps > BPS_DENOMINATOR) revert IFee.InvalidBps();\n        FeeStorage storage $ = _getFeeStorage();\n        $.defaultFeeBps = _feeBps;\n        emit DefaultFeeBpsSet(_feeBps);\n    }\n\n    /**\n     * @dev Sets the fee basis points (BPS) for a specific destination LayerZero EndpointV2 ID.\n     */\n    function setFeeBps(uint32 _dstEid, uint16 _feeBps, bool _enabled) external onlyOwner {\n        if (_feeBps > BPS_DENOMINATOR) revert IFee.InvalidBps();\n        FeeStorage storage $ = _getFeeStorage();\n        $.feeBps[_dstEid] = FeeConfig(_feeBps, _enabled);\n        emit FeeBpsSet(_dstEid, _feeBps, _enabled);\n    }\n\n    /**\n     * @dev Returns the fee for a specific destination LayerZero EndpointV2 ID.\n     */\n    function getFee(uint32 _dstEid, uint256 _amount) public view virtual returns (uint256) {\n        uint16 bps = _getFeeBps(_dstEid);\n        //  @note If amount * bps < BPS_DENOMINATOR, there is no fee\n        return bps == 0 ? 0 : (_amount * bps) / BPS_DENOMINATOR;\n    }\n\n    function _getFeeBps(uint32 _dstEid) internal view returns (uint16) {\n        FeeStorage storage $ = _getFeeStorage();\n        FeeConfig memory config = $.feeBps[_dstEid];\n        return config.enabled ? config.feeBps : $.defaultFeeBps;\n    }\n\n    /**\n     * @dev Returns the default fee.\n     */\n    function defaultFeeBps() public view virtual returns (uint16) {\n        FeeStorage storage $ = _getFeeStorage();\n        return $.defaultFeeBps;\n    }\n\n    /**\n     * @dev Returns the configured fee for a given eid.\n     */\n    function feeBps(uint32 _dstEid) public view virtual returns (FeeConfig memory) {\n        FeeStorage storage $ = _getFeeStorage();\n        FeeConfig memory config = $.feeBps[_dstEid];\n        return config;\n    }\n}"},{"file_path":"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport { OAppSenderUpgradeable, MessagingFee, MessagingReceipt } from \"./OAppSenderUpgradeable.sol\";\n// @dev Import the 'Origin' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport { OAppReceiverUpgradeable, Origin } from \"./OAppReceiverUpgradeable.sol\";\nimport { OAppCoreUpgradeable } from \"./OAppCoreUpgradeable.sol\";\n\n/**\n * @title OApp\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\n */\nabstract contract OAppUpgradeable is OAppSenderUpgradeable, OAppReceiverUpgradeable {\n    /**\n     * @dev Constructor to initialize the OApp with the provided endpoint and owner.\n     * @param _endpoint The address of the LOCAL LayerZero endpoint.\n     */\n    constructor(address _endpoint) OAppCoreUpgradeable(_endpoint) {}\n\n    /**\n     * @dev Initializes the OApp with the provided delegate.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OApp_init(address _delegate) internal onlyInitializing {\n        __OAppCore_init(_delegate);\n        __OAppReceiver_init_unchained();\n        __OAppSender_init_unchained();\n    }\n\n    function __OApp_init_unchained() internal onlyInitializing {}\n\n    /**\n     * @notice Retrieves the OApp version information.\n     * @return senderVersion The version of the OAppSender.sol implementation.\n     * @return receiverVersion The version of the OAppReceiver.sol implementation.\n     */\n    function oAppVersion()\n        public\n        pure\n        virtual\n        override(OAppSenderUpgradeable, OAppReceiverUpgradeable)\n        returns (uint64 senderVersion, uint64 receiverVersion)\n    {\n        return (SENDER_VERSION, RECEIVER_VERSION);\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"./ILayerZeroEndpointV2.sol\";\n\ninterface ILayerZeroReceiver {\n    function allowInitializePath(Origin calldata _origin) external view returns (bool);\n\n    function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\n\n    function lzReceive(\n        Origin calldata _origin,\n        bytes32 _guid,\n        bytes calldata _message,\n        address _executor,\n        bytes calldata _extraData\n    ) external payable;\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/OAppCore.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"./interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n */\nabstract contract OAppCore is IOAppCore, Ownable {\n    // The LayerZero endpoint associated with the given OApp\n    ILayerZeroEndpointV2 public immutable endpoint;\n\n    // Mapping to store peers associated with corresponding endpoints\n    mapping(uint32 eid => bytes32 peer) public peers;\n\n    /**\n     * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\n     * @param _endpoint The address of the LOCAL Layer Zero endpoint.\n     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n     *\n     * @dev The delegate typically should be set as the owner of the contract.\n     */\n    constructor(address _endpoint, address _delegate) {\n        endpoint = ILayerZeroEndpointV2(_endpoint);\n\n        if (_delegate == address(0)) revert InvalidDelegate();\n        endpoint.setDelegate(_delegate);\n    }\n\n    /**\n     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @param _peer The address of the peer to be associated with the corresponding endpoint.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n     * @dev Set this to bytes32(0) to remove the peer address.\n     * @dev Peer is a bytes32 to accommodate non-evm chains.\n     */\n    function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\n        _setPeer(_eid, _peer);\n    }\n\n    /**\n     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n     * @param _eid The endpoint ID.\n     * @param _peer The address of the peer to be associated with the corresponding endpoint.\n     *\n     * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n     * @dev Set this to bytes32(0) to remove the peer address.\n     * @dev Peer is a bytes32 to accommodate non-evm chains.\n     */\n    function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {\n        peers[_eid] = _peer;\n        emit PeerSet(_eid, _peer);\n    }\n\n    /**\n     * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\n     * ie. the peer is set to bytes32(0).\n     * @param _eid The endpoint ID.\n     * @return peer The address of the peer associated with the specified endpoint.\n     */\n    function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\n        bytes32 peer = peers[_eid];\n        if (peer == bytes32(0)) revert NoPeer(_eid);\n        return peer;\n    }\n\n    /**\n     * @notice Sets the delegate address for the OApp.\n     * @param _delegate The address of the delegate to be set.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\n     */\n    function setDelegate(address _delegate) public onlyOwner {\n        endpoint.setDelegate(_delegate);\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/precrime/libs/Packet.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\n\n/**\n * @title InboundPacket\n * @dev Structure representing an inbound packet received by the contract.\n */\nstruct InboundPacket {\n    Origin origin; // Origin information of the packet.\n    uint32 dstEid; // Destination endpointId of the packet.\n    address receiver; // Receiver address for the packet.\n    bytes32 guid; // Unique identifier of the packet.\n    uint256 value; // msg.value of the packet.\n    address executor; // Executor address for the packet.\n    bytes message; // Message payload of the packet.\n    bytes extraData; // Additional arbitrary data for the packet.\n}\n\n/**\n * @title PacketDecoder\n * @dev Library for decoding LayerZero packets.\n */\nlibrary PacketDecoder {\n    using PacketV1Codec for bytes;\n\n    /**\n     * @dev Decode an inbound packet from the given packet data.\n     * @param _packet The packet data to decode.\n     * @return packet An InboundPacket struct representing the decoded packet.\n     */\n    function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\n        packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\n        packet.dstEid = _packet.dstEid();\n        packet.receiver = _packet.receiverB20();\n        packet.guid = _packet.guid();\n        packet.message = _packet.message();\n    }\n\n    /**\n     * @dev Decode multiple inbound packets from the given packet data and associated message values.\n     * @param _packets An array of packet data to decode.\n     * @param _packetMsgValues An array of associated message values for each packet.\n     * @return packets An array of InboundPacket structs representing the decoded packets.\n     */\n    function decode(\n        bytes[] calldata _packets,\n        uint256[] memory _packetMsgValues\n    ) internal pure returns (InboundPacket[] memory packets) {\n        packets = new InboundPacket[](_packets.length);\n        for (uint256 i = 0; i < _packets.length; i++) {\n            bytes calldata packet = _packets[i];\n            packets[i] = PacketDecoder.decode(packet);\n            // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\n            packets[i].value = _packetMsgValues[i];\n        }\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { IOAppOptionsType3, EnforcedOptionParam } from \"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppOptionsType3.sol\";\n\n/**\n * @title OAppOptionsType3\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\n */\nabstract contract OAppOptionsType3Upgradeable is IOAppOptionsType3, OwnableUpgradeable {\n    struct OAppOptionsType3Storage {\n        // @dev The \"msgType\" should be defined in the child contract.\n        mapping(uint32 => mapping(uint16 => bytes)) enforcedOptions;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.oappoptionstype3\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OAPP_OPTIONS_TYPE_3_STORAGE_LOCATION =\n        0x8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea0000;\n\n    uint16 internal constant OPTION_TYPE_3 = 3;\n\n    function _getOAppOptionsType3Storage() internal pure returns (OAppOptionsType3Storage storage $) {\n        assembly {\n            $.slot := OAPP_OPTIONS_TYPE_3_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to\n     * accommodate the different version of Ownable.\n     */\n    function __OAppOptionsType3_init() internal onlyInitializing {}\n\n    function __OAppOptionsType3_init_unchained() internal onlyInitializing {}\n\n    function enforcedOptions(uint32 _eid, uint16 _msgType) public view returns (bytes memory) {\n        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();\n        return $.enforcedOptions[_eid][_msgType];\n    }\n\n    /**\n     * @dev Sets the enforced options for specific endpoint and message type combinations.\n     * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n     *\n     * @dev Only the owner/admin of the OApp can call this function.\n     * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n     * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n     * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n     * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n     */\n    function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\n        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();\n        for (uint256 i = 0; i < _enforcedOptions.length; i++) {\n            // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\n            _assertOptionsType3(_enforcedOptions[i].options);\n            $.enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\n        }\n\n        emit EnforcedOptionSet(_enforcedOptions);\n    }\n\n    /**\n     * @notice Combines options for a given endpoint and message type.\n     * @param _eid The endpoint ID.\n     * @param _msgType The OAPP message type.\n     * @param _extraOptions Additional options passed by the caller.\n     * @return options The combination of caller specified options AND enforced options.\n     *\n     * @dev If there is an enforced lzReceive option:\n     * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\n     * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\n     * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\n     */\n    function combineOptions(\n        uint32 _eid,\n        uint16 _msgType,\n        bytes calldata _extraOptions\n    ) public view virtual returns (bytes memory) {\n        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();\n        bytes memory enforced = $.enforcedOptions[_eid][_msgType];\n\n        // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\n        if (enforced.length == 0) return _extraOptions;\n\n        // No caller options, return enforced\n        if (_extraOptions.length == 0) return enforced;\n\n        // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\n        if (_extraOptions.length >= 2) {\n            _assertOptionsType3(_extraOptions);\n            // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\n            return bytes.concat(enforced, _extraOptions[2:]);\n        }\n\n        // No valid set of options was found.\n        revert InvalidOptions(_extraOptions);\n    }\n\n    /**\n     * @dev Internal function to assert that options are of type 3.\n     * @param _options The options to be checked.\n     */\n    function _assertOptionsType3(bytes calldata _options) internal pure virtual {\n        uint16 optionsType = uint16(bytes2(_options[0:2]));\n        if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.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":"@layerzerolabs/oft-evm/contracts/libs/OFTComposeMsgCodec.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTComposeMsgCodec {\n    // Offset constants for decoding composed messages\n    uint8 private constant NONCE_OFFSET = 8;\n    uint8 private constant SRC_EID_OFFSET = 12;\n    uint8 private constant AMOUNT_LD_OFFSET = 44;\n    uint8 private constant COMPOSE_FROM_OFFSET = 76;\n\n    /**\n     * @dev Encodes a OFT composed message.\n     * @param _nonce The nonce value.\n     * @param _srcEid The source endpoint ID.\n     * @param _amountLD The amount in local decimals.\n     * @param _composeMsg The composed message.\n     * @return _msg The encoded Composed message.\n     */\n    function encode(\n        uint64 _nonce,\n        uint32 _srcEid,\n        uint256 _amountLD,\n        bytes memory _composeMsg // 0x[composeFrom][composeMsg]\n    ) internal pure returns (bytes memory _msg) {\n        _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\n    }\n\n    /**\n     * @dev Retrieves the nonce for the composed message.\n     * @param _msg The message.\n     * @return The nonce value.\n     */\n    function nonce(bytes calldata _msg) internal pure returns (uint64) {\n        return uint64(bytes8(_msg[:NONCE_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the source endpoint ID for the composed message.\n     * @param _msg The message.\n     * @return The source endpoint ID.\n     */\n    function srcEid(bytes calldata _msg) internal pure returns (uint32) {\n        return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the amount in local decimals from the composed message.\n     * @param _msg The message.\n     * @return The amount in local decimals.\n     */\n    function amountLD(bytes calldata _msg) internal pure returns (uint256) {\n        return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\n    }\n\n    /**\n     * @dev Retrieves the composeFrom value from the composed message.\n     * @param _msg The message.\n     * @return The composeFrom value.\n     */\n    function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\n        return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\n    }\n\n    /**\n     * @dev Retrieves the composed message.\n     * @param _msg The message.\n     * @return The composed message.\n     */\n    function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n        return _msg[COMPOSE_FROM_OFFSET:];\n    }\n\n    /**\n     * @dev Converts an address to bytes32.\n     * @param _addr The address to convert.\n     * @return The bytes32 representation of the address.\n     */\n    function addressToBytes32(address _addr) internal pure returns (bytes32) {\n        return bytes32(uint256(uint160(_addr)));\n    }\n\n    /**\n     * @dev Converts bytes32 to an address.\n     * @param _b The bytes32 value to convert.\n     * @return The address representation of bytes32.\n     */\n    function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n        return address(uint160(uint256(_b)));\n    }\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppOptionsType3.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Struct representing enforced option parameters.\n */\nstruct EnforcedOptionParam {\n    uint32 eid; // Endpoint ID\n    uint16 msgType; // Message Type\n    bytes options; // Additional options\n}\n\n/**\n * @title IOAppOptionsType3\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\n */\ninterface IOAppOptionsType3 {\n    // Custom error message for invalid options\n    error InvalidOptions(bytes options);\n\n    // Event emitted when enforced options are set\n    event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\n\n    /**\n     * @notice Sets enforced options for specific endpoint and message type combinations.\n     * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n     */\n    function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\n\n    /**\n     * @notice Combines options for a given endpoint and message type.\n     * @param _eid The endpoint ID.\n     * @param _msgType The OApp message type.\n     * @param _extraOptions Additional options passed by the caller.\n     * @return options The combination of caller specified options AND enforced options.\n     */\n    function combineOptions(\n        uint32 _eid,\n        uint16 _msgType,\n        bytes calldata _extraOptions\n    ) external view returns (bytes memory options);\n}\n"},{"file_path":"@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IPreCrime.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\nstruct PreCrimePeer {\n    uint32 eid;\n    bytes32 preCrime;\n    bytes32 oApp;\n}\n\n// TODO not done yet\ninterface IPreCrime {\n    error OnlyOffChain();\n\n    // for simulate()\n    error PacketOversize(uint256 max, uint256 actual);\n    error PacketUnsorted();\n    error SimulationFailed(bytes reason);\n\n    // for preCrime()\n    error SimulationResultNotFound(uint32 eid);\n    error InvalidSimulationResult(uint32 eid, bytes reason);\n    error CrimeFound(bytes crime);\n\n    function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\n\n    function simulate(\n        bytes[] calldata _packets,\n        uint256[] calldata _packetMsgValues\n    ) external payable returns (bytes memory);\n\n    function buildSimulationResult() external view returns (bytes memory);\n\n    function preCrime(\n        bytes[] calldata _packets,\n        uint256[] calldata _packetMsgValues,\n        bytes[] calldata _simulations\n    ) external;\n\n    function version() external view returns (uint64 major, uint8 minor);\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"},{"file_path":"contracts/oft-evm-upgradeable-with-fee/RateLimiterUpgradeable.sol","source_code":"// SPDX-LICENSE-IDENTIFIER: MIT\npragma solidity ^0.8.20;\n\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @title RateLimiterUpgradeable\n * @dev Abstract contract for implementing rate limiting functionality. This contract provides a basic framework for\n * rate limiting how often a function can be executed. It is designed to be inherited by other contracts requiring rate\n * limiting capabilities to protect resources or services from excessive use.\n * @dev The ordering of transactions within a given block (timestamp) affects the consumed capacity.\n * @dev Carefully consider the minimum window duration for the given blockchain.  For example, on Ethereum, the minimum\n * window duration should be at least 12 seconds.  If a window less than 12 seconds is configured, then the rate limit\n * will effectively reset with each block, rendering rate limiting ineffective.\n * @dev Carefully consider the proportion of the limit to the window.  If the limit is much smaller than the window, the\n * decay function is lossy.  Consider using a limit that is greater than or equal to the window to avoid this.  This is\n * especially important for blockchains with short average block times.\n *\n * Example 1: Max rate limit reached at beginning of window. As time continues the amount of in flights comes down.\n *\n * Rate Limit Config:\n *   limit: 100 units\n *   window: 60 seconds\n *\n *                              Amount in Flight (units) vs. Time Graph (seconds)\n *\n *      100 | * - (Max limit reached at beginning of window)\n *          |   *\n *          |     *\n *          |       *\n *       50 |         * (After 30 seconds only 50 units in flight)\n *          |           *\n *          |             *\n *          |               *\n *       0  +--|---|---|---|---|-->(After 60 seconds 0 units are in flight)\n *             0  15  30  45  60 (seconds)\n *\n * Example 2: Max rate limit reached at beginning of window. As time continues the amount of in flights comes down\n * allowing for more to be sent. At the 90 second mark, more in flights come in.\n *\n * Rate Limit Config:\n *   limit: 100 units\n *   window: 60 seconds\n *\n *                              Amount in Flight (units) vs. Time Graph (seconds)\n *\n *      100 | * - (Max limit reached at beginning of window)\n *          |   *\n *          |     *\n *          |       *\n *       50 |         *          * (50 inflight)\n *          |           *          *\n *          |             *          *\n *          |               *          *\n *        0  +--|--|--|--|--|--|--|--|--|--> Time\n *              0 15 30 45 60 75 90 105 120  (seconds)\n *\n * Example 3: Max rate limit reached at beginning of window. At the 15 second mark, the window gets updated to 60\n * seconds and the limit gets updated to 50 units. This scenario shows the direct depiction of \"in flight\" from the\n * previous window affecting the current window.\n *\n * Initial Rate Limit Config: For first 15 seconds\n *   limit: 100 units\n *   window: 30 seconds\n *\n * Updated Rate Limit Config: Updated at 15 second mark\n *   limit: 50 units\n *   window: 60 seconds\n *\n *                              Amount in Flight (units) vs. Time Graph (seconds)\n *      100 - *\n *            |*\n *            | *\n *            |  *\n *            |   *\n *            |    *\n *            |     *\n *       75 - |      *\n *            |       *\n *            |        *\n *            |         *\n *            |          *\n *            |           *\n *            |            *\n *            |             *\n *       50 - |              𐫰 <--(Slope changes at the 15 second mark because of the update.\n *            |               ✧ *      Window extended to 60 seconds and limit reduced to 50 units.\n *            |                ✧ ︎   *      Because amountInFlight/lastUpdated do not reset, 50 units are\n *            |                 ✧       *      considered in flight from the previous window and the corresponding\n *            |                  ✧ ︎          *     decay from the previous rate.)\n *            |                   ✧              *\n *       25 - |                    ✧                 *\n *            |                     ✧                    *\n *            |                      ✧                        *\n *            |                       ✧                           *\n *            |                        ✧                              *\n *            |                         ✧                                  *\n *            |                          ✧                                     *\n *            |                           ✧                                        *\n *        0 - +---|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----> Time\n *            0   5    10   15   20   25   30   35   40   45   50   55   60   65   70   75   80   85   90 (seconds)\n *            [  Initial 30 Second Window  ]\n *                          [ --------------- Extended 60 Second Window --------------- ]\n */\nabstract contract RateLimiterUpgradeable is Initializable {\n\n    struct RateLimitStorage {\n        mapping(uint32 => RateLimit) rateLimits;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"layerzerov2.storage.ratelimiter\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant RATE_LIMIT_STORAGE_LOCATION = 0xfc4b3847e0649a09792d4c694ef28e20c43dde62a8b3de98eff85ccb4e1f3000;\n\n    function __RateLimiterUpgradeable_init() internal onlyInitializing {}\n\n    function __RateLimiterUpgradeable_init_unchained() internal onlyInitializing {}\n\n    function _getRateLimitStorage() internal pure returns (RateLimitStorage storage $) {\n        assembly {\n            $.slot := RATE_LIMIT_STORAGE_LOCATION\n        }\n    }\n\n    /**\n     * @notice Get the rate limit configuration for a specific destination endpoint id.\n     * @param _dstEid The destination endpoint id.\n     * @return rateLimit The rate limit configuration.\n     */\n    function rateLimits(uint32 _dstEid) public view returns (RateLimit memory) {\n        RateLimitStorage storage $ = _getRateLimitStorage();\n        return $.rateLimits[_dstEid];\n    }\n\n    /**\n     * @notice Rate Limit struct.\n     * @param amountInFlight The amount in the current window.\n     * @param lastUpdated Timestamp representing the last time the rate limit was checked or updated.\n     * @param limit This represents the maximum allowed amount within a given window.\n     * @param window Defines the duration of the rate limiting window.\n     */\n    struct RateLimit {\n        uint256 amountInFlight;\n        uint256 lastUpdated;\n        uint256 limit;\n        uint256 window;\n    }\n\n    /**\n     * @notice Rate Limit Configuration struct.\n     * @param dstEid The destination endpoint id.\n     * @param limit This represents the maximum allowed amount within a given window.\n     * @param window Defines the duration of the rate limiting window.\n     */\n    struct RateLimitConfig {\n        uint32 dstEid;\n        uint256 limit;\n        uint256 window;\n    }\n\n    /**\n     * @notice Emitted when _setRateLimits occurs.\n     * @param rateLimitConfigs An array of `RateLimitConfig` structs representing the rate limit configurations set.\n     * - `dstEid`: The destination endpoint id.\n     * - `limit`: This represents the maximum allowed amount within a given window.\n     * - `window`: Defines the duration of the rate limiting window.\n     */\n    event RateLimitsChanged(RateLimitConfig[] rateLimitConfigs);\n\n    /**\n     * @notice Error that is thrown when an amount exceeds the rate_limit.\n     */\n    error RateLimitExceeded();\n\n    /**\n     * @notice Get the current amount that can be sent to this destination endpoint id for the given rate limit window.\n     * @param _dstEid The destination endpoint id.\n     * @return currentAmountInFlight The current amount that was sent.\n     * @return amountCanBeSent The amount that can be sent.\n     */\n    function getAmountCanBeSent(\n        uint32 _dstEid\n    ) external view virtual returns (uint256 currentAmountInFlight, uint256 amountCanBeSent) {\n        RateLimitStorage storage $ = _getRateLimitStorage();\n        RateLimit memory rl = $.rateLimits[_dstEid];\n        return _amountCanBeSent(rl.amountInFlight, rl.lastUpdated, rl.limit, rl.window);\n    }\n\n    /**\n     * @notice Sets the Rate Limit.\n     * @param _rateLimitConfigs A `RateLimitConfig` struct representing the rate limit configuration.\n     * - `dstEid`: The destination endpoint id.\n     * - `limit`: This represents the maximum allowed amount within a given window.\n     * - `window`: Defines the duration of the rate limiting window.\n     */\n    function _setRateLimits(RateLimitConfig[] memory _rateLimitConfigs) internal virtual {\n        RateLimitStorage storage $ = _getRateLimitStorage();\n        unchecked {\n            for (uint256 i = 0; i < _rateLimitConfigs.length; i++) {\n                RateLimit storage rl = $.rateLimits[_rateLimitConfigs[i].dstEid];\n\n                // @dev Ensure we checkpoint the existing rate limit as to not retroactively apply the new decay rate.\n                _outflow(_rateLimitConfigs[i].dstEid, 0);\n\n                // @dev Does NOT reset the amountInFlight/lastUpdated of an existing rate limit.\n                rl.limit = _rateLimitConfigs[i].limit;\n                rl.window = _rateLimitConfigs[i].window;\n            }\n        }\n        emit RateLimitsChanged(_rateLimitConfigs);\n    }\n\n    /**\n     * @notice Checks current amount in flight and amount that can be sent for a given rate limit window.\n     * @param _amountInFlight The amount in the current window.\n     * @param _lastUpdated Timestamp representing the last time the rate limit was checked or updated.\n     * @param _limit This represents the maximum allowed amount within a given window.\n     * @param _window Defines the duration of the rate limiting window.\n     * @return currentAmountInFlight The amount in the current window.\n     * @return amountCanBeSent The amount that can be sent.\n     */\n    function _amountCanBeSent(\n        uint256 _amountInFlight,\n        uint256 _lastUpdated,\n        uint256 _limit,\n        uint256 _window\n    ) internal view virtual returns (uint256 currentAmountInFlight, uint256 amountCanBeSent) {\n        uint256 timeSinceLastDeposit = block.timestamp - _lastUpdated;\n        // @dev Presumes linear decay.\n        uint256 decay = (_limit * timeSinceLastDeposit) / (_window > 0 ? _window : 1); // prevent division by zero\n        currentAmountInFlight = _amountInFlight <= decay ? 0 : _amountInFlight - decay;\n        // @dev In the event the _limit is lowered, and the 'in-flight' amount is higher than the _limit, set to 0.\n        amountCanBeSent = _limit <= currentAmountInFlight ? 0 : _limit - currentAmountInFlight;\n    }\n\n    /**\n     * @notice Verifies whether the specified amount falls within the rate limit constraints for the targeted\n     * endpoint ID. On successful verification, it updates amountInFlight and lastUpdated. If the amount exceeds\n     * the rate limit, the operation reverts.\n     * @param _dstEid The destination endpoint id.\n     * @param _amount The amount to check for rate limit constraints.\n     */\n    function _outflow(uint32 _dstEid, uint256 _amount) internal virtual {\n        RateLimitStorage storage $ = _getRateLimitStorage();\n        // @dev By default dstEid that have not been explicitly set will return amountCanBeSent == 0.\n        RateLimit storage rl = $.rateLimits[_dstEid];\n\n        (uint256 currentAmountInFlight, uint256 amountCanBeSent) = _amountCanBeSent(\n            rl.amountInFlight,\n            rl.lastUpdated,\n            rl.limit,\n            rl.window\n        );\n        if (_amount > amountCanBeSent) revert RateLimitExceeded();\n\n        // @dev Update the storage to contain the new amount and current timestamp.\n        rl.amountInFlight = currentAmountInFlight + _amount;\n        rl.lastUpdated = block.timestamp;\n    }\n\n    /**\n     * @notice To be used when you want to calculate your rate limits as a function of net outbound AND inbound.\n     * ie. If you move 150 out, and 100 in, you effective inflight should be 50.\n     * Does not need to update decay values, as the inflow is effective immediately.\n     * @param _srcEid The source endpoint id.\n     * @param _amount The amount to inflow back and deduct from amountInFlight.\n     */\n    function _inflow(uint32 _srcEid, uint256 _amount) internal virtual {\n        RateLimitStorage storage $ = _getRateLimitStorage();\n        RateLimit storage rl = $.rateLimits[_srcEid];\n        rl.amountInFlight = _amount >= rl.amountInFlight ? 0 : rl.amountInFlight - _amount;\n    }\n}"},{"file_path":"@openzeppelin/contracts/access/Ownable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    constructor(address initialOwner) {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IMessageLibManager } from \"./IMessageLibManager.sol\";\nimport { IMessagingComposer } from \"./IMessagingComposer.sol\";\nimport { IMessagingChannel } from \"./IMessagingChannel.sol\";\nimport { IMessagingContext } from \"./IMessagingContext.sol\";\n\nstruct MessagingParams {\n    uint32 dstEid;\n    bytes32 receiver;\n    bytes message;\n    bytes options;\n    bool payInLzToken;\n}\n\nstruct MessagingReceipt {\n    bytes32 guid;\n    uint64 nonce;\n    MessagingFee fee;\n}\n\nstruct MessagingFee {\n    uint256 nativeFee;\n    uint256 lzTokenFee;\n}\n\nstruct Origin {\n    uint32 srcEid;\n    bytes32 sender;\n    uint64 nonce;\n}\n\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\n    event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\n\n    event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\n\n    event PacketDelivered(Origin origin, address receiver);\n\n    event LzReceiveAlert(\n        address indexed receiver,\n        address indexed executor,\n        Origin origin,\n        bytes32 guid,\n        uint256 gas,\n        uint256 value,\n        bytes message,\n        bytes extraData,\n        bytes reason\n    );\n\n    event LzTokenSet(address token);\n\n    event DelegateSet(address sender, address delegate);\n\n    function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\n\n    function send(\n        MessagingParams calldata _params,\n        address _refundAddress\n    ) external payable returns (MessagingReceipt memory);\n\n    function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\n\n    function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n    function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n    function lzReceive(\n        Origin calldata _origin,\n        address _receiver,\n        bytes32 _guid,\n        bytes calldata _message,\n        bytes calldata _extraData\n    ) external payable;\n\n    // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\n    function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\n\n    function setLzToken(address _lzToken) external;\n\n    function lzToken() external view returns (address);\n\n    function nativeToken() external view returns (address);\n\n    function setDelegate(address _delegate) external;\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Packet } from \"../../interfaces/ISendLib.sol\";\nimport { AddressCast } from \"../../libs/AddressCast.sol\";\n\nlibrary PacketV1Codec {\n    using AddressCast for address;\n    using AddressCast for bytes32;\n\n    uint8 internal constant PACKET_VERSION = 1;\n\n    // header (version + nonce + path)\n    // version\n    uint256 private constant PACKET_VERSION_OFFSET = 0;\n    //    nonce\n    uint256 private constant NONCE_OFFSET = 1;\n    //    path\n    uint256 private constant SRC_EID_OFFSET = 9;\n    uint256 private constant SENDER_OFFSET = 13;\n    uint256 private constant DST_EID_OFFSET = 45;\n    uint256 private constant RECEIVER_OFFSET = 49;\n    // payload (guid + message)\n    uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\n    uint256 private constant MESSAGE_OFFSET = 113;\n\n    function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\n        encodedPacket = abi.encodePacked(\n            PACKET_VERSION,\n            _packet.nonce,\n            _packet.srcEid,\n            _packet.sender.toBytes32(),\n            _packet.dstEid,\n            _packet.receiver,\n            _packet.guid,\n            _packet.message\n        );\n    }\n\n    function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\n        return\n            abi.encodePacked(\n                PACKET_VERSION,\n                _packet.nonce,\n                _packet.srcEid,\n                _packet.sender.toBytes32(),\n                _packet.dstEid,\n                _packet.receiver\n            );\n    }\n\n    function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\n        return abi.encodePacked(_packet.guid, _packet.message);\n    }\n\n    function header(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return _packet[0:GUID_OFFSET];\n    }\n\n    function version(bytes calldata _packet) internal pure returns (uint8) {\n        return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\n    }\n\n    function nonce(bytes calldata _packet) internal pure returns (uint64) {\n        return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\n    }\n\n    function srcEid(bytes calldata _packet) internal pure returns (uint32) {\n        return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\n    }\n\n    function sender(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\n    }\n\n    function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\n        return sender(_packet).toAddress();\n    }\n\n    function dstEid(bytes calldata _packet) internal pure returns (uint32) {\n        return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\n    }\n\n    function receiver(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\n    }\n\n    function receiverB20(bytes calldata _packet) internal pure returns (address) {\n        return receiver(_packet).toAddress();\n    }\n\n    function guid(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\n    }\n\n    function message(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return bytes(_packet[MESSAGE_OFFSET:]);\n    }\n\n    function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return bytes(_packet[GUID_OFFSET:]);\n    }\n\n    function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\n        return keccak256(payload(_packet));\n    }\n}\n"},{"file_path":"@openzeppelin/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":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingChannel {\n    event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\n    event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n    event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n\n    function eid() external view returns (uint32);\n\n    // this is an emergency function if a message cannot be verified for some reasons\n    // required to provide _nextNonce to avoid race condition\n    function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\n\n    function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n    function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n    function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\n\n    function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n\n    function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\n\n    function inboundPayloadHash(\n        address _receiver,\n        uint32 _srcEid,\n        bytes32 _sender,\n        uint64 _nonce\n    ) external view returns (bytes32);\n\n    function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n}\n"},{"file_path":"@layerzerolabs/oft-evm/contracts/interfaces/IFee.sol","source_code":"// SPDX-LICENSE-IDENTIFIER: MIT\n\npragma solidity ^0.8.0;\n\nstruct FeeConfig {\n    uint16 feeBps;\n    bool enabled;\n}\n\n/**\n * @title Fee interface.\n * @notice A generic interface for collecting fees.\n */\ninterface IFee {\n    // errors\n    error InvalidBps();\n    error InvalidFeeOwner();\n\n    // events\n    event FeeBpsSet(uint32 dstEid, uint16 feeBps, bool enabled);\n    event DefaultFeeBpsSet(uint16 feeBps);\n\n    // setters\n    /**\n     * @dev Sets the default fee basis points (BPS) for all destinations.\n     */\n    function setDefaultFeeBps(uint16 _feeBps) external;\n\n    /**\n     * @dev Sets the fee basis points (BPS) for a specific destination LayerZero EndpointV2 ID.\n     */\n    function setFeeBps(uint32 _dstEid, uint16 _feeBps, bool _enabled) external;\n}\n"},{"file_path":"@openzeppelin/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.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"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_lzEndpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidBps","type":"error"},{"inputs":[],"name":"InvalidDelegate","type":"error"},{"inputs":[],"name":"InvalidEndpointCall","type":"error"},{"inputs":[],"name":"InvalidFeeOwner","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidLocalDecimals","type":"error"},{"inputs":[{"internalType":"bytes","name":"options","type":"bytes"}],"name":"InvalidOptions","type":"error"},{"inputs":[],"name":"LzTokenUnavailable","type":"error"},{"inputs":[],"name":"NoFeesToWithdraw","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"NoPeer","type":"error"},{"inputs":[{"internalType":"uint256","name":"msgValue","type":"uint256"}],"name":"NotEnoughNative","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"OnlyEndpoint","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"}],"name":"OnlyPeer","type":"error"},{"inputs":[],"name":"OnlySelf","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"RateLimitExceeded","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"name":"SimulationResult","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"}],"name":"SlippageExceeded","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"feeBps","type":"uint16"}],"name":"DefaultFeeBpsSet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"indexed":false,"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"EnforcedOptionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"dstEid","type":"uint32"},{"indexed":false,"internalType":"uint16","name":"feeBps","type":"uint16"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"FeeBpsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountLD","type":"uint256"}],"name":"FeeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"inspector","type":"address"}],"name":"MsgInspectorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"dstEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"peer","type":"bytes32"}],"name":"PeerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"preCrimeAddress","type":"address"}],"name":"PreCrimeSet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"window","type":"uint256"}],"indexed":false,"internalType":"struct RateLimiterUpgradeable.RateLimitConfig[]","name":"rateLimitConfigs","type":"tuple[]"}],"name":"RateLimitsChanged","type":"event"},{"inputs":[],"name":"BPS_DENOMINATOR","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND_AND_CALL","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":[],"name":"approvalRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint16","name":"_msgType","type":"uint16"},{"internalType":"bytes","name":"_extraOptions","type":"bytes"}],"name":"combineOptions","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimalConversionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultFeeBps","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpointV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint16","name":"_msgType","type":"uint16"}],"name":"enforcedOptions","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstEid","type":"uint32"}],"name":"feeBps","outputs":[{"components":[{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"bool","name":"enabled","type":"bool"}],"internalType":"struct FeeConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstEid","type":"uint32"}],"name":"getAmountCanBeSent","outputs":[{"internalType":"uint256","name":"currentAmountInFlight","type":"uint256"},{"internalType":"uint256","name":"amountCanBeSent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstEid","type":"uint32"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"","type":"tuple"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"address","name":"_sender","type":"address"}],"name":"isComposeMsgSender","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"isPeer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"origin","type":"tuple"},{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"executor","type":"address"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct InboundPacket[]","name":"_packets","type":"tuple[]"}],"name":"lzReceiveAndRevert","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceiveSimulate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"msgInspector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nextNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oApp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oAppVersion","outputs":[{"internalType":"uint64","name":"senderVersion","type":"uint64"},{"internalType":"uint64","name":"receiverVersion","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"oftVersion","outputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"},{"internalType":"uint64","name":"version","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"}],"name":"peers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preCrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"}],"name":"quoteOFT","outputs":[{"components":[{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"uint256","name":"maxAmountLD","type":"uint256"}],"internalType":"struct OFTLimit","name":"oftLimit","type":"tuple"},{"components":[{"internalType":"int256","name":"feeAmountLD","type":"int256"},{"internalType":"string","name":"description","type":"string"}],"internalType":"struct OFTFeeDetail[]","name":"oftFeeDetails","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"internalType":"bool","name":"_payInLzToken","type":"bool"}],"name":"quoteSend","outputs":[{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"msgFee","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstEid","type":"uint32"}],"name":"rateLimits","outputs":[{"components":[{"internalType":"uint256","name":"amountInFlight","type":"uint256"},{"internalType":"uint256","name":"lastUpdated","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"window","type":"uint256"}],"internalType":"struct RateLimiterUpgradeable.RateLimit","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"_fee","type":"tuple"},{"internalType":"address","name":"_refundAddress","type":"address"}],"name":"send","outputs":[{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"msgReceipt","type":"tuple"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_feeBps","type":"uint16"}],"name":"setDefaultFeeBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"setEnforcedOptions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstEid","type":"uint32"},{"internalType":"uint16","name":"_feeBps","type":"uint16"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setFeeBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_msgInspector","type":"address"}],"name":"setMsgInspector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"setPeer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_preCrime","type":"address"}],"name":"setPreCrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"window","type":"uint256"}],"internalType":"struct RateLimiterUpgradeable.RateLimitConfig[]","name":"_rateLimitConfigs","type":"tuple[]"}],"name":"setRateLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":"000000000000000000000000f9fb20b8e097904f0ab7d12e9dbee88f2dcd0f160000000000000000000000001a44076050125825900e736c501f859c50fe728c"}