Address Contract Partially Verified
Address
0x31932270A7F24397FA50992Cbbe69326050f95F4
Balance
0.000261089 ETH
Nonce
1
Code Size
9953 bytes
Creator
0xaDb5EDe5...51D7 at tx 0xae0c9cc8...6344ba
Indexed Transactions
0
Contract Bytecode
9953 bytes
0x6080604052600436106102345760003560e01c80634549b0391161012e5780638da5cb5b116100ab578063af41063b1161006f578063af41063b146106a9578063bc063e1a146106c9578063dd62ed3e146106df578063f2fde38b14610725578063ffa1ad741461074557600080fd5b80638da5cb5b146106165780638ee88c531461063457806395d89b4114610654578063a457c2d714610669578063a9059cbb1461068957600080fd5b80636bc87c3a116100f25780636bc87c3a1461057257806370a0823114610588578063715018a6146105a8578063796431d0146105bd57806388f82020146105dd57600080fd5b80634549b039146104b857806349bd5a5e146104d85780634a74bb02146104f857806352390c02146105195780635342acb41461053957600080fd5b8063241ec3be116101bc5780633b124fe7116101805780633b124fe71461042c5780633bd5d17314610442578063407133d21461046257806340f8007a14610482578063437823ec1461049857600080fd5b8063241ec3be146103895780632d838119146103aa578063313ce567146103ca5780633685d419146103ec578063395093511461040c57600080fd5b80631694505e116102035780631694505e146102dc57806318160ddd1461031457806319a8ac9e146103295780631f46b1c61461034957806323b872dd1461036957600080fd5b8063061c82d01461024057806306fdde0314610262578063095ea7b31461028d57806313114a9d146102bd57600080fd5b3661023b57005b600080fd5b34801561024c57600080fd5b5061026061025b366004612407565b61075a565b005b34801561026e57600080fd5b506102776107fa565b6040516102849190612477565b60405180910390f35b34801561029957600080fd5b506102ad6102a83660046123c2565b61088c565b6040519015158152602001610284565b3480156102c957600080fd5b506009545b604051908152602001610284565b3480156102e857600080fd5b506013546102fc906001600160a01b031681565b6040516001600160a01b039091168152602001610284565b34801561032057600080fd5b506007546102ce565b34801561033557600080fd5b506015546102fc906001600160a01b031681565b34801561035557600080fd5b506102606103643660046123ed565b6108a3565b34801561037557600080fd5b506102ad610384366004612382565b6108eb565b34801561039557600080fd5b506017546102ad90600160a01b900460ff1681565b3480156103b657600080fd5b506102ce6103c5366004612407565b610954565b3480156103d657600080fd5b50600c5460405160ff9091168152602001610284565b3480156103f857600080fd5b50610260610407366004612312565b6109d8565b34801561041857600080fd5b506102ad6104273660046123c2565b610bc7565b34801561043857600080fd5b506102ce600d5481565b34801561044e57600080fd5b5061026061045d366004612407565b610bfd565b34801561046e57600080fd5b506017546102fc906001600160a01b031681565b34801561048e57600080fd5b506102ce60115481565b3480156104a457600080fd5b506102606104b3366004612312565b610ce9565b3480156104c457600080fd5b506102ce6104d336600461241f565b610d37565b3480156104e457600080fd5b506014546102fc906001600160a01b031681565b34801561050457600080fd5b506015546102ad90600160a81b900460ff1681565b34801561052557600080fd5b50610260610534366004612312565b610dc6565b34801561054557600080fd5b506102ad610554366004612312565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561057e57600080fd5b506102ce600f5481565b34801561059457600080fd5b506102ce6105a3366004612312565b610f19565b3480156105b457600080fd5b50610260610f78565b3480156105c957600080fd5b506102606105d8366004612407565b610fae565b3480156105e957600080fd5b506102ad6105f8366004612312565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561062257600080fd5b506000546001600160a01b03166102fc565b34801561064057600080fd5b5061026061064f366004612407565b6110a8565b34801561066057600080fd5b506102776110ed565b34801561067557600080fd5b506102ad6106843660046123c2565b6110fc565b34801561069557600080fd5b506102ad6106a43660046123c2565b61114b565b3480156106b557600080fd5b506102606106c4366004612407565b611158565b3480156106d557600080fd5b506102ce6109c481565b3480156106eb57600080fd5b506102ce6106fa36600461234a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561073157600080fd5b50610260610740366004612312565b61119d565b34801561075157600080fd5b506102ce600281565b6000546001600160a01b0316331461078d5760405162461bcd60e51b8152600401610784906124ca565b60405180910390fd5b600d819055601154600f546109c491906107a7908461256f565b6107b1919061256f565b11156107f75760405162461bcd60e51b8152602060048201526015602482015274546f74616c20666565206973206f7665722032352560581b6044820152606401610784565b50565b6060600a8054610809906125dd565b80601f0160208091040260200160405190810160405280929190818152602001828054610835906125dd565b80156108825780601f1061085757610100808354040283529160200191610882565b820191906000526020600020905b81548152906001019060200180831161086557829003601f168201915b5050505050905090565b6000610899338484611241565b5060015b92915050565b6000546001600160a01b031633146108cd5760405162461bcd60e51b8152600401610784906124ca565b60178054911515600160a01b0260ff60a01b19909216919091179055565b60006108f8848484611366565b61094a84336109458560405180606001604052806028815260200161265f602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906115dc565b611241565b5060019392505050565b60006008548211156109bb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610784565b60006109c5611608565b90506109d18382611235565b9392505050565b6000546001600160a01b03163314610a025760405162461bcd60e51b8152600401610784906124ca565b6001600160a01b03811660009081526005602052604090205460ff16610a6a5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610784565b60005b600654811015610bc357816001600160a01b031660068281548110610aa257634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610bb15760068054610acd906001906125c6565b81548110610aeb57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600680546001600160a01b039092169183908110610b2557634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600590925220805460ff191690556006805480610b8b57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555050565b80610bbb81612618565b915050610a6d565b5050565b3360008181526003602090815260408083206001600160a01b03871684529091528120549091610899918590610945908661162b565b3360008181526005602052604090205460ff1615610c725760405162461bcd60e51b815260206004820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201526b3434b990333ab731ba34b7b760a11b6064820152608401610784565b6000610c7d83611637565b5050506001600160a01b038616600090815260016020526040902054939450610cab93925084915050611692565b6001600160a01b038316600090815260016020526040902055600854610cd19082611692565b600855600954610ce1908461162b565b600955505050565b6000546001600160a01b03163314610d135760405162461bcd60e51b8152600401610784906124ca565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000600754831115610d8b5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610784565b81610dab576000610d9b84611637565b5094965061089d95505050505050565b6000610db684611637565b5093965061089d95505050505050565b6000546001600160a01b03163314610df05760405162461bcd60e51b8152600401610784906124ca565b6001600160a01b03811660009081526005602052604090205460ff1615610e595760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610784565b6001600160a01b03811660009081526001602052604090205415610eb3576001600160a01b038116600090815260016020526040902054610e9990610954565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600560205260408120805460ff191660019081179091556006805491820181559091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319169091179055565b6001600160a01b03811660009081526005602052604081205460ff1615610f5657506001600160a01b031660009081526002602052604090205490565b6001600160a01b03821660009081526001602052604090205461089d90610954565b6000546001600160a01b03163314610fa25760405162461bcd60e51b8152600401610784906124ca565b610fac600061169e565b565b6000546001600160a01b03163314610fd85760405162461bcd60e51b8152600401610784906124ca565b610ff8612710610ff26005610fec60075490565b906116ee565b90611235565b81101561106d5760405162461bcd60e51b815260206004820152603860248201527f537761706261636b20616d6f756e742073686f756c64206265206174206c656160448201527f737420302e303525206f6620746f74616c20737570706c7900000000000000006064820152608401610784565b60168190556040518181527ff7edd1a72d399eb95c56c07c5a26f00a9096735269c96c75caa8fc4e15bcd5d29060200160405180910390a150565b6000546001600160a01b031633146110d25760405162461bcd60e51b8152600401610784906124ca565b600f819055601154600d546109c491906107a790849061256f565b6060600b8054610809906125dd565b6000610899338461094585604051806060016040528060258152602001612687602591393360009081526003602090815260408083206001600160a01b038d16845290915290205491906115dc565b6000610899338484611366565b6000546001600160a01b031633146111825760405162461bcd60e51b8152600401610784906124ca565b6011819055600f54600d546109c49183916107a7919061256f565b6000546001600160a01b031633146111c75760405162461bcd60e51b8152600401610784906124ca565b6001600160a01b03811661122c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610784565b6107f78161169e565b60006109d18284612587565b6001600160a01b0383166112a35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610784565b6001600160a01b0382166113045760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610784565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166113ca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610784565b6001600160a01b03821661142c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610784565b6000811161148e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610784565b601754600160a01b900460ff161561150f5760175460405163090ec10b60e31b81526001600160a01b03858116600483015284811660248301526044820184905290911690634876085890606401600060405180830381600087803b1580156114f657600080fd5b505af115801561150a573d6000803e3d6000fd5b505050505b600061151a30610f19565b6016549091508110801590819061153b5750601554600160a01b900460ff16155b801561155557506014546001600160a01b03868116911614155b801561156a5750601554600160a81b900460ff165b1561157d57601654915061157d826116fa565b6001600160a01b03851660009081526004602052604090205460019060ff16806115bf57506001600160a01b03851660009081526004602052604090205460ff165b156115c8575060005b6115d4868686846117a1565b505050505050565b600081848411156116005760405162461bcd60e51b81526004016107849190612477565b505050900390565b6000806000611615611941565b90925090506116248282611235565b9250505090565b60006109d1828461256f565b60008060008060008060008060008060006116518c611afb565b935093509350935060008060006116728f87878761166d611608565b611b50565b919f509d509b509599509397509195509350505050919395979092949650565b60006109d182846125c6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006109d182846125a7565b6015805460ff60a01b1916600160a01b179055600061171a826002611235565b905060006117288383611692565b90504761173483611bb2565b60006117404783611692565b905061174c8382611d2f565b60408051858152602081018390529081018490527f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a150506015805460ff60a01b19169055505050565b806117cb576117cb600d8054600e55600f8054601055601180546012556000928390559082905555565b6001600160a01b03841660009081526005602052604090205460ff16801561180c57506001600160a01b03831660009081526005602052604090205460ff16155b156118215761181c848484611df0565b61191f565b6001600160a01b03841660009081526005602052604090205460ff1615801561186257506001600160a01b03831660009081526005602052604090205460ff165b156118725761181c848484611f36565b6001600160a01b03841660009081526005602052604090205460ff161580156118b457506001600160a01b03831660009081526005602052604090205460ff16155b156118c45761181c848484611ff5565b6001600160a01b03841660009081526005602052604090205460ff16801561190457506001600160a01b03831660009081526005602052604090205460ff165b156119145761181c84848461204f565b61191f848484611ff5565b8061193b5761193b600e54600d55601054600f55601254601155565b50505050565b6008546007546000918291825b600654811015611acb5782600160006006848154811061197e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205411806119f757508160026000600684815481106119d057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611a0d57600854600754945094505050509091565b611a616001600060068481548110611a3557634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611692565b9250611ab76002600060068481548110611a8b57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611692565b915080611ac381612618565b91505061194e565b50600754600854611adb91611235565b821015611af2576008546007549350935050509091565b90939092509050565b6000806000806000611b0c866120d8565b90506000611b19876120f5565b90506000611b2688612112565b90506000611b4082611b3a85818d89611692565b90611692565b9993985091965094509092505050565b6000808080611b5f89866116ee565b90506000611b6d89876116ee565b90506000611b7b89886116ee565b90506000611b8989896116ee565b90506000611b9d82611b3a85818989611692565b949d949c50929a509298505050505050505050565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611bf557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611c4957600080fd5b505afa158015611c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c81919061232e565b81600181518110611ca257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601354611cc89130911684611241565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611d019085906000908690309042906004016124ff565b600060405180830381600087803b158015611d1b57600080fd5b505af11580156115d4573d6000803e3d6000fd5b601354611d479030906001600160a01b031684611241565b60135460405163f305d71960e01b815230600482015260248101849052600060448201819052606482015261dead60848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b158015611db057600080fd5b505af1158015611dc4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611de9919061244a565b5050505050565b6000806000806000806000611e0488611637565b9650965096509650965096509650611e4a88600260008d6001600160a01b03166001600160a01b031681526020019081526020016000205461169290919063ffffffff16565b6001600160a01b038b16600090815260026020908152604080832093909355600190522054611e799088611692565b6001600160a01b03808c1660009081526001602052604080822093909355908b1681522054611ea8908761162b565b6001600160a01b038a16600090815260016020526040902055611eca82612148565b611ed3816121d1565b611edd85846122d9565b886001600160a01b03168a6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051611f2291815260200190565b60405180910390a350505050505050505050565b6000806000806000806000611f4a88611637565b9650965096509650965096509650611f9087600160008d6001600160a01b03166001600160a01b031681526020019081526020016000205461169290919063ffffffff16565b6001600160a01b03808c16600090815260016020908152604080832094909455918c16815260029091522054611fc6908561162b565b6001600160a01b038a16600090815260026020908152604080832093909355600190522054611ea8908761162b565b600080600080600080600061200988611637565b9650965096509650965096509650611e7987600160008d6001600160a01b03166001600160a01b031681526020019081526020016000205461169290919063ffffffff16565b600080600080600080600061206388611637565b96509650965096509650965096506120a988600260008d6001600160a01b03166001600160a01b031681526020019081526020016000205461169290919063ffffffff16565b6001600160a01b038b16600090815260026020908152604080832093909355600190522054611f909088611692565b600061089d612710610ff2600d54856116ee90919063ffffffff16565b600061089d612710610ff2600f54856116ee90919063ffffffff16565b6015546000906001600160a01b031661212d57506000919050565b61089d612710610ff2601154856116ee90919063ffffffff16565b6000612152611608565b9050600061216083836116ee565b3060009081526001602052604090205490915061217d908261162b565b3060009081526001602090815260408083209390935560059052205460ff16156121cc57306000908152600260205260409020546121bb908461162b565b306000908152600260205260409020555b505050565b80156107f75760006121e1611608565b905060006121ef83836116ee565b6015546001600160a01b0316600090815260016020526040902054909150612217908261162b565b601580546001600160a01b03908116600090815260016020908152604080832095909555925490911681526005909152205460ff1615612292576015546001600160a01b0316600090815260026020526040902054612276908461162b565b6015546001600160a01b03166000908152600260205260409020555b6015546001600160a01b0316336001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161135991815260200190565b6008546122e69083611692565b6008556009546122f6908261162b565b6009555050565b8035801515811461230d57600080fd5b919050565b600060208284031215612323578081fd5b81356109d181612649565b60006020828403121561233f578081fd5b81516109d181612649565b6000806040838503121561235c578081fd5b823561236781612649565b9150602083013561237781612649565b809150509250929050565b600080600060608486031215612396578081fd5b83356123a181612649565b925060208401356123b181612649565b929592945050506040919091013590565b600080604083850312156123d4578182fd5b82356123df81612649565b946020939093013593505050565b6000602082840312156123fe578081fd5b6109d1826122fd565b600060208284031215612418578081fd5b5035919050565b60008060408385031215612431578182fd5b82359150612441602084016122fd565b90509250929050565b60008060006060848603121561245e578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156124a357858101830151858201604001528201612487565b818111156124b45783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561254e5784516001600160a01b031683529383019391830191600101612529565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561258257612582612633565b500190565b6000826125a257634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156125c1576125c1612633565b500290565b6000828210156125d8576125d8612633565b500390565b600181811c908216806125f157607f821691505b6020821081141561261257634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561262c5761262c612633565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146107f757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f1deb0ccff45f9bf74f993406e2ca2fdf2892684e746540a5defc663c225c84764736f6c63430008040033
Verified Source Code Partial Match
Compiler: v0.8.4+commit.c7e474f2
EVM: istanbul
Optimization: Yes (200 runs)
AntiBotLiquidityGeneratorToken.sol 1675 lines
// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}
// Dependency file: @openzeppelin/contracts/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;
}
}
// Dependency file: @openzeppelin/contracts/access/Ownable.sol
// pragma solidity ^0.8.0;
// import "@openzeppelin/contracts/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() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// Dependency file: @openzeppelin/contracts/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 no longer needed starting with Solidity 0.8. 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 substraction 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;
}
}
}
// Dependency file: @openzeppelin/contracts/utils/Address.sol
// pragma solidity ^0.8.0;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// Dependency file: contracts/interfaces/IUniswapV2Router02.sol
// 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,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETHWithPermit(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountToken, uint256 amountETH);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapTokensForExactETH(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountOut);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
function getAmountsOut(uint256 amountIn, address[] calldata path)
external
view
returns (uint256[] memory amounts);
function getAmountsIn(uint256 amountOut, address[] calldata path)
external
view
returns (uint256[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
// Dependency file: contracts/interfaces/IUniswapV2Factory.sol
// pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
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(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB)
external
returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// Dependency file: contracts/interfaces/IPinkAntiBot.sol
// pragma solidity >=0.5.0;
interface IPinkAntiBot {
function setTokenOwner(address owner) external;
function onPreTransferCheck(
address from,
address to,
uint256 amount
) external;
}
// Dependency file: contracts/BaseToken.sol
// pragma solidity =0.8.4;
enum TokenType {
standard,
antiBotStandard,
liquidityGenerator,
antiBotLiquidityGenerator,
baby,
antiBotBaby,
buybackBaby,
antiBotBuybackBaby
}
abstract contract BaseToken {
event TokenCreated(
address indexed owner,
address indexed token,
TokenType tokenType,
uint256 version
);
}
// Root file: contracts/liquidity-generator/AntiBotLiquidityGeneratorToken.sol
pragma solidity =0.8.4;
// import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import "@openzeppelin/contracts/access/Ownable.sol";
// import "@openzeppelin/contracts/utils/math/SafeMath.sol";
// import "@openzeppelin/contracts/utils/Address.sol";
// import "contracts/interfaces/IUniswapV2Router02.sol";
// import "contracts/interfaces/IUniswapV2Factory.sol";
// import "contracts/interfaces/IPinkAntiBot.sol";
// import "contracts/BaseToken.sol";
contract AntiBotLiquidityGeneratorToken is IERC20, Ownable, BaseToken {
using SafeMath for uint256;
using Address for address;
uint256 public constant VERSION = 2;
uint256 public constant MAX_FEE = 10**4 / 4;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal;
uint256 private _rTotal;
uint256 private _tFeeTotal;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 public _taxFee;
uint256 private _previousTaxFee;
uint256 public _liquidityFee;
uint256 private _previousLiquidityFee;
uint256 public _charityFee;
uint256 private _previousCharityFee;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
address public _charityAddress;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled;
uint256 private numTokensSellToAddToLiquidity;
IPinkAntiBot public pinkAntiBot;
bool public enableAntiBot;
event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event SwapAndLiquifyAmountUpdated(uint256 amount);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap() {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor(
string memory name_,
string memory symbol_,
uint256 totalSupply_,
address router_,
address charityAddress_,
uint16 taxFeeBps_,
uint16 liquidityFeeBps_,
uint16 charityFeeBps_,
address pinkAntiBot_,
address serviceFeeReceiver_,
uint256 serviceFee_
) payable {
if (charityAddress_ == address(0)) {
require(
charityFeeBps_ == 0,
"Cant set both charity address to address 0 and charity percent more than 0"
);
}
require(
taxFeeBps_ + liquidityFeeBps_ + charityFeeBps_ <= MAX_FEE,
"Total fee is over 25%"
);
pinkAntiBot = IPinkAntiBot(pinkAntiBot_);
pinkAntiBot.setTokenOwner(owner());
enableAntiBot = true;
_name = name_;
_symbol = symbol_;
_decimals = 9;
_tTotal = totalSupply_;
_rTotal = (MAX - (MAX % _tTotal));
_taxFee = taxFeeBps_;
_previousTaxFee = _taxFee;
_liquidityFee = liquidityFeeBps_;
_previousLiquidityFee = _liquidityFee;
_charityAddress = charityAddress_;
_charityFee = charityFeeBps_;
_previousCharityFee = _charityFee;
numTokensSellToAddToLiquidity = totalSupply_.div(10**3); // 0.1%
swapAndLiquifyEnabled = true;
_rOwned[owner()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router_);
// Create a uniswap pair for this new token
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
// set the rest of the contract variables
uniswapV2Router = _uniswapV2Router;
// exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), owner(), _tTotal);
emit TokenCreated(
owner(),
address(this),
TokenType.antiBotLiquidityGenerator,
VERSION
);
payable(serviceFeeReceiver_).transfer(serviceFee_);
}
function setEnableAntiBot(bool _enable) external onlyOwner {
enableAntiBot = _enable;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"ERC20: decreased allowance below zero"
)
);
return true;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function deliver(uint256 tAmount) public {
address sender = _msgSender();
require(
!_isExcluded[sender],
"Excluded addresses cannot call this function"
);
(uint256 rAmount, , , , , , ) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee)
public
view
returns (uint256)
{
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount, , , , , , ) = _getValues(tAmount);
return rAmount;
} else {
(, uint256 rTransferAmount, , , , , ) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount)
public
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeFromReward(address account) public onlyOwner {
// require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.');
require(!_isExcluded[account], "Account is already excluded");
if (_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeInReward(address account) external onlyOwner {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _transferBothExcluded(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tLiquidity,
uint256 tCharity
) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeLiquidity(tLiquidity);
_takeCharityFee(tCharity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function setTaxFeePercent(uint256 taxFeeBps) external onlyOwner {
_taxFee = taxFeeBps;
require(
_taxFee + _liquidityFee + _charityFee <= MAX_FEE,
"Total fee is over 25%"
);
}
function setLiquidityFeePercent(uint256 liquidityFeeBps)
external
onlyOwner
{
_liquidityFee = liquidityFeeBps;
require(
_taxFee + _liquidityFee + _charityFee <= MAX_FEE,
"Total fee is over 25%"
);
}
function setCharityFeePercent(uint256 charityFeeBps) external onlyOwner {
_charityFee = charityFeeBps;
require(
_taxFee + _liquidityFee + _charityFee <= MAX_FEE,
"Total fee is over 25%"
);
}
function setSwapBackSettings(uint256 _amount) external onlyOwner {
require(
_amount >= totalSupply().mul(5).div(10**4),
"Swapback amount should be at least 0.05% of total supply"
);
numTokensSellToAddToLiquidity = _amount;
emit SwapAndLiquifyAmountUpdated(_amount);
}
//to recieve ETH from uniswapV2Router when swaping
receive() external payable {}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(
uint256 tTransferAmount,
uint256 tFee,
uint256 tLiquidity,
uint256 tCharity
) = _getTValues(tAmount);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tLiquidity,
tCharity,
_getRate()
);
return (
rAmount,
rTransferAmount,
rFee,
tTransferAmount,
tFee,
tLiquidity,
tCharity
);
}
function _getTValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256
)
{
uint256 tFee = calculateTaxFee(tAmount);
uint256 tLiquidity = calculateLiquidityFee(tAmount);
uint256 tCharityFee = calculateCharityFee(tAmount);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity).sub(
tCharityFee
);
return (tTransferAmount, tFee, tLiquidity, tCharityFee);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tLiquidity,
uint256 tCharity,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rLiquidity = tLiquidity.mul(currentRate);
uint256 rCharity = tCharity.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity).sub(
rCharity
);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (
_rOwned[_excluded[i]] > rSupply ||
_tOwned[_excluded[i]] > tSupply
) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity);
if (_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity);
}
function _takeCharityFee(uint256 tCharity) private {
if (tCharity > 0) {
uint256 currentRate = _getRate();
uint256 rCharity = tCharity.mul(currentRate);
_rOwned[_charityAddress] = _rOwned[_charityAddress].add(rCharity);
if (_isExcluded[_charityAddress])
_tOwned[_charityAddress] = _tOwned[_charityAddress].add(
tCharity
);
emit Transfer(_msgSender(), _charityAddress, tCharity);
}
}
function calculateTaxFee(uint256 _amount) private view returns (uint256) {
return _amount.mul(_taxFee).div(10**4);
}
function calculateLiquidityFee(uint256 _amount)
private
view
returns (uint256)
{
return _amount.mul(_liquidityFee).div(10**4);
}
function calculateCharityFee(uint256 _amount)
private
view
returns (uint256)
{
if (_charityAddress == address(0)) return 0;
return _amount.mul(_charityFee).div(10**4);
}
function removeAllFee() private {
_previousTaxFee = _taxFee;
_previousLiquidityFee = _liquidityFee;
_previousCharityFee = _charityFee;
_taxFee = 0;
_liquidityFee = 0;
_charityFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_liquidityFee = _previousLiquidityFee;
_charityFee = _previousCharityFee;
}
function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (enableAntiBot) {
pinkAntiBot.onPreTransferCheck(from, to, amount);
}
// is the token balance of this contract address over the min number of
// tokens that we need to initiate a swap + liquidity lock?
// also, don't get caught in a circular liquidity event.
// also, don't swap & liquify if sender is uniswap pair.
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinTokenBalance = contractTokenBalance >=
numTokensSellToAddToLiquidity;
if (
overMinTokenBalance &&
!inSwapAndLiquify &&
from != uniswapV2Pair &&
swapAndLiquifyEnabled
) {
contractTokenBalance = numTokensSellToAddToLiquidity;
//add liquidity
swapAndLiquify(contractTokenBalance);
}
//indicates if fee should be deducted from transfer
bool takeFee = true;
//if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
//transfer amount, it will take tax, burn, liquidity fee
_tokenTransfer(from, to, amount, takeFee);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
// split the contract balance into halves
uint256 half = contractTokenBalance.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current ETH balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for ETH
swapTokensForEth(half); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered
// how much ETH did we just swap into?
uint256 newBalance = address(this).balance.sub(initialBalance);
// add liquidity to uniswap
addLiquidity(otherHalf, newBalance);
emit SwapAndLiquify(half, newBalance, otherHalf);
}
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
address(0xdead),
block.timestamp
);
}
//this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[r...
// [truncated — 52449 bytes total]
Read Contract
MAX_FEE 0xbc063e1a → uint256
VERSION 0xffa1ad74 → uint256
_charityAddress 0x19a8ac9e → address
_charityFee 0x40f8007a → uint256
_liquidityFee 0x6bc87c3a → uint256
_taxFee 0x3b124fe7 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
enableAntiBot 0x241ec3be → bool
isExcludedFromFee 0x5342acb4 → bool
isExcludedFromReward 0x88f82020 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
pinkAntiBot 0x407133d2 → address
reflectionFromToken 0x4549b039 → uint256
swapAndLiquifyEnabled 0x4a74bb02 → bool
symbol 0x95d89b41 → string
tokenFromReflection 0x2d838119 → uint256
totalFees 0x13114a9d → uint256
totalSupply 0x18160ddd → uint256
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
deliver 0x3bd5d173
uint256 tAmount
excludeFromFee 0x437823ec
address account
excludeFromReward 0x52390c02
address account
includeInReward 0x3685d419
address account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
renounceOwnership 0x715018a6
No parameters
setCharityFeePercent 0xaf41063b
uint256 charityFeeBps
setEnableAntiBot 0x1f46b1c6
bool _enable
setLiquidityFeePercent 0x8ee88c53
uint256 liquidityFeeBps
setSwapBackSettings 0x796431d0
uint256 _amount
setTaxFeePercent 0x061c82d0
uint256 taxFeeBps
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address