Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xD75f1f81B69bDd4Df8EfbB70e9C6F4609009D753
Balance 0 ETH
Nonce 2
Code Size 18261 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

18261 bytes
0x6080604052600436106104e55760003560e01c80638da5cb5b11610281578063c492f0461161015a578063e98030c7116100cc578063f54afa7811610085578063f54afa7814610ec3578063f8b45b0514610ed9578063fb002c9714610eef578063fd361d0e14610f05578063fd72e22a14610f1f578063fe72b27a14610f3f57600080fd5b8063e98030c714610e21578063ee40166e14610e41578063ee44b44e14610e57578063efcc1b2f14610e6d578063f27fd25414610e83578063f2fde38b14610ea357600080fd5b8063ccd146b21161011e578063ccd146b214610d6f578063d0a3981414610d85578063dd62ed3e14610d9b578063e2f4560514610de1578063e7841ec014610df7578063e884f26014610e0c57600080fd5b8063c492f04614610cf4578063c7c61e2c14610d14578063c876d0b914610d29578063c8c8ebe414610d43578063ccb6135814610d5957600080fd5b8063a8b9d240116101f3578063bbc0c742116101b7578063bbc0c74214610c35578063befd2fac14610c54578063c024666814610c74578063c0f306ef14610c94578063c17b5b8c14610cb4578063c18bc19514610cd457600080fd5b8063a8b9d24014610b4a578063a9059cbb14610b6a578063ad56c13c14610b8a578063b62496f514610bef578063b9e9370014610c1f57600080fd5b80639c1b8af5116102455780639c1b8af514610ab35780639ec22c0e14610ac9578063a26579ad14610adf578063a457c2d714610af4578063a4c82a0014610b14578063a716b77314610b2a57600080fd5b80638da5cb5b14610a2a578063924de9b714610a4857806395d89b4114610a685780639a36f93214610a7d5780639a7a23d614610a9357600080fd5b8063452ed4f1116103be578063715018a611610330578063763cef49116102e9578063763cef4914610995578063783102eb146109aa5780637fa787ba146109c05780638095d564146109d5578063871c128d146109f55780638a8c523c14610a1557600080fd5b8063715018a61461090057806371778e7d14610915578063730c18881461092a5780637506cbd81461094a578063751039fc146109605780637571336a1461097557600080fd5b806364b0f6531161038257806364b0f653146108565780636843cd841461086b5780636ddd17131461088b578063700bb191146108ab57806370a08231146108cb578063712c2985146108eb57600080fd5b8063452ed4f1146107a45780634a62bb65146107d85780634af6f7ee146107f25780634e71d92d146108085780634fbee1931461081d57600080fd5b80631a8145bb116104575780632e82f1a01161041b5780632e82f1a0146106f957806330bb4cff1461071357806330d5d18d14610728578063313ce5671461074857806331e79db014610764578063395093511461078457600080fd5b80631a8145bb146106775780631fc851bd1461068d57806323b872dd146106a35780632c1f5216146106c35780632c3e486c146106e357600080fd5b80630f4432e3116104a95780630f4432e3146105ce578063106b5da1146105e457806310d5de531461060657806318160ddd14610636578063184c16c51461064b578063199ffc721461066157600080fd5b8063058054c9146104f157806306fdde031461051a5780630758d9241461053c578063095ea7b314610588578063099d0d30146105b857600080fd5b366104ec57005b600080fd5b3480156104fd57600080fd5b50610507601d5481565b6040519081526020015b60405180910390f35b34801561052657600080fd5b5061052f610f5f565b604051610511919061413f565b34801561054857600080fd5b506105707f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b039091168152602001610511565b34801561059457600080fd5b506105a86105a33660046141a9565b610ff1565b6040519015158152602001610511565b3480156105c457600080fd5b5061050760145481565b3480156105da57600080fd5b50610507600b5481565b3480156105f057600080fd5b506106046105ff3660046141d5565b611008565b005b34801561061257600080fd5b506105a86106213660046141ee565b60286020526000908152604090205460ff1681565b34801561064257600080fd5b50600254610507565b34801561065757600080fd5b5061050760255481565b34801561066d57600080fd5b5061050760215481565b34801561068357600080fd5b50610507601b5481565b34801561069957600080fd5b50610507600d5481565b3480156106af57600080fd5b506105a86106be36600461420b565b6110ed565b3480156106cf57600080fd5b50600654610570906001600160a01b031681565b3480156106ef57600080fd5b5061050760235481565b34801561070557600080fd5b506022546105a89060ff1681565b34801561071f57600080fd5b50610507611197565b34801561073457600080fd5b506106046107433660046141ee565b61120a565b34801561075457600080fd5b5060405160128152602001610511565b34801561077057600080fd5b5061060461077f3660046141ee565b6112f2565b34801561079057600080fd5b506105a861079f3660046141a9565b61137f565b3480156107b057600080fd5b506105707f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec7581565b3480156107e457600080fd5b50600e546105a89060ff1681565b3480156107fe57600080fd5b5061050760165481565b34801561081457600080fd5b506106046113bb565b34801561082957600080fd5b506105a86108383660046141ee565b6001600160a01b031660009081526027602052604090205460ff1690565b34801561086257600080fd5b50610507611433565b34801561087757600080fd5b506105076108863660046141ee565b61147d565b34801561089757600080fd5b50600e546105a89062010000900460ff1681565b3480156108b757600080fd5b506106046108c63660046141d5565b6114ed565b3480156108d757600080fd5b506105076108e63660046141ee565b6115c0565b3480156108f757600080fd5b506105076115db565b34801561090c57600080fd5b506106046115ff565b34801561092157600080fd5b50610507611673565b34801561093657600080fd5b5061060461094536600461425a565b6116bd565b34801561095657600080fd5b5061050760135481565b34801561096c57600080fd5b506105a86117e5565b34801561098157600080fd5b50610604610990366004614293565b61182e565b3480156109a157600080fd5b506106046118b8565b3480156109b657600080fd5b5061050760205481565b3480156109cc57600080fd5b50610604611a96565b3480156109e157600080fd5b506106046109f03660046142cc565b611b4d565b348015610a0157600080fd5b50610604610a103660046141d5565b611bf6565b348015610a2157600080fd5b50610604611d39565b348015610a3657600080fd5b506005546001600160a01b0316610570565b348015610a5457600080fd5b50610604610a633660046142f8565b611dd2565b348015610a7457600080fd5b5061052f611e18565b348015610a8957600080fd5b506105076103e881565b348015610a9f57600080fd5b50610604610aae366004614293565b611e27565b348015610abf57600080fd5b50610507601c5481565b348015610ad557600080fd5b5061050760265481565b348015610aeb57600080fd5b50610507611f10565b348015610b0057600080fd5b506105a8610b0f3660046141a9565b611f5a565b348015610b2057600080fd5b5061050760245481565b348015610b3657600080fd5b50610604610b453660046141ee565b611ff3565b348015610b5657600080fd5b50610507610b653660046141ee565b612092565b348015610b7657600080fd5b506105a8610b853660046141a9565b6120c5565b348015610b9657600080fd5b50610baa610ba53660046141ee565b6120d2565b604080516001600160a01b0390991689526020890197909752958701949094526060860192909252608085015260a084015260c083015260e082015261010001610511565b348015610bfb57600080fd5b506105a8610c0a3660046141ee565b60296020526000908152604090205460ff1681565b348015610c2b57600080fd5b5061050760155481565b348015610c4157600080fd5b50600e546105a890610100900460ff1681565b348015610c6057600080fd5b50610604610c6f3660046141d5565b61216d565b348015610c8057600080fd5b50610604610c8f366004614293565b6122a3565b348015610ca057600080fd5b50610604610caf3660046141ee565b612325565b348015610cc057600080fd5b50610604610ccf3660046142cc565b612381565b348015610ce057600080fd5b50610604610cef3660046141d5565b612425565b348015610d0057600080fd5b50610604610d0f366004614315565b6124f3565b348015610d2057600080fd5b506106046125cf565b348015610d3557600080fd5b506010546105a89060ff1681565b348015610d4f57600080fd5b5061050760085481565b348015610d6557600080fd5b5061050760185481565b348015610d7b57600080fd5b5061050760125481565b348015610d9157600080fd5b5061050760115481565b348015610da757600080fd5b50610507610db6366004614390565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b348015610ded57600080fd5b5061050760095481565b348015610e0357600080fd5b50610507612638565b348015610e1857600080fd5b506105a8612682565b348015610e2d57600080fd5b50610604610e3c3660046141d5565b6126bf565b348015610e4d57600080fd5b50610507600c5481565b348015610e6357600080fd5b50610507601e5481565b348015610e7957600080fd5b5061050760175481565b348015610e8f57600080fd5b50610baa610e9e3660046141d5565b61271a565b348015610eaf57600080fd5b50610604610ebe3660046141ee565b61275c565b348015610ecf57600080fd5b5061050760195481565b348015610ee557600080fd5b50610507600a5481565b348015610efb57600080fd5b50610507601a5481565b348015610f1157600080fd5b50601f546105a89060ff1681565b348015610f2b57600080fd5b50600754610570906001600160a01b031681565b348015610f4b57600080fd5b50610604610f5a3660046141d5565b612847565b606060038054610f6e906143be565b80601f0160208091040260200160405190810160405280929190818152602001828054610f9a906143be565b8015610fe75780601f10610fbc57610100808354040283529160200191610fe7565b820191906000526020600020905b815481529060010190602001808311610fca57829003601f168201915b5050505050905090565b6000610ffe338484612aca565b5060015b92915050565b6005546001600160a01b0316331461103b5760405162461bcd60e51b8152600401611032906143f8565b60405180910390fd5b670de0b6b3a76400006103e861105060025490565b61105b906001614443565b6110659190614462565b61106f9190614462565b81116110d55760405162461bcd60e51b815260206004820152602f60248201527f43616e6e6f7420736574206d61785472616e73616374696f6e416d6f756e742060448201526e6c6f776572207468616e20302e312560881b6064820152608401611032565b6110e781670de0b6b3a7640000614443565b60085550565b60006110fa848484612bee565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561117f5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401611032565b61118c8533858403612aca565b506001949350505050565b600654604080516342d359d760e11b815290516000926001600160a01b0316916385a6b3ae9160048083019260209291908290030181865afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112059190614484565b905090565b6005546001600160a01b031633146112345760405162461bcd60e51b8152600401611032906143f8565b6001600160a01b03811661128a5760405162461bcd60e51b815260206004820152601860248201527f6d6179206e6f742073657420746f2030206164647265737300000000000000006044820152606401611032565b6112958160016122a3565b6007546040516001600160a01b03918216918316907f086aa05ff00214e2d0c7c02b8a46b2614ad955732e6b43aa8afca69ed1ad76f890600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b0316331461131c5760405162461bcd60e51b8152600401611032906143f8565b60065460405163031e79db60e41b81526001600160a01b038381166004830152909116906331e79db0906024015b600060405180830381600087803b15801561136457600080fd5b505af1158015611378573d6000803e3d6000fd5b5050505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610ffe9185906113b690869061449d565b612aca565b60065460405163bc4c4b3760e01b8152336004820152600060248201526001600160a01b039091169063bc4c4b37906044016020604051808303816000875af115801561140c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143091906144b5565b50565b600654604080516304ddf6ef60e11b815290516000926001600160a01b0316916309bbedde9160048083019260209291908290030181865afa1580156111e1573d6000803e3d6000fd5b60065460405163156dbbf560e31b81526001600160a01b038381166004830152600092169063ab6ddfa8906024015b602060405180830381865afa1580156114c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110029190614484565b6006546040516001624d3b8760e01b0319815260048101839052600091829182916001600160a01b03169063ffb2c479906024016060604051808303816000875af1158015611540573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156491906144d2565b604080518481526020810184905290810182905260608101889052929550909350915032906000907fc864333d6121033635ab41b29ae52f10a22cf4438c3e4f1c4c68518feb2f8a98906080015b60405180910390a350505050565b6001600160a01b031660009081526020819052604090205490565b601f5460009060ff16156115f957601e54601d54611205919061449d565b50600090565b6005546001600160a01b031633146116295760405162461bcd60e51b8152600401611032906143f8565b6005546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600580546001600160a01b0319169055565b6006546040805163ad7a672f60e01b815290516000926001600160a01b03169163ad7a672f9160048083019260209291908290030181865afa1580156111e1573d6000803e3d6000fd5b6005546001600160a01b031633146116e75760405162461bcd60e51b8152600401611032906143f8565b60648310156117545760405162461bcd60e51b815260206004820152603360248201527f63616e6e6f7420736574206275796261636b206d6f7265206f6674656e207468604482015272616e206576657279203130206d696e7574657360681b6064820152608401611032565b6107d08211158015611764575060015b6117c95760405162461bcd60e51b815260206004820152603060248201527f4d75737420736574206175746f204c50206275726e2070657263656e7420626560448201526f747765656e20312520616e642032302560801b6064820152608401611032565b6023929092556021556022805460ff1916911515919091179055565b6005546000906001600160a01b031633146118125760405162461bcd60e51b8152600401611032906143f8565b50600e805460ff19908116909155601080549091169055600190565b6005546001600160a01b031633146118585760405162461bcd60e51b8152600401611032906143f8565b6001600160a01b038216600081815260286020908152604091829020805460ff191685151590811790915591519182527f575f9d01836c9206322151b9e9ec3f2b77b87e71176933b9b44d2d732f768d9591015b60405180910390a25050565b6005546001600160a01b031633146118e25760405162461bcd60e51b8152600401611032906143f8565b6118ea6115db565b4210158015611900575060006118fe6115db565b115b6119455760405162461bcd60e51b815260206004820152601660248201527526bab9ba103932b8bab2b9ba1030b732103bb0b4ba1760511b6044820152606401611032565b6000601d819055601f805460ff191690556020546040516370a0823160e01b8152306004820152606491907f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec756001600160a01b0316906370a0823190602401602060405180830381865afa1580156119c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e59190614484565b6119ef9190614443565b6119f99190614462565b600060205560405163a9059cbb60e01b8152336004820152602481018290529091507f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec756001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015611a6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9291906144b5565b5050565b6005546001600160a01b03163314611ac05760405162461bcd60e51b8152600401611032906143f8565b604051600090339047908381818185875af1925050503d8060008114611b02576040519150601f19603f3d011682016040523d82523d6000602084013e611b07565b606091505b50509050806114305760405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b6044820152606401611032565b6005546001600160a01b03163314611b775760405162461bcd60e51b8152600401611032906143f8565b60178390556016829055601881905580611b91838561449d565b611b9b919061449d565b601581905561012c1015611bf15760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420333025206f72206c6573730000006044820152606401611032565b505050565b6005546001600160a01b03163314611c205760405162461bcd60e51b8152600401611032906143f8565b62030d408110158015611c3657506207a1208111155b611ca05760405162461bcd60e51b815260206004820152603560248201527f20676173466f7250726f63657373696e67206d7573742062652062657477656560448201527406e203230302c30303020616e64203530302c30303605c1b6064820152608401611032565b601c548103611d065760405162461bcd60e51b815260206004820152602c60248201527f43616e6e6f742075706461746520676173466f7250726f63657373696e67207460448201526b6f2073616d652076616c756560a01b6064820152608401611032565b601c5460405182907f40d7e40e79af4e8e5a9b3c57030d8ea93f13d669c06d448c4d631d4ae7d23db790600090a3601c55565b6005546001600160a01b03163314611d635760405162461bcd60e51b8152600401611032906143f8565b600e54610100900460ff1615611dbb5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f742072652d656e61626c652074726164696e6700000000000000006044820152606401611032565b600e805462ffff0019166201010017905543600c55565b6005546001600160a01b03163314611dfc5760405162461bcd60e51b8152600401611032906143f8565b600e8054911515620100000262ff000019909216919091179055565b606060048054610f6e906143be565b6005546001600160a01b03163314611e515760405162461bcd60e51b8152600401611032906143f8565b7f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec756001600160a01b0316826001600160a01b031603611f065760405162461bcd60e51b815260206004820152604560248201527f5468652050616e63616b655377617020706169722063616e6e6f74206265207260448201527f656d6f7665642066726f6d206175746f6d617465644d61726b65744d616b6572606482015264506169727360d81b608482015260a401611032565b611a928282613761565b60065460408051631bc9e27b60e21b815290516000926001600160a01b031691636f2789ec9160048083019260209291908290030181865afa1580156111e1573d6000803e3d6000fd5b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015611fdc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401611032565b611fe93385858403612aca565b5060019392505050565b6005546001600160a01b0316331461201d5760405162461bcd60e51b8152600401611032906143f8565b6120288160016122a3565b60065460405163031e79db60e41b81526001600160a01b038381166004830152909116906331e79db090602401600060405180830381600087803b15801561206f57600080fd5b505af1158015612083573d6000803e3d6000fd5b5050505061143081600161182e565b6006546040516302a2e74960e61b81526001600160a01b038381166004830152600092169063a8b9d240906024016114ac565b6000610ffe338484612bee565b60065460405163fbcbc0f160e01b81526001600160a01b038381166004830152600092839283928392839283928392839291169063fbcbc0f1906024015b61010060405180830381865afa15801561212e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121529190614500565b97509750975097509750975097509750919395975091939597565b6005546001600160a01b031633146121975760405162461bcd60e51b8152600401611032906143f8565b601f5460ff16156122045760405162461bcd60e51b815260206004820152603160248201527f43616e6e6f74207265717565737420616761696e20756e74696c206669727374604482015270103932b8bab2b9ba1034b99037bb32b91760791b6064820152608401611032565b606481111580156122155750600081115b6122615760405162461bcd60e51b815260206004820152601a60248201527f4e65656420746f20736574206265747765656e20312d313030250000000000006044820152606401611032565b42601d55601f805460ff1916600117905560208190556040517fd99a77b2f3951cd076e75814e44db497e6abc203dd251329da0b62c288f9f48b90600090a150565b6005546001600160a01b031633146122cd5760405162461bcd60e51b8152600401611032906143f8565b6001600160a01b038216600081815260276020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df791016118ac565b6005546001600160a01b0316331461234f5760405162461bcd60e51b8152600401611032906143f8565b60065460405163c0f306ef60e01b81526001600160a01b0383811660048301529091169063c0f306ef9060240161134a565b6005546001600160a01b031633146123ab5760405162461bcd60e51b8152600401611032906143f8565b601383905560128290556014819055806123c5838561449d565b6123cf919061449d565b601181905561012c1015611bf15760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420333025206f72206c6573730000006044820152606401611032565b6005546001600160a01b0316331461244f5760405162461bcd60e51b8152600401611032906143f8565b670de0b6b3a7640000606461246360025490565b61246e906001614443565b6124789190614462565b6124829190614462565b81116124db5760405162461bcd60e51b815260206004820152602260248201527f43616e6e6f7420736574206d617857616c6c6574206c6f776572207468616e20604482015261312560f01b6064820152608401611032565b6124ed81670de0b6b3a7640000614443565b600a5550565b6005546001600160a01b0316331461251d5760405162461bcd60e51b8152600401611032906143f8565b60005b8281101561258e57816027600086868581811061253f5761253f61456a565b905060200201602081019061255491906141ee565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061258681614580565b915050612520565b507f7fdaf542373fa84f4ee8d662c642f44e4c2276a217d7d29e548b6eb29a233b358383836040516125c293929190614599565b60405180910390a1505050565b6005546001600160a01b031633146125f95760405162461bcd60e51b8152600401611032906143f8565b601f805460ff1916905560006020819055601d8190556040517ffbcc1c208c9c4d1d9f557267b55c5ae316e74ce676a0db72ef18c6d5f5767c619190a1565b6006546040805163039e107b60e61b815290516000926001600160a01b03169163e7841ec09160048083019260209291908290030181865afa1580156111e1573d6000803e3d6000fd5b6005546000906001600160a01b031633146126af5760405162461bcd60e51b8152600401611032906143f8565b506010805460ff19169055600190565b6005546001600160a01b031633146126e95760405162461bcd60e51b8152600401611032906143f8565b60065460405163e98030c760e01b8152600481018390526001600160a01b039091169063e98030c79060240161134a565b600654604051635183d6fd60e01b81526004810183905260009182918291829182918291829182916001600160a01b0390911690635183d6fd90602401612110565b6005546001600160a01b031633146127865760405162461bcd60e51b8152600401611032906143f8565b6001600160a01b0381166127eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611032565b6005546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031633146128715760405162461bcd60e51b8152600401611032906143f8565b602554602654612881919061449d565b42116128cf5760405162461bcd60e51b815260206004820181905260248201527f4d757374207761697420666f7220636f6f6c646f776e20746f2066696e6973686044820152606401611032565b6107d08111156129345760405162461bcd60e51b815260206004820152602a60248201527f4d6179206e6f74206e756b65206d6f7265207468616e20323025206f6620746f60448201526906b656e7320696e204c560b41b6064820152608401611032565b426026556040516370a0823160e01b81526001600160a01b037f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec7516600482015260009030906370a0823190602401602060405180830381865afa15801561299f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129c39190614484565b905060006127106129d48484614443565b6129de9190614462565b90508015612a1357612a137f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec7561dead83613831565b60007f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec759050806001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612a7357600080fd5b505af1158015612a87573d6000803e3d6000fd5b505050507f01dfa9a7a5ffd5f2630a016e754405184a66ca529745e85abd52e47e76ec70d682604051612abc91815260200190565b60405180910390a150505050565b6001600160a01b038316612b2c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401611032565b6001600160a01b038216612b8d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401611032565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316612c145760405162461bcd60e51b8152600401611032906145f2565b6001600160a01b038216612c3a5760405162461bcd60e51b815260040161103290614637565b80600003612c4e57611bf183836000613831565b600e54610100900460ff16612ce8576001600160a01b03831660009081526027602052604090205460ff1680612c9c57506001600160a01b03821660009081526027602052604090205460ff165b612ce85760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f7420616374697665207965742e0000000000006044820152606401611032565b600e5460ff16156130ec576005546001600160a01b03848116911614801590612d1f57506005546001600160a01b03838116911614155b8015612d3357506001600160a01b03821615155b8015612d4a57506001600160a01b03821661dead14155b8015612d605750600554600160a01b900460ff16155b156130ec5760105460ff1615612e92577f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614158015612de457507f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec756001600160a01b0316826001600160a01b031614155b15612e9257326000908152600f60205260409020544311612e7f5760405162461bcd60e51b815260206004820152604960248201527f5f7472616e736665723a3a205472616e736665722044656c617920656e61626c60448201527f65642e20204f6e6c79206f6e652070757263686173652070657220626c6f636b6064820152681030b63637bbb2b21760b91b608482015260a401611032565b326000908152600f602052604090204390555b6001600160a01b03831660009081526029602052604090205460ff168015612ed357506001600160a01b03821660009081526028602052604090205460ff16155b15612fb157600854811115612f485760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401611032565b600a54612f54836115c0565b612f5e908361449d565b1115612fac5760405162461bcd60e51b815260206004820152601b60248201527f556e61626c6520746f20657863656564204d61782057616c6c657400000000006044820152606401611032565b6130ec565b6001600160a01b03821660009081526029602052604090205460ff168015612ff257506001600160a01b03831660009081526028602052604090205460ff16155b1561306857600854811115612fac5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401611032565b6001600160a01b03821660009081526028602052604090205460ff166130ec57600a54613094836115c0565b61309e908361449d565b11156130ec5760405162461bcd60e51b815260206004820152601b60248201527f556e61626c6520746f20657863656564204d61782057616c6c657400000000006044820152606401611032565b60006130f7306115c0565b600954909150811080159081906131165750600e5462010000900460ff165b801561312c5750600554600160a01b900460ff16155b801561315157506001600160a01b03851660009081526029602052604090205460ff16155b801561317657506001600160a01b03851660009081526027602052604090205460ff16155b801561319b57506001600160a01b03841660009081526027602052604090205460ff16155b156131c9576005805460ff60a01b1916600160a01b1790556131bb613978565b6005805460ff60a01b191690555b600554600160a01b900460ff161580156131fb57506001600160a01b03841660009081526029602052604090205460ff165b8015613209575060225460ff165b80156132245750602354602454613220919061449d565b4210155b801561324957506001600160a01b03851660009081526027602052604090205460ff16155b1561325657613256613ba5565b6005546001600160a01b03861660009081526027602052604090205460ff600160a01b9092048216159116806132a457506001600160a01b03851660009081526027602052604090205460ff165b156132ad575060005b600081156135725743600c5460016132c5919061449d565b1015801561330d57506001600160a01b03861660009081526029602052604090205460ff168061330d57506001600160a01b03871660009081526029602052604090205460ff165b156133b9576133286064613322876063613d31565b90613dba565b90506063613337826021614443565b6133419190614462565b601b6000828254613352919061449d565b9091555060639050613365826021614443565b61336f9190614462565b60196000828254613380919061449d565b9091555060639050613393826021614443565b61339d9190614462565b601a60008282546133ae919061449d565b909155506135549050565b6001600160a01b03861660009081526029602052604090205460ff1680156133e357506000601154115b15613476576134036103e861332260115488613d3190919063ffffffff16565b9050601154601254826134169190614443565b6134209190614462565b60196000828254613431919061449d565b90915550506011546014546134469083614443565b6134509190614462565b601b6000828254613461919061449d565b90915550506011546013546133939083614443565b6001600160a01b03871660009081526029602052604090205460ff1680156134a057506000601554115b15613554576134c06103e861332260155488613d3190919063ffffffff16565b9050601554601654826134d39190614443565b6134dd9190614462565b601960008282546134ee919061449d565b90915550506015546018546135039083614443565b61350d9190614462565b601b600082825461351e919061449d565b90915550506015546017546135339083614443565b61353d9190614462565b601a600082825461354e919061449d565b90915550505b801561356557613565873083613831565b61356f818661467a565b94505b61357d878787613831565b6006546001600160a01b031663e30443bc88613598816115c0565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156135de57600080fd5b505af11580156135f2573d6000803e3d6000fd5b50506006546001600160a01b0316915063e30443bc905087613613816115c0565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561365957600080fd5b505af115801561366d573d6000803e3d6000fd5b5050600554600160a01b900460ff1615915050801561368e57506000601c54115b1561375857601c546006546040516001624d3b8760e01b03198152600481018390526001600160a01b039091169063ffb2c479906024016060604051808303816000875af1925050508015613700575060408051601f3d908101601f191682019092526136fd918101906144d2565b60015b156137565760408051848152602081018490529081018290526060810185905232906001907fc864333d6121033635ab41b29ae52f10a22cf4438c3e4f1c4c68518feb2f8a989060800160405180910390a35050505b505b50505050505050565b6001600160a01b0382166000908152602960205260409020805460ff191682151517905561378f828261182e565b80156137f55760065460405163031e79db60e41b81526001600160a01b038481166004830152909116906331e79db090602401600060405180830381600087803b1580156137dc57600080fd5b505af11580156137f0573d6000803e3d6000fd5b505050505b604051811515906001600160a01b038416907fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab90600090a35050565b6001600160a01b0383166138575760405162461bcd60e51b8152600401611032906145f2565b6001600160a01b03821661387d5760405162461bcd60e51b815260040161103290614637565b6001600160a01b038316600090815260208190526040902054818110156138f55760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401611032565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061392c90849061449d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516115b291815260200190565b6000613983306115c0565b90506000601954601a54601b5461399a919061449d565b6139a4919061449d565b90508115806139b1575080155b156139ba575050565b6000600282601b54856139cd9190614443565b6139d79190614462565b6139e19190614462565b905060006139ef8483613dfc565b9050476139fb82613e3e565b6000613a074783613dfc565b90506000613a356002601b54613a1d9190614462565b613a27908861467a565b601a54613322908590613d31565b90506000613a636002601b54613a4b9190614462565b613a55908961467a565b601954613322908690613d31565b9050600081613a72848661467a565b613a7c919061467a565b6000601b819055601a81905560195590508615801590613a9c5750600081115b15613aef57613aab8782613ffe565b601b54604080518881526020810184905280820192909252517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a15b6006546040516000916001600160a01b03169084908381818185875af1925050503d8060008114613b3c576040519150601f19603f3d011682016040523d82523d6000602084013e613b41565b606091505b50506007546040519192506001600160a01b0316904790600081818185875af1925050503d8060008114613b91576040519150601f19603f3d011682016040523d82523d6000602084013e613b96565b606091505b50505050505050505050505050565b4260249081556040516370a0823160e01b81526001600160a01b037f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec7516600482015260009130916370a082319101602060405180830381865afa158015613c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c349190614484565b9050600061271060215483613c499190614443565b613c539190614462565b90508015613c8857613c887f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec7561dead83613831565b60007f0000000000000000000000003b35a99780fc2c85943e67a901f10bd7317fec759050806001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613ce857600080fd5b505af1158015613cfc573d6000803e3d6000fd5b505050507f6f57447c7d0d492231a83fb5442fa4aab5203af719a9a9ebf5f93ff4dfaa1686826040516125c291815260200190565b600082600003613d4357506000611002565b6000613d4f8385614443565b905082613d5c8583614462565b14613db35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401611032565b9392505050565b6000613db383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506140d7565b6000613db383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061410e565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110613e7357613e7361456a565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f159190614691565b81600181518110613f2857613f2861456a565b60200260200101906001600160a01b031690816001600160a01b031681525050613f73307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612aca565b60405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac94790613fc89085906000908690309042906004016146ae565b600060405180830381600087803b158015613fe257600080fd5b505af1158015613ff6573d6000803e3d6000fd5b505050505050565b614029307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612aca565b60405163f305d71960e01b8152306004820181905260248201849052600060448301819052606483015260848201524260a48201527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03169063f305d71990839060c40160606040518083038185885af11580156140b2573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061137891906144d2565b600081836140f85760405162461bcd60e51b8152600401611032919061413f565b5060006141058486614462565b95945050505050565b600081848411156141325760405162461bcd60e51b8152600401611032919061413f565b506000614105848661467a565b600060208083528351808285015260005b8181101561416c57858101830151858201604001528201614150565b8181111561417e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461143057600080fd5b600080604083850312156141bc57600080fd5b82356141c781614194565b946020939093013593505050565b6000602082840312156141e757600080fd5b5035919050565b60006020828403121561420057600080fd5b8135613db381614194565b60008060006060848603121561422057600080fd5b833561422b81614194565b9250602084013561423b81614194565b929592945050506040919091013590565b801515811461143057600080fd5b60008060006060848603121561426f57600080fd5b833592506020840135915060408401356142888161424c565b809150509250925092565b600080604083850312156142a657600080fd5b82356142b181614194565b915060208301356142c18161424c565b809150509250929050565b6000806000606084860312156142e157600080fd5b505081359360208301359350604090920135919050565b60006020828403121561430a57600080fd5b8135613db38161424c565b60008060006040848603121561432a57600080fd5b833567ffffffffffffffff8082111561434257600080fd5b818601915086601f83011261435657600080fd5b81358181111561436557600080fd5b8760208260051b850101111561437a57600080fd5b602092830195509350508401356142888161424c565b600080604083850312156143a357600080fd5b82356143ae81614194565b915060208301356142c181614194565b600181811c908216806143d257607f821691505b6020821081036143f257634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561445d5761445d61442d565b500290565b60008261447f57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561449657600080fd5b5051919050565b600082198211156144b0576144b061442d565b500190565b6000602082840312156144c757600080fd5b8151613db38161424c565b6000806000606084860312156144e757600080fd5b8351925060208401519150604084015190509250925092565b600080600080600080600080610100898b03121561451d57600080fd5b885161452881614194565b809850506020890151965060408901519550606089015194506080890151935060a0890151925060c0890151915060e089015190509295985092959890939650565b634e487b7160e01b600052603260045260246000fd5b6000600182016145925761459261442d565b5060010190565b6040808252810183905260008460608301825b868110156145dc5782356145bf81614194565b6001600160a01b03168252602092830192909101906001016145ac565b5080925050508215156020830152949350505050565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60008282101561468c5761468c61442d565b500390565b6000602082840312156146a357600080fd5b8151613db381614194565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156146fe5784516001600160a01b0316835293830193918301916001016146d9565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220766e677b601e8b33a94852f2064bd48486466d38178a916abae4031eb904095e64736f6c634300080d0033

Verified Source Code Partial Match

Compiler: v0.8.13+commit.abaa5c0e EVM: london Optimization: Yes (200 runs)
Yashav3.sol 1755 lines
// SPDX-License-Identifier: MIT                                                                               
                                                    
pragma solidity 0.8.13;

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

interface IDexPair {
    function sync() external;
}

interface IUniswapV2Factory {
    function createPair(address tokenA, address tokenB) external returns (address pair);
}

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

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


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;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    function name() public view virtual override returns (string memory) {
        return _name;
    }

    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

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

    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

    function _createInitialSupply(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");
        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);
    }

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

interface DividendPayingTokenOptionalInterface {
  /// @notice View the amount of dividend in wei that an address can withdraw.
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` can withdraw.
  function withdrawableDividendOf(address _owner) external view returns(uint256);

  /// @notice View the amount of dividend in wei that an address has withdrawn.
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` has withdrawn.
  function withdrawnDividendOf(address _owner) external view returns(uint256);

  /// @notice View the amount of dividend in wei that an address has earned in total.
  /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` has earned in total.
  function accumulativeDividendOf(address _owner) external view returns(uint256);
}

interface DividendPayingTokenInterface {
  /// @notice View the amount of dividend in wei that an address can withdraw.
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` can withdraw.
  function dividendOf(address _owner) external view returns(uint256);

  /// @notice Distributes ether to token holders as dividends.
  /// @dev SHOULD distribute the paid ether to token holders as dividends.
  ///  SHOULD NOT directly transfer ether to token holders in this function.
  ///  MUST emit a `DividendsDistributed` event when the amount of distributed ether is greater than 0.
  function distributeDividends() external payable;

  /// @notice Withdraws the ether distributed to the sender.
  /// @dev SHOULD transfer `dividendOf(msg.sender)` wei to `msg.sender`, and `dividendOf(msg.sender)` SHOULD be 0 after the transfer.
  ///  MUST emit a `DividendWithdrawn` event if the amount of ether transferred is greater than 0.
  function withdrawDividend() external;

  /// @dev This event MUST emit when ether is distributed to token holders.
  /// @param from The address which sends ether to this contract.
  /// @param weiAmount The amount of distributed ether in wei.
  event DividendsDistributed(
    address indexed from,
    uint256 weiAmount
  );

  /// @dev This event MUST emit when an address withdraws their dividend.
  /// @param to The address which withdraws ether from this contract.
  /// @param weiAmount The amount of withdrawn ether in wei.
  event DividendWithdrawn(
    address indexed to,
    uint256 weiAmount
  );
}

library SafeMath {
    /**
     * @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) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @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 sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

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

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts 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 mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}



library SafeMathInt {
    int256 private constant MIN_INT256 = int256(1) << 255;
    int256 private constant MAX_INT256 = ~(int256(1) << 255);

    /**
     * @dev Multiplies two int256 variables and fails on overflow.
     */
    function mul(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a * b;

        // Detect overflow when multiplying MIN_INT256 with -1
        require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));
        require((b == 0) || (c / b == a));
        return c;
    }

    /**
     * @dev Division of two int256 variables and fails on overflow.
     */
    function div(int256 a, int256 b) internal pure returns (int256) {
        // Prevent overflow when dividing MIN_INT256 by -1
        require(b != -1 || a != MIN_INT256);

        // Solidity already throws when dividing by 0.
        return a / b;
    }

    /**
     * @dev Subtracts two int256 variables and fails on overflow.
     */
    function sub(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a - b;
        require((b >= 0 && c <= a) || (b < 0 && c > a));
        return c;
    }

    /**
     * @dev Adds two int256 variables and fails on overflow.
     */
    function add(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a + b;
        require((b >= 0 && c >= a) || (b < 0 && c < a));
        return c;
    }

    /**
     * @dev Converts to absolute value, and fails on overflow.
     */
    function abs(int256 a) internal pure returns (int256) {
        require(a != MIN_INT256);
        return a < 0 ? -a : a;
    }


    function toUint256Safe(int256 a) internal pure returns (uint256) {
        require(a >= 0);
        return uint256(a);
    }
}

library SafeMathUint {
  function toInt256Safe(uint256 a) internal pure returns (int256) {
    int256 b = int256(a);
    require(b >= 0);
    return b;
  }
}


interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

contract DividendPayingToken is DividendPayingTokenInterface, DividendPayingTokenOptionalInterface, Ownable {
  using SafeMath for uint256;
  using SafeMathUint for uint256;
  using SafeMathInt for int256;

  // With `magnitude`, we can properly distribute dividends even if the amount of received ether is small.
  // For more discussion about choosing the value of `magnitude`,
  //  see https://github.com/ethereum/EIPs/issues/1726#issuecomment-472352728
  uint256 constant internal magnitude = 2**128;

  uint256 internal magnifiedDividendPerShare;
  
  // About dividendCorrection:
  // If the token balance of a `_user` is never changed, the dividend of `_user` can be computed with:
  //   `dividendOf(_user) = dividendPerShare * balanceOf(_user)`.
  // When `balanceOf(_user)` is changed (via minting/burning/transferring tokens),
  //   `dividendOf(_user)` should not be changed,
  //   but the computed value of `dividendPerShare * balanceOf(_user)` is changed.
  // To keep the `dividendOf(_user)` unchanged, we add a correction term:
  //   `dividendOf(_user) = dividendPerShare * balanceOf(_user) + dividendCorrectionOf(_user)`,
  //   where `dividendCorrectionOf(_user)` is updated whenever `balanceOf(_user)` is changed:
  //   `dividendCorrectionOf(_user) = dividendPerShare * (old balanceOf(_user)) - (new balanceOf(_user))`.
  // So now `dividendOf(_user)` returns the same value before and after `balanceOf(_user)` is changed.
  mapping(address => int256) internal magnifiedDividendCorrections;
  mapping(address => uint256) internal withdrawnDividends;
  
  mapping (address => uint256) public holderBalance;
  uint256 public totalBalance;

  uint256 public totalDividendsDistributed;

  /// @dev Distributes dividends whenever ether is paid to this contract.
  receive() external payable {
    distributeDividends();
  }

  /// @notice Distributes ether to token holders as dividends.
  /// @dev It reverts if the total supply of tokens is 0.
  /// It emits the `DividendsDistributed` event if the amount of received ether is greater than 0.
  /// About undistributed ether:
  ///   In each distribution, there is a small amount of ether not distributed,
  ///     the magnified amount of which is
  ///     `(msg.value * magnitude) % totalSupply()`.
  ///   With a well-chosen `magnitude`, the amount of undistributed ether
  ///     (de-magnified) in a distribution can be less than 1 wei.
  ///   We can actually keep track of the undistributed ether in a distribution
  ///     and try to distribute it in the next distribution,
  ///     but keeping track of such data on-chain costs much more than
  ///     the saved ether, so we don't do that.
    
  function distributeDividends() public override payable { 
      require(totalBalance > 0);

        if (msg.value > 0) {
          magnifiedDividendPerShare = magnifiedDividendPerShare.add(
            (msg.value).mul(magnitude) / totalBalance
          );
          emit DividendsDistributed(msg.sender, msg.value);
    
          totalDividendsDistributed = totalDividendsDistributed.add(msg.value);
        }
  }
  
  /// @notice Withdraws the ether distributed to the sender.
  /// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0.
  function withdrawDividend() external virtual override {
    _withdrawDividendOfUser(payable(msg.sender));
  }

  /// @notice Withdraws the ether distributed to the sender.
  /// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0.
  function _withdrawDividendOfUser(address payable user) internal returns (uint256) {
    uint256 _withdrawableDividend = withdrawableDividendOf(user);
    if (_withdrawableDividend > 0) {
      withdrawnDividends[user] = withdrawnDividends[user].add(_withdrawableDividend);
      emit DividendWithdrawn(user, _withdrawableDividend);
      (bool success,) = user.call{value: _withdrawableDividend, gas: 3000}("");

      if(!success) {
        withdrawnDividends[user] = withdrawnDividends[user].sub(_withdrawableDividend);
        return 0;
      }

      return _withdrawableDividend;
    }

    return 0;
  }


  /// @notice View the amount of dividend in wei that an address can withdraw.
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` can withdraw.
  function dividendOf(address _owner) external view override returns(uint256) {
    return withdrawableDividendOf(_owner);
  }

  /// @notice View the amount of dividend in wei that an address can withdraw.
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` can withdraw.
  function withdrawableDividendOf(address _owner) public view override returns(uint256) {
    return accumulativeDividendOf(_owner).sub(withdrawnDividends[_owner]);
  }

  /// @notice View the amount of dividend in wei that an address has withdrawn.
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` has withdrawn.
  function withdrawnDividendOf(address _owner) external view override returns(uint256) {
    return withdrawnDividends[_owner];
  }


  /// @notice View the amount of dividend in wei that an address has earned in total.
  /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)
  /// = (magnifiedDividendPerShare * balanceOf(_owner) + magnifiedDividendCorrections[_owner]) / magnitude
  /// @param _owner The address of a token holder.
  /// @return The amount of dividend in wei that `_owner` has earned in total.
  function accumulativeDividendOf(address _owner) public view override returns(uint256) {
    return magnifiedDividendPerShare.mul(holderBalance[_owner]).toInt256Safe()
      .add(magnifiedDividendCorrections[_owner]).toUint256Safe() / magnitude;
  }

  /// @dev Internal function that increases tokens to an account.
  /// Update magnifiedDividendCorrections to keep dividends unchanged.
  /// @param account The account that will receive the created tokens.
  /// @param value The amount that will be created.
  function _increase(address account, uint256 value) internal {
    magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account]
      .sub( (magnifiedDividendPerShare.mul(value)).toInt256Safe() );
  }

  /// @dev Internal function that reduces an amount of the token of a given account.
  /// Update magnifiedDividendCorrections to keep dividends unchanged.
  /// @param account The account whose tokens will be burnt.
  /// @param value The amount that will be burnt.
  function _reduce(address account, uint256 value) internal {
    magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account]
      .add( (magnifiedDividendPerShare.mul(value)).toInt256Safe() );
  }

  function _setBalance(address account, uint256 newBalance) internal {
    uint256 currentBalance = holderBalance[account];
    holderBalance[account] = newBalance;
    if(newBalance > currentBalance) {
      uint256 increaseAmount = newBalance.sub(currentBalance);
      _increase(account, increaseAmount);
      totalBalance += increaseAmount;
    } else if(newBalance < currentBalance) {
      uint256 reduceAmount = currentBalance.sub(newBalance);
      _reduce(account, reduceAmount);
      totalBalance -= reduceAmount;
    }
  }
}

contract DividendTracker is DividendPayingToken {
    using SafeMath for uint256;
    using SafeMathInt for int256;

    struct Map {
        address[] keys;
        mapping(address => uint) values;
        mapping(address => uint) indexOf;
        mapping(address => bool) inserted;
    }

    function get(address key) private view returns (uint) {
        return tokenHoldersMap.values[key];
    }

    function getIndexOfKey(address key) private view returns (int) {
        if(!tokenHoldersMap.inserted[key]) {
            return -1;
        }
        return int(tokenHoldersMap.indexOf[key]);
    }

    function getKeyAtIndex(uint index) private view returns (address) {
        return tokenHoldersMap.keys[index];
    }



    function size() private view returns (uint) {
        return tokenHoldersMap.keys.length;
    }

    function set(address key, uint val) private {
        if (tokenHoldersMap.inserted[key]) {
            tokenHoldersMap.values[key] = val;
        } else {
            tokenHoldersMap.inserted[key] = true;
            tokenHoldersMap.values[key] = val;
            tokenHoldersMap.indexOf[key] = tokenHoldersMap.keys.length;
            tokenHoldersMap.keys.push(key);
        }
    }

    function remove(address key) private {
        if (!tokenHoldersMap.inserted[key]) {
            return;
        }

        delete tokenHoldersMap.inserted[key];
        delete tokenHoldersMap.values[key];

        uint index = tokenHoldersMap.indexOf[key];
        uint lastIndex = tokenHoldersMap.keys.length - 1;
        address lastKey = tokenHoldersMap.keys[lastIndex];

        tokenHoldersMap.indexOf[lastKey] = index;
        delete tokenHoldersMap.indexOf[key];

        tokenHoldersMap.keys[index] = lastKey;
        tokenHoldersMap.keys.pop();
    }

    Map private tokenHoldersMap;
    uint256 public lastProcessedIndex;

    mapping (address => bool) public excludedFromDividends;

    mapping (address => uint256) public lastClaimTimes;

    uint256 public claimWait;
    uint256 public immutable minimumTokenBalanceForDividends;

    event ExcludeFromDividends(address indexed account);
    event IncludeInDividends(address indexed account);
    event ClaimWaitUpdated(uint256 indexed newValue, uint256 indexed oldValue);

    event Claim(address indexed account, uint256 amount, bool indexed automatic);

    constructor() {
    	claimWait = 1200;
        minimumTokenBalanceForDividends = 1000 * (10**18);
    }

    function excludeFromDividends(address account) external onlyOwner {
    	excludedFromDividends[account] = true;

    	_setBalance(account, 0);
    	remove(account);

    	emit ExcludeFromDividends(account);
    }
    
    function includeInDividends(address account) external onlyOwner {
    	require(excludedFromDividends[account]);
    	excludedFromDividends[account] = false;

    	emit IncludeInDividends(account);
    }

    function updateClaimWait(uint256 newClaimWait) external onlyOwner {
        require(newClaimWait >= 1200 && newClaimWait <= 86400, "Dividend_Tracker: claimWait must be updated to between 1 and 24 hours");
        require(newClaimWait != claimWait, "Dividend_Tracker: Cannot update claimWait to same value");
        emit ClaimWaitUpdated(newClaimWait, claimWait);
        claimWait = newClaimWait;
    }

    function getLastProcessedIndex() external view returns(uint256) {
    	return lastProcessedIndex;
    }

    function getNumberOfTokenHolders() external view returns(uint256) {
        return tokenHoldersMap.keys.length;
    }

    // Check to see if I really made this contract or if it is a clone!
    // @Sir_Tris on TG, @SirTrisCrypto on Twitter

    function getAccount(address _account)
        public view returns (
            address account,
            int256 index,
            int256 iterationsUntilProcessed,
            uint256 withdrawableDividends,
            uint256 totalDividends,
            uint256 lastClaimTime,
            uint256 nextClaimTime,
            uint256 secondsUntilAutoClaimAvailable) {
        account = _account;

        index = getIndexOfKey(account);

        iterationsUntilProcessed = -1;

        if(index >= 0) {
            if(uint256(index) > lastProcessedIndex) {
                iterationsUntilProcessed = index.sub(int256(lastProcessedIndex));
            }
            else {
                uint256 processesUntilEndOfArray = tokenHoldersMap.keys.length > lastProcessedIndex ?
                                                        tokenHoldersMap.keys.length.sub(lastProcessedIndex) :
                                                        0;


                iterationsUntilProcessed = index.add(int256(processesUntilEndOfArray));
            }
        }


        withdrawableDividends = withdrawableDividendOf(account);
        totalDividends = accumulativeDividendOf(account);

        lastClaimTime = lastClaimTimes[account];

        nextClaimTime = lastClaimTime > 0 ?
                                    lastClaimTime.add(claimWait) :
                                    0;

        secondsUntilAutoClaimAvailable = nextClaimTime > block.timestamp ?
                                                    nextClaimTime.sub(block.timestamp) :
                                                    0;
    }

    function getAccountAtIndex(uint256 index)
        external view returns (
            address,
            int256,
            int256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256) {
    	if(index >= size()) {
            return (0x0000000000000000000000000000000000000000, -1, -1, 0, 0, 0, 0, 0);
        }

        address account = getKeyAtIndex(index);

        return getAccount(account);
    }

    function canAutoClaim(uint256 lastClaimTime) private view returns (bool) {
    	if(lastClaimTime > block.timestamp)  {
    		return false;
    	}

    	return block.timestamp.sub(lastClaimTime) >= claimWait;
    }

    function setBalance(address payable account, uint256 newBalance) external onlyOwner {
    	if(excludedFromDividends[account]) {
    		return;
    	}

    	if(newBalance >= minimumTokenBalanceForDividends) {
            _setBalance(account, newBalance);
    		set(account, newBalance);
    	}
    	else {
            _setBalance(account, 0);
    		remove(account);
    	}

    	processAccount(account, true);
    }
    
    function process(uint256 gas) external returns (uint256, uint256, uint256) {
    	uint256 numberOfTokenHolders = tokenHoldersMap.keys.length;

    	if(numberOfTokenHolders == 0) {
    		return (0, 0, lastProcessedIndex);
    	}

    	uint256 _lastProcessedIndex = lastProcessedIndex;

    	uint256 gasUsed = 0;

    	uint256 gasLeft = gasleft();

    	uint256 iterations = 0;
    	uint256 claims = 0;

    	while(gasUsed < gas && iterations < numberOfTokenHolders) {
    		_lastProcessedIndex++;

    		if(_lastProcessedIndex >= tokenHoldersMap.keys.length) {
    			_lastProcessedIndex = 0;
    		}

    		address account = tokenHoldersMap.keys[_lastProcessedIndex];

    		if(canAutoClaim(lastClaimTimes[account])) {
    			if(processAccount(payable(account), true)) {
    				claims++;
    			}
    		}

    		iterations++;

    		uint256 newGasLeft = gasleft();

    		if(gasLeft > newGasLeft) {
    			gasUsed = gasUsed.add(gasLeft.sub(newGasLeft));
    		}
    		gasLeft = newGasLeft;
    	}

    	lastProcessedIndex = _lastProcessedIndex;

    	return (iterations, claims, lastProcessedIndex);
    }

    function processAccount(address payable account, bool automatic) public onlyOwner returns (bool) {
        uint256 amount = _withdrawDividendOfUser(account);

    	if(amount > 0) {
    		lastClaimTimes[account] = block.timestamp;
            emit Claim(account, amount, automatic);
    		return true;
    	}

    	return false;
    }
}

contract Yashav3 is ERC20, Ownable {
    using SafeMath for uint256;

    IUniswapV2Router02 public immutable dexRouter;
    address public immutable lpPair;

    bool private swapping;

    DividendTracker public dividendTracker;

    address public operationsWallet;
    
    uint256 public maxTransactionAmount;
    uint256 public swapTokensAtAmount;
    uint256 public maxWallet;
    
    uint256 public liquidityActiveBlock = 0; // 0 means liquidity is not active yet
    uint256 public tradingActiveBlock = 0; // 0 means trading is not active
    uint256 public earlyBuyPenaltyEnd; // determines when snipers/bots can sell without extra penalty
    
    bool public limitsInEffect = true;
    bool public tradingActive = false;
    bool public swapEnabled = false;
    
     // Anti-bot and anti-whale mappings and variables
    mapping(address => uint256) private _holderLastTransferTimestamp; // to hold last Transfers temporarily during launch
    bool public transferDelayEnabled = true;
    
    uint256 public constant feeDivisor = 1000;

    uint256 public totalSellFees;
    uint256 public rewardsSellFee;
    uint256 public operationsSellFee;
    uint256 public liquiditySellFee;
    
    uint256 public totalBuyFees;
    uint256 public rewardsBuyFee;
    uint256 public operationsBuyFee;
    uint256 public liquidityBuyFee;
    
    uint256 public tokensForRewards;
    uint256 public tokensForOperations;
    uint256 public tokensForLiquidity;
    
    uint256 public gasForProcessing = 0;

    uint256 public lpWithdrawRequestTimestamp;
    uint256 public lpWithdrawRequestDuration = 3 days;
    bool public lpWithdrawRequestPending;
    uint256 public lpPercToWithDraw;

    uint256 public percentForLPBurn = 100; // 100 = 1%
    bool public lpBurnEnabled = true;
    uint256 public lpBurnFrequency = 3600 seconds;
    uint256 public lastLpBurnTime;
    
    uint256 public manualBurnFrequency = 60 seconds;
    uint256 public lastManualLpBurnTime;

    /******************/

    // exlcude from fees and max transaction amount
    mapping (address => bool) private _isExcludedFromFees;

    mapping (address => bool) public _isExcludedMaxTransactionAmount;

    // store addresses that a automatic market maker pairs. Any transfer *to* these addresses
    // could be subject to a maximum transfer amount
    mapping (address => bool) public automatedMarketMakerPairs;

    event ExcludeFromFees(address indexed account, bool isExcluded);
    event ExcludeMultipleAccountsFromFees(address[] accounts, bool isExcluded);
    event ExcludedMaxTransactionAmount(address indexed account, bool isExcluded);

    event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);

    event OperationsWalletUpdated(address indexed newWallet, address indexed oldWallet);

    event DevWalletUpdated(address indexed newWallet, address indexed oldWallet);

    event GasForProcessingUpdated(uint256 indexed newValue, uint256 indexed oldValue);
    
    event SwapAndLiquify(
        uint256 tokensSwapped,
        uint256 ethReceived,
        uint256 tokensIntoLiqudity
    );

    event SendDividends(
    	uint256 tokensSwapped,
    	uint256 amount
    );

    event ProcessedDividendTracker(
    	uint256 iterations,
    	uint256 claims,
        uint256 lastProcessedIndex,
    	bool indexed automatic,
    	uint256 gas,
    	address indexed processor
    );

    event AutoNukeLP(uint256 amount);
    
    event ManualNukeLP(uint256 amount);

    event RequestedLPWithdraw();
    
    event WithdrewLPForMigration();

    event CanceledLpWithdrawRequest();

    constructor() ERC20("YASHA", "YASHA") {

        uint256 totalSupply = 100 * 1e9 * 1e18;
        
        maxTransactionAmount = totalSupply * 5 / 1000; // 0.5% maxTransactionAmountTxn
        swapTokensAtAmount = totalSupply * 5 / 10000; // 0.05% swap tokens amount
        maxWallet = totalSupply * 1 / 100; // 1% Max wallet

        rewardsBuyFee = 50;
        operationsBuyFee = 20;
        liquidityBuyFee = 20;
        totalBuyFees = rewardsBuyFee + operationsBuyFee + liquidityBuyFee;
        
        rewardsSellFee = 50;
        operationsSellFee = 20;
        liquiditySellFee = 20;
        totalSellFees = rewardsSellFee + operationsSellFee + liquiditySellFee;

    	dividendTracker = new DividendTracker();
    	
    	operationsWallet = address(msg.sender); // set as operations wallet

    	IUniswapV2Router02 _dexRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
    	
         // Create a uniswap pair for this new token
        address _lpPair = IUniswapV2Factory(_dexRouter.factory())
            .createPair(address(this), _dexRouter.WETH());

        dexRouter = _dexRouter;
        lpPair = _lpPair;

        _setAutomatedMarketMakerPair(_lpPair, true);

        // exclude from receiving dividends
        dividendTracker.excludeFromDividends(address(dividendTracker));
        dividendTracker.excludeFromDividends(address(this));
        dividendTracker.excludeFromDividends(owner());
        dividendTracker.excludeFromDividends(address(_dexRouter));
        dividendTracker.excludeFromDividends(address(0xdead));
        
        // exclude from paying fees or having max transaction amount
        excludeFromFees(owner(), true);
        excludeFromFees(address(this), true);
        excludeFromFees(address(0xdead), true);
        excludeFromMaxTransaction(owner(), true);
        excludeFromMaxTransaction(address(this), true);
        excludeFromMaxTransaction(address(dividendTracker), true);
        excludeFromMaxTransaction(address(_dexRouter), true);
        excludeFromMaxTransaction(address(0xdead), true);

        _createInitialSupply(address(owner()), totalSupply);
    }

    receive() external payable {

  	}

    // only use if conducting a presale
    function addPresaleAddressForExclusions(address _presaleAddress) external onlyOwner {
        excludeFromFees(_presaleAddress, true);
        dividendTracker.excludeFromDividends(_presaleAddress);
        excludeFromMaxTransaction(_presaleAddress, true);
    }

     // disable Transfer delay - cannot be reenabled
    function disableTransferDelay() external onlyOwner returns (bool){
        transferDelayEnabled = false;
        return true;
    }

    // excludes wallets and contracts from dividends (such as CEX hotwallets, etc.)
    function excludeFromDividends(address account) external onlyOwner {
        dividendTracker.excludeFromDividends(account);
    }

    // removes exclusion on wallets and contracts from dividends (such as CEX hotwallets, etc.)
    function includeInDividends(address account) external onlyOwner {
        dividendTracker.includeInDividends(account);
    }
    
    // once enabled, can never be turned off
    function enableTrading() external onlyOwner {
        require(!tradingActive, "Cannot re-enable trading");
        tradingActive = true;
        swapEnabled = true;
        tradingActiveBlock = block.number;
    }
    
    // only use to disable contract sales if absolutely necessary (emergency use only)
    function updateSwapEnabled(bool enabled) external onlyOwner(){
        swapEnabled = enabled;
    }

    function updateMaxAmount(uint256 newNum) external onlyOwner {
        require(newNum > (totalSupply() * 1 / 1000)/1e18, "Cannot set maxTransactionAmount lower than 0.1%");
        maxTransactionAmount = newNum * (10**18);
    }
    
    function updateMaxWalletAmount(uint256 newNum) external onlyOwner {
        require(newNum > (totalSupply() * 1 / 100)/1e18, "Cannot set maxWallet lower than 1%");
        maxWallet = newNum * (10**18);
    }
    
    function updateBuyFees(uint256 _operationsFee, uint256 _rewardsFee, uint256 _liquidityFee) external onlyOwner {
        operationsBuyFee = _operationsFee;
        rewardsBuyFee = _rewardsFee;
        liquidityBuyFee = _liquidityFee;
        totalBuyFees = operationsBuyFee + rewardsBuyFee + liquidityBuyFee;
        require(totalBuyFees <= 300, "Must keep fees at 30% or less");
    }
    
    function updateSellFees(uint256 _operationsFee, uint256 _rewardsFee, uint256 _liquidityFee) external onlyOwner {
        operationsSellFee = _operationsFee;
        rewardsSellFee = _rewardsFee;
        liquiditySellFee = _liquidityFee;
        totalSellFees = operationsSellFee + rewardsSellFee + liquiditySellFee;
        require(totalSellFees <= 300, "Must keep fees at 30% or less");
    }

    function excludeFromMaxTransaction(address updAds, bool isEx) public onlyOwner {
        _isExcludedMaxTransactionAmount[updAds] = isEx;
        emit ExcludedMaxTransactionAmount(updAds, isEx);
    }

    function excludeFromFees(address account, bool excluded) public onlyOwner {
        _isExcludedFromFees[account] = excluded;

        emit ExcludeFromFees(account, excluded);
    }

    function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) external onlyOwner {
        for(uint256 i = 0; i < accounts.length; i++) {
            _isExcludedFromFees[accounts[i]] = excluded;
        }

        emit ExcludeMultipleAccountsFromFees(accounts, excluded);
    }

    function setAutomatedMarketMakerPair(address pair, bool value) external onlyOwner {
        require(pair != lpPair, "The PancakeSwap pair cannot be removed from automatedMarketMakerPairs");

        _setAutomatedMarketMakerPair(pair, value);
    }

    function _setAutomatedMarketMakerPair(address pair, bool value) private {
        automatedMarketMakerPairs[pair] = value;

        excludeFromMaxTransaction(pair, value);
        
        if(value) {
            dividendTracker.excludeFromDividends(pair);
        }

        emit SetAutomatedMarketMakerPair(pair, value);
    }

    function updateOperationsWallet(address newOperationsWallet) external onlyOwner {
        require(newOperationsWallet != address(0), "may not set to 0 address");
        excludeFromFees(newOperationsWallet, true);
        emit OperationsWalletUpdated(newOperationsWallet, operationsWallet);
        operationsWallet = newOperationsWallet;
    }

    function updateGasForProcessing(uint256 newValue) external onlyOwner {
        require(newValue >= 200000 && newValue <= 500000, " gasForProcessing must be between 200,000 and 500,000");
        require(newValue != gasForProcessing, "Cannot update gasForProcessing to same value");
        emit GasForProcessingUpdated(newValue, gasForProc...

// [truncated — 64030 bytes total]

Read Contract

_isExcludedMaxTransactionAmount 0x10d5de53 → bool
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
dexRouter 0x0758d924 → address
dividendTokenBalanceOf 0x6843cd84 → uint256
dividendTracker 0x2c1f5216 → address
earlyBuyPenaltyEnd 0x1fc851bd → uint256
feeDivisor 0x9a36f932 → uint256
gasForProcessing 0x9c1b8af5 → uint256
getAccountDividendsInfo 0xad56c13c → address, int256, int256, uint256, uint256, uint256, uint256, uint256
getAccountDividendsInfoAtIndex 0xf27fd254 → address, int256, int256, uint256, uint256, uint256, uint256, uint256
getClaimWait 0xa26579ad → uint256
getLastProcessedIndex 0xe7841ec0 → uint256
getNumberOfDividendTokenHolders 0x64b0f653 → uint256
getNumberOfDividends 0x71778e7d → uint256
getTotalDividendsDistributed 0x30bb4cff → uint256
isExcludedFromFees 0x4fbee193 → bool
lastLpBurnTime 0xa4c82a00 → uint256
lastManualLpBurnTime 0x9ec22c0e → uint256
limitsInEffect 0x4a62bb65 → bool
liquidityActiveBlock 0x0f4432e3 → uint256
liquidityBuyFee 0xccb61358 → uint256
liquiditySellFee 0x099d0d30 → uint256
lpBurnEnabled 0x2e82f1a0 → bool
lpBurnFrequency 0x2c3e486c → uint256
lpPair 0x452ed4f1 → address
lpPercToWithDraw 0x783102eb → uint256
lpWithdrawRequestDuration 0xee44b44e → uint256
lpWithdrawRequestPending 0xfd361d0e → bool
lpWithdrawRequestTimestamp 0x058054c9 → uint256
manualBurnFrequency 0x184c16c5 → uint256
maxTransactionAmount 0xc8c8ebe4 → uint256
maxWallet 0xf8b45b05 → uint256
name 0x06fdde03 → string
nextAvailableLpWithdrawDate 0x712c2985 → uint256
operationsBuyFee 0xefcc1b2f → uint256
operationsSellFee 0x7506cbd8 → uint256
operationsWallet 0xfd72e22a → address
owner 0x8da5cb5b → address
percentForLPBurn 0x199ffc72 → uint256
rewardsBuyFee 0x4af6f7ee → uint256
rewardsSellFee 0xccd146b2 → uint256
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
tokensForLiquidity 0x1a8145bb → uint256
tokensForOperations 0xfb002c97 → uint256
tokensForRewards 0xf54afa78 → uint256
totalBuyFees 0xb9e93700 → uint256
totalSellFees 0xd0a39814 → uint256
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
tradingActiveBlock 0xee40166e → uint256
transferDelayEnabled 0xc876d0b9 → bool
withdrawableDividendOf 0xa8b9d240 → uint256

Write Contract 33 functions

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

addPresaleAddressForExclusions 0xa716b773
address _presaleAddress
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
cancelLPWithdrawRequest 0xc7c61e2c
No parameters
claim 0x4e71d92d
No parameters
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
disableTransferDelay 0xe884f260
No parameters
returns: bool
enableTrading 0x8a8c523c
No parameters
excludeFromDividends 0x31e79db0
address account
excludeFromFees 0xc0246668
address account
bool excluded
excludeFromMaxTransaction 0x7571336a
address updAds
bool isEx
excludeMultipleAccountsFromFees 0xc492f046
address[] accounts
bool excluded
includeInDividends 0xc0f306ef
address account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
manualBurnLiquidityPairTokens 0xfe72b27a
uint256 percent
processDividendTracker 0x700bb191
uint256 gas
removeLimits 0x751039fc
No parameters
returns: bool
renounceOwnership 0x715018a6
No parameters
requestToWithdrawLP 0xbefd2fac
uint256 percToWithdraw
setAutoLPBurnSettings 0x730c1888
uint256 _frequencyInSeconds
uint256 _percent
bool _Enabled
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateBuyFees 0x8095d564
uint256 _operationsFee
uint256 _rewardsFee
uint256 _liquidityFee
updateClaimWait 0xe98030c7
uint256 claimWait
updateGasForProcessing 0x871c128d
uint256 newValue
updateMaxAmount 0x106b5da1
uint256 newNum
updateMaxWalletAmount 0xc18bc195
uint256 newNum
updateOperationsWallet 0x30d5d18d
address newOperationsWallet
updateSellFees 0xc17b5b8c
uint256 _operationsFee
uint256 _rewardsFee
uint256 _liquidityFee
updateSwapEnabled 0x924de9b7
bool enabled
withdrawRequestedLP 0x763cef49
No parameters
withdrawStuckEth 0x7fa787ba
No parameters

Recent Transactions

No transactions found for this address