Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0x328a268b191ef593B72498a9e8a481C086EB21be
Balance 0 ETH
Nonce 1
Code Size 19880 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

19880 bytes
0x6080604052600436106103d3575f3560e01c8063857749b0116101ff578063bccb468711610113578063df2a5b3b116100a8578063eaffd49a11610078578063eaffd49a14610bef578063eb8d72b714610c0e578063f2fde38b14610c2d578063f5ecbdbc14610c4c578063fc0c546a14610c6b575f80fd5b8063df2a5b3b14610b6f578063df47e37314610b8e578063e0bf7fd114610bad578063e6a20ae614610bdb575f80fd5b8063cbed8b9c116100e3578063cbed8b9c14610b09578063cc1776d314610b28578063d1deba1f14610b3d578063dd62ed3e14610b50575f80fd5b8063bccb468714610aa1578063c024666814610ab6578063c18bc19514610ad5578063c446183414610af4575f80fd5b8063a457c2d711610194578063a9059cbb11610164578063a9059cbb146109f2578063b256f7b714610a11578063b353aaa714610a30578063b70143c914610a63578063baf3292d14610a82575f80fd5b8063a457c2d714610976578063a4c51df514610995578063a6c3d165146109b4578063a6fb5dfd146109d3575f80fd5b8063950c8a74116101cf578063950c8a74146108d457806395d89b41146108f35780639bdb9812146109075780639f38369a14610957575f80fd5b8063857749b01461083b5780638cfd8f5c1461086e5780638da5cb5b146108a45780639358928b146108c0575f80fd5b80633d5369f6116102f657806353371be01161028b578063695ef6bf1161025b578063695ef6bf146107ae57806370a08231146107c1578063715018a6146107f55780637533d7881461080957806376203b4814610828575f80fd5b806353371be0146107025780635b8c41e6146107235780636256d1811461077057806366ad5c8a1461078f575f80fd5b806344770515116102c6578063447705151461069457806349bd5a5e146106a75780634c42899a146106da5780634f7041a5146106ed575f80fd5b80633d5369f61461060c5780633d8b38f61461062b5780633f1f4fa41461064a57806342d65a8d14610675575f80fd5b806318160ddd1161036c578063302757441161033c5780633027574414610579578063313ce56714610598578063365260b4146105b957806339509351146105ed575f80fd5b806318160ddd146104dd57806323b872dd146104fb5780632dc0562d1461051a5780632e5bb6ff1461055a575f80fd5b8063095ea7b3116103a7578063095ea7b31461046c5780630df374831461048b5780630f15f4c0146104aa57806310ddb137146104be575f80fd5b80621d3567146103d757806301ffc9a7146103f857806306fdde031461042c57806307e0db171461044d575b5f80fd5b3480156103e2575f80fd5b506103f66103f1366004613dc6565b610c7d565b005b348015610403575f80fd5b50610417610412366004613e53565b610ea8565b60405190151581526020015b60405180910390f35b348015610437575f80fd5b50610440610ede565b6040516104239190613ec7565b348015610458575f80fd5b506103f6610467366004613ed9565b610f6e565b348015610477575f80fd5b50610417610486366004613f06565b610ff2565b348015610496575f80fd5b506103f66104a5366004613f30565b611009565b3480156104b5575f80fd5b506103f6611027565b3480156104c9575f80fd5b506103f66104d8366004613ed9565b61109a565b3480156104e8575f80fd5b506009545b604051908152602001610423565b348015610506575f80fd5b50610417610515366004613f4a565b6110f2565b348015610525575f80fd5b50601454610542906501000000000090046001600160a01b031681565b6040516001600160a01b039091168152602001610423565b348015610565575f80fd5b506103f6610574366004613f88565b611115565b348015610584575f80fd5b506103f6610593366004613fae565b6111b4565b3480156105a3575f80fd5b5060125b60405160ff9091168152602001610423565b3480156105c4575f80fd5b506105d86105d3366004613fc7565b6111d6565b60408051928352602083019190915201610423565b3480156105f8575f80fd5b50610417610607366004613f06565b611229565b348015610617575f80fd5b506103f6610626366004613f88565b61124a565b348015610636575f80fd5b50610417610645366004614027565b61129b565b348015610655575f80fd5b506104ed610664366004613ed9565b60036020525f908152604090205481565b348015610680575f80fd5b506103f661068f366004614027565b611364565b34801561069f575f80fd5b506104ed5f81565b3480156106b2575f80fd5b506105427f0000000000000000000000008343cbfe85c3cadf76c76d15b87e18e89435fe4e81565b3480156106e5575f80fd5b506105a75f81565b3480156106f8575f80fd5b506104ed600d5481565b34801561070d575f80fd5b5060145461041790640100000000900460ff1681565b34801561072e575f80fd5b506104ed61073d3660046140df565b600560209081525f9384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561077b575f80fd5b506103f661078a366004613f88565b6113e5565b34801561079a575f80fd5b506103f66107a9366004613dc6565b6113f2565b6103f66107bc36600461418e565b6114cc565b3480156107cc575f80fd5b506104ed6107db3660046141fc565b6001600160a01b03165f9081526007602052604090205490565b348015610800575f80fd5b506103f6611536565b348015610814575f80fd5b50610440610823366004613ed9565b611549565b6103f6610836366004614217565b6115e0565b348015610846575f80fd5b506105a77f000000000000000000000000000000000000000000000000000000000000000881565b348015610879575f80fd5b506104ed6108883660046142c2565b600260209081525f928352604080842090915290825290205481565b3480156108af575f80fd5b505f546001600160a01b0316610542565b3480156108cb575f80fd5b506104ed61168d565b3480156108df575f80fd5b50600454610542906001600160a01b031681565b3480156108fe575f80fd5b5061044061169c565b348015610912575f80fd5b506104176109213660046140df565b600660209081525f9384526040808520845180860184018051928152908401958401959095209452929052825290205460ff1681565b348015610962575f80fd5b50610440610971366004613ed9565b6116ab565b348015610981575f80fd5b50610417610990366004613f06565b6117bc565b3480156109a0575f80fd5b506105d86109af3660046142f3565b611836565b3480156109bf575f80fd5b506103f66109ce366004614027565b6118c2565b3480156109de575f80fd5b506103f66109ed3660046141fc565b61194a565b3480156109fd575f80fd5b50610417610a0c366004613f06565b611982565b348015610a1c575f80fd5b506103f6610a2b366004613fae565b61198f565b348015610a3b575f80fd5b506105427f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67581565b348015610a6e575f80fd5b506103f6610a7d366004613f88565b6119b3565b348015610a8d575f80fd5b506103f6610a9c3660046141fc565b6119c4565b348015610aac575f80fd5b506104ed60125481565b348015610ac1575f80fd5b506103f6610ad03660046143a4565b611a20565b348015610ae0575f80fd5b506103f6610aef366004613f88565b611a52565b348015610aff575f80fd5b506104ed61271081565b348015610b14575f80fd5b506103f6610b233660046143ce565b611a5f565b348015610b33575f80fd5b506104ed600e5481565b6103f6610b4b366004613dc6565b611ae4565b348015610b5b575f80fd5b506104ed610b6a366004614437565b611cf4565b348015610b7a575f80fd5b506103f6610b8936600461446e565b611d1e565b348015610b99575f80fd5b506103f6610ba83660046144a7565b611d87565b348015610bb8575f80fd5b50610417610bc73660046141fc565b60156020525f908152604090205460ff1681565b348015610be6575f80fd5b506105a7600181565b348015610bfa575f80fd5b506103f6610c093660046144c7565b611e02565b348015610c19575f80fd5b506103f6610c28366004614027565b611f1c565b348015610c38575f80fd5b506103f6610c473660046141fc565b611f75565b348015610c57575f80fd5b50610440610c66366004614587565b611feb565b348015610c76575f80fd5b5030610542565b337f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b031614610cfa5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff86165f9081526001602052604081208054610d17906145d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610d43906145d1565b8015610d8e5780601f10610d6557610100808354040283529160200191610d8e565b820191905f5260205f20905b815481529060010190602001808311610d7157829003601f168201915b50505050509050805186869050148015610da857505f8151115b8015610dd0575080516020820120604051610dc69088908890614603565b6040518091039020145b610e2b5760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610cf1565b610e9f8787878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284375f9201919091525061209892505050565b50505050505050565b5f6001600160e01b03198216631f7ecdf760e01b1480610ed857506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600a8054610eed906145d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610f19906145d1565b8015610f645780601f10610f3b57610100808354040283529160200191610f64565b820191905f5260205f20905b815481529060010190602001808311610f4757829003601f168201915b5050505050905090565b610f76612110565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316906307e0db17906024015b5f604051808303815f87803b158015610fd9575f80fd5b505af1158015610feb573d5f803e3d5ffd5b5050505050565b5f33610fff818585612169565b5060019392505050565b611011612110565b61ffff9091165f90815260036020526040902055565b61102f612110565b601454640100000000900460ff161561107f5760405162461bcd60e51b8152602060048201526012602482015271151c98591a5b99c81b9bdd081c185d5cd95960721b6044820152606401610cf1565b601480544360115564ff000000ff1916640100000001179055565b6110a2612110565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b0316906310ddb13790602401610fc2565b5f336110ff85828561228c565b61110a858585612304565b506001949350505050565b806011540361112b576032600d819055600e5550565b80601154600161113b9190614626565b1061114d576023600d819055600e5550565b80601154600561115d9190614626565b1061116f576019600d819055600e5550565b80601154600b61117f9190614626565b1061119157600f600d819055600e5550565b8060115460186111a19190614626565b106111b157600a600d819055600e555b50565b6111bc612110565b601480549115156101000261ff0019909216919091179055565b5f8061121a8888888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061270492505050565b91509150965096945050505050565b5f33610fff81858561123b8383611cf4565b6112459190614626565b612169565b611252612110565b5f81116112965760405162461bcd60e51b815260206004820152601260248201527143616e6e6f742073657420746f207a65726f60701b6044820152606401610cf1565b600f55565b61ffff83165f90815260016020526040812080548291906112bb906145d1565b80601f01602080910402602001604051908101604052809291908181526020018280546112e7906145d1565b80156113325780601f1061130957610100808354040283529160200191611332565b820191905f5260205f20905b81548152906001019060200180831161131557829003601f168201915b505050505090508383604051611349929190614603565b60405180910390208180519060200120149150509392505050565b61136c612110565b6040516342d65a8d60e01b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906342d65a8d906113bc90869086908690600401614661565b5f604051808303815f87803b1580156113d3575f80fd5b505af1158015610e9f573d5f803e3d5ffd5b6113ed612110565b600c55565b3330146114505760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610cf1565b6114c48686868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050604080516020601f8901819004810282018101909252878152899350915087908790819084018382808284375f920191909152506127f392505050565b505050505050565b6114c4858585856114e060208701876141fc565b6114f060408801602089016141fc565b6114fd604089018961467e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061287892505050565b61153e612110565b6115475f61295d565b565b60016020525f908152604090208054611561906145d1565b80601f016020809104026020016040519081016040528092919081815260200182805461158d906145d1565b80156115d85780601f106115af576101008083540402835291602001916115d8565b820191905f5260205f20905b8154815290600101906020018083116115bb57829003601f168201915b505050505081565b6116828888888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152508a925061162c91505060208901896141fc565b61163c60408a0160208b016141fc565b61164960408b018b61467e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506129ac92505050565b505050505050505050565b5f61169760095490565b905090565b6060600b8054610eed906145d1565b61ffff81165f908152600160205260408120805460609291906116cd906145d1565b80601f01602080910402602001604051908101604052809291908181526020018280546116f9906145d1565b80156117445780601f1061171b57610100808354040283529160200191611744565b820191905f5260205f20905b81548152906001019060200180831161172757829003601f168201915b5050505050905080515f0361179b5760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f72640000006044820152606401610cf1565b6117b55f601483516117ad91906146c0565b839190612aa5565b9392505050565b5f33816117c98286611cf4565b9050838110156118295760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610cf1565b61110a8286868403612169565b5f806118b08b8b8b8b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050604080516020601f8d018190048102820181019092528b81528e93508d9250908c908c90819084018382808284375f92019190915250612bb192505050565b91509150995099975050505050505050565b6118ca612110565b8181306040516020016118df939291906146d3565b60408051601f1981840301815291815261ffff85165f90815260016020522090611909908261473d565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce83838360405161193d93929190614661565b60405180910390a1505050565b611952612110565b601480546001600160a01b03909216650100000000000265010000000000600160c81b0319909216919091179055565b5f33610fff818585612304565b611997612110565b60148054911515620100000262ff000019909216919091179055565b6119bb612110565b6111b181612c68565b6119cc612110565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b9060200160405180910390a150565b611a28612110565b6001600160a01b03919091165f908152601560205260409020805460ff1916911515919091179055565b611a5a612110565b601055565b611a67612110565b6040516332fb62e760e21b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063cbed8b9c90611abb90889088908890889088906004016147f8565b5f604051808303815f87803b158015611ad2575f80fd5b505af1158015611682573d5f803e3d5ffd5b61ffff86165f908152600560205260408082209051611b069088908890614603565b90815260408051602092819003830190206001600160401b0387165f9081529252902054905080611b855760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610cf1565b808383604051611b96929190614603565b604051809103902014611bf55760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610cf1565b61ffff87165f908152600560205260408082209051611c179089908990614603565b90815260408051602092819003830181206001600160401b0389165f90815290845282902093909355601f88018290048202830182019052868252611cac91899189908990819084018382808284375f9201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284375f920191909152506127f392505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611ce3959493929190614830565b60405180910390a150505050505050565b6001600160a01b039182165f90815260086020908152604080832093909416825291909152205490565b611d26612110565b61ffff8381165f8181526002602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac09060600161193d565b611d8f612110565b600a8211158015611da15750600a8111155b611ded5760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f74207365742074617865732061626f7665203130000000000000006044820152606401610cf1565b600d91909155600e556014805460ff19169055565b333014611e515760405162461bcd60e51b815260206004820152601f60248201527f4f4654436f72653a2063616c6c6572206d757374206265204f4654436f7265006044820152606401610cf1565b611e5c308686612e4e565b9350846001600160a01b03168a61ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf86604051611e9e91815260200190565b60405180910390a3604051633fe79aed60e11b81526001600160a01b03861690637fcf35da908390611ee2908e908e908e908e908e908d908d908d9060040161486a565b5f604051808303815f88803b158015611ef9575f80fd5b5087f1158015611f0b573d5f803e3d5ffd5b505050505050505050505050505050565b611f24612110565b61ffff83165f908152600160205260409020611f418284836148c4565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab83838360405161193d93929190614661565b611f7d612110565b6001600160a01b038116611fe25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cf1565b6111b18161295d565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b03169063f5ecbdbc906084015f60405180830381865afa158015612068573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261208f919081019061497d565b95945050505050565b5f806120fa5a60966366ad5c8a60e01b898989896040516024016120bf94939291906149e5565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190612e9f565b91509150816114c4576114c48686868685612f23565b5f546001600160a01b031633146115475760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cf1565b6001600160a01b0383166121cb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610cf1565b6001600160a01b03821661222c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610cf1565b6001600160a01b038381165f8181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b5f6122978484611cf4565b90505f1981146122fe57818110156122f15760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610cf1565b6122fe8484848403612169565b50505050565b5f81116123625760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e73666572206d75737420626520677265617465722060448201526507468616e20360d41b6064820152608401610cf1565b601454640100000000900460ff166123e0575f546001600160a01b038481169116148061239b57505f546001600160a01b038381169116145b6123e05760405162461bcd60e51b8152602060048201526016602482015275151c98591a5b99c81b9bdd081858dd1a5d99481e595d60521b6044820152606401610cf1565b6014545f9060ff16156123f6576123f643611115565b7f0000000000000000000000008343cbfe85c3cadf76c76d15b87e18e89435fe4e6001600160a01b0316846001600160a01b031614801561244f57506001600160a01b0383165f9081526015602052604090205460ff16155b1561254c5760105482612476856001600160a01b03165f9081526007602052604090205490565b6124809190614626565b11156124c55760405162461bcd60e51b815260206004820152601460248201527313585e0815d85b1b195d08125b881159999958dd60621b6044820152606401610cf1565b600c5482111561250a5760405162461bcd60e51b815260206004820152601060248201526f13585e08151e081a5b881959999958dd60821b6044820152606401610cf1565b601454610100900460ff1615612537576064600d548361252a9190614a22565b6125349190614a4d565b90505b60128054905f61254683614a60565b91905055505b7f0000000000000000000000008343cbfe85c3cadf76c76d15b87e18e89435fe4e6001600160a01b0316836001600160a01b03161480156125a557506001600160a01b0384165f9081526015602052604090205460ff16155b1561261c57600c548211156125ef5760405162461bcd60e51b815260206004820152601060248201526f13585e08151e081a5b881959999958dd60821b6044820152606401610cf1565b601454610100900460ff161561261c576064600e548361260f9190614a22565b6126199190614a4d565b90505b305f90815260076020526040902054600f548110801590819061264957506014546301000000900460ff16155b801561268757507f0000000000000000000000008343cbfe85c3cadf76c76d15b87e18e89435fe4e6001600160a01b0316866001600160a01b031614155b80156126ab57506001600160a01b0386165f9081526015602052604090205460ff16155b80156126ba5750601354601254115b156126ca576126ca600f54612c68565b82156126f9575f6126db84866146c0565b90506126e8873086612fbd565b6126f3878783612fbd565b506114c4565b6114c4868686612fbd565b5f805f61274f8761271488613166565b604080515f6020820152602181019390935260c09190911b6001600160c01b0319166041830152805160298184030181526049909201905290565b60405163040a7bb160e41b81529091506001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906340a7bb10906127a6908b90309086908b908b90600401614a78565b6040805180830381865afa1580156127c0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127e49190614acb565b92509250509550959350505050565b5f6127fe82826131eb565b905060ff81166128195761281485858585613246565b610feb565b5f1960ff82160161283057612814858585856132d4565b60405162461bcd60e51b815260206004820152601c60248201527f4f4654436f72653a20756e6b6e6f776e207061636b65742074797065000000006044820152606401610cf1565b5f612885878284816134d7565b61288e856135aa565b50905061289d888888846135e9565b90505f81116128ea5760405162461bcd60e51b815260206004820152601960248201527813d19510dbdc994e88185b5bdd5b9d081d1bdbc81cdb585b1b603a1b6044820152606401610cf1565b5f6128f88761271484613166565b905061290888828787873461361a565b86896001600160a01b03168961ffff167fd81fc9b8523134ed613870ed029d6170cbb73aa6a6bc311b9a642689fb9df59a8560405161294991815260200190565b60405180910390a450979650505050505050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f6129c3896001846001600160401b0389166134d7565b6129cc876135aa565b5090506129db8a8a8a846135e9565b90505f8111612a285760405162461bcd60e51b815260206004820152601960248201527813d19510dbdc994e88185b5bdd5b9d081d1bdbc81cdb585b1b603a1b6044820152606401610cf1565b5f612a3e338a612a3785613166565b8a8a6137b7565b9050612a4e8a828787873461361a565b888b6001600160a01b03168b61ffff167fd81fc9b8523134ed613870ed029d6170cbb73aa6a6bc311b9a642689fb9df59a85604051612a8f91815260200190565b60405180910390a4509998505050505050505050565b606081612ab381601f614626565b1015612af25760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610cf1565b612afc8284614626565b84511015612b405760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610cf1565b606082158015612b5e5760405191505f825260208201604052612ba8565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612b97578051835260209283019201612b7f565b5050858452601f01601f1916604052505b50949350505050565b5f805f612bc2338a612a378b613166565b60405163040a7bb160e41b81529091506001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906340a7bb1090612c19908d90309086908b908b90600401614a78565b6040805180830381865afa158015612c33573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c579190614acb565b925092505097509795505050505050565b6014805463ff000000191663010000001790556040805160028082526060820183525f9260208301908036833701905050905030815f81518110612cae57612cae614aed565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d4e9190614b01565b81600181518110612d6157612d61614aed565b60200260200101906001600160a01b031690816001600160a01b031681525050612dac307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612169565b60145460405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81169263791ac94792612e109287925f92889265010000000000909204909116904290600401614b1c565b5f604051808303815f87803b158015612e27575f80fd5b505af1158015612e39573d5f803e3d5ffd5b50506014805463ff0000001916905550505050565b5f33306001600160a01b03861614801590612e7b5750806001600160a01b0316856001600160a01b031614155b15612e8b57612e8b85828561228c565b612e96858585612304565b50909392505050565b5f60605f805f8661ffff166001600160401b03811115612ec157612ec1614075565b6040519080825280601f01601f191660200182016040528015612eeb576020820181803683370190505b5090505f808751602089015f8d8df191503d925086831115612f0b578692505b828152825f602083013e909890975095505050505050565b818051906020012060055f8761ffff1661ffff1681526020019081526020015f2085604051612f529190614b8d565b9081526040805191829003602090810183206001600160401b0388165f908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c90612fae9087908790879087908790614ba8565b60405180910390a15050505050565b6001600160a01b0383166130215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610cf1565b6001600160a01b0382166130835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610cf1565b6001600160a01b0383165f90815260076020526040902054818110156130fa5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610cf1565b6001600160a01b038085165f8181526007602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906131599086815260200190565b60405180910390a36122fe565b5f806131927f00000000000000000000000000000000000000000000000000000002540be40084614a4d565b90506001600160401b03811115610ed85760405162461bcd60e51b815260206004820152601a60248201527f4f4654436f72653a20616d6f756e745344206f766572666c6f770000000000006044820152606401610cf1565b5f6131f7826001614626565b8351101561323d5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401610cf1565b50016001015190565b5f80613251836137fd565b90925090506001600160a01b03821661326a5761dead91505b5f61327482613881565b90506132818784836138b5565b9050826001600160a01b03168761ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf836040516132c391815260200190565b60405180910390a350505050505050565b5f805f805f6132e2866138c7565b945094509450945094505f60065f8b61ffff1661ffff1681526020019081526020015f20896040516133149190614b8d565b90815260408051602092819003830190206001600160401b038b165f908152925281205460ff16915061334685613881565b9050816133b2576133588b30836138b5565b61ffff8c165f9081526006602052604090819020905191925060019161337f908d90614b8d565b90815260408051602092819003830190206001600160401b038d165f90815292529020805460ff19169115159190911790555b6001600160a01b0386163b613409576040516001600160a01b03871681527f9aedf5fdba8716db3b6705ca00150643309995d4f818a249ed6dde6677e7792d9060200160405180910390a1505050505050506122fe565b8a8a8a8a8a8a868a5f8a613426578b6001600160401b0316613428565b5a5b90505f806134595a609663eaffd49a60e01b8e8e8e8d8d8d8d8d6040516024016120bf989796959493929190614bf9565b9150915081156134b2578751602089012060405161ffff8d16907fb8890edbfc1c74692f527444645f95489c3703cc2df42e4a366f5d06fa6cd884906134a4908e908e908690614c6c565b60405180910390a2506134bf565b6134bf8b8b8b8b85612f23565b50505050505050505050505050505050505050505050565b5f6134e18361397d565b61ffff8087165f90815260026020908152604080832093891683529290522054909150806135515760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610cf1565b61355b8382614626565b8210156114c45760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610cf1565b5f806135d67f00000000000000000000000000000000000000000000000000000002540be40084614c99565b90506135e281846146c0565b9150915091565b5f336001600160a01b03861681146136065761360686828561228c565b61361086846139d8565b5090949350505050565b61ffff86165f9081526001602052604081208054613637906145d1565b80601f0160208091040260200160405190810160405280929190818152602001828054613663906145d1565b80156136ae5780601f10613685576101008083540402835291602001916136ae565b820191905f5260205f20905b81548152906001019060200180831161369157829003601f168201915b5050505050905080515f0361371e5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b6064820152608401610cf1565b613729878751613b0a565b60405162c5803160e81b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063c5803100908490613780908b9086908c908c908c908c90600401614cac565b5f604051808303818588803b158015613797575f80fd5b505af11580156137a9573d5f803e3d5ffd5b505050505050505050505050565b6060600185856001600160a01b03891685876040516020016137de96959493929190614d12565b604051602081830303815290604052905095945050505050565b505050565b5f808061380a84826131eb565b60ff1614801561381b575082516029145b6138625760405162461bcd60e51b815260206004820152601860248201527713d19510dbdc994e881a5b9d985b1a59081c185e5b1bd85960421b6044820152606401610cf1565b61386d83600d613b7a565b915061387a836021613bde565b9050915091565b5f610ed87f00000000000000000000000000000000000000000000000000000002540be4006001600160401b038416614a22565b5f6138c08383613c3a565b5092915050565b5f808060608160016138d987836131eb565b60ff16146139245760405162461bcd60e51b815260206004820152601860248201527713d19510dbdc994e881a5b9d985b1a59081c185e5b1bd85960421b6044820152606401610cf1565b61392f86600d613b7a565b935061393c866021613bde565b9250613949866029613cf9565b9450613956866049613bde565b9050613972605180885161396a91906146c0565b889190612aa5565b915091939590929450565b5f6022825110156139d05760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d73000000006044820152606401610cf1565b506022015190565b6001600160a01b038216613a385760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610cf1565b6001600160a01b0382165f9081526007602052604090205481811015613aab5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610cf1565b6001600160a01b0383165f8181526007602090815260408083208686039055600980548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b61ffff82165f9081526003602052604081205490819003613b2a57506127105b808211156137f85760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c617267656044820152606401610cf1565b5f613b86826014614626565b83511015613bce5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610cf1565b500160200151600160601b900490565b5f613bea826008614626565b83511015613c315760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b6044820152606401610cf1565b50016008015190565b6001600160a01b038216613c905760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610cf1565b8060095f828254613ca19190614626565b90915550506001600160a01b0382165f818152600760209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b5f613d05826020614626565b83511015613d4d5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401610cf1565b50016020015190565b803561ffff81168114613d67575f80fd5b919050565b5f8083601f840112613d7c575f80fd5b5081356001600160401b03811115613d92575f80fd5b602083019150836020828501011115613da9575f80fd5b9250929050565b80356001600160401b0381168114613d67575f80fd5b5f805f805f8060808789031215613ddb575f80fd5b613de487613d56565b955060208701356001600160401b0380821115613dff575f80fd5b613e0b8a838b01613d6c565b9097509550859150613e1f60408a01613db0565b94506060890135915080821115613e34575f80fd5b50613e4189828a01613d6c565b979a9699509497509295939492505050565b5f60208284031215613e63575f80fd5b81356001600160e01b0319811681146117b5575f80fd5b5f5b83811015613e94578181015183820152602001613e7c565b50505f910152565b5f8151808452613eb3816020860160208601613e7a565b601f01601f19169290920160200192915050565b602081525f6117b56020830184613e9c565b5f60208284031215613ee9575f80fd5b6117b582613d56565b6001600160a01b03811681146111b1575f80fd5b5f8060408385031215613f17575f80fd5b8235613f2281613ef2565b946020939093013593505050565b5f8060408385031215613f41575f80fd5b613f2283613d56565b5f805f60608486031215613f5c575f80fd5b8335613f6781613ef2565b92506020840135613f7781613ef2565b929592945050506040919091013590565b5f60208284031215613f98575f80fd5b5035919050565b80358015158114613d67575f80fd5b5f60208284031215613fbe575f80fd5b6117b582613f9f565b5f805f805f8060a08789031215613fdc575f80fd5b613fe587613d56565b9550602087013594506040870135935061400160608801613f9f565b925060808701356001600160401b0381111561401b575f80fd5b613e4189828a01613d6c565b5f805f60408486031215614039575f80fd5b61404284613d56565b925060208401356001600160401b0381111561405c575f80fd5b61406886828701613d6c565b9497909650939450505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156140b1576140b1614075565b604052919050565b5f6001600160401b038211156140d1576140d1614075565b50601f01601f191660200190565b5f805f606084860312156140f1575f80fd5b6140fa84613d56565b925060208401356001600160401b03811115614114575f80fd5b8401601f81018613614124575f80fd5b8035614137614132826140b9565b614089565b81815287602083850101111561414b575f80fd5b816020840160208301375f6020838301015280945050505061416f60408501613db0565b90509250925092565b5f60608284031215614188575f80fd5b50919050565b5f805f805f60a086880312156141a2575f80fd5b85356141ad81613ef2565b94506141bb60208701613d56565b9350604086013592506060860135915060808601356001600160401b038111156141e3575f80fd5b6141ef88828901614178565b9150509295509295909350565b5f6020828403121561420c575f80fd5b81356117b581613ef2565b5f805f805f805f8060e0898b03121561422e575f80fd5b883561423981613ef2565b975061424760208a01613d56565b9650604089013595506060890135945060808901356001600160401b0380821115614270575f80fd5b61427c8c838d01613d6c565b909650945084915061429060a08c01613db0565b935060c08b01359150808211156142a5575f80fd5b506142b28b828c01614178565b9150509295985092959890939650565b5f80604083850312156142d3575f80fd5b6142dc83613d56565b91506142ea60208401613d56565b90509250929050565b5f805f805f805f805f60e08a8c03121561430b575f80fd5b6143148a613d56565b985060208a0135975060408a0135965060608a01356001600160401b038082111561433d575f80fd5b6143498d838e01613d6c565b909850965086915061435d60808d01613db0565b955061436b60a08d01613f9f565b945060c08c0135915080821115614380575f80fd5b5061438d8c828d01613d6c565b915080935050809150509295985092959850929598565b5f80604083850312156143b5575f80fd5b82356143c081613ef2565b91506142ea60208401613f9f565b5f805f805f608086880312156143e2575f80fd5b6143eb86613d56565b94506143f960208701613d56565b93506040860135925060608601356001600160401b0381111561441a575f80fd5b61442688828901613d6c565b969995985093965092949392505050565b5f8060408385031215614448575f80fd5b823561445381613ef2565b9150602083013561446381613ef2565b809150509250929050565b5f805f60608486031215614480575f80fd5b61448984613d56565b925061449760208501613d56565b9150604084013590509250925092565b5f80604083850312156144b8575f80fd5b50508035926020909101359150565b5f805f805f805f805f806101008b8d0312156144e1575f80fd5b6144ea8b613d56565b995060208b01356001600160401b0380821115614505575f80fd5b6145118e838f01613d6c565b909b50995089915061452560408e01613db0565b985060608d0135975060808d0135915061453e82613ef2565b90955060a08c0135945060c08c0135908082111561455a575f80fd5b506145678d828e01613d6c565b9150809450508092505060e08b013590509295989b9194979a5092959850565b5f805f806080858703121561459a575f80fd5b6145a385613d56565b93506145b160208601613d56565b925060408501356145c181613ef2565b9396929550929360600135925050565b600181811c908216806145e557607f821691505b60208210810361418857634e487b7160e01b5f52602260045260245ffd5b818382375f9101908152919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610ed857610ed8614612565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b61ffff84168152604060208201525f61208f604083018486614639565b5f808335601e19843603018112614693575f80fd5b8301803591506001600160401b038211156146ac575f80fd5b602001915036819003821315613da9575f80fd5b81810381811115610ed857610ed8614612565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b601f8211156137f857805f5260205f20601f840160051c8101602085101561471e5750805b601f840160051c820191505b81811015610feb575f815560010161472a565b81516001600160401b0381111561475657614756614075565b61476a8161476484546145d1565b846146f9565b602080601f83116001811461479d575f84156147865750858301515b5f19600386901b1c1916600185901b1785556114c4565b5f85815260208120601f198616915b828110156147cb578886015182559484019460019091019084016147ac565b50858210156147e857878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f61ffff808816835280871660208401525084604083015260806060830152614825608083018486614639565b979650505050505050565b61ffff86168152608060208201525f61484d608083018688614639565b6001600160401b0394909416604083015250606001529392505050565b61ffff8916815260c060208201525f61488760c08301898b614639565b6001600160401b038816604084015286606084015285608084015282810360a08401526148b5818587614639565b9b9a5050505050505050505050565b6001600160401b038311156148db576148db614075565b6148ef836148e983546145d1565b836146f9565b5f601f841160018114614920575f85156149095750838201355b5f19600387901b1c1916600186901b178355610feb565b5f83815260208120601f198716915b8281101561494f578685013582556020948501946001909201910161492f565b508682101561496b575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f6020828403121561498d575f80fd5b81516001600160401b038111156149a2575f80fd5b8201601f810184136149b2575f80fd5b80516149c0614132826140b9565b8181528560208385010111156149d4575f80fd5b61208f826020830160208601613e7a565b61ffff85168152608060208201525f614a016080830186613e9c565b6001600160401b038516604084015282810360608401526148258185613e9c565b8082028115828204841417610ed857610ed8614612565b634e487b7160e01b5f52601260045260245ffd5b5f82614a5b57614a5b614a39565b500490565b5f60018201614a7157614a71614612565b5060010190565b61ffff861681526001600160a01b038516602082015260a0604082018190525f90614aa590830186613e9c565b84151560608401528281036080840152614abf8185613e9c565b98975050505050505050565b5f8060408385031215614adc575f80fd5b505080516020909101519092909150565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215614b11575f80fd5b81516117b581613ef2565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b81811015614b6c5784516001600160a01b031683529383019391830191600101614b47565b50506001600160a01b03969096166060850152505050608001529392505050565b5f8251614b9e818460208701613e7a565b9190910192915050565b61ffff8616815260a060208201525f614bc460a0830187613e9c565b6001600160401b03861660408401528281036060840152614be58186613e9c565b90508281036080840152614abf8185613e9c565b5f61010061ffff8b168352806020840152614c168184018b613e9c565b6001600160401b038a166040850152606084018990526001600160a01b038816608085015260a0840187905283810360c08501529050614c568186613e9c565b9150508260e08301529998505050505050505050565b606081525f614c7e6060830186613e9c565b6001600160401b039490941660208301525060400152919050565b5f82614ca757614ca7614a39565b500690565b61ffff8716815260c060208201525f614cc860c0830188613e9c565b8281036040840152614cda8188613e9c565b6001600160a01b0387811660608601528616608085015283810360a08501529050614d058185613e9c565b9998505050505050505050565b60ff60f81b8760f81b1681528560018201525f6001600160401b0360c01b808760c01b166021840152856029840152808560c01b166049840152508251614d60816051850160208701613e7a565b9190910160510197965050505050505056fea2646970667358221220e53ab7693f14237317e29f8462de245d91c629598bfc3f8569822bd3a59786e764736f6c63430008160033

Verified Source Code Partial Match

Compiler: v0.8.22+commit.4fc1097e EVM: shanghai Optimization: Yes (200 runs)
MetaZero.sol 2822 lines
// File: contracts/LayerZero/token/oft/v2/interfaces/IOFTReceiverV2.sol



pragma solidity >=0.5.0;

interface IOFTReceiverV2 {
    /**
     * @dev Called by the OFT contract when tokens are received from source chain.
     * @param _srcChainId The chain id of the source chain.
     * @param _srcAddress The address of the OFT token contract on the source chain.
     * @param _nonce The nonce of the transaction on the source chain.
     * @param _from The address of the account who calls the sendAndCall() on the source chain.
     * @param _amount The amount of tokens to transfer.
     * @param _payload Additional data with no specified format.
     */
    function onOFTReceived(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes32 _from, uint _amount, bytes calldata _payload) external;
}

// File: @openzeppelin/contracts/utils/introspection/IERC165.sol


// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol


// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;


/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// File: contracts/LayerZero/token/oft/v2/interfaces/ICommonOFT.sol



pragma solidity >=0.5.0;


/**
 * @dev Interface of the IOFT core standard
 */
interface ICommonOFT is IERC165 {

    struct LzCallParams {
        address payable refundAddress;
        address zroPaymentAddress;
        bytes adapterParams;
    }

    /**
     * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)
     * _dstChainId - L0 defined chain id to send tokens too
     * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain
     * _amount - amount of the tokens to transfer
     * _useZro - indicates to use zro to pay L0 fees
     * _adapterParam - flexible bytes array to indicate messaging adapter services in L0
     */
    function estimateSendFee(uint16 _dstChainId, bytes32 _toAddress, uint _amount, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee);

    function estimateSendAndCallFee(uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes calldata _payload, uint64 _dstGasForCall, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee);

    /**
     * @dev returns the circulating amount of tokens on current chain
     */
    function circulatingSupply() external view returns (uint);

    /**
     * @dev returns the address of the ERC20 token
     */
    function token() external view returns (address);
}

// File: contracts/LayerZero/token/oft/v2/interfaces/IOFTV2.sol



pragma solidity >=0.5.0;


/**
 * @dev Interface of the IOFT core standard
 */
interface IOFTV2 is ICommonOFT {

    /**
     * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`
     * `_from` the owner of token
     * `_dstChainId` the destination chain identifier
     * `_toAddress` can be any size depending on the `dstChainId`.
     * `_amount` the quantity of tokens in wei
     * `_refundAddress` the address LayerZero refunds if too much message fee is sent
     * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)
     * `_adapterParams` is a flexible bytes array to indicate messaging adapter services
     */
    function sendFrom(address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, LzCallParams calldata _callParams) external payable;

    function sendAndCall(address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes calldata _payload, uint64 _dstGasForCall, LzCallParams calldata _callParams) external payable;
}

// File: contracts/LayerZero/libraries/ExcessivelySafeCall.sol


pragma solidity >=0.7.6;

library ExcessivelySafeCall {
    uint constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

    /// @notice Use when you _really_ really _really_ don't trust the called
    /// contract. This prevents the called contract from causing reversion of
    /// the caller in as many ways as we can.
    /// @dev The main difference between this and a solidity low-level call is
    /// that we limit the number of bytes that the callee can cause to be
    /// copied to caller memory. This prevents stupid things like malicious
    /// contracts returning 10,000,000 bytes causing a local OOG when copying
    /// to memory.
    /// @param _target The address to call
    /// @param _gas The amount of gas to forward to the remote contract
    /// @param _maxCopy The maximum number of bytes of returndata to copy
    /// to memory.
    /// @param _calldata The data to send to the remote contract
    /// @return success and returndata, as `.call()`. Returndata is capped to
    /// `_maxCopy` bytes.
    function excessivelySafeCall(
        address _target,
        uint _gas,
        uint16 _maxCopy,
        bytes memory _calldata
    ) internal returns (bool, bytes memory) {
        // set up for assembly call
        uint _toCopy;
        bool _success;
        bytes memory _returnData = new bytes(_maxCopy);
        // dispatch message to recipient
        // by assembly calling "handle" function
        // we call via assembly to avoid memcopying a very large returndata
        // returned by a malicious contract
        assembly {
            _success := call(
                _gas, // gas
                _target, // recipient
                0, // ether value
                add(_calldata, 0x20), // inloc
                mload(_calldata), // inlen
                0, // outloc
                0 // outlen
            )
            // limit our copy to 256 bytes
            _toCopy := returndatasize()
            if gt(_toCopy, _maxCopy) {
                _toCopy := _maxCopy
            }
            // Store the length of the copied bytes
            mstore(_returnData, _toCopy)
            // copy the bytes from returndata[0:_toCopy]
            returndatacopy(add(_returnData, 0x20), 0, _toCopy)
        }
        return (_success, _returnData);
    }

    /// @notice Use when you _really_ really _really_ don't trust the called
    /// contract. This prevents the called contract from causing reversion of
    /// the caller in as many ways as we can.
    /// @dev The main difference between this and a solidity low-level call is
    /// that we limit the number of bytes that the callee can cause to be
    /// copied to caller memory. This prevents stupid things like malicious
    /// contracts returning 10,000,000 bytes causing a local OOG when copying
    /// to memory.
    /// @param _target The address to call
    /// @param _gas The amount of gas to forward to the remote contract
    /// @param _maxCopy The maximum number of bytes of returndata to copy
    /// to memory.
    /// @param _calldata The data to send to the remote contract
    /// @return success and returndata, as `.call()`. Returndata is capped to
    /// `_maxCopy` bytes.
    function excessivelySafeStaticCall(
        address _target,
        uint _gas,
        uint16 _maxCopy,
        bytes memory _calldata
    ) internal view returns (bool, bytes memory) {
        // set up for assembly call
        uint _toCopy;
        bool _success;
        bytes memory _returnData = new bytes(_maxCopy);
        // dispatch message to recipient
        // by assembly calling "handle" function
        // we call via assembly to avoid memcopying a very large returndata
        // returned by a malicious contract
        assembly {
            _success := staticcall(
                _gas, // gas
                _target, // recipient
                add(_calldata, 0x20), // inloc
                mload(_calldata), // inlen
                0, // outloc
                0 // outlen
            )
            // limit our copy to 256 bytes
            _toCopy := returndatasize()
            if gt(_toCopy, _maxCopy) {
                _toCopy := _maxCopy
            }
            // Store the length of the copied bytes
            mstore(_returnData, _toCopy)
            // copy the bytes from returndata[0:_toCopy]
            returndatacopy(add(_returnData, 0x20), 0, _toCopy)
        }
        return (_success, _returnData);
    }

    /**
     * @notice Swaps function selectors in encoded contract calls
     * @dev Allows reuse of encoded calldata for functions with identical
     * argument types but different names. It simply swaps out the first 4 bytes
     * for the new selector. This function modifies memory in place, and should
     * only be used with caution.
     * @param _newSelector The new 4-byte selector
     * @param _buf The encoded contract args
     */
    function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {
        require(_buf.length >= 4);
        uint _mask = LOW_28_MASK;
        assembly {
            // load the first word of
            let _word := mload(add(_buf, 0x20))
            // mask out the top 4 bytes
            // /x
            _word := and(_word, _mask)
            _word := or(_newSelector, _word)
            mstore(add(_buf, 0x20), _word)
        }
    }
}

// File: contracts/LayerZero/libraries/BytesLib.sol


/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <[email protected]>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
 */
pragma solidity >=0.8.0 <0.9.0;

library BytesLib {
    function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(
                0x40,
                and(
                    add(add(end, iszero(add(length, mload(_preBytes)))), 31),
                    not(31) // Round down to the nearest 32 bytes.
                )
            )
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes.slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00), and(mload(mc), mask)))

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint _start,
        uint _length
    ) internal pure returns (bytes memory) {
        require(_length + 31 >= _length, "slice_overflow");
        require(_bytes.length >= _start + _length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
        require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1, "toUint8_outOfBounds");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(bytes memory _bytes, uint _start) internal pure returns (uint) {
        require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
        uint tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                    // the next line is the loop condition:
                    // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint256(mc < end) + cb == 2)
                        for {

                        } eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

// File: contracts/LayerZero/lzApp/interfaces/ILayerZeroUserApplicationConfig.sol



pragma solidity >=0.5.0;

interface ILayerZeroUserApplicationConfig {
    // @notice set the configuration of the LayerZero messaging library of the specified version
    // @param _version - messaging library version
    // @param _chainId - the chainId for the pending config change
    // @param _configType - type of configuration. every messaging library has its own convention.
    // @param _config - configuration in the bytes. can encode arbitrary content.
    function setConfig(
        uint16 _version,
        uint16 _chainId,
        uint _configType,
        bytes calldata _config
    ) external;

    // @notice set the send() LayerZero messaging library version to _version
    // @param _version - new messaging library version
    function setSendVersion(uint16 _version) external;

    // @notice set the lzReceive() LayerZero messaging library version to _version
    // @param _version - new messaging library version
    function setReceiveVersion(uint16 _version) external;

    // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload
    // @param _srcChainId - the chainId of the source chain
    // @param _srcAddress - the contract address of the source contract at the source chain
    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;
}

// File: contracts/LayerZero/lzApp/interfaces/ILayerZeroEndpoint.sol



pragma solidity >=0.5.0;


interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {
    // @notice send a LayerZero message to the specified address at a LayerZero endpoint.
    // @param _dstChainId - the destination chain identifier
    // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains
    // @param _payload - a custom bytes payload to send to the destination contract
    // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address
    // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction
    // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination
    function send(
        uint16 _dstChainId,
        bytes calldata _destination,
        bytes calldata _payload,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) external payable;

    // @notice used by the messaging library to publish verified payload
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source contract (as bytes) at the source chain
    // @param _dstAddress - the address on destination chain
    // @param _nonce - the unbound message ordering nonce
    // @param _gasLimit - the gas limit for external contract execution
    // @param _payload - verified payload to send to the destination contract
    function receivePayload(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        address _dstAddress,
        uint64 _nonce,
        uint _gasLimit,
        bytes calldata _payload
    ) external;

    // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);

    // @notice get the outboundNonce from this source chain which, consequently, is always an EVM
    // @param _srcAddress - the source chain contract address
    function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);

    // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery
    // @param _dstChainId - the destination chain identifier
    // @param _userApplication - the user app address on this EVM chain
    // @param _payload - the custom message to send over LayerZero
    // @param _payInZRO - if false, user app pays the protocol fee in native token
    // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain
    function estimateFees(
        uint16 _dstChainId,
        address _userApplication,
        bytes calldata _payload,
        bool _payInZRO,
        bytes calldata _adapterParam
    ) external view returns (uint nativeFee, uint zroFee);

    // @notice get this Endpoint's immutable source identifier
    function getChainId() external view returns (uint16);

    // @notice the interface to retry failed message on this Endpoint destination
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    // @param _payload - the payload to be retried
    function retryPayload(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        bytes calldata _payload
    ) external;

    // @notice query if any STORED payload (message blocking) at the endpoint.
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);

    // @notice query if the _libraryAddress is valid for sending msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getSendLibraryAddress(address _userApplication) external view returns (address);

    // @notice query if the _libraryAddress is valid for receiving msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getReceiveLibraryAddress(address _userApplication) external view returns (address);

    // @notice query if the non-reentrancy guard for send() is on
    // @return true if the guard is on. false otherwise
    function isSendingPayload() external view returns (bool);

    // @notice query if the non-reentrancy guard for receive() is on
    // @return true if the guard is on. false otherwise
    function isReceivingPayload() external view returns (bool);

    // @notice get the configuration of the LayerZero messaging library of the specified version
    // @param _version - messaging library version
    // @param _chainId - the chainId for the pending config change
    // @param _userApplication - the contract address of the user application
    // @param _configType - type of configuration. every messaging library has its own convention.
    function getConfig(
        uint16 _version,
        uint16 _chainId,
        address _userApplication,
        uint _configType
    ) external view returns (bytes memory);

    // @notice get the send() LayerZero messaging library version
    // @param _userApplication - the contract address of the user application
    function getSendVersion(address _userApplication) external view returns (uint16);

    // @notice get the lzReceive() LayerZero messaging library version
    // @param _userApplication - the contract address of the user application
    function getReceiveVersion(address _userApplication) external view returns (uint16);
}

// File: contracts/LayerZero/lzApp/interfaces/ILayerZeroReceiver.sol



pragma solidity >=0.5.0;

interface ILayerZeroReceiver {
    // @notice LayerZero endpoint will invoke this function to deliver the message on the destination
    // @param _srcChainId - the source endpoint identifier
    // @param _srcAddress - the source sending contract address from the source chain
    // @param _nonce - the ordered message nonce
    // @param _payload - the signed payload is the UA bytes has encoded to be sent
    function lzReceive(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) external;
}

// File: @openzeppelin/contracts/utils/Context.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// File: @openzeppelin/contracts/access/Ownable.sol


// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File: contracts/LayerZero/lzApp/LzApp.sol



pragma solidity ^0.8.0;






/*
 * a generic LzReceiver implementation
 */
abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig {
    using BytesLib for bytes;

    // ua can not send payload larger than this by default, but it can be changed by the ua owner
    uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;

    ILayerZeroEndpoint public immutable lzEndpoint;
    mapping(uint16 => bytes) public trustedRemoteLookup;
    mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;
    mapping(uint16 => uint) public payloadSizeLimitLookup;
    address public precrime;

    event SetPrecrime(address precrime);
    event SetTrustedRemote(uint16 _remoteChainId, bytes _path);
    event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);
    event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);

    constructor(address _endpoint) {
        lzEndpoint = ILayerZeroEndpoint(_endpoint);
    }

    function lzReceive(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) public virtual override {
        // lzReceive must be called by the endpoint for security
        require(_msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller");

        bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];
        // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.
        require(
            _srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote),
            "LzApp: invalid source sending contract"
        );

        _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
    }

    // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging
    function _blockingLzReceive(
        uint16 _srcChainId,
        bytes memory _srcAddress,
        uint64 _nonce,
        bytes memory _payload
    ) internal virtual;

    function _lzSend(
        uint16 _dstChainId,
        bytes memory _payload,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes memory _adapterParams,
        uint _nativeFee
    ) internal virtual {
        bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];
        require(trustedRemote.length != 0, "LzApp: destination chain is not a trusted source");
        _checkPayloadSize(_dstChainId, _payload.length);
        lzEndpoint.send{value: _nativeFee}(_dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams);
    }

    function _checkGasLimit(
        uint16 _dstChainId,
        uint16 _type,
        bytes memory _adapterParams,
        uint _extraGas
    ) internal view virtual {
        uint providedGasLimit = _getGasLimit(_adapterParams);
        uint minGasLimit = minDstGasLookup[_dstChainId][_type];
        require(minGasLimit > 0, "LzApp: minGasLimit not set");
        require(providedGasLimit >= minGasLimit + _extraGas, "LzApp: gas limit is too low");
    }

    function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {
        require(_adapterParams.length >= 34, "LzApp: invalid adapterParams");
        assembly {
            gasLimit := mload(add(_adapterParams, 34))
        }
    }

    function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {
        uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];
        if (payloadSizeLimit == 0) {
            // use default if not set
            payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;
        }
        require(_payloadSize <= payloadSizeLimit, "LzApp: payload size is too large");
    }

    //---------------------------UserApplication config----------------------------------------
    function getConfig(
        uint16 _version,
        uint16 _chainId,
        address,
        uint _configType
    ) external view returns (bytes memory) {
        return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);
    }

    // generic config for LayerZero user Application
    function setConfig(
        uint16 _version,
        uint16 _chainId,
        uint _configType,
        bytes calldata _config
    ) external override onlyOwner {
        lzEndpoint.setConfig(_version, _chainId, _configType, _config);
    }

    function setSendVersion(uint16 _version) external override onlyOwner {
        lzEndpoint.setSendVersion(_version);
    }

    function setReceiveVersion(uint16 _version) external override onlyOwner {
        lzEndpoint.setReceiveVersion(_version);
    }

    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {
        lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);
    }

    // _path = abi.encodePacked(remoteAddress, localAddress)
    // this function set the trusted path for the cross-chain communication
    function setTrustedRemote(uint16 _remoteChainId, bytes calldata _path) external onlyOwner {
        trustedRemoteLookup[_remoteChainId] = _path;
        emit SetTrustedRemote(_remoteChainId, _path);
    }

    function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {
        trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));
        emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);
    }

    function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {
        bytes memory path = trustedRemoteLookup[_remoteChainId];
        require(path.length != 0, "LzApp: no trusted path record");
        return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)
    }

    function setPrecrime(address _precrime) external onlyOwner {
        precrime = _precrime;
        emit SetPrecrime(_precrime);
    }

    function setMinDstGas(
        uint16 _dstChainId,
        uint16 _packetType,
        uint _minGas
    ) external onlyOwner {
        minDstGasLookup[_dstChainId][_packetType] = _minGas;
        emit SetMinDstGas(_dstChainId, _packetType, _minGas);
    }

    // if the size is 0, it means default size limit
    function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {
        payloadSizeLimitLookup[_dstChainId] = _size;
    }

    //--------------------------- VIEW FUNCTION ----------------------------------------
    function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {
        bytes memory trustedSource = trustedRemoteLookup[_srcChainId];
        return keccak256(trustedSource) == keccak256(_srcAddress);
    }
}

// File: contracts/LayerZero/lzApp/NonblockingLzApp.sol



pragma solidity ^0.8.0;



/*
 * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel
 * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking
 * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)
 */
abstract contract NonblockingLzApp is LzApp {
    using ExcessivelySafeCall for address;

    constructor(address _endpoint) LzApp(_endpoint) {}
...

// [truncated — 101208 bytes total]

Read Contract

DEFAULT_PAYLOAD_SIZE_LIMIT 0xc4461834 → uint256
NO_EXTRA_GAS 0x44770515 → uint256
PT_SEND 0x4c42899a → uint8
PT_SEND_AND_CALL 0xe6a20ae6 → uint8
_isExcludedFromFees 0xe0bf7fd1 → bool
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyTax 0x4f7041a5 → uint256
buys 0xbccb4687 → uint256
circulatingSupply 0x9358928b → uint256
creditedPackets 0x9bdb9812 → bool
decimals 0x313ce567 → uint8
estimateSendAndCallFee 0xa4c51df5 → uint256, uint256
estimateSendFee 0x365260b4 → uint256, uint256
failedMessages 0x5b8c41e6 → bytes32
getConfig 0xf5ecbdbc → bytes
getTrustedRemoteAddress 0x9f38369a → bytes
isTrustedRemote 0x3d8b38f6 → bool
lzEndpoint 0xb353aaa7 → address
minDstGasLookup 0x8cfd8f5c → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
payloadSizeLimitLookup 0x3f1f4fa4 → uint256
precrime 0x950c8a74 → address
sellTax 0xcc1776d3 → uint256
sharedDecimals 0x857749b0 → uint8
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
taxWallet 0x2dc0562d → address
token 0xfc0c546a → address
totalSupply 0x18160ddd → uint256
tradingAllowed 0x53371be0 → bool
trustedRemoteLookup 0x7533d788 → bytes
uniswapV2Pair 0x49bd5a5e → address

Write Contract 33 functions

These functions modify contract state and require a wallet transaction to execute.

activate 0x0f15f4c0
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
callOnOFTReceived 0xeaffd49a
uint16 _srcChainId
bytes _srcAddress
uint64 _nonce
bytes32 _from
address _to
uint256 _amount
bytes _payload
uint256 _gasForCall
changeMinAmountToSwapTaxes 0x3d5369f6
uint256 newMinAmount
changetaxWallet 0xa6fb5dfd
address _newtaxWallet
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableTaxes 0x30275744
bool _enable
excludeFromFees 0xc0246668
address _address
bool _isExcluded
forceResumeReceive 0x42d65a8d
uint16 _srcChainId
bytes _srcAddress
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
lzReceive 0x001d3567
uint16 _srcChainId
bytes _srcAddress
uint64 _nonce
bytes _payload
manualSwap 0xb70143c9
uint256 _amount
nonblockingLzReceive 0x66ad5c8a
uint16 _srcChainId
bytes _srcAddress
uint64 _nonce
bytes _payload
removeLaunchTax 0xdf47e373
uint256 _newBuyTaxPercent
uint256 _newSellTaxPercent
renounceOwnership 0x715018a6
No parameters
retryMessage 0xd1deba1f
uint16 _srcChainId
bytes _srcAddress
uint64 _nonce
bytes _payload
sendAndCall 0x772350ca
address _from
uint16 _dstChainId
bytes32 _toAddress
uint256 _amount
bytes _payload
uint64 _dstGasForCall
tuple _callParams
sendFrom 0xf29df5e1
address _from
uint16 _dstChainId
bytes32 _toAddress
uint256 _amount
tuple _callParams
setConfig 0xcbed8b9c
uint16 _version
uint16 _chainId
uint256 _configType
bytes _config
setMinDstGas 0xdf2a5b3b
uint16 _dstChainId
uint16 _packetType
uint256 _minGas
setPayloadSizeLimit 0x0df37483
uint16 _dstChainId
uint256 _size
setPrecrime 0xbaf3292d
address _precrime
setReceiveVersion 0x10ddb137
uint16 _version
setSendVersion 0x07e0db17
uint16 _version
setTax 0x2e5bb6ff
uint256 _block
setTrustedRemote 0xeb8d72b7
uint16 _remoteChainId
bytes _path
setTrustedRemoteAddress 0xa6c3d165
uint16 _remoteChainId
bytes _remoteAddress
toggleLimits 0xb256f7b7
bool _limitsEnabed
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateMaxTxAmount 0x6256d181
uint256 _newAmount
updateMaxWalletAmount 0xc18bc195
uint256 newMaxWalletAmount

Recent Transactions

No transactions found for this address