Address Contract Partially Verified
Address
0x11771AC9293F109adb7cEC7bb6AC35622f4178BC
Balance
0.013920 ETH
Nonce
1
Code Size
16289 bytes
Creator
0xE5347661...f5f7 at tx 0x023a53a4...6a3c60
Indexed Transactions
0
Contract Bytecode
16289 bytes
0x60806040526004361061023e575f3560e01c8063720094071161012d578063aba668c5116100aa578063d939c9601161006e578063d939c96014610802578063e12f3a611461082c578063e3c1d5be14610868578063eb91d37e146108a4578063f2fde38b146108cf57610245565b8063aba668c514610736578063bce4d6ae14610760578063bfb6202814610788578063d186baa0146107b0578063d547741f146107da57610245565b806391d14854116100f157806391d14854146106585780639c007c7514610694578063a217fddf146106bc578063a81e43ae146106e6578063a89c8c5e1461070e57610245565b8063720094071461058257806375b238fc1461059e578063842a77d3146105c85780638da5cb5b146106045780639106d7ba1461062e57610245565b806336568abe116101bb5780635a18664c1161017f5780635a18664c146104de5780635ac3cb3d146104f45780636f8b44b01461051c578063715018a614610544578063718394311461055a57610245565b806336568abe14610424578063428a64551461044c57806344dab4c41461046257806348c54b9d1461049e57806350480fd2146104b457610245565b8063248a9ca311610202578063248a9ca3146103425780632959258f1461037e5780632f2ff15d146103a857806332cb6b0c146103d057806335a9e7d6146103fa57610245565b806301ffc9a71461024957806309b6c9ba146102855780630e760a81146102af5780631011589f146102d75780631ad874b41461031857610245565b3661024557005b5f5ffd5b348015610254575f5ffd5b5061026f600480360381019061026a9190612c57565b6108f7565b60405161027c9190612c9c565b60405180910390f35b348015610290575f5ffd5b50610299610970565b6040516102a69190612dee565b60405180910390f35b3480156102ba575f5ffd5b506102d560048036038101906102d09190612e38565b610a07565b005b3480156102e2575f5ffd5b506102fd60048036038101906102f89190612e38565b610ab7565b60405161030f96959493929190612e72565b60405180910390f35b348015610323575f5ffd5b5061032c610afe565b6040516103399190612c9c565b60405180910390f35b34801561034d575f5ffd5b5061036860048036038101906103639190612f04565b610b10565b6040516103759190612f3e565b60405180910390f35b348015610389575f5ffd5b50610392610b2c565b60405161039f9190612c9c565b60405180910390f35b3480156103b3575f5ffd5b506103ce60048036038101906103c99190612fb1565b610b3f565b005b3480156103db575f5ffd5b506103e4610b61565b6040516103f19190612fef565b60405180910390f35b348015610405575f5ffd5b5061040e610b67565b60405161041b9190613081565b60405180910390f35b34801561042f575f5ffd5b5061044a60048036038101906104459190612fb1565b610c75565b005b348015610457575f5ffd5b50610460610cf0565b005b34801561046d575f5ffd5b506104886004803603810190610483919061309a565b610f35565b6040516104959190612fef565b60405180910390f35b3480156104a9575f5ffd5b506104b2610f55565b005b3480156104bf575f5ffd5b506104c861115b565b6040516104d59190612fef565b60405180910390f35b3480156104e9575f5ffd5b506104f2611161565b005b3480156104ff575f5ffd5b5061051a60048036038101906105159190613113565b6112b5565b005b348015610527575f5ffd5b50610542600480360381019061053d9190612e38565b6114b9565b005b34801561054f575f5ffd5b50610558611569565b005b348015610565575f5ffd5b50610580600480360381019061057b9190613267565b61157c565b005b61059c600480360381019061059791906132db565b6116cb565b005b3480156105a9575f5ffd5b506105b2611c46565b6040516105bf9190612f3e565b60405180910390f35b3480156105d3575f5ffd5b506105ee60048036038101906105e99190613319565b611c6a565b6040516105fb9190612fef565b60405180910390f35b34801561060f575f5ffd5b50610618611c7f565b6040516106259190613353565b60405180910390f35b348015610639575f5ffd5b50610642611ca7565b60405161064f9190612fef565b60405180910390f35b348015610663575f5ffd5b5061067e60048036038101906106799190612fb1565b611cad565b60405161068b9190612c9c565b60405180910390f35b34801561069f575f5ffd5b506106ba60048036038101906106b59190613396565b611d10565b005b3480156106c7575f5ffd5b506106d0611dd3565b6040516106dd9190612f3e565b60405180910390f35b3480156106f1575f5ffd5b5061070c60048036038101906107079190613489565b611dd9565b005b348015610719575f5ffd5b50610734600480360381019061072f91906134d0565b611f2a565b005b348015610741575f5ffd5b5061074a612054565b6040516107579190613569565b60405180910390f35b34801561076b575f5ffd5b5061078660048036038101906107819190613396565b612079565b005b348015610793575f5ffd5b506107ae60048036038101906107a99190613319565b61213b565b005b3480156107bb575f5ffd5b506107c4612186565b6040516107d19190613569565b60405180910390f35b3480156107e5575f5ffd5b5061080060048036038101906107fb9190612fb1565b6121ab565b005b34801561080d575f5ffd5b506108166121cd565b6040516108239190613353565b60405180910390f35b348015610837575f5ffd5b50610852600480360381019061084d9190613319565b6121f2565b60405161085f9190612fef565b60405180910390f35b348015610873575f5ffd5b5061088e60048036038101906108899190612e38565b612238565b60405161089b9190612fef565b60405180910390f35b3480156108af575f5ffd5b506108b861224d565b6040516108c6929190613582565b60405180910390f35b3480156108da575f5ffd5b506108f560048036038101906108f09190613319565b61226d565b005b5f7f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109695750610968826122f1565b5b9050919050565b6060600a805480602002602001604051908101604052809291908181526020015f905b828210156109fe578382905f5260205f2090600602016040518060c00160405290815f82015481526020016001820154815260200160028201548152602001600382015481526020016004820154815260200160058201548152505081526020019060010190610993565b50505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16610a26611c7f565b73ffffffffffffffffffffffffffffffffffffffff161480610a6e5750610a6d7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b610aad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa490613603565b60405180910390fd5b8060088190555050565b600a8181548110610ac6575f80fd5b905f5260205f2090600602015f91509050805f0154908060010154908060020154908060030154908060040154908060050154905086565b60095f9054906101000a900460ff1681565b5f5f5f8381526020019081526020015f20600101549050919050565b600960019054906101000a900460ff1681565b610b4882610b10565b610b518161235a565b610b5b838361236e565b50505050565b60065481565b610b6f612b60565b5f6001600a80549050610b82919061364e565b90505b5f8110610c3657600a8181548110610ba057610b9f613681565b5b905f5260205f2090600602015f01544210610c2357600a8181548110610bc957610bc8613681565b5b905f5260205f2090600602016040518060c00160405290815f820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582015481525050915050610c72565b8080610c2e906136ae565b915050610b85565b506040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c699061371f565b60405180910390fd5b90565b610c7d612457565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ce1576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ceb828261245e565b505050565b3373ffffffffffffffffffffffffffffffffffffffff16610d0f611c7f565b73ffffffffffffffffffffffffffffffffffffffff161480610d575750610d567fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b610d96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8d90613603565b60405180910390fd5b5f60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610df19190613353565b602060405180830381865afa158015610e0c573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e309190613751565b90505f8111610e74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6b906137c6565b60405180910390fd5b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610ef19291906137e4565b6020604051808303815f875af1158015610f0d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f31919061381f565b5050565b600c602052815f5260405f20602052805f5260405f205f91509150505481565b610f5d612547565b600960019054906101000a900460ff16610fac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa390613894565b60405180910390fd5b600854421015610ff1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe8906138fc565b60405180910390fd5b5f600b5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490505f8111611074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106b90613964565b60405180910390fd5b5f600b5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550611102338260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125969092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e430826040516111489190612fef565b60405180910390a250611159612615565b565b60085481565b3373ffffffffffffffffffffffffffffffffffffffff16611180611c7f565b73ffffffffffffffffffffffffffffffffffffffff1614806111c857506111c77fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b611207576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fe90613603565b60405180910390fd5b5f4790505f811161124d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611244906139cc565b60405180910390fd5b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f193505050501580156112b1573d5f5f3e3d5ffd5b5050565b3373ffffffffffffffffffffffffffffffffffffffff166112d4611c7f565b73ffffffffffffffffffffffffffffffffffffffff16148061131c575061131b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b61135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613603565b60405180910390fd5b5f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016113959190613353565b602060405180830381865afa1580156113b0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113d49190613751565b90505f8111611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f906137c6565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b81526004016114749291906137e4565b6020604051808303815f875af1158015611490573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114b4919061381f565b505050565b3373ffffffffffffffffffffffffffffffffffffffff166114d8611c7f565b73ffffffffffffffffffffffffffffffffffffffff161480611520575061151f7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b61155f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155690613603565b60405180910390fd5b8060068190555050565b61157161261e565b61157a5f6126a5565b565b3373ffffffffffffffffffffffffffffffffffffffff1661159b611c7f565b73ffffffffffffffffffffffffffffffffffffffff1614806115e357506115e27fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b611622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161990613603565b60405180910390fd5b600a805490508210611669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166090613a34565b60405180910390fd5b80600a838154811061167e5761167d613681565b5b905f5260205f2090600602015f820151815f01556020820151816001015560408201518160020155606082015181600301556080820151816004015560a082015181600501559050505050565b6116d3612547565b60095f9054906101000a900460ff16611721576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171890613a9c565b60405180910390fd5b5f61172a612768565b90505f600a828154811061174157611740613681565b5b905f5260205f20906006020190508060030154841015611796576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178d90613b04565b60405180910390fd5b80600401546117fa85600c5f8681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461280a90919063ffffffff16565b111561183b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183290613b6c565b60405180910390fd5b806005015461186485600d5f8681526020019081526020015f205461280a90919063ffffffff16565b11156118a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189c90613bd4565b60405180910390fd5b6006546118bd8560075461280a90919063ffffffff16565b11156118fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f590613c3c565b60405180910390fd5b5f5f8460ff16036119845761193a670de0b6b3a764000061192c84600101548861281f90919063ffffffff16565b61283490919063ffffffff16565b90508034101561197f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197690613ca4565b60405180910390fd5b611a51565b60018460ff1603611a15576119c0670de0b6b3a76400006119b284600201548861281f90919063ffffffff16565b61283490919063ffffffff16565b9050611a1033308360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612849909392919063ffffffff16565b611a50565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4790613d0c565b60405180910390fd5b5b611aa185600b5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461280a90919063ffffffff16565b600b5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550611b4185600c5f8681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461280a90919063ffffffff16565b600c5f8581526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550611bb585600d5f8681526020019081526020015f205461280a90919063ffffffff16565b600d5f8581526020019081526020015f2081905550611bdf8560075461280a90919063ffffffff16565b6007819055503373ffffffffffffffffffffffffffffffffffffffff167f07bd967119635e499edb871f00e988945fc967531c4dfa79a630a18ed98cf1eb868387604051611c2f93929190613d39565b60405180910390a2505050611c42612615565b5050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b600b602052805f5260405f205f915090505481565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60075481565b5f5f5f8481526020019081526020015f205f015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16611d2f611c7f565b73ffffffffffffffffffffffffffffffffffffffff161480611d775750611d767fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b611db6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dad90613603565b60405180910390fd5b80600960016101000a81548160ff02191690831515021790555050565b5f5f1b81565b3373ffffffffffffffffffffffffffffffffffffffff16611df8611c7f565b73ffffffffffffffffffffffffffffffffffffffff161480611e405750611e3f7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b611e7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7690613603565b60405180910390fd5b600a5f611e8c9190612b90565b5f5f90505b8151811015611f2657600a828281518110611eaf57611eae613681565b5b6020026020010151908060018154018082558091505060019003905f5260205f2090600602015f909190919091505f820151815f01556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015550508080600101915050611e91565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16611f49611c7f565b73ffffffffffffffffffffffffffffffffffffffff161480611f915750611f907fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b611fd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc790613603565b60405180910390fd5b8160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff16612098611c7f565b73ffffffffffffffffffffffffffffffffffffffff1614806120e057506120df7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611cad565b5b61211f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211690613603565b60405180910390fd5b8060095f6101000a81548160ff02191690831515021790555050565b61214361261e565b8060055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6121b482610b10565b6121bd8161235a565b6121c7838361245e565b50505050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f600b5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b600d602052805f5260405f205f915090505481565b5f5f5f612258610b67565b90508060200151816040015192509250509091565b61227561261e565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036122e5575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016122dc9190613353565b60405180910390fd5b6122ee816126a5565b50565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61236b81612366612457565b6128cb565b50565b5f6123798383611cad565b61244d5760015f5f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506123ea612457565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019050612451565b5f90505b92915050565b5f33905090565b5f6124698383611cad565b1561253d575f5f5f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506124da612457565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a460019050612541565b5f90505b92915050565b60026001540361258c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161258390613db8565b60405180910390fd5b6002600181905550565b612610838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016125c99291906137e4565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061291c565b505050565b60018081905550565b612626612457565b73ffffffffffffffffffffffffffffffffffffffff16612644611c7f565b73ffffffffffffffffffffffffffffffffffffffff16146126a357612667612457565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161269a9190613353565b60405180910390fd5b565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5f6001600a8054905061277c919061364e565b90505b5f81106127cb57600a818154811061279a57612799613681565b5b905f5260205f2090600602015f015442106127b85780915050612807565b80806127c3906136ae565b91505061277f565b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127fe9061371f565b60405180910390fd5b90565b5f81836128179190613dd6565b905092915050565b5f818361282c9190613e09565b905092915050565b5f81836128419190613e77565b905092915050565b6128c5848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161287e93929190613ea7565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061291c565b50505050565b6128d58282611cad565b6129185780826040517fe2517d3f00000000000000000000000000000000000000000000000000000000815260040161290f929190613edc565b60405180910390fd5b5050565b5f612946828473ffffffffffffffffffffffffffffffffffffffff166129b190919063ffffffff16565b90505f81511415801561296a575080806020019051810190612968919061381f565b155b156129ac57826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016129a39190613353565b60405180910390fd5b505050565b60606129be83835f6129c6565b905092915050565b606081471015612a0d57306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401612a049190613353565b60405180910390fd5b5f5f8573ffffffffffffffffffffffffffffffffffffffff168486604051612a359190613f55565b5f6040518083038185875af1925050503d805f8114612a6f576040519150601f19603f3d011682016040523d82523d5f602084013e612a74565b606091505b5091509150612a84868383612a8f565b925050509392505050565b606082612aa457612a9f82612b1c565b612b14565b5f8251148015612aca57505f8473ffffffffffffffffffffffffffffffffffffffff163b145b15612b0c57836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401612b039190613353565b60405180910390fd5b819050612b15565b5b9392505050565b5f81511115612b2e5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5080545f8255600602905f5260205f2090810190612bae9190612bb1565b50565b5b80821115612bed575f5f82015f9055600182015f9055600282015f9055600382015f9055600482015f9055600582015f905550600601612bb2565b5090565b5f604051905090565b5f5ffd5b5f5ffd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612c3681612c02565b8114612c40575f5ffd5b50565b5f81359050612c5181612c2d565b92915050565b5f60208284031215612c6c57612c6b612bfa565b5b5f612c7984828501612c43565b91505092915050565b5f8115159050919050565b612c9681612c82565b82525050565b5f602082019050612caf5f830184612c8d565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f819050919050565b612cf081612cde565b82525050565b60c082015f820151612d0a5f850182612ce7565b506020820151612d1d6020850182612ce7565b506040820151612d306040850182612ce7565b506060820151612d436060850182612ce7565b506080820151612d566080850182612ce7565b5060a0820151612d6960a0850182612ce7565b50505050565b5f612d7a8383612cf6565b60c08301905092915050565b5f602082019050919050565b5f612d9c82612cb5565b612da68185612cbf565b9350612db183612ccf565b805f5b83811015612de1578151612dc88882612d6f565b9750612dd383612d86565b925050600181019050612db4565b5085935050505092915050565b5f6020820190508181035f830152612e068184612d92565b905092915050565b612e1781612cde565b8114612e21575f5ffd5b50565b5f81359050612e3281612e0e565b92915050565b5f60208284031215612e4d57612e4c612bfa565b5b5f612e5a84828501612e24565b91505092915050565b612e6c81612cde565b82525050565b5f60c082019050612e855f830189612e63565b612e926020830188612e63565b612e9f6040830187612e63565b612eac6060830186612e63565b612eb96080830185612e63565b612ec660a0830184612e63565b979650505050505050565b5f819050919050565b612ee381612ed1565b8114612eed575f5ffd5b50565b5f81359050612efe81612eda565b92915050565b5f60208284031215612f1957612f18612bfa565b5b5f612f2684828501612ef0565b91505092915050565b612f3881612ed1565b82525050565b5f602082019050612f515f830184612f2f565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f612f8082612f57565b9050919050565b612f9081612f76565b8114612f9a575f5ffd5b50565b5f81359050612fab81612f87565b92915050565b5f5f60408385031215612fc757612fc6612bfa565b5b5f612fd485828601612ef0565b9250506020612fe585828601612f9d565b9150509250929050565b5f6020820190506130025f830184612e63565b92915050565b60c082015f82015161301c5f850182612ce7565b50602082015161302f6020850182612ce7565b5060408201516130426040850182612ce7565b5060608201516130556060850182612ce7565b5060808201516130686080850182612ce7565b5060a082015161307b60a0850182612ce7565b50505050565b5f60c0820190506130945f830184613008565b92915050565b5f5f604083850312156130b0576130af612bfa565b5b5f6130bd85828601612e24565b92505060206130ce85828601612f9d565b9150509250929050565b5f6130e282612f76565b9050919050565b6130f2816130d8565b81146130fc575f5ffd5b50565b5f8135905061310d816130e9565b92915050565b5f6020828403121561312857613127612bfa565b5b5f613135848285016130ff565b91505092915050565b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61318882613142565b810181811067ffffffffffffffff821117156131a7576131a6613152565b5b80604052505050565b5f6131b9612bf1565b90506131c5828261317f565b919050565b5f60c082840312156131df576131de61313e565b5b6131e960c06131b0565b90505f6131f884828501612e24565b5f83015250602061320b84828501612e24565b602083015250604061321f84828501612e24565b604083015250606061323384828501612e24565b606083015250608061324784828501612e24565b60808301525060a061325b84828501612e24565b60a08301525092915050565b5f5f60e0838503121561327d5761327c612bfa565b5b5f61328a85828601612e24565b925050602061329b858286016131ca565b9150509250929050565b5f60ff82169050919050565b6132ba816132a5565b81146132c4575f5ffd5b50565b5f813590506132d5816132b1565b92915050565b5f5f604083850312156132f1576132f0612bfa565b5b5f6132fe85828601612e24565b925050602061330f858286016132c7565b9150509250929050565b5f6020828403121561332e5761332d612bfa565b5b5f61333b84828501612f9d565b91505092915050565b61334d81612f76565b82525050565b5f6020820190506133665f830184613344565b92915050565b61337581612c82565b811461337f575f5ffd5b50565b5f813590506133908161336c565b92915050565b5f602082840312156133ab576133aa612bfa565b5b5f6133b884828501613382565b91505092915050565b5f5ffd5b5f67ffffffffffffffff8211156133df576133de613152565b5b602082029050602081019050919050565b5f5ffd5b5f613406613401846133c5565b6131b0565b90508083825260208201905060c08402830185811115613429576134286133f0565b5b835b81811015613452578061343e88826131ca565b84526020840193505060c08101905061342b565b5050509392505050565b5f82601f8301126134705761346f6133c1565b5b81356134808482602086016133f4565b91505092915050565b5f6020828403121561349e5761349d612bfa565b5b5f82013567ffffffffffffffff8111156134bb576134ba612bfe565b5b6134c78482850161345c565b91505092915050565b5f5f604083850312156134e6576134e5612bfa565b5b5f6134f385828601612f9d565b925050602061350485828601612f9d565b9150509250929050565b5f819050919050565b5f61353161352c61352784612f57565b61350e565b612f57565b9050919050565b5f61354282613517565b9050919050565b5f61355382613538565b9050919050565b61356381613549565b82525050565b5f60208201905061357c5f83018461355a565b92915050565b5f6040820190506135955f830185612e63565b6135a26020830184612e63565b9392505050565b5f82825260208201905092915050565b7f43616c6c6572206973206e6f742061646d696e206f72206f776e6572000000005f82015250565b5f6135ed601c836135a9565b91506135f8826135b9565b602082019050919050565b5f6020820190508181035f83015261361a816135e1565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61365882612cde565b915061366383612cde565b925082820390508181111561367b5761367a613621565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f6136b882612cde565b91505f82036136ca576136c9613621565b5b600182039050919050565b7f4e6f2076616c6964207072696365207374657020666f756e64000000000000005f82015250565b5f6137096019836135a9565b9150613714826136d5565b602082019050919050565b5f6020820190508181035f830152613736816136fd565b9050919050565b5f8151905061374b81612e0e565b92915050565b5f6020828403121561376657613765612bfa565b5b5f6137738482850161373d565b91505092915050565b7f4e6f20746f6b656e7320746f20776974686472617700000000000000000000005f82015250565b5f6137b06015836135a9565b91506137bb8261377c565b602082019050919050565b5f6020820190508181035f8301526137dd816137a4565b9050919050565b5f6040820190506137f75f830185613344565b6138046020830184612e63565b9392505050565b5f815190506138198161336c565b92915050565b5f6020828403121561383457613833612bfa565b5b5f6138418482850161380b565b91505092915050565b7f436c61696d696e67206973206e6f7420616374697665000000000000000000005f82015250565b5f61387e6016836135a9565b91506138898261384a565b602082019050919050565b5f6020820190508181035f8301526138ab81613872565b9050919050565b7f436c61696d696e6720686173206e6f74207374617274656420796574000000005f82015250565b5f6138e6601c836135a9565b91506138f1826138b2565b602082019050919050565b5f6020820190508181035f830152613913816138da565b9050919050565b7f4e6f20746f6b656e7320746f20636c61696d00000000000000000000000000005f82015250565b5f61394e6012836135a9565b91506139598261391a565b602082019050919050565b5f6020820190508181035f83015261397b81613942565b9050919050565b7f4e6f206e617469766520746f6b656e20746f20776974686472617700000000005f82015250565b5f6139b6601b836135a9565b91506139c182613982565b602082019050919050565b5f6020820190508181035f8301526139e3816139aa565b9050919050565b7f496e646578206f7574206f6620626f756e6473000000000000000000000000005f82015250565b5f613a1e6013836135a9565b9150613a29826139ea565b602082019050919050565b5f6020820190508181035f830152613a4b81613a12565b9050919050565b7f50726573616c65206973206e6f742061637469766500000000000000000000005f82015250565b5f613a866015836135a9565b9150613a9182613a52565b602082019050919050565b5f6020820190508181035f830152613ab381613a7a565b9050919050565b7f50757263686173652062656c6f77207068617365206d696e696d756d000000005f82015250565b5f613aee601c836135a9565b9150613af982613aba565b602082019050919050565b5f6020820190508181035f830152613b1b81613ae2565b9050919050565b7f45786365656473206d6178207065722077616c6c657420666f722070686173655f82015250565b5f613b566020836135a9565b9150613b6182613b22565b602082019050919050565b5f6020820190508181035f830152613b8381613b4a565b9050919050565b7f45786365656473207068617365206361700000000000000000000000000000005f82015250565b5f613bbe6011836135a9565b9150613bc982613b8a565b602082019050919050565b5f6020820190508181035f830152613beb81613bb2565b9050919050565b7f45786365656473206d617820737570706c7900000000000000000000000000005f82015250565b5f613c266012836135a9565b9150613c3182613bf2565b602082019050919050565b5f6020820190508181035f830152613c5381613c1a565b9050919050565b7f496e73756666696369656e74206e617469766520746f6b656e2073656e7400005f82015250565b5f613c8e601e836135a9565b9150613c9982613c5a565b602082019050919050565b5f6020820190508181035f830152613cbb81613c82565b9050919050565b7f496e76616c696420746f6b656e2063686f6963650000000000000000000000005f82015250565b5f613cf66014836135a9565b9150613d0182613cc2565b602082019050919050565b5f6020820190508181035f830152613d2381613cea565b9050919050565b613d33816132a5565b82525050565b5f606082019050613d4c5f830186612e63565b613d596020830185612e63565b613d666040830184613d2a565b949350505050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c005f82015250565b5f613da2601f836135a9565b9150613dad82613d6e565b602082019050919050565b5f6020820190508181035f830152613dcf81613d96565b9050919050565b5f613de082612cde565b9150613deb83612cde565b9250828201905080821115613e0357613e02613621565b5b92915050565b5f613e1382612cde565b9150613e1e83612cde565b9250828202613e2c81612cde565b91508282048414831517613e4357613e42613621565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f613e8182612cde565b9150613e8c83612cde565b925082613e9c57613e9b613e4a565b5b828204905092915050565b5f606082019050613eba5f830186613344565b613ec76020830185613344565b613ed46040830184612e63565b949350505050565b5f604082019050613eef5f830185613344565b613efc6020830184612f2f565b9392505050565b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f613f2f82613f03565b613f398185613f0d565b9350613f49818560208601613f17565b80840191505092915050565b5f613f608284613f25565b91508190509291505056fea2646970667358221220effb4b41c1d3c5bbd7171e8b1adaacd19f3c8014e5b094690b616397bec7003b64736f6c634300081e0033
Verified Source Code Partial Match
Compiler: v0.8.30+commit.73712a01
EVM: prague
Optimization: No
EliseoPresaleClaim.sol 1510 lines
// File: @openzeppelin/contracts/access/IAccessControl.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/access/AccessControl.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
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].
*
* CAUTION: See Security Considerations above.
*/
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/Address.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}
// File: @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
/**
* @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;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @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);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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: new/contracts/EliseoPresale.sol
pragma solidity ^0.8.22;
contract EliseoPresaleClaim is AccessControl, ReentrancyGuard, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
struct PriceStep {
uint256 timestamp;
uint256 nativeTokenPrice;
uint256 extraToken1Price;
uint256 minPurchase;
uint256 maxPerWallet; // per‑wallet cap in this phase
uint256 maxPhaseSupply; // total cap for the phase
}
IERC20 public tokenBeingSold;
IERC20 public extraToken1 = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
address public fundRecipient;
uint256 public MAX_SUPPLY = 5775000000 ether;
uint256 public totalSold;
uint256 public claimingStartTime = 1908511838;
bool public presaleOn = true;
bool public claimingOn = false;
PriceStep[] public priceSteps;
// total purchases per user (used for claim logic)
mapping(address => uint256) public purchases;
// NEW: per‑phase tracking
mapping(uint256 => mapping(address => uint256)) public phasePurchases; // phaseIndex => user => amount
mapping(uint256 => uint256) public phaseTotalSold; // phaseIndex => total sold
event TokensPurchased(address indexed buyer, uint256 amount, uint256 price, uint8 tokenChoice);
event TokensClaimed(address indexed claimer, uint256 amount);
constructor(address _initialOwner) Ownable(_initialOwner) {
_grantRole(ADMIN_ROLE, msg.sender);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
fundRecipient = msg.sender;
/*
Initialize phases with:
timestamp,
nativeTokenPrice (ETH denomination),
extraToken1Price (USDC, 6‑decimals),
minPurchase,
maxPerWallet,
maxPhaseSupply
All token amounts use 18 decimals (ether).
*/
priceSteps.push(
PriceStep({
timestamp: 1751117400,
nativeTokenPrice: 138196350869,
extraToken1Price: 0.000333e6,
minPurchase: 7507507 ether,
maxPerWallet: 150150150 ether,
maxPhaseSupply: 1980000000 ether
})
);
priceSteps.push(
PriceStep({
timestamp: 1751117400 + 60 days,
nativeTokenPrice: 275147689569,
extraToken1Price: 0.000663e6,
minPurchase: 15082956 ether,
maxPerWallet: 377073906 ether,
maxPhaseSupply: 2640000000 ether
})
);
priceSteps.push(
PriceStep({
timestamp: 1751117400 + 120 days,
nativeTokenPrice: 468954584031 ether,
extraToken1Price: 0.001130e6,
minPurchase: 44247 ether,
maxPerWallet: 44247788 ether,
maxPhaseSupply: 1155000000 ether
})
);
}
modifier onlyAdminOrOwner() {
require(owner() == msg.sender || hasRole(ADMIN_ROLE, msg.sender), "Caller is not admin or owner");
_;
}
// === Admin setters (unchanged except where noted) ===
function setPresaleState(bool _state) external onlyAdminOrOwner {
presaleOn = _state;
}
function setClaimingState(bool _state) external onlyAdminOrOwner {
claimingOn = _state;
}
function setClaimingStartTime(uint256 _startTime) external onlyAdminOrOwner {
claimingStartTime = _startTime;
}
function updatePriceSteps(PriceStep[] memory _newPriceSteps) external onlyAdminOrOwner {
delete priceSteps;
for (uint i = 0; i < _newPriceSteps.length; i++) {
priceSteps.push(_newPriceSteps[i]);
}
}
function updateSinglePriceStep(uint256 _index, PriceStep memory _newStep) external onlyAdminOrOwner {
require(_index < priceSteps.length, "Index out o...
// [truncated — 54744 bytes total]
Read Contract
ADMIN_ROLE 0x75b238fc → bytes32
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
MAX_SUPPLY 0x32cb6b0c → uint256
claimingOn 0x2959258f → bool
claimingStartTime 0x50480fd2 → uint256
extraToken1 0xd186baa0 → address
fundRecipient 0xd939c960 → address
getClaimableAmount 0xe12f3a61 → uint256
getCurrentPrice 0xeb91d37e → uint256, uint256
getCurrentPriceStep 0x35a9e7d6 → tuple
getPriceSteps 0x09b6c9ba → tuple[]
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
owner 0x8da5cb5b → address
phasePurchases 0x44dab4c4 → uint256
phaseTotalSold 0xe3c1d5be → uint256
presaleOn 0x1ad874b4 → bool
priceSteps 0x1011589f → uint256, uint256, uint256, uint256, uint256, uint256
purchases 0x842a77d3 → uint256
supportsInterface 0x01ffc9a7 → bool
tokenBeingSold 0xaba668c5 → address
totalSold 0x9106d7ba → uint256
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
claimTokens 0x48c54b9d
No parameters
grantRole 0x2f2ff15d
bytes32 role
address account
purchase 0x72009407
uint256 _quantity
uint8 _tokenChoice
renounceOwnership 0x715018a6
No parameters
renounceRole 0x36568abe
bytes32 role
address callerConfirmation
revokeRole 0xd547741f
bytes32 role
address account
setClaimingStartTime 0x0e760a81
uint256 _startTime
setClaimingState 0x9c007c75
bool _state
setFundRecipient 0xbfb62028
address _newRecipient
setMaxSupply 0x6f8b44b0
uint256 _maxSupply
setPresaleState 0xbce4d6ae
bool _state
setTokenAddresses 0xa89c8c5e
address _tokenBeingSold
address _extraToken1
transferOwnership 0xf2fde38b
address newOwner
updatePriceSteps 0x6e42a51f
tuple[] _newPriceSteps
updateSinglePriceStep 0xb6f11aae
uint256 _index
tuple _newStep
withdrawCustomToken 0x5ac3cb3d
address _token
withdrawExtraToken 0x428a6455
No parameters
withdrawNativeToken 0x5a18664c
No parameters
Recent Transactions
No transactions found for this address