[ { "inputs": [ { "internalType": "address", "name": "_token0", "type": "address" }, { "internalType": "address", "name": "_token1", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ { "internalType": "address", "name": "target", "type": "address" } ], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "AddressInsufficientBalance", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" } ], "name": "ERC20InsufficientAllowance", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" } ], "name": "ERC20InsufficientBalance", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "approver", "type": "address" } ], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "receiver", "type": "address" } ], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" } ], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" } ], "name": "ERC20InvalidSpender", "type": "error" }, { "inputs": [], "name": "FailedInnerCall", "type": "error" }, { "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "name": "SafeERC20FailedOperation", "type": "error" }, { "inputs": [], "name": "TokenSale_No_Liquidity_Output", "type": "error" }, { "inputs": [], "name": "TokenSwap_Invalid_Address", "type": "error" }, { "inputs": [], "name": "TokenSwap_Invalid_Amount", "type": "error" }, { "inputs": [], "name": "TokenSwap_Invalid_Exchange_Rate", "type": "error" }, { "inputs": [], "name": "TokenSwap_No_Liquidity_Shares", "type": "error" }, { "inputs": [], "name": "TokenSwap_TokenA_Transfer_Failed", "type": "error" }, { "inputs": [], "name": "TokenSwap_TokenB_Transfer_Failed", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "_to", "type": "address" } ], "name": "TokenSwap_Liquidity_Burned", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "_to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_shareTokens", "type": "uint256" } ], "name": "TokenSwap_Liquidity_Minted", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "", "type": "address" }, { "indexed": false, "internalType": "address", "name": "", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "TokenSwap_Swap", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "amount0In", "type": "uint256" }, { "internalType": "uint256", "name": "amount1In", "type": "uint256" } ], "name": "addLiquidity", "outputs": [ { "internalType": "uint256", "name": "_shareTokens", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" } ], "name": "allowance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "approve", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "exchangeRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_tokenIn", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" } ], "name": "getRate", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getReserves", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_to", "type": "address" } ], "name": "removeLiquidity", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "reserves0", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "reserves1", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_tokenIn", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" } ], "name": "swap", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token0", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token1", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalLiquidity", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" } ]
60c06040523480156200001157600080fd5b506040516200198f3803806200198f833981016040819052620000349162000116565b6040518060400160405280601081526020016f4c697175696469747920546f6b656e7360801b8152506040518060400160405280600681526020016553484152455360d01b81525081600390816200008d9190620001f3565b5060046200009c8282620001f3565b50506001600555506001600160a01b0382161580620000c257506001600160a01b038116155b15620000e1576040516303a6af6f60e31b815260040160405180910390fd5b6001600160a01b039182166080521660a052620002bf565b80516001600160a01b03811681146200011157600080fd5b919050565b600080604083850312156200012a57600080fd5b6200013583620000f9565b91506200014560208401620000f9565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200017957607f821691505b6020821081036200019a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001ee57600081815260208120601f850160051c81016020861015620001c95750805b601f850160051c820191505b81811015620001ea57828155600101620001d5565b5050505b505050565b81516001600160401b038111156200020f576200020f6200014e565b620002278162000220845462000164565b84620001a0565b602080601f8311600181146200025f5760008415620002465750858301515b600019600386901b1c1916600185901b178555620001ea565b600085815260208120601f198616915b8281101562000290578886015182559484019460019091019084016200026f565b5085821015620002af5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05161163a62000355600039600081816102a9015281816104870152818161057201528181610717015281816108bb015281816109d801528181610bdf0152610d0601526000818161019201528181610452015281816104e4015281816106dc0152818161079f015281816108800152818161095a01528181610a6d01528181610b490152610cd2015261163a6000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c806355776b77116100ad578063b9b4c46311610071578063b9b4c46314610288578063d004f0f714610291578063d21220a7146102a4578063d798f86e146102cb578063dd62ed3e146102e057600080fd5b806355776b771461021e57806370a0823114610231578063886ef6441461025a57806395d89b411461026d578063a9059cbb1461027557600080fd5b806318160ddd116100f457806318160ddd146101e357806323b872dd146101eb5780632c6a592f146101fe578063313ce567146102075780633ba0b9a91461021657600080fd5b806306fdde03146101315780630902f1ac1461014f578063095ea7b31461016a5780630dfe16811461018d57806315770f92146101cc575b600080fd5b610139610319565b60405161014691906113d3565b60405180910390f35b60065460075460408051928352602083019190915201610146565b61017d61017836600461141d565b6103ab565b6040519015158152602001610146565b6101b47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610146565b6101d560085481565b604051908152602001610146565b6002546101d5565b61017d6101f9366004611447565b6103c5565b6101d560065481565b60405160128152602001610146565b6101d5600c81565b6101d561022c366004611483565b6103eb565b6101d561023f3660046114b6565b6001600160a01b031660009081526020819052604090205490565b6101d561026836600461141d565b6106d8565b610139610857565b61017d61028336600461141d565b610866565b6101d560075481565b6101d561029f36600461141d565b610874565b6101b47f000000000000000000000000000000000000000000000000000000000000000081565b6102de6102d93660046114b6565b610b02565b005b6101d56102ee3660046114d1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461032890611504565b80601f016020809104026020016040519081016040528092919081815260200182805461035490611504565b80156103a15780601f10610376576101008083540402835291602001916103a1565b820191906000526020600020905b81548152906001019060200180831161038457829003601f168201915b5050505050905090565b6000336103b9818585610d9a565b60019150505b92915050565b6000336103d3858285610dac565b6103de858585610e2f565b60019150505b9392505050565b60006103f5610e8e565b6001600160a01b03841661041c576040516303a6af6f60e31b815260040160405180910390fd5b821580610427575081155b156104455760405163d40cb8ff60e01b815260040160405180910390fd5b61047a6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086610eb8565b6104af6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085610eb8565b6000806104bf6006546007549091565b6040516370a0823160e01b815230600482015291935091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801561052b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054f9190611538565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156105b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105dd9190611538565b905060006105ea60025490565b90508060000361061d57610606610601888a611567565b610f1f565b955061061863deadbeef6103e8610f8f565b610652565b61064f8561062b838b611567565b610635919061157e565b85610640848b611567565b61064a919061157e565b610fc9565b95505b856000036106735760405163fb005b0160e01b815260040160405180910390fd5b61067d8987610f8f565b60068390556007829055604080516001600160a01b038b168152602081018890527fdcccd234831198849b99f6752542021d2c6e363317794d2895fbdab16f968fb8910160405180910390a150505050506103e46001600555565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316148061074b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316145b610768576040516303a6af6f60e31b815260040160405180910390fd5b816000036107895760405163d40cb8ff60e01b815260040160405180910390fd5b6000806107996006546007549091565b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b03160361081557600c6107e385600a611567565b6107ed919061157e565b92508083111561081057604051633c8573d160e01b815260040160405180910390fd5b61084f565b600a610822600c86611567565b61082c919061157e565b92508183111561084f57604051633c8573d160e01b815260040160405180910390fd5b505092915050565b60606004805461032890611504565b6000336103b9818585610e2f565b600061087e610e8e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614806108ef57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316145b61090c576040516303a6af6f60e31b815260040160405180910390fd5b8160000361092d5760405163d40cb8ff60e01b815260040160405180910390fd5b6109426001600160a01b038416333085610eb8565b6000806109526006546007549091565b9150915060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031603610a2657600c61099e86600a611567565b6109a8919061157e565b9050818111156109cb57604051633c8573d160e01b815260040160405180910390fd5b6109ff6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383610fdf565b610a21610a0c86856115a0565b610a1683856115b3565b600691909155600755565b610aab565b600a610a33600c87611567565b610a3d919061157e565b905082811115610a6057604051633c8573d160e01b815260040160405180910390fd5b610a946001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383610fdf565b610aab610aa182856115b3565b610a1687856115a0565b604080513381526001600160a01b03881660208201529081018290527ff434fb8b95a58da43726a853655915494ce2099ad2849cc157d43ac61249b7c29060600160405180910390a1925050506103bf6001600555565b610b0a610e8e565b6001600160a01b038116610b31576040516303a6af6f60e31b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610b98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbc9190611538565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610c26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4a9190611538565b30600090815260208190526040812054600254929350919081610c6d8685611567565b610c77919061157e565b9050600082610c868686611567565b610c90919061157e565b9050811580610c9d575080155b15610cbb57604051633c8573d160e01b815260040160405180910390fd5b610cc53085611010565b610cf96001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168884610fdf565b610d2d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168883610fdf565b6006869055600785905560408051338152602081018490529081018290526001600160a01b03881660608201527fb5a013ee97da2bf8935c890777e0dc3b8264cb8964cf819fb98c26c75c4d69f29060800160405180910390a1505050505050610d976001600555565b50565b610da78383836001611046565b505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610e295781811015610e1a57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b610e2984848484036000611046565b50505050565b6001600160a01b038316610e5957604051634b637e8f60e11b815260006004820152602401610e11565b6001600160a01b038216610e835760405163ec442f0560e01b815260006004820152602401610e11565b610da783838361111b565b600260055403610eb157604051633ee5aeb560e01b815260040160405180910390fd5b6002600555565b6040516001600160a01b038481166024830152838116604483015260648201839052610e299186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611245565b60006003821115610f805750806000610f3960028361157e565b610f449060016115a0565b90505b81811015610f7a57905080600281610f5f818661157e565b610f6991906115a0565b610f73919061157e565b9050610f47565b50919050565b8115610f8a575060015b919050565b6001600160a01b038216610fb95760405163ec442f0560e01b815260006004820152602401610e11565b610fc56000838361111b565b5050565b6000818310610fd857816103e4565b5090919050565b6040516001600160a01b03838116602483015260448201839052610da791859182169063a9059cbb90606401610eed565b6001600160a01b03821661103a57604051634b637e8f60e11b815260006004820152602401610e11565b610fc58260008361111b565b6001600160a01b0384166110705760405163e602df0560e01b815260006004820152602401610e11565b6001600160a01b03831661109a57604051634a1406b160e11b815260006004820152602401610e11565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610e2957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161110d91815260200190565b60405180910390a350505050565b6001600160a01b03831661114657806002600082825461113b91906115a0565b909155506111b89050565b6001600160a01b038316600090815260208190526040902054818110156111995760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610e11565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166111d4576002805482900390556111f3565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161123891815260200190565b60405180910390a3505050565b600061125a6001600160a01b038416836112a8565b9050805160001415801561127f57508080602001905181019061127d91906115c6565b155b15610da757604051635274afe760e01b81526001600160a01b0384166004820152602401610e11565b60606103e48383600084600080856001600160a01b031684866040516112ce91906115e8565b60006040518083038185875af1925050503d806000811461130b576040519150601f19603f3d011682016040523d82523d6000602084013e611310565b606091505b509150915061132086838361132a565b9695505050505050565b60608261133f5761133a82611386565b6103e4565b815115801561135657506001600160a01b0384163b155b1561137f57604051639996b31560e01b81526001600160a01b0385166004820152602401610e11565b50806103e4565b8051156113965780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b60005b838110156113ca5781810151838201526020016113b2565b50506000910152565b60208152600082518060208401526113f28160408501602087016113af565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610f8a57600080fd5b6000806040838503121561143057600080fd5b61143983611406565b946020939093013593505050565b60008060006060848603121561145c57600080fd5b61146584611406565b925061147360208501611406565b9150604084013590509250925092565b60008060006060848603121561149857600080fd5b6114a184611406565b95602085013595506040909401359392505050565b6000602082840312156114c857600080fd5b6103e482611406565b600080604083850312156114e457600080fd5b6114ed83611406565b91506114fb60208401611406565b90509250929050565b600181811c9082168061151857607f821691505b602082108103610f7a57634e487b7160e01b600052602260045260246000fd5b60006020828403121561154a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176103bf576103bf611551565b60008261159b57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156103bf576103bf611551565b818103818111156103bf576103bf611551565b6000602082840312156115d857600080fd5b815180151581146103e457600080fd5b600082516115fa8184602087016113af565b919091019291505056fea2646970667358221220cf6efcf40fc85cc0e13335326d2e58fd099f49d73f07596a6a2fe33f4a42071564736f6c63430008140033000000000000000000000000ca263de5cf48ee276d1b9367a5077d331e150d63000000000000000000000000c428265ab883da1458982732c9ac8571bf497b1d