Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559
Balance 0.365145 ETH
Nonce 1
Code Size 14721 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

14721 bytes
0x6080604052600436106101185760003560e01c806383bd37f9116100a0578063b810fb4311610064578063b810fb43146102ae578063e10895f9146102ce578063e7d3fc60146102ee578063f2fde38b14610304578063f827065e1461032457600080fd5b806383bd37f91461022c57806384a7f3dd1461023457806387b621b51461023c5780638da5cb5b1461025c5780639286b93d1461028e57600080fd5b80633b635ce4116100e75780633b635ce4146101af5780634886c675146101d05780636c082c13146101ec578063715018a6146102045780637bf2d6d41461021957600080fd5b8063080c25b314610124578063174da6211461014d57806328be42f41461016f5780633596f9a21461018f57600080fd5b3661011f57005b600080fd5b610137610132366004612eda565b6103a6565b6040516101449190612ff2565b60405180910390f35b34801561015957600080fd5b5061016d610168366004613050565b610863565b005b34801561017b57600080fd5b5061013761018a3660046130d0565b610975565b34801561019b57600080fd5b5061016d6101aa366004613177565b610ec1565b6101c26101bd366004613255565b610f46565b604051908152602001610144565b3480156101dc57600080fd5b506101c2670de0b6b3a764000081565b3480156101f857600080fd5b506101c2638000000081565b34801561021057600080fd5b5061016d610f5f565b6101376102273660046132c2565b610f73565b6101c2610f90565b610137611153565b34801561024857600080fd5b506101c261025736600461337b565b611379565b34801561026857600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610144565b34801561029a57600080fd5b5061016d6102a936600461340e565b611446565b3480156102ba57600080fd5b506102766102c936600461340e565b6114a4565b3480156102da57600080fd5b5061016d6102e9366004613427565b6114ce565b3480156102fa57600080fd5b506101c260025481565b34801561031057600080fd5b5061016d61031f366004613478565b6116db565b34801561033057600080fd5b5061037761033f366004613493565b6003602052600090815260409020546001600160401b03811690600160401b81046001600160a01b031690600160e01b900460ff1683565b604080516001600160401b0390941684526001600160a01b039092166020840152151590820152606001610144565b60606103cc60405180606001604052806060815260200160008152602001600081525090565b606060008034116103de578a516103ec565b60018b516103ec91906134c4565b90506040518060600160405280826001600160401b0381111561041157610411612c63565b60405190808252806020026020018201604052801561045657816020015b604080518082019091526000808252602082015281526020019060019003908161042f5790505b5081526020018d6020015181526020018d604001518152509250806001600160401b0381111561048857610488612c63565b6040519080825280602002602001820160405280156104cd57816020015b60408051808201909152600080825260208201528152602001906001900390816104a65790505b509150506000805b8b518110156107b05760006001600160a01b03168c82815181106104fb576104fb6134db565b6020026020010151600001516001600160a01b03161415610585578b8181518110610528576105286134db565b6020026020010151602001516000141561056057348c828151811061054f5761054f6134db565b602002602001015160200181815250505b8b8181518110610572576105726134db565b602002602001015160200151915061079e565b8b8181518110610597576105976134db565b60200260200101516020015160001415610664578b81815181106105bd576105bd6134db565b6020908102919091010151516040516370a0823160e01b81523360048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561060957600080fd5b505afa15801561061d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064191906134f1565b8c8281518110610653576106536134db565b602002602001015160200181815250505b6000821561067c576106776001836134c4565b61067e565b815b90508c8281518110610692576106926134db565b602002602001015160000151856000015182815181106106b4576106b46134db565b60209081029190910101516001600160a01b0390911690528c518d90839081106106e0576106e06134db565b60200260200101516020015185600001518281518110610702576107026134db565b602002602001015160200181815250508c8281518110610724576107246134db565b602002602001015160400151848281518110610742576107426134db565b60209081029190910101516001600160a01b0390911690528c518d908390811061076e5761076e6134db565b60200260200101516020015184828151811061078c5761078c6134db565b60200260200101516020018181525050505b806107a88161350a565b9150506104d5565b508034146107d95760405162461bcd60e51b81526004016107d090613525565b60405180910390fd5b508a5160608c015160405163edd9444b60e01b81526001600160a01b039092169163edd9444b9161081391869186913391906004016135f3565b600060405180830381600087803b15801561082d57600080fd5b505af1158015610841573d6000803e3d6000fd5b505050506108548a8a8a8a8a8a8a611754565b9b9a5050505050505050505050565b61086b612082565b8382146108b35760405162461bcd60e51b815260206004820152601660248201527524b73b30b634b210333ab73239903a3930b739b332b960511b60448201526064016107d0565b60005b8481101561096d5761095b8686838181106108d3576108d36134db565b90506020020160208101906108e89190613478565b838686858181106108fb576108fb6134db565b905060200201356000146109275786868581811061091b5761091b6134db565b90506020020135612175565b61095689898681811061093c5761093c6134db565b90506020020160208101906109519190613478565b6120dc565b612175565b806109658161350a565b9150506108b6565b505050505050565b606061097f612082565b600087516001600160401b0381111561099a5761099a612c63565b6040519080825280602002602001820160405280156109c3578160200160208202803683370190505b509050600088516001600160401b038111156109e1576109e1612c63565b604051908082528060200260200182016040528015610a0a578160200160208202803683370190505b50905060005b8951811015610b5d57898181518110610a2b57610a2b6134db565b602002602001015160000151828281518110610a4957610a496134db565b60200260200101906001600160a01b031690816001600160a01b031681525050898181518110610a7b57610a7b6134db565b602002602001015160200151600014610ab157898181518110610aa057610aa06134db565b602002602001015160200151610ad3565b610ad3828281518110610ac657610ac66134db565b60200260200101516120dc565b838281518110610ae557610ae56134db565b602002602001018181525050610b4b828281518110610b0657610b066134db565b60200260200101518b8381518110610b2057610b206134db565b602002602001015160400151858481518110610b3e57610b3e6134db565b6020026020010151612175565b80610b558161350a565b915050610a10565b50600088516001600160401b03811115610b7957610b79612c63565b604051908082528060200260200182016040528015610ba2578160200160208202803683370190505b509050600089516001600160401b03811115610bc057610bc0612c63565b604051908082528060200260200182016040528015610be9578160200160208202803683370190505b50905060005b8a51811015610c8c578a8181518110610c0a57610c0a6134db565b602002602001015160000151828281518110610c2857610c286134db565b60200260200101906001600160a01b031690816001600160a01b031681525050610c5d828281518110610ac657610ac66134db565b838281518110610c6f57610c6f6134db565b602090810291909101015280610c848161350a565b915050610bef565b5060405163cb70e27360e01b81526001600160a01b0387169063cb70e27390600090610cc2908c908c908a9033906004016136a9565b6000604051808303818588803b158015610cdb57600080fd5b505af1158015610cef573d6000803e3d6000fd5b505050505060008a516001600160401b03811115610d0f57610d0f612c63565b604051908082528060200260200182016040528015610d38578160200160208202803683370190505b50955060005b8b51811015610e4f57838181518110610d5957610d596134db565b6020026020010151610d76848381518110610ac657610ac66134db565b610d8091906134c4565b878281518110610d9257610d926134db565b602002602001018181525050610def8c8281518110610db357610db36134db565b6020026020010151600001518d8381518110610dd157610dd16134db565b602002602001015160400151898481518110610b3e57610b3e6134db565b8b8181518110610e0157610e016134db565b602002602001015160200151878281518110610e1f57610e1f6134db565b6020026020010151610e319190613701565b610e3b9083613720565b915080610e478161350a565b915050610d3e565b5089811015610e705760405162461bcd60e51b81526004016107d090613738565b7f7d7fb03518253ae01913536628b78d6d82e63e19b943aab5f4948356021259be33868689866000604051610eaa969594939291906137a8565b60405180910390a150505050509695505050505050565b610ec9612082565b60005b81811015610f41576001838383818110610ee857610ee86134db565b9050602002016020810190610efd9190613478565b81546001810183556000928352602090922090910180546001600160a01b0319166001600160a01b0390921691909117905580610f398161350a565b915050610ecc565b505050565b6000610f558686868686612236565b9695505050505050565b610f67612082565b610f71600061233e565b565b6060610f848888888888888861238e565b98975050505050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101829052600080368133611044565b600080823560f01c80801561101b5760018114611026577fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf4820154935060028501925061103d565b60028501925061103d565b6001600160a01b03853560501c1693506016850192505b5050915091565b6000600461105181610fd3565b9150915081885261106181610fd3565b60608a018290529092506001810191503560f81c8015611090578135600882602003021c60208a015280820191505b50803560f81c6001820191508135600882602003021c8060808b01528183019250823560e81c915062ffffff8262ffffff0382020460a08b015250506003810190506110db81610fd3565b915096506110e881610fd3565b9150915060008214156110f9578691505b81604089015261110881610fd3565b915091506000821415611119578291505b60c0880191909152803560e01c94506005810193506004013560f81c602002915061114990508583838787612236565b9550505050505090565b6060600080828060063360043560f890811c90600535901c816001600160401b0381111561118357611183612c63565b6040519080825280602002602001820160405280156111ce57816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816111a15790505b509550806001600160401b038111156111e9576111e9612c63565b60405190808252806020026020018201604052801561123457816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816112075790505b50945061124084610fd3565b94509750833560f81c6001850194508435600882602003021c975080850194505060008060005b848110156112d457602080820201890151915061128387610fd3565b8184526001810198509093503560f81c80156112ae578735600882602003021c602084015280880197505b506112b887610fd3565b97509250826112c5578a92505b60408201839052600101611267565b5060005b838110156113405760208082020188015191506112f487610fd3565b97509250828252863560f81c6001880197508735600882602003021c602084015280880197505061132487610fd3565b9750925082611331578592505b604082018390526001016112d8565b50506004850194803560e01c945060050192505050823560f81c60200261136c86868985858d8961238e565b9850505050505050505090565b85516040805160a08101825287516001600160a01b0390811660608084019182526020808c0180516080870152928552808d015181860152858d015185870152855180870187528c870151851681529251908301528b0151935163187945bd60e11b815260009592909216936330f28b7a936113fc939092913391600401613820565b600060405180830381600087803b15801561141657600080fd5b505af115801561142a573d6000803e3d6000fd5b5050505061143b86868686866125e8565b979650505050505050565b61144e612082565b61146160c8670de0b6b3a7640000613899565b81111561149f5760405162461bcd60e51b815260206004820152600c60248201526b08ccaca40e8dede40d0d2ced60a31b60448201526064016107d0565b600255565b600181815481106114b457600080fd5b6000918252602090912001546001600160a01b0316905081565b63ffffffff8316600090815260036020526040902054600160e01b900460ff16156115295760405162461bcd60e51b815260206004820152600b60248201526a436f646520696e2075736560a81b60448201526064016107d0565b61153c6032670de0b6b3a7640000613899565b826001600160401b031611156115835760405162461bcd60e51b815260206004820152600c60248201526b08ccaca40e8dede40d0d2ced60a31b60448201526064016107d0565b63800000008363ffffffff16116115e7576001600160401b038216156115e25760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642066656520666f7220636f646560601b60448201526064016107d0565b611680565b6000826001600160401b0316116116375760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642066656520666f7220636f646560601b60448201526064016107d0565b6001600160a01b0381166116805760405162461bcd60e51b815260206004820152601060248201526f4e756c6c2062656e656669636961727960801b60448201526064016107d0565b63ffffffff9290921660009081526003602052604090208054600160e01b6001600160401b03939093166001600160e01b031990911617600160401b6001600160a01b03909416939093029290921760ff60e01b1916179055565b6116e3612082565b6001600160a01b0381166117485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d0565b6117518161233e565b50565b60606000861161179f5760405162461bcd60e51b8152602060048201526016602482015275536c697070616765206c696d697420746f6f206c6f7760501b60448201526064016107d0565b600088516001600160401b038111156117ba576117ba612c63565b6040519080825280602002602001820160405280156117e3578160200160208202803683370190505b509050600089516001600160401b0381111561180157611801612c63565b60405190808252806020026020018201604052801561182a578160200160208202803683370190505b50905060005b8a51811015611a46578a818151811061184b5761184b6134db565b602002602001015160200151838281518110611869576118696134db565b6020026020010181815250508a8181518110611887576118876134db565b6020026020010151600001518282815181106118a5576118a56134db565b60200260200101906001600160a01b031690816001600160a01b03168152505060005b8181101561197e578b81815181106118e2576118e26134db565b6020026020010151600001516001600160a01b03168c8381518110611909576119096134db565b6020026020010151600001516001600160a01b0316141561196c5760405162461bcd60e51b815260206004820152601760248201527f4475706c696361746520736f7572636520746f6b656e7300000000000000000060448201526064016107d0565b806119768161350a565b9150506118c8565b5060005b8a51811015611a33578a818151811061199d5761199d6134db565b6020026020010151600001516001600160a01b03168c83815181106119c4576119c46134db565b6020026020010151600001516001600160a01b03161415611a215760405162461bcd60e51b8152602060048201526017602482015276105c989a5d1c9859d9481b9bdd081cdd5c1c1bdc9d1959604a1b60448201526064016107d0565b80611a2b8161350a565b915050611982565b5080611a3e8161350a565b915050611830565b50600089516001600160401b03811115611a6257611a62612c63565b604051908082528060200260200182016040528015611a8b578160200160208202803683370190505b50905060005b8a51811015611ba95760005b81811015611b53578b8181518110611ab757611ab76134db565b6020026020010151600001516001600160a01b03168c8381518110611ade57611ade6134db565b6020026020010151600001516001600160a01b03161415611b415760405162461bcd60e51b815260206004820152601c60248201527f4475706c69636174652064657374696e6174696f6e20746f6b656e730000000060448201526064016107d0565b80611b4b8161350a565b915050611a9d565b50611b7a8b8281518110611b6957611b696134db565b6020026020010151600001516120dc565b828281518110611b8c57611b8c6134db565b602090810291909101015280611ba18161350a565b915050611a91565b5060405163cb70e27360e01b81526001600160a01b0387169063cb70e273903490611bde908c908c90899033906004016136a9565b6000604051808303818588803b158015611bf757600080fd5b505af1158015611c0b573d6000803e3d6000fd5b505060408051606081018252600080825260208201819052918101919091529250611c34915050565b63800000008663ffffffff161115611ca2575063ffffffff8516600090815260036020908152604091829020825160608101845290546001600160401b0381168252600160401b81046001600160a01b031692820192909252600160e01b90910460ff161515918101919091525b6002548b51600091906001600160401b03811115611cc257611cc2612c63565b604051908082528060200260200182016040528015611ceb578160200160208202803683370190505b50965060005b8d51811015611f6057848181518110611d0c57611d0c6134db565b6020026020010151611d298f8381518110611b6957611b696134db565b611d3391906134c4565b888281518110611d4557611d456134db565b6020908102919091010152670de0b6b3a7640000611d6383826134c4565b898381518110611d7557611d756134db565b6020026020010151611d879190613701565b611d919190613899565b888281518110611da357611da36134db565b60200260200101818152505063800000008963ffffffff161115611eaf57611e438e8281518110611dd657611dd66134db565b6020026020010151600001518560200151670de0b6b3a7640000600a611dfc9190613701565b87600001516001600160401b03168c8681518110611e1c57611e1c6134db565b6020026020010151611e2e9190613701565b611e39906008613701565b6109569190613899565b8351670de0b6b3a764000090611e62906001600160401b0316826134c4565b898381518110611e7457611e746134db565b6020026020010151611e869190613701565b611e909190613899565b888281518110611ea257611ea26134db565b6020026020010181815250505b611f008e8281518110611ec457611ec46134db565b6020026020010151600001518f8381518110611ee257611ee26134db565b6020026020010151604001518a8481518110610b3e57610b3e6134db565b8d8181518110611f1257611f126134db565b602002602001015160200151888281518110611f3057611f306134db565b6020026020010151611f429190613701565b611f4c9084613720565b925080611f588161350a565b915050611cf1565b508b821015611f815760405162461bcd60e51b81526004016107d090613738565b505060008b516001600160401b03811115611f9e57611f9e612c63565b604051908082528060200260200182016040528015611fc7578160200160208202803683370190505b50905060005b8c51811015612030578c8181518110611fe857611fe86134db565b602002602001015160000151828281518110612006576120066134db565b6001600160a01b0390921660209283029190910190910152806120288161350a565b915050611fcd565b507f7d7fb03518253ae01913536628b78d6d82e63e19b943aab5f4948356021259be33868689858c60405161206a969594939291906137a8565b60405180910390a15050505050979650505050505050565b6000546001600160a01b03163314610f715760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107d0565b60006001600160a01b0382166120f3575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b15801561213257600080fd5b505afa158015612146573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216a91906134f1565b92915050565b919050565b6001600160a01b038316612222576000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146121d0576040519150601f19603f3d011682016040523d82523d6000602084013e6121d5565b606091505b505090508061221c5760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b60448201526064016107d0565b50505050565b610f416001600160a01b0384168383612979565b84516000906001600160a01b031661228457602086015161225c57346020870152612331565b8560200151341461227f5760405162461bcd60e51b81526004016107d090613525565b612331565b602086015161230d5785516040516370a0823160e01b81523360048201526001600160a01b03909116906370a082319060240160206040518083038186803b1580156122cf57600080fd5b505afa1580156122e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230791906134f1565b60208701525b604086015160208701518751612331926001600160a01b03909116913391906129dc565b610f5586868686866125e8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60606000805b89518110156125ac5760006001600160a01b03168a82815181106123ba576123ba6134db565b6020026020010151600001516001600160a01b03161415612444578981815181106123e7576123e76134db565b6020026020010151602001516000141561241f57348a828151811061240e5761240e6134db565b602002602001015160200181815250505b898181518110612431576124316134db565b602002602001015160200151915061259a565b898181518110612456576124566134db565b602002602001015160200151600014156125235789818151811061247c5761247c6134db565b6020908102919091010151516040516370a0823160e01b81523360048201526001600160a01b03909116906370a082319060240160206040518083038186803b1580156124c857600080fd5b505afa1580156124dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250091906134f1565b8a8281518110612512576125126134db565b602002602001015160200181815250505b61259a338b8381518110612539576125396134db565b6020026020010151604001518c8481518110612557576125576134db565b6020026020010151602001518d8581518110612575576125756134db565b6020026020010151600001516001600160a01b03166129dc909392919063ffffffff16565b806125a48161350a565b915050612394565b508034146125cc5760405162461bcd60e51b81526004016107d090613525565b6125db89898989898989611754565b9998505050505050505050565b600085608001518660a0015111156126425760405162461bcd60e51b815260206004820152601a60248201527f4d696e696d756d2067726561746572207468616e2071756f746500000000000060448201526064016107d0565b60008660a001511161268f5760405162461bcd60e51b8152602060048201526016602482015275536c697070616765206c696d697420746f6f206c6f7760501b60448201526064016107d0565b85606001516001600160a01b031686600001516001600160a01b031614156126f35760405162461bcd60e51b8152602060048201526017602482015276105c989a5d1c9859d9481b9bdd081cdd5c1c1bdc9d1959604a1b60448201526064016107d0565b600061270287606001516120dc565b6040805160018082528183019092529192506000919060208083019080368337019050509050876020015181600081518110612740576127406134db565b602090810291909101015260405163cb70e27360e01b81526001600160a01b0386169063cb70e27390349061277f908b908b90879033906004016136a9565b6000604051808303818588803b15801561279857600080fd5b505af11580156127ac573d6000803e3d6000fd5b5050505050816127bf89606001516120dc565b6127c991906134c4565b925063800000008463ffffffff16111561289c5763ffffffff841660009081526003602090815260409182902082516060808201855291546001600160401b0381168252600160401b81046001600160a01b0316938201849052600160e01b900460ff161515938101939093528a015161286591612850670de0b6b3a7640000600a613701565b8451611e2e906001600160401b031689613701565b8051670de0b6b3a764000090612884906001600160401b0316826134c4565b61288e9086613701565b6128989190613899565b9350505b60008860800151846128ae91906138bb565b905060008113156128c157886080015193505b8860a001518410156128e55760405162461bcd60e51b81526004016107d090613738565b6128f889606001518a60c0015186612175565b6020898101518a516060808d015160408051338152958601949094526001600160a01b039283168585015290840188905216608083015260a0820183905263ffffffff871660c0830152517f823eaf01002d7353fbcadb2ea3305cc46fa35d799cb0914846d185ac06f8ad059181900360e00190a150505095945050505050565b6040516001600160a01b038316602482015260448101829052610f4190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612a14565b6040516001600160a01b038085166024830152831660448201526064810182905261221c9085906323b872dd60e01b906084016129a5565b6000612a69826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612ae69092919063ffffffff16565b805190915015610f415780806020019051810190612a8791906138fa565b610f415760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107d0565b6060612af58484600085612afd565b949350505050565b606082471015612b5e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107d0565b600080866001600160a01b03168587604051612b7a919061391c565b60006040518083038185875af1925050503d8060008114612bb7576040519150601f19603f3d011682016040523d82523d6000602084013e612bbc565b606091505b509150915061143b8783838760608315612c34578251612c2d576001600160a01b0385163b612c2d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107d0565b5081612af5565b612af58383815115612c495781518083602001fd5b8060405162461bcd60e51b81526004016107d09190613938565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715612c9b57612c9b612c63565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612cc957612cc9612c63565b604052919050565b80356001600160a01b038116811461217057600080fd5b600060808284031215612cfa57600080fd5b612d02612c79565b9050612d0d82612cd1565b8152602080830135818301526040830135604083015260608301356001600160401b0380821115612d3d57600080fd5b818501915085601f830112612d5157600080fd5b813581811115612d6357612d63612c63565b612d75601f8201601f19168501612ca1565b91508082528684828501011115612d8b57600080fd5b808484018584013760008482840101525080606085015250505092915050565b600082601f830112612dbc57600080fd5b813560206001600160401b0380831115612dd857612dd8612c63565b612de6828460051b01612ca1565b83815260609384028601830193838201919088861115612e0557600080fd5b8488015b86811015612e705781818b031215612e215760008081fd5b604080518381018181108882111715612e3c57612e3c612c63565b8252612e4783612cd1565b81528783013588820152612e5c828401612cd1565b918101919091528452928501928101612e09565b509098975050505050505050565b60008083601f840112612e9057600080fd5b5081356001600160401b03811115612ea757600080fd5b602083019150836020828501011115612ebf57600080fd5b9250929050565b803563ffffffff8116811461217057600080fd5b60008060008060008060008060e0898b031215612ef657600080fd5b88356001600160401b0380821115612f0d57600080fd5b612f198c838d01612ce8565b995060208b0135915080821115612f2f57600080fd5b612f3b8c838d01612dab565b985060408b0135915080821115612f5157600080fd5b612f5d8c838d01612dab565b975060608b0135965060808b0135915080821115612f7a57600080fd5b50612f878b828c01612e7e565b9095509350612f9a905060a08a01612cd1565b9150612fa860c08a01612ec6565b90509295985092959890939650565b600081518084526020808501945080840160005b83811015612fe757815187529582019590820190600101612fcb565b509495945050505050565b6020815260006130056020830184612fb7565b9392505050565b60008083601f84011261301e57600080fd5b5081356001600160401b0381111561303557600080fd5b6020830191508360208260051b8501011115612ebf57600080fd5b60008060008060006060868803121561306857600080fd5b85356001600160401b038082111561307f57600080fd5b61308b89838a0161300c565b909750955060208801359150808211156130a457600080fd5b506130b18882890161300c565b90945092506130c4905060408701612cd1565b90509295509295909350565b60008060008060008060a087890312156130e957600080fd5b86356001600160401b038082111561310057600080fd5b61310c8a838b01612dab565b9750602089013591508082111561312257600080fd5b61312e8a838b01612dab565b965060408901359550606089013591508082111561314b57600080fd5b5061315889828a01612e7e565b909450925061316b905060808801612cd1565b90509295509295509295565b6000806020838503121561318a57600080fd5b82356001600160401b038111156131a057600080fd5b6131ac8582860161300c565b90969095509350505050565b600060e082840312156131ca57600080fd5b60405160e081018181106001600160401b03821117156131ec576131ec612c63565b6040529050806131fb83612cd1565b81526020830135602082015261321360408401612cd1565b604082015261322460608401612cd1565b60608201526080830135608082015260a083013560a082015261324960c08401612cd1565b60c08201525092915050565b6000806000806000610140868803121561326e57600080fd5b61327887876131b8565b945060e08601356001600160401b0381111561329357600080fd5b61329f88828901612e7e565b90955093506132b390506101008701612cd1565b91506130c46101208701612ec6565b600080600080600080600060c0888a0312156132dd57600080fd5b87356001600160401b03808211156132f457600080fd5b6133008b838c01612dab565b985060208a013591508082111561331657600080fd5b6133228b838c01612dab565b975060408a0135965060608a013591508082111561333f57600080fd5b5061334c8a828b01612e7e565b909550935061335f905060808901612cd1565b915061336d60a08901612ec6565b905092959891949750929550565b600080600080600080610160878903121561339557600080fd5b86356001600160401b03808211156133ac57600080fd5b6133b88a838b01612ce8565b97506133c78a60208b016131b8565b96506101008901359150808211156133de57600080fd5b506133eb89828a01612e7e565b90955093506133ff90506101208801612cd1565b915061316b6101408801612ec6565b60006020828403121561342057600080fd5b5035919050565b60008060006060848603121561343c57600080fd5b61344584612ec6565b925060208401356001600160401b038116811461346157600080fd5b915061346f60408501612cd1565b90509250925092565b60006020828403121561348a57600080fd5b61300582612cd1565b6000602082840312156134a557600080fd5b61300582612ec6565b634e487b7160e01b600052601160045260246000fd5b6000828210156134d6576134d66134ae565b500390565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561350357600080fd5b5051919050565b600060001982141561351e5761351e6134ae565b5060010190565b6020808252600f908201526e57726f6e67206d73672e76616c756560881b604082015260600190565b600081518084526020808501945080840160005b83811015612fe75761358887835180516001600160a01b03168252602090810151910152565b6040969096019590820190600101613562565b60005b838110156135b657818101518382015260200161359e565b8381111561221c5750506000910152565b600081518084526135df81602086016020860161359b565b601f01601f19169290920160200192915050565b60808152600060e082018651606060808501528181518084526101008601915060209350838301925060005b818110156136585761364583855180516001600160a01b03168252602090810151910152565b928401926040929092019160010161361f565b50508289015160a0860152604089015160c08601528481038386015261367e818961354e565b9250505061369760408401866001600160a01b03169052565b828103606084015261143b81856135c7565b60608152836060820152838560808301376000608085830101526000601f19601f860116820160808382030160208401526136e76080820186612fb7565b91505060018060a01b038316604083015295945050505050565b600081600019048311821515161561371b5761371b6134ae565b500290565b60008219821115613733576137336134ae565b500190565b60208082526017908201527f536c697070616765204c696d6974204578636565646564000000000000000000604082015260600190565b600081518084526020808501945080840160005b83811015612fe75781516001600160a01b031687529582019590820190600101613783565b6001600160a01b038716815260c0602082018190526000906137cc90830188612fb7565b82810360408401526137de818861376f565b905082810360608401526137f28187612fb7565b90508281036080840152613806818661376f565b91505063ffffffff831660a0830152979650505050505050565b600061010061384383885180516001600160a01b03168252602090810151910152565b6020870151604084015260408701516060840152613877608084018780516001600160a01b03168252602090810151910152565b6001600160a01b03851660c084015260e0830181905261143b818401856135c7565b6000826138b657634e487b7160e01b600052601260045260246000fd5b500490565b60008083128015600160ff1b8501841216156138d9576138d96134ae565b6001600160ff1b03840183138116156138f4576138f46134ae565b50500390565b60006020828403121561390c57600080fd5b8151801515811461300557600080fd5b6000825161392e81846020870161359b565b9190910192915050565b60208152600061300560208301846135c756fea2646970667358221220f7eba796625aab166cbc2f47818bfb461215dfacdf5852a17be46345c52fdc1264736f6c63430008080033

Verified Source Code Partial Match

Compiler: v0.8.8+commit.dddeac2f EVM: london Optimization: Yes (200 runs)
OdosRouterV2.sol 1586 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.8;

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

/**
 * @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;
    }
}

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

/**
 * @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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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);
    }
}

// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

// https://github.com/Uniswap/permit2

/// @title SignatureTransfer
/// @notice Handles ERC20 token transfers through signature based actions
/// @dev Requires user's token approval on the Permit2 contract
interface ISignatureTransfer {

    /// @notice The token and amount details for a transfer signed in the permit transfer signature
    struct TokenPermissions {
        // ERC20 token address
        address token;
        // the maximum amount that can be spent
        uint256 amount;
    }

    /// @notice The signed permit message for a single token transfer
    struct PermitTransferFrom {
        TokenPermissions permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }

    /// @notice Specifies the recipient address and amount for batched transfers.
    /// @dev Recipients and amounts correspond to the index of the signed token permissions array.
    /// @dev Reverts if the requested amount is greater than the permitted signed amount.
    struct SignatureTransferDetails {
        // recipient address
        address to;
        // spender requested amount
        uint256 requestedAmount;
    }

    /// @notice Used to reconstruct the signed permit message for multiple token transfers
    /// @dev Do not need to pass in spender address as it is required that it is msg.sender
    /// @dev Note that a user still signs over a spender address
    struct PermitBatchTransferFrom {
        // the tokens and corresponding amounts permitted for a transfer
        TokenPermissions[] permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }
    /// @notice Transfers a token using a signed permit message
    /// @dev Reverts if the requested amount is greater than the permitted signed amount
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails The spender's requested transfer details for the permitted token
    /// @param signature The signature to verify
    function permitTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /// @notice Transfers multiple tokens using a signed permit message
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails Specifies the recipient and requested amount for the token transfer
    /// @param signature The signature to verify
    function permitTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;
}

// @dev interface for interacting with an Odos executor
interface IOdosExecutor {
  function executePath (
    bytes calldata bytecode,
    uint256[] memory inputAmount,
    address msgSender
  ) external payable;
}

/// @title Routing contract for Odos SOR
/// @author Semiotic AI
/// @notice Wrapper with security gaurentees around execution of arbitrary operations on user tokens
contract OdosRouterV2 is Ownable {
  using SafeERC20 for IERC20;

  /// @dev The zero address is uniquely used to represent eth since it is already
  /// recognized as an invalid ERC20, and due to its gas efficiency
  address constant _ETH = address(0);

  /// @dev Address list where addresses can be cached for use when reading from storage is cheaper
  // than reading from calldata. addressListStart is the storage slot of the first dynamic array element
  uint256 private constant addressListStart = 
    80084422859880547211683076133703299733277748156566366325829078699459944778998;
  address[] public addressList;

  // @dev constants for managing referrals and fees
  uint256 public constant REFERRAL_WITH_FEE_THRESHOLD = 1 << 31;
  uint256 public constant FEE_DENOM = 1e18;

  // @dev fee taken on multi-input and multi-output swaps instead of positive slippage
  uint256 public swapMultiFee;

  /// @dev Contains all information needed to describe the input and output for a swap
  struct permit2Info {
    address contractAddress;
    uint256 nonce;
    uint256 deadline;
    bytes signature;
  }
  /// @dev Contains all information needed to describe the input and output for a swap
  struct swapTokenInfo {
    address inputToken;
    uint256 inputAmount;
    address inputReceiver;
    address outputToken;
    uint256 outputQuote;
    uint256 outputMin;
    address outputReceiver;
  }
  /// @dev Contains all information needed to describe an intput token for swapMulti
  struct inputTokenInfo {
    address tokenAddress;
    uint256 amountIn;
    address receiver;
  }
  /// @dev Contains all information needed to describe an output token for swapMulti
  struct outputTokenInfo {
    address tokenAddress;
    uint256 relativeValue;
    address receiver;
  }
  // @dev event for swapping one token for another
  event Swap(
    address sender,
    uint256 inputAmount,
    address inputToken,
    uint256 amountOut,
    address outputToken,
    int256 slippage,
    uint32 referralCode
  );
  /// @dev event for swapping multiple input and/or output tokens
  event SwapMulti(
    address sender,
    uint256[] amountsIn,
    address[] tokensIn,
    uint256[] amountsOut,
    address[] tokensOut,
    uint32 referralCode
  );
  /// @dev Holds all information for a given referral
  struct referralInfo {
    uint64 referralFee;
    address beneficiary;
    bool registered;
  }
  /// @dev Register referral fee and information
  mapping(uint32 => referralInfo) public referralLookup;

  /// @dev Set the null referralCode as "Unregistered" with no additional fee
  constructor() {
    referralLookup[0].referralFee = 0;
    referralLookup[0].beneficiary = address(0);
    referralLookup[0].registered = true;

    swapMultiFee = 5e14;
  }
  /// @dev Must exist in order for contract to receive eth
  receive() external payable { }

  /// @notice Custom decoder to swap with compact calldata for efficient execution on L2s
  function swapCompact() 
    external
    payable
    returns (uint256)
  {
    swapTokenInfo memory tokenInfo;

    address executor;
    uint32 referralCode;
    bytes calldata pathDefinition;
    {
      address msgSender = msg.sender;

      assembly {
        // Define function to load in token address, either from calldata or from storage
        function getAddress(currPos) -> result, newPos {
          let inputPos := shr(240, calldataload(currPos))

          switch inputPos
          // Reserve the null address as a special case that can be specified with 2 null bytes
          case 0x0000 {
            newPos := add(currPos, 2)
          }
          // This case means that the address is encoded in the calldata directly following the code
          case 0x0001 {
            result := and(shr(80, calldataload(currPos)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
            newPos := add(currPos, 22)
          }
          // Otherwise we use the case to load in from the cached address list
          default {
            result := sload(add(addressListStart, sub(inputPos, 2)))
            newPos := add(currPos, 2)
          }
        }
        let result := 0
        let pos := 4

        // Load in the input and output token addresses
        result, pos := getAddress(pos)
        mstore(tokenInfo, result)

        result, pos := getAddress(pos)
        mstore(add(tokenInfo, 0x60), result)

        // Load in the input amount - a 0 byte means the full balance is to be used
        let inputAmountLength := shr(248, calldataload(pos))
        pos := add(pos, 1)

        if inputAmountLength {
          mstore(add(tokenInfo, 0x20), shr(mul(sub(32, inputAmountLength), 8), calldataload(pos)))
          pos := add(pos, inputAmountLength)
        }

        // Load in the quoted output amount
        let quoteAmountLength := shr(248, calldataload(pos))
        pos := add(pos, 1)

        let outputQuote := shr(mul(sub(32, quoteAmountLength), 8), calldataload(pos))
        mstore(add(tokenInfo, 0x80), outputQuote)
        pos := add(pos, quoteAmountLength)

        // Load the slippage tolerance and use to get the minimum output amount
        {
          let slippageTolerance := shr(232, calldataload(pos))
          mstore(add(tokenInfo, 0xA0), div(mul(outputQuote, sub(0xFFFFFF, slippageTolerance)), 0xFFFFFF))
        }
        pos := add(pos, 3)

        // Load in the executor address
        executor, pos := getAddress(pos)

        // Load in the destination to send the input to - Zero denotes the executor
        result, pos := getAddress(pos)
        if eq(result, 0) { result := executor }
        mstore(add(tokenInfo, 0x40), result)

        // Load in the destination to send the output to - Zero denotes msg.sender
        result, pos := getAddress(pos)
        if eq(result, 0) { result := msgSender }
        mstore(add(tokenInfo, 0xC0), result)

        // Load in the referralCode
        referralCode := shr(224, calldataload(pos))
        pos := add(pos, 4)

        // Set the offset and size for the pathDefinition portion of the msg.data
        pathDefinition.length := mul(shr(248, calldataload(pos)), 32)
        pathDefinition.offset := add(pos, 1)
      }
    }
    return _swapApproval(
      tokenInfo,
      pathDefinition,
      executor,
      referralCode
    );
  }
  /// @notice Externally facing interface for swapping two tokens
  /// @param tokenInfo All information about the tokens being swapped
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function swap(
    swapTokenInfo memory tokenInfo,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    external
    payable
    returns (uint256 amountOut)
  {
    return _swapApproval(
      tokenInfo,
      pathDefinition,
      executor,
      referralCode
    );
  }

  /// @notice Internal function for initiating approval transfers
  /// @param tokenInfo All information about the tokens being swapped
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function _swapApproval(
    swapTokenInfo memory tokenInfo,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    internal
    returns (uint256 amountOut)
  {
    if (tokenInfo.inputToken == _ETH) {
      // Support rebasing tokens by allowing the user to trade the entire balance
      if (tokenInfo.inputAmount == 0) {
        tokenInfo.inputAmount = msg.value;
      } else {
        require(msg.value == tokenInfo.inputAmount, "Wrong msg.value");
      }
    }
    else {
      // Support rebasing tokens by allowing the user to trade the entire balance
      if (tokenInfo.inputAmount == 0) {
        tokenInfo.inputAmount = IERC20(tokenInfo.inputToken).balanceOf(msg.sender);
      }
      IERC20(tokenInfo.inputToken).safeTransferFrom(
        msg.sender,
        tokenInfo.inputReceiver,
        tokenInfo.inputAmount
      );
    }
    return _swap(
      tokenInfo,
      pathDefinition,
      executor,
      referralCode
    );
  }

  /// @notice Externally facing interface for swapping two tokens
  /// @param permit2 All additional info for Permit2 transfers
  /// @param tokenInfo All information about the tokens being swapped
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function swapPermit2(
    permit2Info memory permit2,
    swapTokenInfo memory tokenInfo,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    external
    returns (uint256 amountOut)
  {
    ISignatureTransfer(permit2.contractAddress).permitTransferFrom(
      ISignatureTransfer.PermitTransferFrom(
        ISignatureTransfer.TokenPermissions(
          tokenInfo.inputToken,
          tokenInfo.inputAmount
        ),
        permit2.nonce,
        permit2.deadline
      ),
      ISignatureTransfer.SignatureTransferDetails(
        tokenInfo.inputReceiver,
        tokenInfo.inputAmount
      ),
      msg.sender,
      permit2.signature
    );
    return _swap(
      tokenInfo,
      pathDefinition,
      executor,
      referralCode
    );
  }

  /// @notice contains the main logic for swapping one token for another
  /// Assumes input tokens have already been sent to their destinations and
  /// that msg.value is set to expected ETH input value, or 0 for ERC20 input
  /// @param tokenInfo All information about the tokens being swapped
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function _swap(
    swapTokenInfo memory tokenInfo,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    internal
    returns (uint256 amountOut)
  {
    // Check for valid output specifications
    require(tokenInfo.outputMin <= tokenInfo.outputQuote, "Minimum greater than quote");
    require(tokenInfo.outputMin > 0, "Slippage limit too low");
    require(tokenInfo.inputToken != tokenInfo.outputToken, "Arbitrage not supported");

    uint256 balanceBefore = _universalBalance(tokenInfo.outputToken);

    // Delegate the execution of the path to the specified Odos Executor
    uint256[] memory amountsIn = new uint256[](1);
    amountsIn[0] = tokenInfo.inputAmount;

    IOdosExecutor(executor).executePath{value: msg.value}(pathDefinition, amountsIn, msg.sender);

    amountOut = _universalBalance(tokenInfo.outputToken) - balanceBefore;

    if (referralCode > REFERRAL_WITH_FEE_THRESHOLD) {
      referralInfo memory thisReferralInfo = referralLookup[referralCode];

      _universalTransfer(
        tokenInfo.outputToken,
        thisReferralInfo.beneficiary,
        amountOut * thisReferralInfo.referralFee * 8 / (FEE_DENOM * 10)
      );
      amountOut = amountOut * (FEE_DENOM - thisReferralInfo.referralFee) / FEE_DENOM;
    }
    int256 slippage = int256(amountOut) - int256(tokenInfo.outputQuote);
    if (slippage > 0) {
      amountOut = tokenInfo.outputQuote;
    }
    require(amountOut >= tokenInfo.outputMin, "Slippage Limit Exceeded");

    // Transfer out the final output to the end user
    _universalTransfer(tokenInfo.outputToken, tokenInfo.outputReceiver, amountOut);

    emit Swap(
      msg.sender,
      tokenInfo.inputAmount,
      tokenInfo.inputToken,
      amountOut,
      tokenInfo.outputToken,
      slippage,
      referralCode
    );
  }

  /// @notice Custom decoder to swapMulti with compact calldata for efficient execution on L2s
  function swapMultiCompact() 
    external
    payable
    returns (uint256[] memory amountsOut)
  {
    address executor;
    uint256 valueOutMin;

    inputTokenInfo[] memory inputs;
    outputTokenInfo[] memory outputs;

    uint256 pos = 6;
    {
      address msgSender = msg.sender;

      uint256 numInputs;
      uint256 numOutputs;

      assembly {
        numInputs := shr(248, calldataload(4))
        numOutputs := shr(248, calldataload(5))
      }
      inputs = new inputTokenInfo[](numInputs);
      outputs = new outputTokenInfo[](numOutputs);

      assembly {
        // Define function to load in token address, either from calldata or from storage
        function getAddress(currPos) -> result, newPos {
          let inputPos := shr(240, calldataload(currPos))

          switch inputPos
          // Reserve the null address as a special case that can be specified with 2 null bytes
          case 0x0000 {
            newPos := add(currPos, 2)
          }
          // This case means that the address is encoded in the calldata directly following the code
          case 0x0001 {
            result := and(shr(80, calldataload(currPos)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
            newPos := add(currPos, 22)
          }
          // Otherwise we use the case to load in from the cached address list
          default {
            result := sload(add(addressListStart, sub(inputPos, 2)))
            newPos := add(currPos, 2)
          }
        }
        executor, pos := getAddress(pos)

        // Load in the quoted output amount
        let outputMinAmountLength := shr(248, calldataload(pos))
        pos := add(pos, 1)

        valueOutMin := shr(mul(sub(32, outputMinAmountLength), 8), calldataload(pos))
        pos := add(pos, outputMinAmountLength)

        let result := 0
        let memPos := 0

        for { let element := 0 } lt(element, numInputs) { element := add(element, 1) }
        {
          memPos := mload(add(inputs, add(mul(element, 0x20), 0x20)))

          // Load in the token address
          result, pos := getAddress(pos)
          mstore(memPos, result)

          // Load in the input amount - a 0 byte means the full balance is to be used
          let inputAmountLength := shr(248, calldataload(pos))
          pos := add(pos, 1)

          if inputAmountLength {
             mstore(add(memPos, 0x20), shr(mul(sub(32, inputAmountLength), 8), calldataload(pos)))
            pos := add(pos, inputAmountLength)
          }
          result, pos := getAddress(pos)
          if eq(result, 0) { result := executor }

          mstore(add(memPos, 0x40), result)
        }
        for { let element := 0 } lt(element, numOutputs) { element := add(element, 1) }
        {
          memPos := mload(add(outputs, add(mul(element, 0x20), 0x20)))

          // Load in the token address
          result, pos := getAddress(pos)
          mstore(memPos, result)

          // Load in the quoted output amount
          let outputAmountLength := shr(248, calldataload(pos))
          pos := add(pos, 1)

          mstore(add(memPos, 0x20), shr(mul(sub(32, outputAmountLength), 8), calldataload(pos)))
          pos := add(pos, outputAmountLength)

          result, pos := getAddress(pos)
          if eq(result, 0) { result := msgSender }

          mstore(add(memPos, 0x40), result)
        }
      }
    }
    uint32 referralCode;
    bytes calldata pathDefinition;

    assembly {
      // Load in the referralCode
      referralCode := shr(224, calldataload(pos))
      pos := add(pos, 4)

      // Set the offset and size for the pathDefinition portion of the msg.data
      pathDefinition.length := mul(shr(248, calldataload(pos)), 32)
      pathDefinition.offset := add(pos, 1)
    }
    return _swapMultiApproval(
      inputs,
      outputs,
      valueOutMin,
      pathDefinition,
      executor,
      referralCode
    );
  }

  /// @notice Externally facing interface for swapping between two sets of tokens
  /// @param inputs list of input token structs for the path being executed
  /// @param outputs list of output token structs for the path being executed
  /// @param valueOutMin minimum amount of value out the user will accept
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function swapMulti(
    inputTokenInfo[] memory inputs,
    outputTokenInfo[] memory outputs,
    uint256 valueOutMin,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    external
    payable
    returns (uint256[] memory amountsOut)
  {
    return _swapMultiApproval(
      inputs,
      outputs,
      valueOutMin,
      pathDefinition,
      executor,
      referralCode
    );
  }

  /// @notice Internal logic for swapping between two sets of tokens with approvals
  /// @param inputs list of input token structs for the path being executed
  /// @param outputs list of output token structs for the path being executed
  /// @param valueOutMin minimum amount of value out the user will accept
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function _swapMultiApproval(
    inputTokenInfo[] memory inputs,
    outputTokenInfo[] memory outputs,
    uint256 valueOutMin,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    internal
    returns (uint256[] memory amountsOut)
  {
    // If input amount is still 0 then that means the maximum possible input is to be used
    uint256 expected_msg_value = 0;

    for (uint256 i = 0; i < inputs.length; i++) {
      if (inputs[i].tokenAddress == _ETH) {
        if (inputs[i].amountIn == 0) {
          inputs[i].amountIn = msg.value;
        }
        expected_msg_value = inputs[i].amountIn;
      } 
      else {
        if (inputs[i].amountIn == 0) {
          inputs[i].amountIn = IERC20(inputs[i].tokenAddress).balanceOf(msg.sender);
        }
        IERC20(inputs[i].tokenAddress).safeTransferFrom(
          msg.sender,
          inputs[i].receiver,
          inputs[i].amountIn
        );
      }
    }
    require(msg.value == expected_msg_value, "Wrong msg.value");

    return _swapMulti(
      inputs,
      outputs,
      valueOutMin,
      pathDefinition,
      executor,
      referralCode
    );
  }

  /// @notice Externally facing interface for swapping between two sets of tokens with Permit2
  /// @param permit2 All additional info for Permit2 transfers
  /// @param inputs list of input token structs for the path being executed
  /// @param outputs list of output token structs for the path being executed
  /// @param valueOutMin minimum amount of value out the user will accept
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function swapMultiPermit2(
    permit2Info memory permit2,
    inputTokenInfo[] memory inputs,
    outputTokenInfo[] memory outputs,
    uint256 valueOutMin,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    external
    payable
    returns (uint256[] memory amountsOut)
  {
    ISignatureTransfer.PermitBatchTransferFrom memory permit;
    ISignatureTransfer.SignatureTransferDetails[] memory transferDetails;
    {
      uint256 permit_length = msg.value > 0 ? inputs.length - 1 : inputs.length;

      permit = ISignatureTransfer.PermitBatchTransferFrom(
        new ISignatureTransfer.TokenPermissions[](permit_length),
        permit2.nonce,
        permit2.deadline
      );
      transferDetails = 
        new ISignatureTransfer.SignatureTransferDetails[](permit_length);
    }
    {
      uint256 expected_msg_value = 0;
      for (uint256 i = 0; i < inputs.length; i++) {

        if (inputs[i].tokenAddress == _ETH) {
          if (inputs[i].amountIn == 0) {
            inputs[i].amountIn = msg.value;
          }
          expected_msg_value = inputs[i].amountIn;
        }
        else {
          if (inputs[i].amountIn == 0) {
            inputs[i].amountIn = IERC20(inputs[i].tokenAddress).balanceOf(msg.sender);
          }
          uint256 permit_index = expected_msg_value == 0 ? i : i - 1;

          permit.permitted[permit_index].token = inputs[i].tokenAddress;
          permit.permitted[permit_index].amount = inputs[i].amountIn;

          transferDetails[permit_index].to = inputs[i].receiver;
          transferDetails[permit_index].requestedAmount = inputs[i].amountIn;
        }
      }
      require(msg.value == expected_msg_value, "Wrong msg.value");
    }
    ISignatureTransfer(permit2.contractAddress).permitTransferFrom(
      permit,
      transferDetails,
      msg.sender,
      permit2.signature
    );
    return _swapMulti(
      inputs,
      outputs,
      valueOutMin,
      pathDefinition,
      executor,
      referralCode
    );
  }

  /// @notice contains the main logic for swapping between two sets of tokens
  /// assumes that inputs have already been sent to the right location and msg.value
  /// is set correctly to be 0 for no native input and match native inpuit otherwise
  /// @param inputs list of input token structs for the path being executed
  /// @param outputs list of output token structs for the path being executed
  /// @param valueOutMin minimum amount of value out the user will accept
  /// @param pathDefinition Encoded path definition for executor
  /// @param executor Address of contract that will execute the path
  /// @param referralCode referral code to specify the source of the swap
  function _swapMulti(
    inputTokenInfo[] memory inputs,
    outputTokenInfo[] memory outputs,
    uint256 valueOutMin,
    bytes calldata pathDefinition,
    address executor,
    uint32 referralCode
  )
    internal
    returns (uint256[] memory amountsOut)
  {
    // Check for valid output specifications
    require(valueOutMin > 0, "Slippage limit too low");

    // Extract arrays of input amount values and tokens from the inputs struct list
    uint256[] memory amountsIn = new uint256[](inputs.length);
    address[] memory tokensIn = new address[](inputs.length);

    // Check input specification validity and transfer input tokens to executor
    {
      for (uint256 i = 0; i < inputs.length; i++) {

        amountsIn[i] = inputs[i].amountIn;
        tokensIn[i] = inputs[i].tokenAddress;

        for (uint256 j = 0; j < i; j++) {
          require(
            inputs[i].tokenAddress != inputs[j].tokenAddress,
            "Duplicate source tokens"
          );
        }
        for (uint256 j = 0; j < outputs.length; j++) {
          require(
            inputs[i].tokenAddress != outputs[j].tokenAddress,
            "Arbitrage not supported"
          );
        }
      }
    }
    // Check outputs for duplicates and record balances before swap
    uint256[] memory balancesBefore = new uint256[](outputs.length);
    for (uint256 i = 0; i < outputs.length; i++) {
      for (uint256 j = 0; j < i; j++) {
        require(
          outputs[i].tokenAddress != outputs[j].tokenAddress,
          "Duplicate destination tokens"
        );
      }
      balancesBefore[i] = _universalBalance(outputs[i].tokenAddress);
    }
    // Delegate the execution of the path to the specified Odos Executor
    IOdosExecutor(executor).executePath{value: msg.value}(pathDefinition, amountsIn, msg.sender);...

// [truncated — 57860 bytes total]

Read Contract

FEE_DENOM 0x4886c675 → uint256
REFERRAL_WITH_FEE_THRESHOLD 0x6c082c13 → uint256
addressList 0xb810fb43 → address
owner 0x8da5cb5b → address
referralLookup 0xf827065e → uint64, address, bool
swapMultiFee 0xe7d3fc60 → uint256

Write Contract 13 functions

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

registerReferralCode 0xe10895f9
uint32 _referralCode
uint64 _referralFee
address _beneficiary
renounceOwnership 0x715018a6
No parameters
setSwapMultiFee 0x9286b93d
uint256 _swapMultiFee
swap 0xb824e9a3
tuple tokenInfo
bytes pathDefinition
address executor
uint32 referralCode
returns: uint256
swapCompact 0x83bd37f9
No parameters
returns: uint256
swapMulti 0x29249a36
tuple[] inputs
tuple[] outputs
uint256 valueOutMin
bytes pathDefinition
address executor
uint32 referralCode
returns: uint256[]
swapMultiCompact 0x84a7f3dd
No parameters
returns: uint256[]
swapMultiPermit2 0x3dd6f352
tuple permit2
tuple[] inputs
tuple[] outputs
uint256 valueOutMin
bytes pathDefinition
address executor
uint32 referralCode
returns: uint256[]
swapPermit2 0x823a9cb6
tuple permit2
tuple tokenInfo
bytes pathDefinition
address executor
uint32 referralCode
returns: uint256
swapRouterFunds 0x324cdbd7
tuple[] inputs
tuple[] outputs
uint256 valueOutMin
bytes pathDefinition
address executor
returns: uint256[]
transferOwnership 0xf2fde38b
address newOwner
transferRouterFunds 0x174da621
address[] tokens
uint256[] amounts
address dest
writeAddressList 0x3596f9a2
address[] addresses

Recent Transactions

No transactions found for this address