Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xD87996Ff3D06858BFC20989aEF50cc5FCD4d84ca
Balance 0.453963 ETH ($948.48)
Nonce 1
Code Size 12288 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

12288 bytes
0x6080604052600436106102765760003560e01c806385af30c51161014f578063cf089e13116100c1578063e9481eee1161007a578063e9481eee14610801578063f11a24d314610831578063f2fde38b14610853578063f637434214610873578063f8b45b0514610895578063fc59d23d146108ab57600080fd5b8063cf089e131461071a578063cf188ad01461073a578063d68f8cde1461075a578063d8c6404b1461077a578063dd62ed3e1461079b578063df8408fe146107e157600080fd5b80639a7a23d6116101135780639a7a23d614610654578063a457c2d714610674578063a9059cbb14610694578063aa498023146106b4578063b62496f5146106d4578063c8c8ebe41461070457600080fd5b806385af30c5146105bf5780638da5cb5b146105df57806391c1004a146105fd578063921369131461061d57806395d89b411461063f57600080fd5b80635342acb4116101e857806373b9e82c116101ac57806373b9e82c146104e257806375f0a8741461050257806377ec7449146105225780637bce5a04146105425780637c75ad3a146105775780637cf84bd71461059f57600080fd5b80635342acb41461042657806357e62b981461045657806365b8dbc01461047757806370a0823114610497578063715018a6146104cd57600080fd5b806323b872dd1161023a57806323b872dd1461035a5780632ae2f1211461037a5780632d5fd55a1461039a578063313ce567146103ba57806339509351146103e65780634707c5511461040657600080fd5b806306e297121461028257806306fdde03146102c7578063095ea7b3146102e957806318160ddd146103195780631c499ab01461033857600080fd5b3661027d57005b600080fd5b34801561028e57600080fd5b506102aa73fd6439aeff9d2389856b7486b9e74a6dacadcdce81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102d357600080fd5b506102dc6108c1565b6040516102be9190612ae1565b3480156102f557600080fd5b50610309610304366004612b4b565b610953565b60405190151581526020016102be565b34801561032557600080fd5b506002545b6040519081526020016102be565b34801561034457600080fd5b50610358610353366004612b77565b61096b565b005b34801561036657600080fd5b50610309610375366004612b90565b610a20565b34801561038657600080fd5b50610358610395366004612bdf565b610a44565b3480156103a657600080fd5b506103586103b5366004612c18565b610b28565b3480156103c657600080fd5b50600654600160a81b900460ff1660405160ff90911681526020016102be565b3480156103f257600080fd5b50610309610401366004612b4b565b610b70565b34801561041257600080fd5b50610358610421366004612bdf565b610baf565b34801561043257600080fd5b50610309610441366004612c3c565b600f6020526000908152604090205460ff1681565b34801561046257600080fd5b5060085461030990600160a01b900460ff1681565b34801561048357600080fd5b50610358610492366004612c3c565b610cce565b3480156104a357600080fd5b5061032a6104b2366004612c3c565b6001600160a01b031660009081526020819052604090205490565b3480156104d957600080fd5b50610358610ec2565b3480156104ee57600080fd5b506103586104fd366004612b77565b610ef8565b34801561050e57600080fd5b506008546102aa906001600160a01b031681565b34801561052e57600080fd5b506006546102aa906001600160a01b031681565b34801561054e57600080fd5b5060075461056490600160d81b900461ffff1681565b60405161ffff90911681526020016102be565b34801561058357600080fd5b506102aa731ccfe8c40ef259566433716002e379dfffbf5a3e81565b3480156105ab57600080fd5b506007546102aa906001600160a01b031681565b3480156105cb57600080fd5b50600d546102aa906001600160a01b031681565b3480156105eb57600080fd5b506005546001600160a01b03166102aa565b34801561060957600080fd5b50610358610618366004612c3c565b610fad565b34801561062957600080fd5b5060075461056490600160c81b900461ffff1681565b34801561064b57600080fd5b506102dc6110ff565b34801561066057600080fd5b5061035861066f366004612bdf565b61110e565b34801561068057600080fd5b5061030961068f366004612b4b565b611142565b3480156106a057600080fd5b506103096106af366004612b4b565b6111d4565b3480156106c057600080fd5b506103586106cf366004612b77565b6111e2565b3480156106e057600080fd5b506103096106ef366004612c3c565b60106020526000908152604090205460ff1681565b34801561071057600080fd5b5061032a600b5481565b34801561072657600080fd5b50610358610735366004612c70565b61129e565b34801561074657600080fd5b50600c546102aa906001600160a01b031681565b34801561076657600080fd5b50610358610775366004612c70565b61141c565b34801561078657600080fd5b5060065461030990600160a01b900460ff1681565b3480156107a757600080fd5b5061032a6107b6366004612ca3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156107ed57600080fd5b506103586107fc366004612bdf565b61159a565b34801561080d57600080fd5b5061030961081c366004612c3c565b600e6020526000908152604090205460ff1681565b34801561083d57600080fd5b5060075461056490600160b81b900461ffff1681565b34801561085f57600080fd5b5061035861086e366004612c3c565b611676565b34801561087f57600080fd5b5060075461056490600160a81b900461ffff1681565b3480156108a157600080fd5b5061032a600a5481565b3480156108b757600080fd5b5061032a60095481565b6060600380546108d090612cd1565b80601f01602080910402602001604051908101604052809291908181526020018280546108fc90612cd1565b80156109495780601f1061091e57610100808354040283529160200191610949565b820191906000526020600020905b81548152906001019060200180831161092c57829003601f168201915b5050505050905090565b60003361096181858561170e565b5060019392505050565b6005546001600160a01b0316331461099e5760405162461bcd60e51b815260040161099590612d0b565b60405180910390fd5b600081116109de5760405162461bcd60e51b815260206004820152600d60248201526c06d617857616c6c6574203e203609c1b6044820152606401610995565b600a546040805183815260208101929092527fff64d41f60feb77d52f64ae64a9fc3929d57a89d0cc55728762468bae5e0fe52910160405180910390a1600a55565b600033610a2e858285611832565b610a398585856118c4565b506001949350505050565b6005546001600160a01b03163314610a6e5760405162461bcd60e51b815260040161099590612d0b565b6001600160a01b0382166000908152600e602052604090205481151560ff909116151503610ac85760405162461bcd60e51b8152602060048201526007602482015266616c726561647960c81b6044820152606401610995565b6001600160a01b0382166000818152600e6020908152604091829020805460ff191685151590811790915591519182527f82170bbd72c16b30c410014b7382121a699ed119a182e48a0b6cadcc89104ac991015b60405180910390a25050565b6005546001600160a01b03163314610b525760405162461bcd60e51b815260040161099590612d0b565b60068054911515600160a01b0260ff60a01b19909216919091179055565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906109619082908690610baa908790612d56565b61170e565b6005546001600160a01b03163314610bd95760405162461bcd60e51b815260040161099590612d0b565b6001600160a01b038216610c2f5760405162461bcd60e51b815260206004820152601b60248201527f6d61726b6574696e672077616c6c65742063616e2774206265203000000000006044820152606401610995565b600854604080518315158152600160a01b830460ff16151560208201526001600160a01b03928316928516917fc8dfdd9b91ac62ee1bd8be3541ea02d8e584461c794c6e49e94ccf21c71ebcca910160405180910390a360088054911515600160a01b026001600160a81b03199092166001600160a01b039093169283179190911790556000908152600f60205260409020805460ff19166001179055565b6005546001600160a01b03163314610cf85760405162461bcd60e51b815260040161099590612d0b565b600c546001600160a01b0390811690821603610d625760405162461bcd60e51b815260206004820152602360248201527f54686520726f7574657220616c7265616479206861732074686174206164647260448201526265737360e81b6064820152608401610995565b600c546040516001600160a01b03918216918316907f8fc842bbd331dfa973645f4ed48b11683d501ebf1352708d77a5da2ab49a576e90600090a3600c80546001600160a01b0319166001600160a01b0383169081179091556040805163c45a015560e01b815290516000929163c45a01559160048083019260209291908290030181865afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190612d6e565b6007546040516364e329cb60e11b81523060048201526001600160a01b03918216602482015291169063c9c65396906044016020604051808303816000875af1158015610e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e929190612d6e565b600d80546001600160a01b0319166001600160a01b038316908117909155909150610ebe906001611d16565b5050565b6005546001600160a01b03163314610eec5760405162461bcd60e51b815260040161099590612d0b565b610ef66000611e15565b565b6005546001600160a01b03163314610f225760405162461bcd60e51b815260040161099590612d0b565b60008111610f6b5760405162461bcd60e51b815260206004820152601660248201527506d696e416d6f756e74546f54616b65466565203e20360541b6044820152606401610995565b6009546040805183815260208101929092527f772a06bc936eb749842080c472181e970cd4f23bd1ab7d0b84a80aec26910434910160405180910390a1600955565b6005546001600160a01b03163314610fd75760405162461bcd60e51b815260040161099590612d0b565b600780546001600160a01b0319166001600160a01b0383811691909117909155600c546040805163c45a015560e01b81529051919092169163c45a01559160048083019260209291908290030181865afa158015611039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105d9190612d6e565b6007546040516364e329cb60e11b81523060048201526001600160a01b03918216602482015291169063c9c65396906044016020604051808303816000875af11580156110ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d29190612d6e565b600d80546001600160a01b0319166001600160a01b039290921691821790556110fc906001611d16565b50565b6060600480546108d090612cd1565b6005546001600160a01b031633146111385760405162461bcd60e51b815260040161099590612d0b565b610ebe8282611d16565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156111c75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610995565b610a39828686840361170e565b6000336109618185856118c4565b6005546001600160a01b0316331461120c5760405162461bcd60e51b815260040161099590612d0b565b6000811161125c5760405162461bcd60e51b815260206004820152601860248201527f6d61785472616e73616374696f6e416d6f756e74203e203000000000000000006044820152606401610995565b600b546040805183815260208101929092527f35eec0711af6fbe3039535323be51b57996b6945b0d55862607c7a02e52e4507910160405180910390a1600b55565b6005546001600160a01b031633146112c85760405162461bcd60e51b815260040161099590612d0b565b60075460c8906112e390600160a81b900461ffff1684612d8b565b61ffff1611156113275760405162461bcd60e51b815260206004820152600f60248201526e73656c6c20666565203c3d2032302560881b6044820152606401610995565b60075460c89061134290600160b81b900461ffff1683612d8b565b61ffff1611156113855760405162461bcd60e51b815260206004820152600e60248201526d62757920666565203c3d2032302560901b6044820152606401610995565b6007546040805161ffff85811682528481166020830152600160c81b8404811682840152600160d81b9093049092166060830152517f1d6b62961d401d548eb1549c97109c0b905ccd7af9c3777d3076cc8438fdfe659181900360800190a16007805463ffffffff60c81b1916600160c81b61ffff9485160261ffff60d81b191617600160d81b9290931691909102919091179055565b6005546001600160a01b031633146114465760405162461bcd60e51b815260040161099590612d0b565b60075460c89061146190600160c81b900461ffff1684612d8b565b61ffff1611156114a55760405162461bcd60e51b815260206004820152600f60248201526e73656c6c20666565203c3d2032302560881b6044820152606401610995565b60075460c8906114c090600160d81b900461ffff1683612d8b565b61ffff1611156115035760405162461bcd60e51b815260206004820152600e60248201526d62757920666565203c3d2032302560901b6044820152606401610995565b6007546040805161ffff85811682528481166020830152600160a81b8404811682840152600160b81b9093049092166060830152517f95c5c99557725e816faf752c6675d63483841c28a7a009ed792470a9cb4dea239181900360800190a16007805463ffffffff60a81b1916600160a81b61ffff9485160261ffff60b81b191617600160b81b9290931691909102919091179055565b6005546001600160a01b031633146115c45760405162461bcd60e51b815260040161099590612d0b565b6001600160a01b0382166000908152600f602052604090205481151560ff90911615150361161e5760405162461bcd60e51b8152602060048201526007602482015266616c726561647960c81b6044820152606401610995565b6001600160a01b0382166000818152600f6020908152604091829020805460ff191685151590811790915591519182527f2d43abd87b27cee7b0aa8c6f7e0b4a3247b683262a83cbc2318b0df398a49aa99101610b1c565b6005546001600160a01b031633146116a05760405162461bcd60e51b815260040161099590612d0b565b6001600160a01b0381166117055760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610995565b6110fc81611e15565b6001600160a01b0383166117705760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610995565b6001600160a01b0382166117d15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610995565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146118be57818110156118b15760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610995565b6118be848484840361170e565b50505050565b600754600160a01b900460ff161580156118e75750600654600160a01b900460ff165b801561190c57506001600160a01b0383166000908152600f602052604090205460ff16155b801561193157506001600160a01b0382166000908152600f602052604090205460ff16155b156119a55760065460405163090ec10b60e31b81526001600160a01b03858116600483015284811660248301526044820184905290911690634876085890606401600060405180830381600087803b15801561198c57600080fd5b505af11580156119a0573d6000803e3d6000fd5b505050505b6001600160a01b0383166119cb5760405162461bcd60e51b815260040161099590612db1565b6001600160a01b0382166119f15760405162461bcd60e51b815260040161099590612df6565b306000908152602081905260409020546009546007549082101590600160a01b900460ff16158015611a205750805b8015611a4457506001600160a01b03841660009081526010602052604090205460ff165b15611a5157611a51611e67565b6007546000908190600160a01b900460ff16158015611a8957506001600160a01b0387166000908152600f602052604090205460ff16155b8015611aae57506001600160a01b0386166000908152600f602052604090205460ff16155b15611bf7576001600160a01b03871660009081526010602052604090205460ff1615611b2a576007546103e890611af090600160b81b900461ffff1687612e39565b611afa9190612e58565b6007549092506103e890611b1990600160d81b900461ffff1687612e39565b611b239190612e58565b9050611b9d565b6001600160a01b03861660009081526010602052604090205460ff1615611b9d576007546103e890611b6790600160a81b900461ffff1687612e39565b611b719190612e58565b6007549092506103e890611b9090600160c81b900461ffff1687612e39565b611b9a9190612e58565b90505b6000611ba98284612d56565b90508015611bbc57611bbc88308361252d565b81611bc78488612e7a565b611bd19190612e7a565b955082601154611be19190612d56565b601155601254611bf2908390612d56565b601255505b611c0287878761252d565b600754600160a01b900460ff16611d0d576001600160a01b0387166000908152600e602052604090205460ff16611c8457600b548510611c845760405162461bcd60e51b815260206004820152601d60248201527f45524332303a2065786365656473207472616e73666572206c696d69740000006044820152606401610995565b6001600160a01b0386166000908152600e602052604090205460ff16611d0d57600a546001600160a01b03871660009081526020819052604090205410611d0d5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a2065786365656473206d61782077616c6c6574206c696d6974006044820152606401610995565b50505050505050565b6001600160a01b03821660009081526010602052604090205481151560ff909116151503611dac5760405162461bcd60e51b815260206004820152603860248201527f4175746f6d61746564206d61726b6574206d616b65722070616972206973206160448201527f6c72656164792073657420746f20746861742076616c756500000000000000006064820152608401610995565b6001600160a01b0382166000818152601060209081526040808320805486151560ff199182168117909255600e84529382902080549094168117909355519182527fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab9101610b1c565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6007805460ff60a01b1916600160a01b1790553060009081526020819052604081205490506000601254601154611e9e9190612d56565b9050801580611eac57508082105b15611eb857505061251e565b60006002601154611ec99190612e58565b90506000600c60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f449190612d6e565b6007546001600160a01b03908116911614611fca576007546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611fa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc59190612e91565b611fcc565b475b600854909150600090600160a01b900460ff161561233057600060125484611ff49190612d56565b905080156120055761200581612681565b600c54604080516315ab88c960e31b815290516000926001600160a01b03169163ad5c46489160048083019260209291908290030181865afa15801561204f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120739190612d6e565b6007546001600160a01b03908116911614612103576007546040516370a0823160e01b815230600482015285916001600160a01b0316906370a0823190602401602060405180830381865afa1580156120d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120f49190612e91565b6120fe9190612e7a565b61210d565b61210d8447612e7a565b9050600082601254836121209190612e39565b61212a9190612e58565b90506121368183612e7a565b9350801561232857600c60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612191573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121b59190612d6e565b6007546001600160a01b0391821691160361226d576008546040516000916001600160a01b03169083908381818185875af1925050503d8060008114612217576040519150601f19603f3d011682016040523d82523d6000602084013e61221c565b606091505b505090508015612267576000601281905560408051918252602082018490527f6f92bce3e91466137aa4d5474fe565c002872fb18ed6af4a856959be0a81277a910160405180910390a15b50612328565b60075460085460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af11580156122c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e69190612eaa565b506000601281905560408051918252602082018390527f6f92bce3e91466137aa4d5474fe565c002872fb18ed6af4a856959be0a81277a910160405180910390a15b5050506124ba565b821561233f5761233f83612681565b600c60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b69190612d6e565b6007546001600160a01b03908116911614612446576007546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa158015612413573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124379190612e91565b6124419190612e7a565b612450565b6124508247612e7a565b601254909150156124ba576008546012546124789130916001600160a01b03909116906118c4565b60125460408051918252600060208301527f6f92bce3e91466137aa4d5474fe565c002872fb18ed6af4a856959be0a81277a910160405180910390a160006012555b6000831180156124ca5750600081115b15612513576124d98382612887565b60408051848152602081018390527f28fc98272ce761178794ad6768050fea1648e07f1e2ffe15afd3a290f8381486910160405180910390a15b505060006011555050505b6007805460ff60a01b19169055565b6001600160a01b0383166125535760405162461bcd60e51b815260040161099590612db1565b6001600160a01b0382166125795760405162461bcd60e51b815260040161099590612df6565b6001600160a01b038316600090815260208190526040902054818110156125f15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610995565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290612628908490612d56565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161267491815260200190565b60405180910390a36118be565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106126b6576126b6612ec7565b6001600160a01b0392831660209182029290920101526007548251911690829060019081106126e7576126e7612ec7565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015612740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127649190612d6e565b6001600160a01b03168160018151811061278057612780612ec7565b60200260200101516001600160a01b03160361281d57600c546127ae9030906001600160a01b03168461170e565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906127e7908590600090869030904290600401612f21565b600060405180830381600087803b15801561280157600080fd5b505af1158015612815573d6000803e3d6000fd5b505050505050565b61283c30731ccfe8c40ef259566433716002e379dfffbf5a3e8461170e565b600c54604051637274ca1b60e11b8152731ccfe8c40ef259566433716002e379dfffbf5a3e9163e4e99436916127e7916001600160a01b031690869060009087904290600401612f5d565b600c5461289f9030906001600160a01b03168461170e565b600754600c5460405163095ea7b360e01b81526001600160a01b0391821660048201526024810184905291169063095ea7b3906044016020604051808303816000875af11580156128f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129189190612eaa565b50600c60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561296c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129909190612d6e565b6007546001600160a01b03918216911603612a3f57600c5460405163f305d71960e01b815230600482015260248101849052600060448201819052606482015261dead60848201524260a48201526001600160a01b039091169063f305d71990839060c40160606040518083038185885af1158015612a13573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612a389190612f9c565b5050505050565b600c5460075460405162e8e33760e81b81523060048201526001600160a01b039182166024820152604481018590526064810184905260006084820181905260a482015261dead60c48201524260e482015291169063e8e3370090610104016060604051808303816000875af1158015612abd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a389190612f9c565b600060208083528351808285015260005b81811015612b0e57858101830151858201604001528201612af2565b81811115612b20576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146110fc57600080fd5b60008060408385031215612b5e57600080fd5b8235612b6981612b36565b946020939093013593505050565b600060208284031215612b8957600080fd5b5035919050565b600080600060608486031215612ba557600080fd5b8335612bb081612b36565b92506020840135612bc081612b36565b929592945050506040919091013590565b80151581146110fc57600080fd5b60008060408385031215612bf257600080fd5b8235612bfd81612b36565b91506020830135612c0d81612bd1565b809150509250929050565b600060208284031215612c2a57600080fd5b8135612c3581612bd1565b9392505050565b600060208284031215612c4e57600080fd5b8135612c3581612b36565b803561ffff81168114612c6b57600080fd5b919050565b60008060408385031215612c8357600080fd5b612c8c83612c59565b9150612c9a60208401612c59565b90509250929050565b60008060408385031215612cb657600080fd5b8235612cc181612b36565b91506020830135612c0d81612b36565b600181811c90821680612ce557607f821691505b602082108103612d0557634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115612d6957612d69612d40565b500190565b600060208284031215612d8057600080fd5b8151612c3581612b36565b600061ffff808316818516808303821115612da857612da8612d40565b01949350505050565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6000816000190483118215151615612e5357612e53612d40565b500290565b600082612e7557634e487b7160e01b600052601260045260246000fd5b500490565b600082821015612e8c57612e8c612d40565b500390565b600060208284031215612ea357600080fd5b5051919050565b600060208284031215612ebc57600080fd5b8151612c3581612bd1565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b83811015612f165781516001600160a01b031687529582019590820190600101612ef1565b509495945050505050565b85815284602082015260a060408201526000612f4060a0830186612edd565b6001600160a01b0394909416606083015250608001529392505050565b60018060a01b038616815284602082015283604082015260a060608201526000612f8a60a0830185612edd565b90508260808301529695505050505050565b600080600060608486031215612fb157600080fd5b835192506020840151915060408401519050925092509256fea2646970667358221220269326ef55a9b3810f87ac3d399cf45d81b1790fd51662a1ffa75ba0724909e564736f6c634300080d0033

Verified Source Code Full Match

Compiler: v0.8.13+commit.abaa5c0e EVM: london Optimization: Yes (200 runs)
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

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 `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);

    /**
     * @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);
}
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);
}
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;
    }
}
StandardTokenWithAntibot.sol 834 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

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;
}

interface IUniswapV2Pair {
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
    event Transfer(address indexed from, address indexed to, uint256 value);

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    event Mint(address indexed sender, uint256 amount0, uint256 amount1);
    event Burn(
        address indexed sender,
        uint256 amount0,
        uint256 amount1,
        address indexed to
    );
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function factory() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );

    function price0CumulativeLast() external view returns (uint256);

    function price1CumulativeLast() external view returns (uint256);

    function kLast() external view returns (uint256);

    function mint(address to) external returns (uint256 liquidity);

    function burn(address to)
        external
        returns (uint256 amount0, uint256 amount1);

    function swap(
        uint256 amount0Out,
        uint256 amount1Out,
        address to,
        bytes calldata data
    ) external;

    function skim(address to) external;

    function sync() external;

    function initialize(address, address) external;
}

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;

    function INIT_CODE_PAIR_HASH() external view returns (bytes32);
}

interface IGemAntiBot {
    function setTokenOwner(address owner) external;

    function onPreTransferCheck(
        address from,
        address to,
        uint256 amount
    ) external;
}
interface IUniswapV2Caller {
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        address router,
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        uint256 deadline
    ) external;
}
interface IFee {
    function payFee(
        uint256 _tokenType
    ) external payable;
}
contract StandardTokenWithAntibot is ERC20, Ownable {
    IUniswapV2Caller public constant uniswapV2Caller =
        IUniswapV2Caller(0x1CcFE8c40eF259566433716002E379dFfFbf5a3e);
    IFee public constant feeContract = IFee(0xfd6439AEfF9d2389856B7486b9e74a6DacaDcDCe);
    address public gemAntiBot;
    bool public antiBotEnabled;
    uint8 private _decimals;
    ///////////////////////////////////////////////////////////////////////////
    address public baseTokenForPair;
    bool private inSwapAndLiquify;
    uint16 public sellLiquidityFee;
    uint16 public buyLiquidityFee;

    uint16 public sellMarketingFee;
    uint16 public buyMarketingFee;

    address public marketingWallet;
    bool public isMarketingFeeBaseToken;

    uint256 public minAmountToTakeFee;
    uint256 public maxWallet;
    uint256 public maxTransactionAmount;

    IUniswapV2Router02 public mainRouter;
    address public mainPair;

    mapping(address => bool) public isExcludedFromMaxTransactionAmount;
    mapping(address => bool) public isExcludedFromFee;
    mapping(address => bool) public automatedMarketMakerPairs;

    uint256 private _liquidityFeeTokens;
    uint256 private _marketingFeeTokens;

    event UpdateLiquidityFee(
        uint16 newSellLiquidityFee,
        uint16 newBuyLiquidityFee,
        uint16 oldSellLiquidityFee,
        uint16 oldBuyLiquidityFee
    );
    event UpdateMarketingFee(
        uint16 newSellMarketingFee,
        uint16 newBuyMarketingFee,
        uint16 oldSellMarketingFee,
        uint16 oldBuyMarketingFee
    );
    event UpdateMarketingWallet(
        address indexed newMarketingWallet,
        bool newIsMarketingFeeBaseToken,
        address indexed oldMarketingWallet,
        bool oldIsMarketingFeeBaseToken
    );
    event ExcludedFromMaxTransactionAmount(address indexed account, bool isExcluded);
    event UpdateMinAmountToTakeFee(uint256 newMinAmountToTakeFee, uint256 oldMinAmountToTakeFee);
    event SetAutomatedMarketMakerPair(address indexed pair, bool value);  
    event ExcludedFromFee(address indexed account, bool isEx);
    event SwapAndLiquify(
        uint256 tokensForLiquidity,
        uint256 baseTokenForLiquidity
    );
    event MarketingFeeTaken(
        uint256 marketingFeeTokens,
        uint256 marketingFeeBaseTokenSwapped
    );
    event UpdateUniswapV2Router(address indexed newAddress, address indexed oldRouter);
    event UpdateMaxWallet(uint256 newMaxWallet, uint256 oldMaxWallet);
    event UpdateMaxTransactionAmount(uint256 newMaxTransactionAmount, uint256 oldMaxTransactionAmount);
    ///////////////////////////////////////////////////////////////////////////////
    constructor(
        string memory _name,
        string memory _symbol,
        uint8 __decimals,
        uint256 _totalSupply,
        uint256 _maxWallet,
        uint256 _maxTransactionAmount,
        address[4] memory _accounts,
        bool _isMarketingFeeBaseToken,
        uint16[4] memory _fees
    ) payable ERC20(_name, _symbol) {
        feeContract.payFee{value: msg.value}(1);   
        _decimals = __decimals;
        _mint(msg.sender, _totalSupply);
        baseTokenForPair = _accounts[2];
        require(_accounts[0] != address(0), "marketing wallet can not be 0");
        require(_accounts[1] != address(0), "Router address can not be 0");
        require(_fees[0] + (_fees[2]) <= 200, "sell fee <= 20%");
        require(_fees[1] + (_fees[3]) <= 200, "buy fee <= 20%");
        gemAntiBot = _accounts[3];
        IGemAntiBot(gemAntiBot).setTokenOwner(msg.sender);
        antiBotEnabled = true;
        marketingWallet = _accounts[0];
        isMarketingFeeBaseToken = _isMarketingFeeBaseToken;
        emit UpdateMarketingWallet(
            marketingWallet,
            isMarketingFeeBaseToken,
            address(0),
            false
        );
        mainRouter = IUniswapV2Router02(_accounts[1]);
        emit UpdateUniswapV2Router(address(mainRouter), address(0));
        mainPair = IUniswapV2Factory(mainRouter.factory()).createPair(
            address(this),
            baseTokenForPair
        );
        require(_maxTransactionAmount>0, "maxTransactionAmount > 0");
        require(_maxWallet>0, "maxWallet > 0");
        maxWallet = _maxWallet;
        emit UpdateMaxWallet(maxWallet, 0);
        maxTransactionAmount=_maxTransactionAmount;
        emit UpdateMaxTransactionAmount(maxTransactionAmount, 0);        
        sellLiquidityFee = _fees[0];
        buyLiquidityFee = _fees[1];
        emit UpdateLiquidityFee(sellLiquidityFee, buyLiquidityFee, 0, 0);        
        sellMarketingFee=_fees[2];
        buyMarketingFee=_fees[3];
        emit UpdateMarketingFee(
            sellMarketingFee,
            buyMarketingFee,
            0,
            0
        );
        minAmountToTakeFee = _totalSupply / 10000;
        emit UpdateMinAmountToTakeFee(minAmountToTakeFee, 0);
        isExcludedFromFee[address(this)] = true;
        isExcludedFromFee[marketingWallet] = true;
        isExcludedFromFee[_msgSender()] = true;
        isExcludedFromFee[address(0xdead)] = true;
        isExcludedFromMaxTransactionAmount[address(0xdead)] = true;
        isExcludedFromMaxTransactionAmount[address(this)] = true;
        isExcludedFromMaxTransactionAmount[marketingWallet] = true;
        isExcludedFromMaxTransactionAmount[_msgSender()] = true;
        _setAutomatedMarketMakerPair(mainPair, true);
    }

    function decimals() public view override returns (uint8) {
        return _decimals;
    }

    function setUsingAntiBot(bool enabled_) external onlyOwner {
        antiBotEnabled = enabled_;
    }

    function updateUniswapV2Pair(address _baseTokenForPair) external onlyOwner {
        baseTokenForPair = _baseTokenForPair;
        mainPair = IUniswapV2Factory(mainRouter.factory()).createPair(
            address(this),
            baseTokenForPair
        );
        _setAutomatedMarketMakerPair(mainPair, true);
    }

    function updateUniswapV2Router(address newAddress) public onlyOwner {
        require(
            newAddress != address(mainRouter),
            "The router already has that address"
        );
        emit UpdateUniswapV2Router(newAddress, address(mainRouter));
        mainRouter = IUniswapV2Router02(newAddress);
        address _mainPair = IUniswapV2Factory(mainRouter.factory()).createPair(
            address(this),
            baseTokenForPair
        );
        mainPair = _mainPair;
        _setAutomatedMarketMakerPair(mainPair, true);
    }

    function updateMaxWallet(uint256 _maxWallet) external onlyOwner {
        require(_maxWallet>0, "maxWallet > 0");
        emit UpdateMaxWallet(_maxWallet, maxWallet);
        maxWallet = _maxWallet;
    }

    function updateMaxTransactionAmount(uint256 _maxTransactionAmount)
        external
        onlyOwner
    {
        require(_maxTransactionAmount>0, "maxTransactionAmount > 0");
        emit UpdateMaxTransactionAmount(_maxTransactionAmount, maxTransactionAmount);
        maxTransactionAmount = _maxTransactionAmount;
    }

    /////////////////////////////////////////////////////////////////////////////////
    modifier lockTheSwap() {
        inSwapAndLiquify = true;
        _;
        inSwapAndLiquify = false;
    }

    function updateLiquidityFee(
        uint16 _sellLiquidityFee,
        uint16 _buyLiquidityFee
    ) external onlyOwner {
        require(
            _sellLiquidityFee + (sellMarketingFee) <= 200,
            "sell fee <= 20%"
        );
        require(_buyLiquidityFee + (buyMarketingFee) <= 200, "buy fee <= 20%");
        emit UpdateLiquidityFee(
            _sellLiquidityFee,
            _buyLiquidityFee,
            sellLiquidityFee,
            buyLiquidityFee
        );
        sellLiquidityFee = _sellLiquidityFee;
        buyLiquidityFee = _buyLiquidityFee;   
    }

    function updateMarketingFee(
        uint16 _sellMarketingFee,
        uint16 _buyMarketingFee
    ) external onlyOwner {
        require(
            _sellMarketingFee + (sellLiquidityFee) <= 200,
            "sell fee <= 20%"
        );
        require(_buyMarketingFee + (buyLiquidityFee) <= 200, "buy fee <= 20%");
        emit UpdateMarketingFee(
            _sellMarketingFee,
            _buyMarketingFee,
            sellMarketingFee,
            buyMarketingFee
        );
        sellMarketingFee = _sellMarketingFee;
        buyMarketingFee = _buyMarketingFee;     
    }

    function updateMarketingWallet(
        address _marketingWallet,
        bool _isMarketingFeeBaseToken
    ) external onlyOwner {
        require(_marketingWallet != address(0), "marketing wallet can't be 0");
        emit UpdateMarketingWallet(_marketingWallet, _isMarketingFeeBaseToken,
            marketingWallet, isMarketingFeeBaseToken);
        marketingWallet = _marketingWallet;
        isMarketingFeeBaseToken = _isMarketingFeeBaseToken;
        isExcludedFromFee[_marketingWallet] = true;
    }

    function updateMinAmountToTakeFee(uint256 _minAmountToTakeFee)
        external
        onlyOwner
    {
        require(_minAmountToTakeFee > 0, "minAmountToTakeFee > 0");
        emit UpdateMinAmountToTakeFee(_minAmountToTakeFee, minAmountToTakeFee);
        minAmountToTakeFee = _minAmountToTakeFee;     
    }

    function setAutomatedMarketMakerPair(address pair, bool value)
        public
        onlyOwner
    {
        _setAutomatedMarketMakerPair(pair, value);
    }

    function _setAutomatedMarketMakerPair(address pair, bool value) private {
        require(
            automatedMarketMakerPairs[pair] != value,
            "Automated market maker pair is already set to that value"
        );
        automatedMarketMakerPairs[pair] = value;
        isExcludedFromMaxTransactionAmount[pair] = value;
        emit SetAutomatedMarketMakerPair(pair, value);
    }

    function excludeFromFee(address account, bool isEx) external onlyOwner {
        require(isExcludedFromFee[account] != isEx, "already");
        isExcludedFromFee[account] = isEx;
        emit ExcludedFromFee(account, isEx);
    }

    function excludeFromMaxTransactionAmount(address account, bool isEx)
        external
        onlyOwner
    {
        require(isExcludedFromMaxTransactionAmount[account]!=isEx, "already");
        isExcludedFromMaxTransactionAmount[account] = isEx;
        emit ExcludedFromMaxTransactionAmount(account, isEx);
    }

    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal override {
        if (
            !inSwapAndLiquify &&
            antiBotEnabled &&
            !isExcludedFromFee[from] &&
            !isExcludedFromFee[to]
        ) {
            IGemAntiBot(gemAntiBot).onPreTransferCheck(from, to, amount);
        }
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");
        uint256 contractTokenBalance = balanceOf(address(this));
        bool overMinimumTokenBalance = contractTokenBalance >=
            minAmountToTakeFee;

        // Take Fee
        if (
            !inSwapAndLiquify &&
            overMinimumTokenBalance &&
            automatedMarketMakerPairs[to]
        ) {
            takeFee();
        }

        uint256 _liquidityFee;
        uint256 _marketingFee;
        // If any account belongs to isExcludedFromFee account then remove the fee
        if (
            !inSwapAndLiquify &&
            !isExcludedFromFee[from] &&
            !isExcludedFromFee[to]
        ) {
            // Buy
            if (automatedMarketMakerPairs[from]) {
                _liquidityFee = (amount * (buyLiquidityFee)) / (1000);
                _marketingFee = (amount * (buyMarketingFee)) / (1000);
            }
            // Sell
            else if (automatedMarketMakerPairs[to]) {
                _liquidityFee = (amount * (sellLiquidityFee)) / (1000);
                _marketingFee = (amount * (sellMarketingFee)) / (1000);
            }
            uint256 _feeTotal = _liquidityFee + (_marketingFee);
            if (_feeTotal > 0) super._transfer(from, address(this), _feeTotal);
            amount = amount - (_liquidityFee) - (_marketingFee);
            _liquidityFeeTokens = _liquidityFeeTokens + (_liquidityFee);
            _marketingFeeTokens = _marketingFeeTokens + (_marketingFee);
        }
        super._transfer(from, to, amount);
        if (!inSwapAndLiquify) {
            if (!isExcludedFromMaxTransactionAmount[from]) {
                require(
                    amount < maxTransactionAmount,
                    "ERC20: exceeds transfer limit"
                );
            }
            if (!isExcludedFromMaxTransactionAmount[to]) {
                require(
                    balanceOf(to) < maxWallet,
                    "ERC20: exceeds max wallet limit"
                );
            }
        }
    }

    function takeFee() private lockTheSwap {
        uint256 contractBalance = balanceOf(address(this));
        uint256 totalTokensTaken = _liquidityFeeTokens + _marketingFeeTokens;
        if (totalTokensTaken == 0 || contractBalance < totalTokensTaken) {
            return;
        }

        // Halve the amount of liquidity tokens
        uint256 tokensForLiquidity = _liquidityFeeTokens / 2;
        uint256 initialBaseTokenBalance = baseTokenForPair==mainRouter.WETH() ? address(this).balance
            : IERC20(baseTokenForPair).balanceOf(address(this));
        uint256 baseTokenForLiquidity;
        if (isMarketingFeeBaseToken) {
            uint256 tokensForSwap=tokensForLiquidity+_marketingFeeTokens;
            if(tokensForSwap>0)
                swapTokensForBaseToken(tokensForSwap);
            uint256 baseTokenBalance = baseTokenForPair==mainRouter.WETH() ? address(this).balance - initialBaseTokenBalance
                : IERC20(baseTokenForPair).balanceOf(address(this)) - initialBaseTokenBalance;
            uint256 baseTokenForMarketing = (baseTokenBalance *
                _marketingFeeTokens) / tokensForSwap;
            baseTokenForLiquidity = baseTokenBalance - baseTokenForMarketing;
            if(baseTokenForMarketing>0){
                if(baseTokenForPair==mainRouter.WETH()){                
                    (bool success, )=address(marketingWallet).call{value: baseTokenForMarketing}("");
                    if(success){
                        _marketingFeeTokens = 0;
                        emit MarketingFeeTaken(0, baseTokenForMarketing);
                    }
                }else{
                    IERC20(baseTokenForPair).transfer(
                        marketingWallet,
                        baseTokenForMarketing
                    );
                    _marketingFeeTokens = 0;
                    emit MarketingFeeTaken(0, baseTokenForMarketing);
                }                   
            }  
        } else {
            if(tokensForLiquidity>0)
                swapTokensForBaseToken(tokensForLiquidity);
            baseTokenForLiquidity = baseTokenForPair==mainRouter.WETH() ? address(this).balance - initialBaseTokenBalance
                : IERC20(baseTokenForPair).balanceOf(address(this)) - initialBaseTokenBalance;
            if(_marketingFeeTokens>0){
                _transfer(address(this), marketingWallet, _marketingFeeTokens);
                emit MarketingFeeTaken(_marketingFeeTokens, 0);
                _marketingFeeTokens = 0;
            }   
        }

        if (tokensForLiquidity > 0 && baseTokenForLiquidity > 0) {
            addLiquidity(tokensForLiquidity, baseTokenForLiquidity);
            emit SwapAndLiquify(tokensForLiquidity, baseTokenForLiquidity);
        }

        _liquidityFeeTokens = 0;
    }

    function swapTokensForBaseToken(uint256 tokenAmount) private {
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = baseTokenForPair;        
        if (path[1] == mainRouter.WETH()){
            _approve(address(this), address(mainRouter), tokenAmount);
            mainRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
                tokenAmount,
                0, // accept any amount of BaseToken
                path,
                address(this),
                block.timestamp
            );
        }else{
            _approve(address(this), address(uniswapV2Caller), tokenAmount);
            uniswapV2Caller.swapExactTokensForTokensSupportingFeeOnTransferTokens(
                    address(mainRouter),
                    tokenAmount,
                    0, // accept any amount of BaseToken
                    path,
                    block.timestamp
                );
        }
    }

    function addLiquidity(uint256 tokenAmount, uint256 baseTokenAmount)
        private
    {
        _approve(address(this), address(mainRouter), tokenAmount);
        IERC20(baseTokenForPair).approve(address(mainRouter), baseTokenAmount);
        if (baseTokenForPair == mainRouter.WETH()) 
            mainRouter.addLiquidityETH{value: baseTokenAmount}(
                address(this),
                tokenAmount,
                0, // slippage is unavoidable
                0, // slippage is unavoidable
                address(0xdead),
                block.timestamp
            );
        else
            mainRouter.addLiquidity(
                address(this),
                baseTokenForPair,
                tokenAmount,
                baseTokenAmount,
                0,
                0,
                address(0xdead),
                block.timestamp
            );
    }

    receive() external payable {}
}
ERC20.sol 383 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * 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}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * 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 value {ERC20} uses, unless this function is
     * 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, _allowances[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 = _allowances[owner][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * 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;
        }
        _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;
        _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;
        }
        _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 Spend `amount` form the allowance of `owner` toward `spender`.
     *
     * 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 {}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 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 {
        _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);
    }
}

Read Contract

allowance 0xdd62ed3e → uint256
antiBotEnabled 0xd8c6404b → bool
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
baseTokenForPair 0x7cf84bd7 → address
buyLiquidityFee 0xf11a24d3 → uint16
buyMarketingFee 0x7bce5a04 → uint16
decimals 0x313ce567 → uint8
feeContract 0x06e29712 → address
gemAntiBot 0x77ec7449 → address
isExcludedFromFee 0x5342acb4 → bool
isExcludedFromMaxTransactionAmount 0xe9481eee → bool
isMarketingFeeBaseToken 0x57e62b98 → bool
mainPair 0x85af30c5 → address
mainRouter 0xcf188ad0 → address
marketingWallet 0x75f0a874 → address
maxTransactionAmount 0xc8c8ebe4 → uint256
maxWallet 0xf8b45b05 → uint256
minAmountToTakeFee 0xfc59d23d → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellLiquidityFee 0xf6374342 → uint16
sellMarketingFee 0x92136913 → uint16
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
uniswapV2Caller 0x7c75ad3a → address

Write Contract 19 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
excludeFromFee 0xdf8408fe
address account
bool isEx
excludeFromMaxTransactionAmount 0x2ae2f121
address account
bool isEx
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
setUsingAntiBot 0x2d5fd55a
bool enabled_
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateLiquidityFee 0xd68f8cde
uint16 _sellLiquidityFee
uint16 _buyLiquidityFee
updateMarketingFee 0xcf089e13
uint16 _sellMarketingFee
uint16 _buyMarketingFee
updateMarketingWallet 0x4707c551
address _marketingWallet
bool _isMarketingFeeBaseToken
updateMaxTransactionAmount 0xaa498023
uint256 _maxTransactionAmount
updateMaxWallet 0x1c499ab0
uint256 _maxWallet
updateMinAmountToTakeFee 0x73b9e82c
uint256 _minAmountToTakeFee
updateUniswapV2Pair 0x91c1004a
address _baseTokenForPair
updateUniswapV2Router 0x65b8dbc0
address newAddress

Recent Transactions

No transactions found for this address