Address Contract Verified
Address
0xcaa79Bf8B1d00Bf3D4f6dbEC6221955871C04618
Balance
0 ETH
Nonce
1
Code Size
11135 bytes
Creator
0xa8C2111F...C2De at tx 0x48b0e727...1e085b
Indexed Transactions
0
Contract Bytecode
11135 bytes
0x6080604052600436106103855760003560e01c80637ca8448a116101d1578063bbc0c74211610102578063d85ba063116100a0578063f8b45b051161006f578063f8b45b0514610a57578063f9f92be414610a6d578063fde83a3414610a8d578063fe575a8714610aa357600080fd5b8063d85ba063146109eb578063dd62ed3e14610a01578063e2f4560514610a21578063f2fde38b14610a3757600080fd5b8063c18bc195116100dc578063c18bc1951461096d578063cea208511461098d578063d257b34f146109b5578063d7c94efd146109d557600080fd5b8063bbc0c7421461090e578063bc205ad31461092d578063c02466681461094d57600080fd5b806398118cb41161016f578063a457c2d711610149578063a457c2d71461087e578063a9059cbb1461089e578063adee28ff146108be578063b62496f5146108de57600080fd5b806398118cb41461081857806399524bbe1461082e5780639a7a23d61461085e57600080fd5b80638da5cb5b116101ab5780638da5cb5b146107af578063924de9b7146107cd57806395d89b41146107ed57806396ea32da1461080257600080fd5b80637ca8448a1461075a5780637cb332bb1461077a57806389f6bab41461079a57600080fd5b806349bd5a5e116102b65780636db794371161025457806372cacded1161022357806372cacded146106ea578063751039fc1461070057806375e3661e14610715578063782c4e991461073557600080fd5b80636db794371461065f5780636ddd17131461067f57806370a082311461069f578063715018a6146106d557600080fd5b8063599270441161029057806359927044146105f45780635f1893611461061457806364f99f82146106295780636a486a8e1461064957600080fd5b806349bd5a5e1461056d5780634a62bb65146105a15780634fbee193146105bb57600080fd5b806324b9f3c11161032357806338377d0a116102fd57806338377d0a146104ec578063395093511461050c5780633dc599ff1461052c578063422b5bf51461054d57600080fd5b806324b9f3c1146104a457806327c8f835146104ba578063313ce567146104d057600080fd5b80631694505e1161035f5780631694505e1461040357806318160ddd1461044f5780631a8145bb1461046e57806323b872dd1461048457600080fd5b806306fdde0314610391578063095ea7b3146103bc5780630e3db9f2146103ec57600080fd5b3661038c57005b600080fd5b34801561039d57600080fd5b506103a6610adc565b6040516103b39190612750565b60405180910390f35b3480156103c857600080fd5b506103dc6103d73660046127b3565b610b6e565b60405190151581526020016103b3565b3480156103f857600080fd5b50610401610b88565b005b34801561040f57600080fd5b506104377f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b0390911681526020016103b3565b34801561045b57600080fd5b506002545b6040519081526020016103b3565b34801561047a57600080fd5b50610460600f5481565b34801561049057600080fd5b506103dc61049f3660046127df565b610ba3565b3480156104b057600080fd5b50610460600e5481565b3480156104c657600080fd5b5061043761dead81565b3480156104dc57600080fd5b50604051601281526020016103b3565b3480156104f857600080fd5b50610401610507366004612820565b610bc7565b34801561051857600080fd5b506103dc6105273660046127b3565b610c83565b34801561053857600080fd5b506014546103dc906301000000900460ff1681565b34801561055957600080fd5b50610401610568366004612839565b610ca5565b34801561057957600080fd5b506104377f0000000000000000000000006b268960693359f8c64e043d72ce7580867521b281565b3480156105ad57600080fd5b506014546103dc9060ff1681565b3480156105c757600080fd5b506103dc6105d636600461285b565b6001600160a01b031660009081526015602052604090205460ff1690565b34801561060057600080fd5b50600854610437906001600160a01b031681565b34801561062057600080fd5b50610401610d1e565b34801561063557600080fd5b50610401610644366004612886565b610d3b565b34801561065557600080fd5b50610460600a5481565b34801561066b57600080fd5b5061040161067a366004612839565b610d6e565b34801561068b57600080fd5b506014546103dc9062010000900460ff1681565b3480156106ab57600080fd5b506104606106ba36600461285b565b6001600160a01b031660009081526020819052604090205490565b3480156106e157600080fd5b50610401610ddf565b3480156106f657600080fd5b50610460600b5481565b34801561070c57600080fd5b506103dc610df3565b34801561072157600080fd5b5061040161073036600461285b565b610e0d565b34801561074157600080fd5b506007546104379061010090046001600160a01b031681565b34801561076657600080fd5b5061040161077536600461285b565b610e36565b34801561078657600080fd5b5061040161079536600461285b565b610ea2565b3480156107a657600080fd5b50610401610f07565b3480156107bb57600080fd5b506005546001600160a01b0316610437565b3480156107d957600080fd5b506104016107e83660046128bf565b610f29565b3480156107f957600080fd5b506103a6610f4d565b34801561080e57600080fd5b5061046060115481565b34801561082457600080fd5b50610460600c5481565b34801561083a57600080fd5b506103dc61084936600461285b565b60166020526000908152604090205460ff1681565b34801561086a57600080fd5b50610401610879366004612886565b610f5c565b34801561088a57600080fd5b506103dc6108993660046127b3565b611015565b3480156108aa57600080fd5b506103dc6108b93660046127b3565b611090565b3480156108ca57600080fd5b506104016108d936600461285b565b61109e565b3480156108ea57600080fd5b506103dc6108f936600461285b565b60176020526000908152604090205460ff1681565b34801561091a57600080fd5b506014546103dc90610100900460ff1681565b34801561093957600080fd5b506104016109483660046128dc565b61110e565b34801561095957600080fd5b50610401610968366004612886565b611254565b34801561097957600080fd5b50610401610988366004612820565b6112bb565b34801561099957600080fd5b50610437737a250d5630b4cf539739df2c5dacb4c659f2488d81565b3480156109c157600080fd5b506103dc6109d0366004612820565b61136a565b3480156109e157600080fd5b50610460600d5481565b3480156109f757600080fd5b5061046060095481565b348015610a0d57600080fd5b50610460610a1c3660046128dc565b611499565b348015610a2d57600080fd5b5061046060125481565b348015610a4357600080fd5b50610401610a5236600461285b565b6114c4565b348015610a6357600080fd5b5061046060135481565b348015610a7957600080fd5b50610401610a8836600461285b565b61153d565b348015610a9957600080fd5b5061046060105481565b348015610aaf57600080fd5b506103dc610abe36600461285b565b6001600160a01b031660009081526006602052604090205460ff1690565b606060038054610aeb9061290a565b80601f0160208091040260200160405190810160405280929190818152602001828054610b179061290a565b8015610b645780601f10610b3957610100808354040283529160200191610b64565b820191906000526020600020905b815481529060010190602001808311610b4757829003601f168201915b5050505050905090565b600033610b7c81858561168f565b60019150505b92915050565b610b906117b3565b6014805462ffff00191662010100179055565b600033610bb185828561180d565b610bbc858585611881565b506001949350505050565b610bcf6117b3565b670de0b6b3a76400006103e8610be460025490565b610bef90600161295a565b610bf99190612971565b610c039190612971565b811015610c6b5760405162461bcd60e51b815260206004820152602b60248201527f43616e6e6f7420736574206d617854726164696e67416d6f756e74206c6f776560448201526a72207468616e20302e312560a81b60648201526084015b60405180910390fd5b610c7d81670de0b6b3a764000061295a565b60115550565b600033610b7c818585610c968383611499565b610ca09190612993565b61168f565b610cad6117b3565b6103e8610cba8284612993565b1115610cf65760405162461bcd60e51b815260206004820152600b60248201526a15dc9bdb99c8125b9c1d5d60aa1b6044820152606401610c62565b600b829055600c81905580610d0d836103e86129a6565b610d1791906129a6565b600d555050565b610d266117b3565b6014805463ff00000019166301000000179055565b610d436117b3565b6001600160a01b03919091166000908152601660205260409020805460ff1916911515919091179055565b610d766117b3565b60328211158015610d88575060328111155b610dd45760405162461bcd60e51b815260206004820152601c60248201527f4275792f73656c6c2066656573206d757374206265203c3d2035302e000000006044820152606401610c62565b600991909155600a55565b610de76117b3565b610df1600061202f565b565b6000610dfd6117b3565b506014805460ff19169055600190565b610e156117b3565b6001600160a01b03166000908152600660205260409020805460ff19169055565b610e3e6117b3565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610e8b576040519150601f19603f3d011682016040523d82523d6000602084013e610e90565b606091505b5050905080610e9e57600080fd5b5050565b610eaa6117b3565b6008546040516001600160a01b03918216918316907f8aa0f85050aca99be43beb823e0457e77966b3baf697a289b03681978f96166890600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b610f0f6117b3565b30600090815260208190526040902054610df19047612081565b610f316117b3565b60148054911515620100000262ff000019909216919091179055565b606060048054610aeb9061290a565b610f646117b3565b7f0000000000000000000000006b268960693359f8c64e043d72ce7580867521b26001600160a01b0316826001600160a01b03160361100b5760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610c62565b610e9e8282612187565b600033816110238286611499565b9050838110156110835760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610c62565b610bbc828686840361168f565b600033610b7c818585611881565b6110a66117b3565b6007546040516001600160a01b036101009092048216918316907fc9f2d63eee8632b33d7a7db5252eb29036e81ee4fbe29260febe0c49ffb8a7bb90600090a3600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6111166117b3565b6001600160a01b03821661116c5760405162461bcd60e51b815260206004820152601a60248201527f5f746f6b656e20616464726573732063616e6e6f7420626520300000000000006044820152606401610c62565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156111b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d791906129b9565b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390529192509084169063a9059cbb906044016020604051808303816000875af115801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e91906129d2565b50505050565b61125c6117b3565b6001600160a01b038216600081815260156020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b6112c36117b3565b670de0b6b3a76400006103e86112d860025490565b6112e390600a61295a565b6112ed9190612971565b6112f79190612971565b8110156113525760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f7420736574206d617857616c6c6574206c6f776572207468616e20604482015263312e302560e01b6064820152608401610c62565b61136481670de0b6b3a764000061295a565b60135550565b60006113746117b3565b620186a061138160025490565b61138c90600161295a565b6113969190612971565b8210156114035760405162461bcd60e51b815260206004820152603560248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60448201527410181718181892903a37ba30b61039bab838363c9760591b6064820152608401610c62565b6103e861140f60025490565b61141a90600561295a565b6114249190612971565b8211156114905760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b6064820152608401610c62565b50601255600190565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6114cc6117b3565b6001600160a01b0381166115315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c62565b61153a8161202f565b50565b6115456117b3565b6014546301000000900460ff16156115a95760405162461bcd60e51b815260206004820152602160248201527f5465616d20686173207265766f6b656420626c61636b6c6973742072696768746044820152607360f81b6064820152608401610c62565b7f0000000000000000000000006b268960693359f8c64e043d72ce7580867521b26001600160a01b0316816001600160a01b03161415801561160857506001600160a01b038116737a250d5630b4cf539739df2c5dacb4c659f2488d14155b61166b5760405162461bcd60e51b815260206004820152602e60248201527f43616e6e6f7420626c61636b6c69737420746f6b656e277320763220726f757460448201526d32b91037b9103b19103837b7b61760911b6064820152608401610c62565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b0383166116f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610c62565b6001600160a01b0382166117525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610c62565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b03163314610df15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c62565b60006118198484611499565b9050600019811461124e57818110156118745760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610c62565b61124e848484840361168f565b6001600160a01b0383166118a75760405162461bcd60e51b8152600401610c62906129ef565b6001600160a01b0382166118cd5760405162461bcd60e51b8152600401610c6290612a34565b6001600160a01b03831660009081526006602052604090205460ff161561192b5760405162461bcd60e51b815260206004820152601260248201527114d95b99195c88189b1858dadb1a5cdd195960721b6044820152606401610c62565b6001600160a01b03821660009081526006602052604090205460ff161561198b5760405162461bcd60e51b8152602060048201526014602482015273149958d95a5d995c88189b1858dadb1a5cdd195960621b6044820152606401610c62565b806000036119a45761199f838360006121db565b505050565b60145460ff1615611d0b576005546001600160a01b038481169116148015906119db57506005546001600160a01b03838116911614155b80156119ef57506001600160a01b03821615155b8015611a0657506001600160a01b03821661dead14155b8015611a15575060075460ff16155b15611d0b57601454610100900460ff16611aad576001600160a01b03831660009081526015602052604090205460ff1680611a6857506001600160a01b03821660009081526015602052604090205460ff165b611aad5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610c62565b6001600160a01b03831660009081526017602052604090205460ff168015611aee57506001600160a01b03821660009081526016602052604090205460ff16155b15611bce57601154811115611b5f5760405162461bcd60e51b815260206004820152603160248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527036b0bc2a3930b234b733a0b6b7bab73a1760791b6064820152608401610c62565b6013546001600160a01b038316600090815260208190526040902054611b859083612993565b1115611bc95760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610c62565b611d0b565b6001600160a01b03821660009081526017602052604090205460ff168015611c0f57506001600160a01b03831660009081526016602052604090205460ff16155b15611c8157601154811115611bc95760405162461bcd60e51b815260206004820152603260248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152711036b0bc2a3930b234b733a0b6b7bab73a1760711b6064820152608401610c62565b6001600160a01b03821660009081526016602052604090205460ff16611d0b576013546001600160a01b038316600090815260208190526040902054611cc79083612993565b1115611d0b5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610c62565b3060009081526020819052604090205460125481108015908190611d37575060145462010000900460ff165b8015611d46575060075460ff16155b8015611d6b57506001600160a01b03851660009081526017602052604090205460ff16155b8015611d9057506001600160a01b03851660009081526015602052604090205460ff16155b8015611db557506001600160a01b03841660009081526015602052604090205460ff16155b15611dda576007805460ff19166001179055611dcf612305565b6007805460ff191690555b6007546001600160a01b03861660009081526015602052604090205460ff91821615911680611e2157506001600160a01b03851660009081526015602052604090205460ff165b15611e2a575060005b6000811561201b576001600160a01b03861660009081526017602052604090205460ff168015611e5c57506000600a54115b15611f1d57611e826103e8611e7c600a548861256590919063ffffffff16565b90612578565b90506103e8600c5482611e95919061295a565b611e9f9190612971565b600f6000828254611eb09190612993565b9091555050600d546103e890611ec6908361295a565b611ed09190612971565b60106000828254611ee19190612993565b9091555050600b546103e890611ef7908361295a565b611f019190612971565b600e6000828254611f129190612993565b90915550611ffd9050565b6001600160a01b03871660009081526017602052604090205460ff168015611f4757506000600954115b15611ffd57611f676103e8611e7c6009548861256590919063ffffffff16565b90506103e8600c5482611f7a919061295a565b611f849190612971565b600f6000828254611f959190612993565b9091555050600d546103e890611fab908361295a565b611fb59190612971565b60106000828254611fc69190612993565b9091555050600b546103e890611fdc908361295a565b611fe69190612971565b600e6000828254611ff79190612993565b90915550505b801561200e5761200e8730836121db565b61201881866129a6565b94505b6120268787876121db565b50505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6120ac307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8461168f565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663f305d7198230856000806120f36005546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561215b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906121809190612a77565b5050505050565b6001600160a01b038216600081815260176020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b6001600160a01b0383166122015760405162461bcd60e51b8152600401610c62906129ef565b6001600160a01b0382166122275760405162461bcd60e51b8152600401610c6290612a34565b6001600160a01b0383166000908152602081905260409020548181101561229f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610c62565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361124e565b3060009081526020819052604081205490506000601054600e54600f5461232c9190612993565b6123369190612993565b90506000821580612345575081155b1561234f57505050565b60125461235d90601461295a565b8311156123755760125461237290601461295a565b92505b6000600283600f5486612388919061295a565b6123929190612971565b61239c9190612971565b905060006123aa8583612584565b9050476123b682612590565b60006123c24783612584565b905060006123f06002600f546123d89190612971565b6123e290896129a6565b600e54611e7c908590612565565b9050600061241e6002600f546124069190612971565b612410908a6129a6565b601054611e7c908690612565565b905060008161242d84866129a6565b61243791906129a6565b6000600f819055600e81905560108190556008546040519293506001600160a01b031691849181818185875af1925050503d8060008114612494576040519150601f19603f3d011682016040523d82523d6000602084013e612499565b606091505b509098505086158015906124ad5750600081115b15612500576124bc8782612081565b600f54604080518881526020810184905280820192909252517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a15b6007546040516101009091046001600160a01b0316904790600081818185875af1925050503d8060008114612551576040519150601f19603f3d011682016040523d82523d6000602084013e612556565b606091505b50505050505050505050505050565b6000612571828461295a565b9392505050565b60006125718284612971565b600061257182846129a6565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106125c5576125c5612aa5565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612643573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126679190612abb565b8160018151811061267a5761267a612aa5565b60200260200101906001600160a01b031690816001600160a01b0316815250506126c5307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8461168f565b60405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac9479061271a908590600090869030904290600401612ad8565b600060405180830381600087803b15801561273457600080fd5b505af1158015612748573d6000803e3d6000fd5b505050505050565b600060208083528351808285015260005b8181101561277d57858101830151858201604001528201612761565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461153a57600080fd5b600080604083850312156127c657600080fd5b82356127d18161279e565b946020939093013593505050565b6000806000606084860312156127f457600080fd5b83356127ff8161279e565b9250602084013561280f8161279e565b929592945050506040919091013590565b60006020828403121561283257600080fd5b5035919050565b6000806040838503121561284c57600080fd5b50508035926020909101359150565b60006020828403121561286d57600080fd5b81356125718161279e565b801515811461153a57600080fd5b6000806040838503121561289957600080fd5b82356128a48161279e565b915060208301356128b481612878565b809150509250929050565b6000602082840312156128d157600080fd5b813561257181612878565b600080604083850312156128ef57600080fd5b82356128fa8161279e565b915060208301356128b48161279e565b600181811c9082168061291e57607f821691505b60208210810361293e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610b8257610b82612944565b60008261298e57634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610b8257610b82612944565b81810381811115610b8257610b82612944565b6000602082840312156129cb57600080fd5b5051919050565b6000602082840312156129e457600080fd5b815161257181612878565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b600080600060608486031215612a8c57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612acd57600080fd5b81516125718161279e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612b285784516001600160a01b031683529383019391830191600101612b03565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212209dc3ea0620357ba3eeab3d39d50d82fe1ffcbfd8eb1c193ae3af856e68ac005a64736f6c63430008120033
Verified Source Code Full Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: Yes (200 runs)
Token.sol 483 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
contract Token is ERC20, Ownable {
using SafeMath for uint256;
// Anti-bot and anti-whale mappings and variables
mapping(address => bool) blacklisted;
bool private swapping;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
address public constant uniswapV2RouterAddr = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address public revShareWallet;
address public teamWallet;
uint256 constant FEE_BASE = 1000; // 100% = 1000
uint256 public buyTotalFees; // buy fee
uint256 public sellTotalFees; // sell fee
uint256 public revShareFee;
uint256 public liquidityFee;
uint256 public teamFee;
uint256 public tokensForRevShare;
uint256 public tokensForLiquidity;
uint256 public tokensForTeam;
uint256 public maxTradingAmount;
uint256 public swapTokensAtAmount;
uint256 public maxWallet;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
bool public blacklistRenounced = false;
/******************/
// exclude from fees and max transaction amount
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTradingAmount;
// store addresses that a automatic market maker pairs. Any transfer *to* these addresses
// could be subject to a maximum transfer amount
mapping(address => bool) public automatedMarketMakerPairs;
event ExcludeFromFees(address indexed account, bool isExcluded);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event revShareWalletUpdated(address indexed newWallet, address indexed oldWallet);
event teamWalletUpdated(address indexed newWallet, address indexed oldWallet);
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
constructor(
string memory name,
string memory symbol,
uint256 maxTradingAmount_,
uint256 maxWallet_,
uint256 revFee_,
uint256 liquidityFee_,
uint256 sellFee_,
uint256 buyFee_,
address revShareWallet_
) ERC20(name, symbol) {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(uniswapV2RouterAddr);
excludeFromMaxTrading(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
excludeFromMaxTrading(address(uniswapV2Pair), true);
_setAutomatedMarketMakerPair(address(uniswapV2Pair), true);
uint256 totalSupply = 1_000_000_000 * 1e18;
swapTokensAtAmount = (totalSupply * 5) / 10000; // auto swap back at 0.05% of supply
maxTradingAmount = maxTradingAmount_ * 1e18;
maxWallet = maxWallet_ * 1e18;
// Fee distribute
// First stage: 20% for Liquid, 80% for Team
// Next stage: 20% for Liquid, 40% for Team, 40% for Rev
revShareFee = revFee_;
liquidityFee = liquidityFee_;
teamFee = FEE_BASE - revFee_ - liquidityFee_;
// 5% fee for buy/sell
buyTotalFees = buyFee_;
sellTotalFees = sellFee_;
revShareWallet = revShareWallet_;
teamWallet = msg.sender;
// exclude from paying fees or having max transaction amount
excludeFromFees(owner(), true);
excludeFromFees(address(this), true);
excludeFromFees(deadAddress, true);
excludeFromMaxTrading(owner(), true);
excludeFromMaxTrading(address(this), true);
excludeFromMaxTrading(deadAddress, true);
/*
_mint is an internal function in ERC20.sol that is only called here,
and CANNOT be called ever again
*/
_mint(msg.sender, totalSupply);
}
receive() external payable {}
// once enabled, can never be turned off
function startNow() external onlyOwner {
tradingActive = true;
swapEnabled = true;
}
// remove limits after token is stable
function removeLimits() external onlyOwner returns (bool) {
limitsInEffect = false;
return true;
}
// change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(
uint256 newAmount
) external onlyOwner returns (bool) {
require(
newAmount >= (totalSupply() * 1) / 100000,
"Swap amount cannot be lower than 0.001% total supply."
);
require(
newAmount <= (totalSupply() * 5) / 1000,
"Swap amount cannot be higher than 0.5% total supply."
);
swapTokensAtAmount = newAmount;
return true;
}
function updateMaxTradingAmount(uint256 newNum) external onlyOwner {
require(
newNum >= ((totalSupply() * 1) / 1000) / 1e18,
"Cannot set maxTradingAmount lower than 0.1%"
);
maxTradingAmount = newNum * (10 ** 18);
}
function updateMaxWalletAmount(uint256 newNum) external onlyOwner {
require(
newNum >= ((totalSupply() * 10) / 1000) / 1e18,
"Cannot set maxWallet lower than 1.0%"
);
maxWallet = newNum * (10 ** 18);
}
function excludeFromMaxTrading(address updAds, bool isEx) public onlyOwner {
_isExcludedMaxTradingAmount[updAds] = isEx;
}
// only use to disable contract sales if absolutely necessary (emergency use only)
function updateSwapEnabled(bool enabled) external onlyOwner {
swapEnabled = enabled;
}
function updateFees(
uint256 buyTotalFees_,
uint256 sellTotalFees_
) external onlyOwner {
require(
buyTotalFees_ <= 50 && sellTotalFees_ <= 50,
"Buy/sell fees must be <= 50."
);
buyTotalFees = buyTotalFees_;
sellTotalFees = sellTotalFees_;
}
function updateFeeDistribution(
uint256 revShareFee_,
uint256 liquidityFee_
) external onlyOwner {
require(revShareFee_ + liquidityFee_ <= FEE_BASE, "Wrong Input");
revShareFee = revShareFee_;
liquidityFee = liquidityFee_;
teamFee = FEE_BASE - revShareFee_ - liquidityFee_;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
function setAutomatedMarketMakerPair(
address pair,
bool value
) public onlyOwner {
require(pair != uniswapV2Pair, "The pair cannot be removed from automatedMarketMakerPairs");
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
function updateRevShareWallet(
address newRevShareWallet
) external onlyOwner {
emit revShareWalletUpdated(newRevShareWallet, revShareWallet);
revShareWallet = newRevShareWallet;
}
function updateTeamWallet(address newWallet) external onlyOwner {
emit teamWalletUpdated(newWallet, teamWallet);
teamWallet = newWallet;
}
function isExcludedFromFees(address account) public view returns (bool) {
return _isExcludedFromFees[account];
}
function isBlacklisted(address account) public view returns (bool) {
return blacklisted[account];
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(!blacklisted[from], "Sender blacklisted");
require(!blacklisted[to], "Receiver blacklisted");
if (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (limitsInEffect) {
if (
from != owner() &&
to != owner() &&
to != address(0) &&
to != deadAddress &&
!swapping
) {
if (!tradingActive) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
if (
automatedMarketMakerPairs[from] &&
!_isExcludedMaxTradingAmount[to]
) {
//when buy
require(
amount <= maxTradingAmount,
"Buy transfer amount exceeds the maxTradingAmount."
);
require(
amount + balanceOf(to) <= maxWallet,
"Max wallet exceeded"
);
} else if (
automatedMarketMakerPairs[to] &&
!_isExcludedMaxTradingAmount[from]
) {
//when sell
require(
amount <= maxTradingAmount,
"Sell transfer amount exceeds the maxTradingAmount."
);
} else if (!_isExcludedMaxTradingAmount[to]) {
//when transfer
require(
amount + balanceOf(to) <= maxWallet,
"Max wallet exceeded"
);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
swapEnabled &&
!swapping &&
!automatedMarketMakerPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on sell
if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(FEE_BASE);
tokensForLiquidity += (fees * liquidityFee) / FEE_BASE;
tokensForTeam += (fees * teamFee) / FEE_BASE;
tokensForRevShare += (fees * revShareFee) / FEE_BASE;
}
// on buy
else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(FEE_BASE);
tokensForLiquidity += (fees * liquidityFee) / FEE_BASE;
tokensForTeam += (fees * teamFee) / FEE_BASE;
tokensForRevShare += (fees * revShareFee) / FEE_BASE;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
);
}
function addLiquidityWithBalance() external onlyOwner {
addLiquidity(balanceOf(address(this)), address(this).balance);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
uint256 totalTokensToSwap = tokensForLiquidity +
tokensForRevShare +
tokensForTeam;
bool success;
if (contractBalance == 0 || totalTokensToSwap == 0) {
return;
}
if (contractBalance > swapTokensAtAmount * 20) {
contractBalance = swapTokensAtAmount * 20;
}
// Halve the amount of liquidity tokens
uint256 liquidityTokens = (contractBalance * tokensForLiquidity) /
totalTokensToSwap /
2;
uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens);
uint256 initialETHBalance = address(this).balance;
swapTokensForEth(amountToSwapForETH);
uint256 ethBalance = address(this).balance.sub(initialETHBalance);
uint256 ethForRevShare = ethBalance.mul(tokensForRevShare).div(
totalTokensToSwap - (tokensForLiquidity / 2)
);
uint256 ethForTeam = ethBalance.mul(tokensForTeam).div(
totalTokensToSwap - (tokensForLiquidity / 2)
);
uint256 ethForLiquidity = ethBalance - ethForRevShare - ethForTeam;
tokensForLiquidity = 0;
tokensForRevShare = 0;
tokensForTeam = 0;
(success, ) = address(teamWallet).call{value: ethForTeam}("");
if (liquidityTokens > 0 && ethForLiquidity > 0) {
addLiquidity(liquidityTokens, ethForLiquidity);
emit SwapAndLiquify(
amountToSwapForETH,
ethForLiquidity,
tokensForLiquidity
);
}
(success, ) = address(revShareWallet).call{
value: address(this).balance
}("");
}
function withdrawStuckToken(
address _token,
address _to
) external onlyOwner {
require(_token != address(0), "_token address cannot be 0");
uint256 _contractBalance = IERC20(_token).balanceOf(address(this));
IERC20(_token).transfer(_to, _contractBalance);
}
function withdrawStuckEth(address toAddr) external onlyOwner {
(bool success, ) = toAddr.call{value: address(this).balance}("");
require(success);
}
// @dev team renounce blacklist commands
function renounceBlacklist() public onlyOwner {
blacklistRenounced = true;
}
// @dev blacklist v3 pools; can unblacklist() down the road to suit project and community
function blacklist(address _addr) public onlyOwner {
require(!blacklistRenounced, "Team has revoked blacklist rights");
require(
_addr != address(uniswapV2Pair) && _addr != address(uniswapV2RouterAddr),
"Cannot blacklist token's v2 router or v2 pool."
);
blacklisted[_addr] = true;
}
// @dev unblacklist address; not affected by blacklistRenounced incase team wants to unblacklist v3 pools down the road
function unblacklist(address _addr) public onlyOwner {
blacklisted[_addr] = false;
}
}
Address.sol 244 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/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);
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.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. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
ERC20.sol 365 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
IERC20.sol 78 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
SafeMath.sol 215 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
ReentrancyGuard.sol 77 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
IUniswapV2Factory.sol 17 lines
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
IERC20Metadata.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
IUniswapV2Router01.sol 95 lines
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
IUniswapV2Router02.sol 44 lines
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
Read Contract
_isExcludedMaxTradingAmount 0x99524bbe → bool
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
blacklistRenounced 0x3dc599ff → bool
buyTotalFees 0xd85ba063 → uint256
deadAddress 0x27c8f835 → address
decimals 0x313ce567 → uint8
isBlacklisted 0xfe575a87 → bool
isExcludedFromFees 0x4fbee193 → bool
limitsInEffect 0x4a62bb65 → bool
liquidityFee 0x98118cb4 → uint256
maxTradingAmount 0x96ea32da → uint256
maxWallet 0xf8b45b05 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
revShareFee 0x72cacded → uint256
revShareWallet 0x782c4e99 → address
sellTotalFees 0x6a486a8e → uint256
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
teamFee 0xd7c94efd → uint256
teamWallet 0x59927044 → address
tokensForLiquidity 0x1a8145bb → uint256
tokensForRevShare 0x24b9f3c1 → uint256
tokensForTeam 0xfde83a34 → uint256
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address
uniswapV2RouterAddr 0xcea20851 → address
Write Contract 26 functions
These functions modify contract state and require a wallet transaction to execute.
addLiquidityWithBalance 0x89f6bab4
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
blacklist 0xf9f92be4
address _addr
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeFromFees 0xc0246668
address account
bool excluded
excludeFromMaxTrading 0x64f99f82
address updAds
bool isEx
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
removeLimits 0x751039fc
No parameters
returns: bool
renounceBlacklist 0x5f189361
No parameters
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
startNow 0x0e3db9f2
No parameters
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unblacklist 0x75e3661e
address _addr
updateFeeDistribution 0x422b5bf5
uint256 revShareFee_
uint256 liquidityFee_
updateFees 0x6db79437
uint256 buyTotalFees_
uint256 sellTotalFees_
updateMaxTradingAmount 0x38377d0a
uint256 newNum
updateMaxWalletAmount 0xc18bc195
uint256 newNum
updateRevShareWallet 0xadee28ff
address newRevShareWallet
updateSwapEnabled 0x924de9b7
bool enabled
updateSwapTokensAtAmount 0xd257b34f
uint256 newAmount
returns: bool
updateTeamWallet 0x7cb332bb
address newWallet
withdrawStuckEth 0x7ca8448a
address toAddr
withdrawStuckToken 0xbc205ad3
address _token
address _to
Recent Transactions
No transactions found for this address