Address Contract Partially Verified
Address
0x7a63846D7c1F2718Cd548Df853746Ca2e81B61d2
Balance
0 ETH
Nonce
1
Code Size
17505 bytes
Creator
0x69F33e02...3891 at tx 0xb18de839...46ab24
Indexed Transactions
0
Contract Bytecode
17505 bytes
0x608060405234801561001057600080fd5b50600436106104495760003560e01c80636713cea211610241578063c1d25f831161013b578063d3b7adc9116100c3578063efef39a111610087578063efef39a114610a7e578063f2fde38b14610a8c578063f51f96dd14610a9f578063f67c008e14610aa8578063ff273b6614610abb57600080fd5b8063d3b7adc914610a1f578063d6ca214d14610a3f578063d98b1f9d14610a4f578063da943cee14610a58578063e86613a714610a6b57600080fd5b8063cc89629b1161010a578063cc89629b14610997578063cddfb5fd146109aa578063d03df6dd146109bd578063d1a12d6a146109d7578063d390bcc7146109e057600080fd5b8063c1d25f831461094b578063c32d55641461095e578063c9a2ff4314610971578063ca1d209d1461098457600080fd5b80638aae995a116101c9578063a54bd56d1161018d578063a54bd56d14610900578063a590c84e14610913578063a89e852214610926578063aacc557a1461092f578063bae235bc1461094257600080fd5b80638aae995a146108ac5780638da5cb5b146108b5578063928e5f8b146108c6578063961be391146108d8578063a47ff99b146108e057600080fd5b806376ebbbc21161021057806376ebbbc21461084457806378e97925146108585780637dd209461461087f57806384b587d11461088c57806389910cac1461089957600080fd5b80636713cea2146107e4578063715018a6146107ed57806374f54826146107f557806376078dbe1461083157600080fd5b80633197cbb61161035257806348faade4116102da5780635559638f1161029e5780635559638f146107445780635b2ee404146107645780635dbb4dbd146107845780635e2c19db146107ae578063642d0f70146107d157600080fd5b806348faade4146106ed578063497aef28146106f65780634ae0f5431461071557806352811c4b1461071e578063547a5eee1461073157600080fd5b80633efa1b68116103215780633efa1b681461069b578063402914f5146106a8578063440bc7f3146106c857806345cb3dde146106db5780634797a548146106e457600080fd5b80633197cbb6146106445780633763326a1461066b5780633ccfd60b1461067e5780633d9205c11461068657600080fd5b80631d6a4581116103d55780632316448c116103a45780632316448c146105d1578063252b99c5146105e457806326c65482146105f75780632feb25f61461060a5780633013ce291461061d57600080fd5b80631d6a4581146105775780631e937107146105805780631fa3f435146105935780632270e82d146105be57600080fd5b80630acc8cd11161041c5780630acc8cd1146104d057806310002d2a146104e35780631101eaaf1461051c5780631637cde0146105415780631649a8a91461055457600080fd5b806301fc191c1461044e578063022a8b1a146104635780630288a39c14610476578063041ae880146104a5575b600080fd5b61046161045c366004613b2e565b610ace565b005b610461610471366004613b79565b610b72565b60185461048c90600160a01b900462ffffff1681565b60405162ffffff90911681526020015b60405180910390f35b6017546104b8906001600160a01b031681565b6040516001600160a01b03909116815260200161049c565b6104616104de366004613be0565b610d65565b61050e6104f1366004613c9d565b8051602081830181018051600f8252928201919093012091525481565b60405190815260200161049c565b60125461052c9063ffffffff1681565b60405163ffffffff909116815260200161049c565b61046161054f366004613cd1565b610dfa565b610567610562366004613d12565b610e79565b604051901515815260200161049c565b61050e60045481565b61046161058e366004613b79565b610f01565b61050e6105a1366004613c9d565b805160208183018101805160108252928201919093012091525481565b6104616105cc366004613d59565b611136565b6104616105df366004613d76565b61115d565b6104616105f2366004613dc8565b61127d565b610461610605366004613be0565b6112b8565b61050e610618366004613de1565b611420565b6104b87f00000000000000000000000026827f7f51769ea21f94ba98ba64f5d0dc8988f981565b61050e7f0000000000000000000000000000000000000000000000000000000067fe585081565b610461610679366004613d59565b611489565b6104616114ea565b61068e611616565b60405161049c9190613e0b565b6007546105679060ff1681565b61050e6106b6366004613be0565b601f6020526000908152604090205481565b6104616106d6366004613dc8565b611685565b61050e60135481565b61050e60055481565b61050e601c5481565b61050e610704366004613be0565b602080526000908152604090205481565b61050e60225481565b61046161072c366004613dc8565b611707565b61046161073f366004613be0565b6118d7565b61050e610752366004613be0565b60086020526000908152604090205481565b61050e610772366004613be0565b60146020526000908152604090205481565b610797610792366004613dc8565b611936565b6040805192835260ff90911660208301520161049c565b6105676107bc366004613be0565b60196020526000908152604090205460ff1681565b61050e6107df366004613e5d565b611967565b61050e60065481565b610461611b26565b61050e610803366004613e92565b600a602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b61056761083f366004613edf565b611b79565b60125461056790600160201b900460ff1681565b61050e7f0000000000000000000000000000000000000000000000000000000067fd06d081565b601b546105679060ff1681565b6021546105679060ff1681565b6104616108a7366004613f19565b611c07565b61050e601a5481565b6000546001600160a01b03166104b8565b60215461056790610100900460ff1681565b610461611c60565b6108f36108ee366004613de1565b611f95565b60405161049c9190613fdc565b61046161090e366004613fef565b61204e565b610461610921366004613be0565b6121a5565b61050e60035481565b61046161093d36600461409d565b6121f7565b61050e60115481565b610461610959366004613d59565b612281565b61046161096c366004613dc8565b6122c6565b61050e61097f366004613be0565b612359565b610461610992366004613dc8565b61238c565b6018546104b8906001600160a01b031681565b6104616109b8366004613dc8565b6124a7565b601d546104b890600160201b90046001600160a01b031681565b61050e601e5481565b6105676109ee366004613e92565b600c602090815260009283526040909220815180830184018051928152908401929093019190912091525460ff1681565b61050e610a2d366004613be0565b60096020526000908152604090205481565b601d5461052c9063ffffffff1681565b61050e60155481565b610461610a66366004613dc8565b6124f7565b6108f3610a79366004613dc8565b61260c565b61046161045c366004613dc8565b610461610a9a366004613be0565b612637565b61050e60025481565b610461610ab6366004613d59565b6126ad565b610567610ac9366004613dc8565b612707565b60405162461bcd60e51b815260206004820152606260248201527f5573652077686974656c697374656450757263686173652875696e743235362060448201527f7061796d656e74416d6f756e742c20627974657333325b5d2063616c6c64617460648201527f61206d65726b6c6550726f6f662c2075696e7432353620616c6c6f636174696f6084820152616e2960f01b60a482015260c4015b60405180910390fd5b60026001541415610b955760405162461bcd60e51b8152600401610b69906140c2565b6002600155601854610bd390600160a01b900462ffffff167f0000000000000000000000000000000000000000000000000000000067fe585061410f565b4211610bf15760405162461bcd60e51b8152600401610b6990614127565b6021543390600161010090910460ff16151514610c475760405162461bcd60e51b8152602060048201526014602482015273757365207769746864726177476976656177617960601b6044820152606401610b69565b60025415610c885760405162461bcd60e51b815260206004820152600e60248201526d6e6f74206120676976656177617960901b6044820152606401610b69565b610c9481858585611b79565b610cb05760405162461bcd60e51b8152600401610b699061416d565b6001600160a01b03811660009081526019602052604090205460ff16610cf7576001600160a01b0381166000908152601f6020908152604080832085905590805290208290555b6000610d0282612359565b905080610d515760405162461bcd60e51b815260206004820152601a60248201527f776974686472617720676976656177617920616d6f756e7420300000000000006044820152606401610b69565b610d5a81612728565b505060018055505050565b610d6d612763565b6001600160a01b038116610db05760405162461bcd60e51b815260206004820152600a602482015269183c1810333ab73232b960b11b6044820152606401610b69565b601780546001600160a01b0319166001600160a01b0383169081179091556040517f73e0366d7ceb5a21fb27f8b2aa2720e2a9dee755bd85bfb5dbccf2830753b02290600090a250565b60405162461bcd60e51b815260206004820152604860248201527f557365207769746864726177476976656177617928627974657333325b5d206360448201527f616c6c64617461206d65726b6c6550726f6f662c2075696e7432353620616c6c6064820152676f636174696f6e2960c01b608482015260a401610b69565b6040516bffffffffffffffffffffffff19606085901b1660208201526000908190603401604051602081830303815290604052805190602001209050610ef684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601e5491508490506127bf565b9150505b9392505050565b60026001541415610f245760405162461bcd60e51b8152600401610b69906140c2565b6002600155601854610f6290600160a01b900462ffffff167f0000000000000000000000000000000000000000000000000000000067fe585061410f565b4211610f805760405162461bcd60e51b8152600401610b6990614127565b6021543390610100900460ff1615610fda5760405162461bcd60e51b815260206004820152601a60248201527f75736520776974686472617747697665617761795665737465640000000000006044820152606401610b69565b6002541561101b5760405162461bcd60e51b815260206004820152600e60248201526d6e6f74206120676976656177617960901b6044820152606401610b69565b6001600160a01b03811660009081526019602052604090205460ff16156110785760405162461bcd60e51b815260206004820152601160248201527030b63932b0b23c903bb4ba34323930bbb760791b6044820152606401610b69565b61108481858585611b79565b6110a05760405162461bcd60e51b8152600401610b699061416d565b6001600160a01b03811660009081526019602052604081205460ff166110e957506001600160a01b0381166000908152601f602090815260408083208590559080529020829055815b80610d515760405162461bcd60e51b815260206004820152601a60248201527f776974686472617720676976656177617920616d6f756e7420300000000000006044820152606401610b69565b61113e612763565b60128054911515600160201b0264ff0000000019909216919091179055565b427f0000000000000000000000000000000000000000000000000000000067fd06d011156111c25760405162461bcd60e51b815260206004820152601260248201527139b0b632903430b9903737ba103132b3bab760711b6044820152606401610b69565b7f0000000000000000000000000000000000000000000000000000000067fe585042111561121e5760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b6044820152606401610b69565b602254821561125c5761123333858585611b79565b61124f5760405162461bcd60e51b8152600401610b699061416d565b60225482111561125c5750805b6000611269335b83611420565b905061127586826127d5565b505050505050565b611285612763565b600581905560405181907f4d893dbff365afe590ba8bf0f5d258598f5e63fde5b989dcd4902cf89d403c2f90600090a250565b6112c0612763565b6018546112f990600160a01b900462ffffff167f0000000000000000000000000000000000000000000000000000000067fe585061410f565b42116113175760405162461bcd60e51b8152600401610b6990614127565b7f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b0316816001600160a01b0316141561135657600080fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b15801561139857600080fd5b505afa1580156113ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d09190614194565b90506113e66001600160a01b03831633836128bd565b60405181815233907fb1d34d1c064a5cb36c65797ef779e448eefccf2b978edbcfd206cc687c8cea5a906020015b60405180910390a25050565b600080670de0b6b3a76400006001600160401b03168360025461144391906141ad565b61144d91906141e2565b905080600354101561145e57506003545b6001600160a01b03841660009081526008602052604090205461148190826141f6565b949350505050565b611491612763565b7f0000000000000000000000000000000000000000000000000000000067fd06d042106114d05760405162461bcd60e51b8152600401610b699061420d565b602180549115156101000261ff0019909216919091179055565b60185461152390600160a01b900462ffffff167f0000000000000000000000000000000000000000000000000000000067fe585061410f565b42116115415760405162461bcd60e51b8152600401610b6990614127565b600260015414156115645760405162461bcd60e51b8152600401610b69906140c2565b60026001819055546115af5760405162461bcd60e51b8152602060048201526014602482015273757365207769746864726177476976656177617960601b6044820152606401610b69565b3360006115bb82612359565b9050806116055760405162461bcd60e51b81526020600482015260186024820152773737903a37b5b2b7103a37903132903bb4ba34323930bbb760411b6044820152606401610b69565b61160e81612728565b505060018055565b60606016805480602002602001604051908101604052809291908181526020016000905b8282101561167c57600084815260209081902060408051808201909152600285029091018054825260019081015460ff1682840152908352909201910161163a565b50505050905090565b601d54600160201b90046001600160a01b0316336001600160a01b031614806116b857506000546001600160a01b031633145b6116d45760405162461bcd60e51b8152600401610b699061423b565b601e81905560405181907fc504a95022b9d01b3024e95b0a85c200d0c538f417160776512b95fcbf7b2daa90600090a250565b6018546001600160a01b0316336001600160a01b0316148061173357506000546001600160a01b031633145b61177f5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206e6f7420636173686572206f72206f776e65720000000000006044820152606401610b69565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000026827f7f51769ea21f94ba98ba64f5d0dc8988f96001600160a01b0316906370a082319060240160206040518083038186803b1580156117e157600080fd5b505afa1580156117f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118199190614194565b90508181101561186b5760405162461bcd60e51b815260206004820181905260248201527f4e6f20656e6f756768207061796d656e7420746f6b656e7320746f20636173686044820152606401610b69565b61189f7f00000000000000000000000026827f7f51769ea21f94ba98ba64f5d0dc8988f96001600160a01b031633846128bd565b604080518381526000602082015233917f83205c70ca31ffcb57664adecfd9894647d48665aefae1fb38bbc7ca4c1b86fb9101611414565b6118df612763565b601d8054640100000000600160c01b031916600160201b6001600160a01b038416908102919091179091556040517f7aba5fc71e3607d34203924738fbacc00b5782879615f86db108794b4bdcc95b90600090a250565b6016818154811061194657600080fd5b60009182526020909120600290910201805460019091015490915060ff1682565b60004260155411156119ce5760135460155461198391906141f6565b6001600160a01b0383166000908152601460205260409020546013546119a99190612925565b6119b390426141f6565b6119bd90866141ad565b6119c791906141e2565b9050610efa565b6016548015801590611a0d57504260166119e96001846141f6565b815481106119f9576119f961427f565b906000526020600020906002020160000154115b15611b1d576000805b828160ff161015611ae7574260168260ff1681548110611a3857611a3861427f565b9060005260206000209060020201600001541115611a5557611ae7565b60168160ff1681548110611a6b57611a6b61427f565b600091825260208083206002909202909101546001600160a01b038816835260149091526040909120541015611ad55760168160ff1681548110611ab157611ab161427f565b6000918252602090912060016002909202010154611ad29060ff1683614295565b91505b80611adf816142ba565b915050611a16565b5060ff8116611afb57600092505050610efa565b6064611b0a60ff8316886141ad565b611b1491906141e2565b92505050610efa565b50919392505050565b60405162461bcd60e51b815260206004820152602260248201527f6f776e6572736869702072656e756e63696174696f6e2069732064697361626c604482015261195960f21b6064820152608401610b69565b6040516bffffffffffffffffffffffff19606086901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050611bfd85858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601e5491508490506127bf565b9695505050505050565b611c0f612763565b7f0000000000000000000000000000000000000000000000000000000067fd06d04210611c4e5760405162461bcd60e51b8152600401610b699061420d565b611c5a8484848461293c565b50505050565b6018546001600160a01b0316336001600160a01b03161480611c8c57506000546001600160a01b031633145b611cd85760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206e6f7420636173686572206f72206f776e65720000000000006044820152606401610b69565b601854611d1190600160a01b900462ffffff167f0000000000000000000000000000000000000000000000000000000067fe585061410f565b4211611d2f5760405162461bcd60e51b8152600401610b6990614127565b601b5460ff1615611d735760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e4818d85cda195960921b6044820152606401610b69565b601b805460ff191660011790556040516370a0823160e01b81523060048201526000906001600160a01b037f00000000000000000000000026827f7f51769ea21f94ba98ba64f5d0dc8988f916906370a082319060240160206040518083038186803b158015611de257600080fd5b505afa158015611df6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1a9190614194565b9050611e507f00000000000000000000000026827f7f51769ea21f94ba98ba64f5d0dc8988f96001600160a01b031633836128bd565b6040516370a0823160e01b81523060048201526000907f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b0316906370a082319060240160206040518083038186803b158015611eb257600080fd5b505afa158015611ec6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eea9190614194565b90506000611ef6612d23565b9050600082601a5410611f0b57601a54611f0d565b825b90506000611f1b83836141f6565b9050611f53335b6001600160a01b037f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba01690836128bd565b604080518681526020810183905233917f83205c70ca31ffcb57664adecfd9894647d48665aefae1fb38bbc7ca4c1b86fb910160405180910390a25050505050565b600b6020528160005260406000208181548110611fb157600080fd5b90600052602060002001600091509150508054611fcd906142da565b80601f0160208091040260200160405190810160405280929190818152602001828054611ff9906142da565b80156120465780601f1061201b57610100808354040283529160200191612046565b820191906000526020600020905b81548152906001019060200180831161202957829003601f168201915b505050505081565b427f0000000000000000000000000000000000000000000000000000000067fd06d011156120b35760405162461bcd60e51b815260206004820152601260248201527139b0b632903430b9903737ba103132b3bab760711b6044820152606401610b69565b7f0000000000000000000000000000000000000000000000000000000067fe585042111561210f5760405162461bcd60e51b815260206004820152600960248201526839b0b6329037bb32b960b91b6044820152606401610b69565b602254841561214d5761212433878787611b79565b6121405760405162461bcd60e51b8152600401610b699061416d565b60225484111561214d5750825b600061215833611263565b905061219b888286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d5e92505050565b5050505050505050565b6121ad612763565b601880546001600160a01b0319166001600160a01b0383169081179091556040517fde112653552cba8a4f696cac12b4478ce2b9b8c0e04429455a2052ec7c0412ce90600090a250565b6121ff612763565b7f0000000000000000000000000000000000000000000000000000000067fd06d0421061223e5760405162461bcd60e51b8152600401610b699061420d565b61227561227062ffffff83167f0000000000000000000000000000000000000000000000000000000067fe585061410f565b601355565b61227e816130f4565b50565b612289612763565b6007805460ff19168215159081179091556040517fae0c36aff5cb672be07be42475485a2ac49daf228c55f2e749ff5075778a701890600090a250565b601d54600160201b90046001600160a01b0316336001600160a01b031614806122f957506000546001600160a01b031633145b6123155760405162461bcd60e51b8152600401610b699061423b565b7f0000000000000000000000000000000000000000000000000000000067fd06d042106123545760405162461bcd60e51b8152600401610b699061420d565b602255565b6001600160a01b03811660009081526020808052604080832054601f909252822054612386919084611967565b92915050565b6017546001600160a01b0316336001600160a01b0316146123e35760405162461bcd60e51b815260206004820152601160248201527031b0b63632b9103737ba10333ab73232b960791b6044820152606401610b69565b7f0000000000000000000000000000000000000000000000000000000067fd06d042106124225760405162461bcd60e51b8152600401610b699061420d565b6124577f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b03163330846131f0565b80601a6000828254612469919061410f565b909155505060405181815233907fda8220a878ff7a89474ccffdaa31ea1ed1ffbb0207d5051afccc4fbaf81f9bcd906020015b60405180910390a250565b6124af612763565b7f0000000000000000000000000000000000000000000000000000000067fd06d042106124ee5760405162461bcd60e51b8152600401610b699061420d565b61227e81613228565b601d54600160201b90046001600160a01b0316336001600160a01b0316148061252a57506000546001600160a01b031633145b6125465760405162461bcd60e51b8152600401610b699061423b565b60025461255390826141ad565b600681905560045411156125de5760405162461bcd60e51b815260206004820152604660248201527f4d6178207075726368617361626c652073686f756c64206e6f74206265206c6f60448201527f776572207468616e2074686520616d6f756e74206f6620746f6b656e2070757260648201526518da185cd95960d21b608482015260a401610b69565b60405181907f851466103668359b383470efccd1760dc8caf09bc6d5a74acc7d78ac751c21e990600090a250565b600d818154811061261c57600080fd5b906000526020600020016000915090508054611fcd906142da565b61263f612763565b6001600160a01b0381166126a45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b69565b61227e81613372565b6126b5612763565b7f0000000000000000000000000000000000000000000000000000000067fd06d042106126f45760405162461bcd60e51b8152600401610b699061420d565b6021805460ff1916911515919091179055565b6000600254826127179190614315565b158015612386575050600254111590565b336000908152601460209081526040808320429055601f909152812080548392906127549084906141f6565b9091555061227e9050816133c2565b6000546001600160a01b031633146127bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b69565b565b6000826127cc85846134cc565b14949350505050565b60215460ff1615612848576127e982612707565b6128485760405162461bcd60e51b815260206004820152602a60248201527f63616e206f6e6c792062757920696e746567657220616d6f756e74206f662073604482015269616c6520746f6b656e7360b01b6064820152608401610b69565b81601c600082825461285a919061410f565b9091555061286a90508282613519565b6002543360009081526008602052604081205490919061289390670de0b6b3a7640000906141ad565b61289d91906141e2565b33600090815260208080526040808320849055601f909152902055505050565b6040516001600160a01b03831660248201526044810182905261292090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526137f3565b505050565b6000818310156129355781610efa565b5090919050565b612944612763565b601254600160201b900460ff168061295d575060135442105b6129a95760405162461bcd60e51b815260206004820152601d60248201527f43616e277420656469742076657374696e672061667465722073616c650000006044820152606401610b69565b8281146129f85760405162461bcd60e51b815260206004820152601b60248201527f646174657320616e642070637420646f65736e2774206d6174636800000000006044820152606401610b69565b82612a365760405162461bcd60e51b815260206004820152600e60248201526d696e70757420697320656d70747960901b6044820152606401610b69565b6064831115612a875760405162461bcd60e51b815260206004820152601e60248201527f696e707574206c656e6774682063616e6e6f74206578636565642031303000006044820152606401610b69565b612a9360166000613a08565b60008060135486866000818110612aac57612aac61427f565b9050602002013511612b1d5760405162461bcd60e51b815260206004820152603460248201527f666972737420636c61696d2074696d65206973206265666f726520656e642074604482015273696d65202b2077697468647261772064656c617960601b6064820152608401610b69565b60005b85811015612c8057868682818110612b3a57612b3a61427f565b905060200201358310612b8f5760405162461bcd60e51b815260206004820152601c60248201527f6461746573206e6f7420696e20617363656e64696e67206f72646572000000006044820152606401610b69565b868682818110612ba157612ba161427f565b905060200201359250848482818110612bbc57612bbc61427f565b9050602002016020810190612bd19190614329565b612bdb9083614295565b915060166040518060400160405280898985818110612bfc57612bfc61427f565b905060200201358152602001878785818110612c1a57612c1a61427f565b9050602002016020810190612c2f9190614329565b60ff9081169091528254600181810185556000948552602094859020845160029093020191825593909201519190920180549190921660ff1990911617905580612c788161434c565b915050612b20565b50612c8f6312d1d76c836141f6565b60135411612caf5760405162461bcd60e51b8152600401610b6990614367565b8060ff16606414612d165760405162461bcd60e51b815260206004820152602b60248201527f746f74616c20696e7075742070657263656e7461676520646f65736e2774206560448201526a07175616c20746f203130360ac1b6064820152608401610b69565b5050600060155550505050565b600060025460001415612d365750600090565b600254601c54612d4f90670de0b6b3a7640000906141ad565b612d5991906141e2565b905090565b6000815111612d9f5760405162461bcd60e51b815260206004820152600d60248201526c636f646520697320656d70747960981b6044820152606401610b69565b604081511115612de45760405162461bcd60e51b815260206004820152601060248201526f636f646520697320746f6f206c6f6e6760801b6044820152606401610b69565b612dee83836127d5565b600e81604051612dfe91906143b1565b9081526040519081900360200190205460ff16612e8c576001600e82604051612e2791906143b1565b90815260405160209181900382019020805460ff191692151592909217909155600d80546001810182556000919091528251612e8a927fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb590920191840190613a29565b505b336000908152600c6020526040908190209051612eaa9083906143b1565b9081526040519081900360200190205460ff16612faf57601154336000908152600b602052604090205410612f215760405162461bcd60e51b815260206004820152601f60248201527f6d61782070726f6d6f20636f64652070657220757365722072656163686564006044820152606401610b69565b336000908152600c602052604090819020905160019190612f439084906143b1565b908152604051908190036020019020805491151560ff19909216919091179055600b6000612f6e3390565b6001600160a01b0316815260208082019290925260400160009081208054600181018255908252908290208351612fad93919092019190840190613a29565b505b82600f82604051612fc091906143b1565b90815260200160405180910390206000828254612fdd919061410f565b9091555050336000908152600a60205260409081902090516130009083906143b1565b9081526020016040518091039020546000141561304c57600160108260405161302991906143b1565b90815260200160405180910390206000828254613046919061410f565b90915550505b336000908152600960205260408120805485929061306b90849061410f565b9091555050336000908152600a60205260409081902090518491906130919084906143b1565b908152602001604051809103902060008282546130ae919061410f565b909155505060405133907fd4855e7b21a64eb863713fc0e6b4e68770d741fd2bcedbb31ec938db7c31337c906130e790869085906143cd565b60405180910390a2505050565b6130fc612763565b7f0000000000000000000000000000000000000000000000000000000067fd06d0421061313b5760405162461bcd60e51b8152600401610b699061420d565b6309679a3662ffffff8216106131a25760405162461bcd60e51b815260206004820152602660248201527f776974686472617744656c61792068617320746f2062652077697468696e203560448201526520796561727360d01b6064820152608401610b69565b6018805462ffffff60a01b1916600160a01b62ffffff8416908102919091179091556040517f0dac7b34fe917a51c24c51f379615699f5c23ce9168eaed469bc161c9002860890600090a250565b6040516001600160a01b0380851660248301528316604482015260648101829052611c5a9085906323b872dd60e01b906084016128e9565b613230612763565b601254600160201b900460ff1680613249575060135442105b6132955760405162461bcd60e51b815260206004820152601d60248201527f43616e277420656469742076657374696e672061667465722073616c650000006044820152606401610b69565b60135481116133055760405162461bcd60e51b815260206004820152603660248201527f76657374696e6720656e642074696d652068617320746f206265206166746572604482015275207769746864726177616c2073746172742074696d6560501b6064820152608401610b69565b6133136312d1d76c826141f6565b601354116133335760405162461bcd60e51b8152600401610b6990614367565b601581905561334460166000613a08565b60405181907f83d190eb78c1206ea1abb0222d475a5f70b7f63bcd534ab65e9404b39016c7a490600090a250565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8061340a5760405162461bcd60e51b81526020600482015260186024820152773737903a37b5b2b7103a37903132903bb4ba34323930bbb760411b6044820152606401610b69565b3360009081526019602052604090205460ff1661349157601d80546001919060009061343d90849063ffffffff166143e6565b92506101000a81548163ffffffff021916908363ffffffff1602179055506001601960006134683390565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790555b61349a33611f22565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200161249c565b600081815b8451811015613511576134fd828683815181106134f0576134f061427f565b60200260200101516138c5565b9150806135098161434c565b9150506134d1565b509392505050565b6002600154141561353c5760405162461bcd60e51b8152600401610b69906140c2565b600260015560075460ff16156135895760405162461bcd60e51b81526020600482015260126024820152711c1d5c98da185cd9481a5cc81a185b1d195960721b6044820152606401610b69565b6000600254116135d05760405162461bcd60e51b815260206004820152601260248201527173616c65207072696365206973207a65726f60701b6044820152606401610b69565b6005548210156136155760405162461bcd60e51b815260206004820152601060248201526f30b6b7bab73a103132b637bb9036b4b760811b6044820152606401610b69565b8082111561365b5760405162461bcd60e51b8152602060048201526013602482015272195e18d959591cc81b585e081c185e5b595b9d606a1b6044820152606401610b69565b8161369e5760405162461bcd60e51b81526020600482015260136024820152721e995c9bc81c185e5b595b9d08185b5bdd5b9d606a1b6044820152606401610b69565b81600460008282546136b0919061410f565b909155505060065415806136c8575060045460065410155b61370d5760405162461bcd60e51b8152602060048201526016602482015275657863656564206d6178207075726368617361626c6560501b6044820152606401610b69565b3360009081526008602052604090205461375c57601280546001919060009061373d90849063ffffffff166143e6565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b336000908152600860205260408120805484929061377b90849061410f565b909155506137b690507f00000000000000000000000026827f7f51769ea21f94ba98ba64f5d0dc8988f96001600160a01b03163330856131f0565b60405182815233907f2499a5330ab0979cc612135e7883ebc3cd5c9f7a8508f042540c34723348f6329060200160405180910390a2505060018055565b6000613848826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138f49092919063ffffffff16565b8051909150156129205780806020019051810190613866919061440e565b6129205760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b69565b60008183106138e1576000828152602084905260409020610efa565b6000838152602083905260409020610efa565b60606114818484600085856001600160a01b0385163b6139565760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b69565b600080866001600160a01b0316858760405161397291906143b1565b60006040518083038185875af1925050503d80600081146139af576040519150601f19603f3d011682016040523d82523d6000602084013e6139b4565b606091505b50915091506139c48282866139cf565b979650505050505050565b606083156139de575081610efa565b8251156139ee5782518084602001fd5b8160405162461bcd60e51b8152600401610b699190613fdc565b508054600082556002029060005260206000209081019061227e9190613aad565b828054613a35906142da565b90600052602060002090601f016020900481019282613a575760008555613a9d565b82601f10613a7057805160ff1916838001178555613a9d565b82800160010185558215613a9d579182015b82811115613a9d578251825591602001919060010190613a82565b50613aa9929150613ace565b5090565b5b80821115613aa9576000815560018101805460ff19169055600201613aae565b5b80821115613aa95760008155600101613acf565b60008083601f840112613af557600080fd5b5081356001600160401b03811115613b0c57600080fd5b6020830191508360208260051b8501011115613b2757600080fd5b9250929050565b600080600060408486031215613b4357600080fd5b8335925060208401356001600160401b03811115613b6057600080fd5b613b6c86828701613ae3565b9497909650939450505050565b600080600060408486031215613b8e57600080fd5b83356001600160401b03811115613ba457600080fd5b613bb086828701613ae3565b909790965060209590950135949350505050565b80356001600160a01b0381168114613bdb57600080fd5b919050565b600060208284031215613bf257600080fd5b610efa82613bc4565b634e487b7160e01b600052604160045260246000fd5b600082601f830112613c2257600080fd5b81356001600160401b0380821115613c3c57613c3c613bfb565b604051601f8301601f19908116603f01168101908282118183101715613c6457613c64613bfb565b81604052838152866020858801011115613c7d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060208284031215613caf57600080fd5b81356001600160401b03811115613cc557600080fd5b61148184828501613c11565b60008060208385031215613ce457600080fd5b82356001600160401b03811115613cfa57600080fd5b613d0685828601613ae3565b90969095509350505050565b600080600060408486031215613d2757600080fd5b613d3084613bc4565b925060208401356001600160401b03811115613b6057600080fd5b801515811461227e57600080fd5b600060208284031215613d6b57600080fd5b8135610efa81613d4b565b60008060008060608587031215613d8c57600080fd5b8435935060208501356001600160401b03811115613da957600080fd5b613db587828801613ae3565b9598909750949560400135949350505050565b600060208284031215613dda57600080fd5b5035919050565b60008060408385031215613df457600080fd5b613dfd83613bc4565b946020939093013593505050565b602080825282518282018190526000919060409081850190868401855b82811015613e505781518051855286015160ff16868501529284019290850190600101613e28565b5091979650505050505050565b600080600060608486031215613e7257600080fd5b8335925060208401359150613e8960408501613bc4565b90509250925092565b60008060408385031215613ea557600080fd5b613eae83613bc4565b915060208301356001600160401b03811115613ec957600080fd5b613ed585828601613c11565b9150509250929050565b60008060008060608587031215613ef557600080fd5b613efe85613bc4565b935060208501356001600160401b03811115613da957600080fd5b60008060008060408587031215613f2f57600080fd5b84356001600160401b0380821115613f4657600080fd5b613f5288838901613ae3565b90965094506020870135915080821115613f6b57600080fd5b50613f7887828801613ae3565b95989497509550505050565b60005b83811015613f9f578181015183820152602001613f87565b83811115611c5a5750506000910152565b60008151808452613fc8816020860160208601613f84565b601f01601f19169290920160200192915050565b602081526000610efa6020830184613fb0565b6000806000806000806080878903121561400857600080fd5b8635955060208701356001600160401b038082111561402657600080fd5b6140328a838b01613ae3565b909750955060408901359450606089013591508082111561405257600080fd5b818901915089601f83011261406657600080fd5b81358181111561407557600080fd5b8a602082850101111561408757600080fd5b6020830194508093505050509295509295509295565b6000602082840312156140af57600080fd5b813562ffffff81168114610efa57600080fd5b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115614122576141226140f9565b500190565b60208082526026908201527f63616e2774207769746864726177206265666f726520636c61696d20697320736040820152651d185c9d195960d21b606082015260800190565b6020808252600d908201526c1c1c9bdbd9881a5b9d985b1a59609a1b604082015260600190565b6000602082840312156141a657600080fd5b5051919050565b60008160001904831182151516156141c7576141c76140f9565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826141f1576141f16141cc565b500490565b600082821015614208576142086140f9565b500390565b6020808252601490820152731cd85b1948185b1c9958591e481cdd185c9d195960621b604082015260600190565b60208082526024908201527f63616c6c6572206e6f742077686974656c69737420736574746572206f72206f6040820152633bb732b960e11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff84168060ff038211156142b2576142b26140f9565b019392505050565b600060ff821660ff8114156142d1576142d16140f9565b60010192915050565b600181811c908216806142ee57607f821691505b6020821081141561430f57634e487b7160e01b600052602260045260246000fd5b50919050565b600082614324576143246141cc565b500690565b60006020828403121561433b57600080fd5b813560ff81168114610efa57600080fd5b6000600019821415614360576143606140f9565b5060010190565b6020808252602a908201527f76657374696e6720656e642074696d652068617320746f2062652077697468696040820152696e20313020796561727360b01b606082015260800190565b600082516143c3818460208701613f84565b9190910192915050565b8281526040602082015260006114816040830184613fb0565b600063ffffffff808316818516808303821115614405576144056140f9565b01949350505050565b60006020828403121561442057600080fd5b8151610efa81613d4b56fea264697066735822122073046635c677b403de4a63d3102589e1bb1f813b2b5569c7dd8b31f8f650086064736f6c63430008090033
Verified Source Code Partial Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: Yes (200 runs)
IFFixedSaleV12.sol 2542 lines
// SPDX-License-Identifier: MIT // Sources flattened with hardhat v2.16.1 https://hardhat.org // File @openzeppelin/contracts/utils/[email protected] // 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; } } // File @openzeppelin/contracts/access/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions 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); } } // File @openzeppelin/contracts/token/ERC20/[email protected] // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); } // File @openzeppelin/contracts/token/ERC20/extensions/[email protected] // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; /** * @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); } // File @openzeppelin/contracts/token/ERC20/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; /** * @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, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _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 Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } // File @openzeppelin/contracts/token/ERC20/extensions/[email protected] // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } // File @openzeppelin/contracts/utils/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File @openzeppelin/contracts/token/ERC20/utils/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File @openzeppelin/contracts/utils/cryptography/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`, * consuming from one or the other at each step according to the instructions given by * `proofFlags`. * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof} * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } } // File @openzeppelin/contracts/security/[email protected] // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // File contracts/IFFundable.sol pragma solidity 0.8.9; /** @title Abstract contract providing funder related functions in a sale @notice To be implemented by IFSale. */ abstract contract IFFundable is Ownable, ReentrancyGuard { using SafeERC20 for ERC20; // --- CONSTANTS // number of decimals of sale price uint64 constant SALE_PRICE_DECIMALS = 10**18; uint64 private constant ONE_HOUR = 3600; uint64 private constant ONE_YEAR = 31556926; uint64 private constant FIVE_YEARS = 157784630; uint64 private constant TEN_YEARS = 315742060; // --- OPERATOR ADDRESSES address public funder; // optional casher (settable by owner) address public casher; // --- SALE INFO // start timestamp when sale is active (inclusive) uint256 public immutable startTime; // end timestamp when sale is active (inclusive) uint256 public immutable endTime; // payment token ERC20 private immutable paymentToken; // sale token ERC20 private immutable saleToken; // withdraw/cash delay timestamp (inclusive) uint24 public withdrawDelay; // tracks whether user has already successfully withdrawn mapping(address => bool) public hasWithdrawn; // --- STATS // amount of sale token to sell uint256 public saleAmount; // tracks whether sale has been cashed bool public hasCashed; // total payment received for sale uint256 public totalPaymentReceived; // counter of unique withdrawers (doesn't count "cash"ing) uint32 public withdrawerCount; // --- CONSTRUCTOR constructor( ERC20 _paymentToken, ERC20 _saleToken, uint256 _startTime, uint256 _endTime, address _funder ) { // saleToken shouldn't be the same as paymentToken require(_saleToken != _paymentToken, 'saleToken = paymentToken'); // when salePrice != 0, paymentToken and maxTotalPayment shouldn't be 0 // sale token cannot be 0 require(address(_saleToken) != address(0), '0x0 saleToken'); // start timestamp must be in future require(block.timestamp < _startTime, 'start timestamp too early'); require(_startTime - ONE_YEAR < block.timestamp, 'start time has to be within 1 year'); // end timestamp must be after start timestamp require(_startTime < _endTime, 'end timestamp must be after start timestamp'); require(_endTime - TEN_YEARS < _startTime, 'end time has to be within 10 years'); require(_funder != address(0), '0x0 funder'); funder = _funder; paymentToken = _paymentToken; // can be 0 (for giveaway) saleToken = _saleToken; startTime = _startTime;... // [truncated — 92863 bytes total]
Read Contract
amountPerCode 0x10002d2a → uint256
casher 0xcc89629b → address
checkWhitelist 0x1649a8a9 → bool
checkWhitelist 0x76078dbe → bool
claimable 0x402914f5 → uint256
cliffPeriod 0x5dbb4dbd → uint256, uint8
codes 0xe86613a7 → string
endTime 0x3197cbb6 → uint256
funder 0x041ae880 → address
getCliffPeriod 0x3d9205c1 → tuple[]
getCurrentClaimableToken 0xc9a2ff43 → uint256
getMaxPayment 0x2feb25f6 → uint256
getUnlockedToken 0x642d0f70 → uint256
hasCashed 0x7dd20946 → bool
hasUsedCode 0xd390bcc7 → bool
hasWithdrawn 0x5e2c19db → bool
isIntegerPayment 0xff273b66 → bool
isIntegerSale 0x84b587d1 → bool
isPurchaseHalted 0x3efa1b68 → bool
isVestedGiveaway 0x928e5f8b → bool
latestClaimTime 0x5b2ee404 → uint256
linearVestingEndTime 0xd98b1f9d → uint256
maxPromoCodePerUser 0xbae235bc → uint256
maxTotalPayment 0xa89e8522 → uint256
maxTotalPurchasable 0x6713cea2 → uint256
minTotalPayment 0x4797a548 → uint256
owner 0x8da5cb5b → address
paymentReceived 0x5559638f → uint256
paymentReceivedWithCode 0xd3b7adc9 → uint256
paymentReceivedWithEachCode 0x74f54826 → uint256
paymentToken 0x3013ce29 → address
promoCodesPerUser 0xa47ff99b → string
publicAllocation 0x4ae0f543 → uint256
purchaserCount 0x1101eaaf → uint32
renounceOwnership 0x715018a6
saleAmount 0x8aae995a → uint256
salePrice 0xf51f96dd → uint256
saleTokenPurchased 0x1d6a4581 → uint256
startTime 0x78e97925 → uint256
totalPaymentReceived 0x48faade4 → uint256
totalPurchased 0x497aef28 → uint256
uniqueUsePerCode 0x1fa3f435 → uint256
vestingEditableOverride 0x76ebbbc2 → bool
whitelistRootHash 0xd1a12d6a → bytes32
whitelistSetter 0xd03df6dd → address
whitelistedPurchase 0x01fc191c
withdrawDelay 0x0288a39c → uint24
withdrawGiveaway 0x1637cde0
withdrawTime 0x45cb3dde → uint256
withdrawerCount 0xd6ca214d → uint32
Write Contract 25 functions
These functions modify contract state and require a wallet transaction to execute.
cash 0x961be391
No parameters
cashPaymentToken 0x52811c4b
uint256 amount
emergencyTokenRetrieve 0x26c65482
address token
fund 0xca1d209d
uint256 amount
purchase 0xefef39a1
uint256
setCasher 0xa590c84e
address _casher
setCliffPeriod 0x89910cac
uint256[] claimTimes
uint8[] pct
setFunder 0x0acc8cd1
address _funder
setIsIntegerSale 0xf67c008e
bool _isIntegerSale
setIsPurchaseHalted 0xc1d25f83
bool _isPurchaseHalted
setLinearVestingEndTime 0xcddfb5fd
uint256 _vestingEndTime
setMaxTotalPurchasable 0xda943cee
uint256 _maxTotalPurchasable
setMinTotalPayment 0x252b99c5
uint256 _minTotalPayment
setPublicAllocation 0xc32d5564
uint256 _publicAllocation
setVestedGiveaway 0x3763326a
bool _isVestedGiveaway
setVestingEditable 0x2270e82d
bool _vestingEditableOverride
setWhitelist 0x440bc7f3
bytes32 _whitelistRootHash
setWhitelistSetter 0x547a5eee
address _whitelistSetter
setWithdrawDelay 0xaacc557a
uint24 _withdrawDelay
transferOwnership 0xf2fde38b
address newOwner
whitelistedPurchase 0x2316448c
uint256 paymentAmount
bytes32[] merkleProof
uint256 _allocation
whitelistedPurchaseWithCode 0xa54bd56d
uint256 paymentAmount
bytes32[] merkleProof
uint256 _allocation
string code
withdraw 0x3ccfd60b
No parameters
withdrawGiveaway 0x1e937107
bytes32[] merkleProof
uint256 allocation
withdrawGiveawayVested 0x022a8b1a
bytes32[] merkleProof
uint256 allocation
Recent Transactions
No transactions found for this address