Address Contract Verified
Address
0xF156FE9193D12EDD2C3D67f172CEa554a4B64981
Balance
0 ETH
Nonce
1
Code Size
9870 bytes
Creator
0x10F1Bc04...a089 at tx 0x0a961d26...2f2d47
Indexed Transactions
0
Contract Bytecode
9870 bytes
0x6080604052600436106101d6575f3560e01c806367c7ad8011610101578063bed784e411610094578063e03a2eb211610063578063e03a2eb214610644578063e538b3401461066c578063e5516dbf14610688578063f2fde38b146106b0576101d6565b8063bed784e414610586578063bfd85f67146105b0578063d0a40609146105f2578063d4b885ae1461061c576101d6565b80637b496f4c116100d05780637b496f4c146104e05780638da5cb5b1461050a578063938db1c614610534578063b941d3e01461055c576101d6565b806367c7ad80146104525780636fd8856d1461047a578063715018a6146104a25780637493ef2d146104b8576101d6565b806337e595701161017957806355b986d91161014857806355b986d9146103b057806359bdde53146103d857806363aaa282146104025780636516a6b61461042a576101d6565b806337e59570146102e65780633cef0c6a1461030e578063469e90671461033657806352024b8614610374576101d6565b80630ae0a7ef116101b55780630ae0a7ef146102545780631131b5331461027e5780631c171005146102a65780632f516e31146102bc576101d6565b80620aa953146101da578063037c99b01461020257806305ea3ed51461022a575b5f5ffd5b3480156101e5575f5ffd5b5061020060048036038101906101fb91906118e2565b6106d8565b005b34801561020d575f5ffd5b5061022860048036038101906102239190611920565b61070f565b005b348015610235575f5ffd5b5061023e610731565b60405161024b919061199d565b60405180910390f35b34801561025f575f5ffd5b50610268610756565b60405161027591906119c5565b60405180910390f35b348015610289575f5ffd5b506102a4600480360381019061029f9190611920565b61075c565b005b3480156102b1575f5ffd5b506102ba610781565b005b3480156102c7575f5ffd5b506102d06107b5565b6040516102dd91906119c5565b60405180910390f35b3480156102f1575f5ffd5b5061030c60048036038101906103079190611920565b6107bb565b005b348015610319575f5ffd5b50610334600480360381019061032f91906119de565b610837565b005b348015610341575f5ffd5b5061035c60048036038101906103579190611a44565b610849565b60405161036b93929190611a7e565b60405180910390f35b34801561037f575f5ffd5b5061039a600480360381019061039591906119de565b61088e565b6040516103a791906119c5565b60405180910390f35b3480156103bb575f5ffd5b506103d660048036038101906103d19190611920565b6108a3565b005b3480156103e3575f5ffd5b506103ec6108c8565b6040516103f991906119c5565b60405180910390f35b34801561040d575f5ffd5b5061042860048036038101906104239190611bf0565b6108ce565b005b348015610435575f5ffd5b50610450600480360381019061044b9190611c59565b610948565b005b34801561045d575f5ffd5b5061047860048036038101906104739190611c84565b610993565b005b348015610485575f5ffd5b506104a0600480360381019061049b9190611920565b6109e3565b005b3480156104ad575f5ffd5b506104b6610a07565b005b3480156104c3575f5ffd5b506104de60048036038101906104d99190611a44565b610a1a565b005b3480156104eb575f5ffd5b506104f4610a65565b604051610501919061199d565b60405180910390f35b348015610515575f5ffd5b5061051e610a8a565b60405161052b9190611cc2565b60405180910390f35b34801561053f575f5ffd5b5061055a60048036038101906105559190611c59565b610ab1565b005b348015610567575f5ffd5b50610570610afc565b60405161057d919061199d565b60405180910390f35b348015610591575f5ffd5b5061059a610b21565b6040516105a79190611d36565b60405180910390f35b3480156105bb575f5ffd5b506105d660048036038101906105d191906119de565b610b46565b6040516105e99796959493929190611d5e565b60405180910390f35b3480156105fd575f5ffd5b50610606610b90565b6040516106139190611dcb565b60405180910390f35b348015610627575f5ffd5b50610642600480360381019061063d9190611a44565b610ba3565b005b34801561064f575f5ffd5b5061066a600480360381019061066591906119de565b610bee565b005b61068660048036038101906106819190611de4565b610c00565b005b348015610693575f5ffd5b506106ae60048036038101906106a99190611fbc565b611500565b005b3480156106bb575f5ffd5b506106d660048036038101906106d19190611a44565b611629565b005b6106e06116ad565b80600b5f8481526020019081526020015f206006015f6101000a81548160ff0219169083151502179055505050565b6107176116ad565b80600a5f8481526020019081526020015f20819055505050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b6107646116ad565b80600b5f8481526020019081526020015f20600401819055505050565b6107896116ad565b600860149054906101000a900460ff1615600860146101000a81548160ff021916908315150217905550565b60045481565b6107c36116ad565b600b5f8381526020019081526020015f206002015481101561081a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108119061208c565b60405180910390fd5b80600b5f8481526020019081526020015f20600101819055505050565b61083f6116ad565b8060058190555050565b6009602052805f5260405f205f91509050805f015490806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154905083565b600a602052805f5260405f205f915090505481565b6108ab6116ad565b80600b5f8481526020019081526020015f20600501819055505050565b60035481565b6108d66116ad565b81600b5f8381526020019081526020015f205f820151815f01556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015f6101000a81548160ff0219169083151502179055509050505050565b6109506116ad565b8060075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61099b6116ad565b8173ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f193505050501580156109de573d5f5f3e3d5ffd5b505050565b6109eb6116ad565b80600b5f8481526020019081526020015f205f01819055505050565b610a0f6116ad565b610a185f611734565b565b610a226116ad565b8060065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ab96116ad565b8060085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b602052805f5260405f205f91509050805f015490806001015490806002015490806003015490806004015490806005015490806006015f9054906101000a900460ff16905087565b600860149054906101000a900460ff1681565b610bab6116ad565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610bf66116ad565b8060048190555050565b610c086117f5565b5f600b5f8581526020019081526020015f206040518060e00160405290815f82015481526020016001820154815260200160028201548152602001600382015481526020016004820154815260200160058201548152602001600682015f9054906101000a900460ff16151515158152505090505f3490505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610cf857505f60095f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f0154115b610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e906120f4565b60405180910390fd5b5f825f015111610d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d739061215c565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610e4257505f73ffffffffffffffffffffffffffffffffffffffff1660095f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610ec6578260095f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600860149054906101000a900460ff1615610f16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0d906121ea565b60405180910390fd5b8382604001518360200151610f2b9190612235565b11610f6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f62906122b2565b60405180910390fd5b428260800151108015610f815750428260a00151115b610fc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb790612340565b60405180910390fd5b5f825f015185610fd0919061235e565b90505f600a5f8781526020019081526020015f20541115611031575f612710600a5f8881526020019081526020015f20548361100c919061235e565b61101691906123cc565b90505f81111561102f57808261102c9190612235565b91505b505b8260c0015115611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90612446565b60405180910390fd5b818111156110b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b0906124ae565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff1660095f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611249575f6127106004548461115d919061235e565b61116791906123cc565b905060095f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f1935050505015801561120b573d5f5f3e3d5ffd5b507f1b59e49fa7832f1f29cfd6411da39fa555c617d0112c3de9aad2677226a5ff3a33868360405161123f939291906124cc565b60405180910390a1505b5f60055411156112d35760065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6127106005548561129f919061235e565b6112a991906123cc565b90811502906040515f60405180830381858888f193505050501580156112d1573d5f5f3e3d5ffd5b505b5f6112e860024761184490919063ffffffff16565b90505f8111156113bd5760075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015611356573d5f5f3e3d5ffd5b5060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f193505050501580156113bb573d5f5f3e3d5ffd5b505b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933886040518363ffffffff1660e01b8152600401611419929190612501565b5f604051808303815f87803b158015611430575f5ffd5b505af1158015611442573d5f5f3e3d5ffd5b505050508560095f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f015f8282546114949190612528565b9250508190555081600b5f8981526020019081526020015f206003015f8282546114be9190612528565b9250508190555085600b5f8981526020019081526020015f206002015f8282546114e89190612528565b92505081905550505050506114fb611859565b505050565b6115086116ad565b805182511461154c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611543906125a5565b60405180910390fd5b5f5f90505b82518110156116245760025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f198483815181106115aa576115a96125c3565b5b60200260200101518484815181106115c5576115c46125c3565b5b60200260200101516040518363ffffffff1660e01b81526004016115ea929190612501565b5f604051808303815f87803b158015611601575f5ffd5b505af1158015611613573d5f5f3e3d5ffd5b505050508080600101915050611551565b505050565b6116316116ad565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116a1575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016116989190611cc2565b60405180910390fd5b6116aa81611734565b50565b6116b5611862565b73ffffffffffffffffffffffffffffffffffffffff166116d3610a8a565b73ffffffffffffffffffffffffffffffffffffffff1614611732576116f6611862565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016117299190611cc2565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60026001540361183a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118319061263a565b60405180910390fd5b6002600181905550565b5f818361185191906123cc565b905092915050565b60018081905550565b5f33905090565b5f604051905090565b5f5ffd5b5f5ffd5b5f819050919050565b61188c8161187a565b8114611896575f5ffd5b50565b5f813590506118a781611883565b92915050565b5f8115159050919050565b6118c1816118ad565b81146118cb575f5ffd5b50565b5f813590506118dc816118b8565b92915050565b5f5f604083850312156118f8576118f7611872565b5b5f61190585828601611899565b9250506020611916858286016118ce565b9150509250929050565b5f5f6040838503121561193657611935611872565b5b5f61194385828601611899565b925050602061195485828601611899565b9150509250929050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6119878261195e565b9050919050565b6119978161197d565b82525050565b5f6020820190506119b05f83018461198e565b92915050565b6119bf8161187a565b82525050565b5f6020820190506119d85f8301846119b6565b92915050565b5f602082840312156119f3576119f2611872565b5b5f611a0084828501611899565b91505092915050565b5f611a138261195e565b9050919050565b611a2381611a09565b8114611a2d575f5ffd5b50565b5f81359050611a3e81611a1a565b92915050565b5f60208284031215611a5957611a58611872565b5b5f611a6684828501611a30565b91505092915050565b611a7881611a09565b82525050565b5f606082019050611a915f8301866119b6565b611a9e6020830185611a6f565b611aab60408301846119b6565b949350505050565b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611afd82611ab7565b810181811067ffffffffffffffff82111715611b1c57611b1b611ac7565b5b80604052505050565b5f611b2e611869565b9050611b3a8282611af4565b919050565b5f60e08284031215611b5457611b53611ab3565b5b611b5e60e0611b25565b90505f611b6d84828501611899565b5f830152506020611b8084828501611899565b6020830152506040611b9484828501611899565b6040830152506060611ba884828501611899565b6060830152506080611bbc84828501611899565b60808301525060a0611bd084828501611899565b60a08301525060c0611be4848285016118ce565b60c08301525092915050565b5f5f6101008385031215611c0757611c06611872565b5b5f611c1485828601611b3f565b92505060e0611c2585828601611899565b9150509250929050565b611c388161197d565b8114611c42575f5ffd5b50565b5f81359050611c5381611c2f565b92915050565b5f60208284031215611c6e57611c6d611872565b5b5f611c7b84828501611c45565b91505092915050565b5f5f60408385031215611c9a57611c99611872565b5b5f611ca785828601611c45565b9250506020611cb885828601611899565b9150509250929050565b5f602082019050611cd55f830184611a6f565b92915050565b5f819050919050565b5f611cfe611cf9611cf48461195e565b611cdb565b61195e565b9050919050565b5f611d0f82611ce4565b9050919050565b5f611d2082611d05565b9050919050565b611d3081611d16565b82525050565b5f602082019050611d495f830184611d27565b92915050565b611d58816118ad565b82525050565b5f60e082019050611d715f83018a6119b6565b611d7e60208301896119b6565b611d8b60408301886119b6565b611d9860608301876119b6565b611da560808301866119b6565b611db260a08301856119b6565b611dbf60c0830184611d4f565b98975050505050505050565b5f602082019050611dde5f830184611d4f565b92915050565b5f5f5f60608486031215611dfb57611dfa611872565b5b5f611e0886828701611899565b9350506020611e1986828701611899565b9250506040611e2a86828701611a30565b9150509250925092565b5f5ffd5b5f67ffffffffffffffff821115611e5257611e51611ac7565b5b602082029050602081019050919050565b5f5ffd5b5f611e79611e7484611e38565b611b25565b90508083825260208201905060208402830185811115611e9c57611e9b611e63565b5b835b81811015611ec55780611eb18882611a30565b845260208401935050602081019050611e9e565b5050509392505050565b5f82601f830112611ee357611ee2611e34565b5b8135611ef3848260208601611e67565b91505092915050565b5f67ffffffffffffffff821115611f1657611f15611ac7565b5b602082029050602081019050919050565b5f611f39611f3484611efc565b611b25565b90508083825260208201905060208402830185811115611f5c57611f5b611e63565b5b835b81811015611f855780611f718882611899565b845260208401935050602081019050611f5e565b5050509392505050565b5f82601f830112611fa357611fa2611e34565b5b8135611fb3848260208601611f27565b91505092915050565b5f5f60408385031215611fd257611fd1611872565b5b5f83013567ffffffffffffffff811115611fef57611fee611876565b5b611ffb85828601611ecf565b925050602083013567ffffffffffffffff81111561201c5761201b611876565b5b61202885828601611f8f565b9150509250929050565b5f82825260208201905092915050565b7f4e657720746f74616c206c657373207468616e20616c726561647920736f6c645f82015250565b5f612076602083612032565b915061208182612042565b602082019050919050565b5f6020820190508181035f8301526120a38161206a565b9050919050565b7f496e76616c696420726566657272616c000000000000000000000000000000005f82015250565b5f6120de601083612032565b91506120e9826120aa565b602082019050919050565b5f6020820190508181035f83015261210b816120d2565b9050919050565b7f507269636520646f6573206e6f742065786973740000000000000000000000005f82015250565b5f612146601483612032565b915061215182612112565b602082019050919050565b5f6020820190508181035f8301526121738161213a565b9050919050565b7f43757272656e746c792073656c6c696e6720686173206265656e2073746f70655f8201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b5f6121d4602183612032565b91506121df8261217a565b604082019050919050565b5f6020820190508181035f830152612201816121c8565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61223f8261187a565b915061224a8361187a565b925082820390508181111561226257612261612208565b5b92915050565b7f496e76616c6964207175616e74697479000000000000000000000000000000005f82015250565b5f61229c601083612032565b91506122a782612268565b602082019050919050565b5f6020820190508181035f8301526122c981612290565b9050919050565b7f456974686572207374617274206f7220656e642074696d6520646f6573206e6f5f8201527f74206d61746368206f7572206461746100000000000000000000000000000000602082015250565b5f61232a603083612032565b9150612335826122d0565b604082019050919050565b5f6020820190508181035f8301526123578161231e565b9050919050565b5f6123688261187a565b91506123738361187a565b92508282026123818161187a565b9150828204841483151761239857612397612208565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6123d68261187a565b91506123e18361187a565b9250826123f1576123f061239f565b5b828204905092915050565b7f50686173652069732064656163746976617465640000000000000000000000005f82015250565b5f612430601483612032565b915061243b826123fc565b602082019050919050565b5f6020820190508181035f83015261245d81612424565b9050919050565b7f496e76616c696420616d6f756e7420666f7220627579696e67000000000000005f82015250565b5f612498601983612032565b91506124a382612464565b602082019050919050565b5f6020820190508181035f8301526124c58161248c565b9050919050565b5f6060820190506124df5f830186611a6f565b6124ec6020830185611a6f565b6124f960408301846119b6565b949350505050565b5f6040820190506125145f830185611a6f565b61252160208301846119b6565b9392505050565b5f6125328261187a565b915061253d8361187a565b925082820190508082111561255557612554612208565b5b92915050565b7f496e76616c696420617267756d656e74000000000000000000000000000000005f82015250565b5f61258f601083612032565b915061259a8261255b565b602082019050919050565b5f6020820190508181035f8301526125bc81612583565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c005f82015250565b5f612624601f83612032565b915061262f826125f0565b602082019050919050565b5f6020820190508181035f83015261265181612618565b905091905056fea26469706673582212202c7c600ad848239e356f77ab88957eee955579981a00befedcf2180530bf27dd64736f6c634300081e0033
Verified Source Code Full Match
Compiler: v0.8.30+commit.73712a01
EVM: cancun
Optimization: No
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* 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);
}
}
ReentrancyGuard.sol 77 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
SafeMath.sol 215 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
}
buyingNFT.sol 209 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
abstract contract MiningLicenseNFT {
function mint(address user, uint256 quantity) public virtual;
}
contract BuyingLicense is Ownable, ReentrancyGuard {
MiningLicenseNFT public fetcher;
uint256 public totalNumberOfPhases;
uint256 public referralPr = 1000;
uint256 public debPr = 500;
address payable public reciverAdr;
address payable public pool1;
address payable public pool2;
bool public isSaleStop;
using SafeMath for uint256;
struct phase {
uint256 price;
uint256 totalLicense;
uint256 quantitySale;
uint256 totalBuy;
uint256 startTime;
uint256 endTime;
bool isDeactivate;
}
struct buyerRecord {
uint amount;
address referral;
uint claimAmount;
}
event referralIncome(address buyer ,address referral ,uint256 amount);
mapping ( address /*address of the user */ => buyerRecord) public records;
mapping (uint256 => uint256)public bonusRewards;
mapping(uint256 => phase) public perPhase;
constructor() Ownable(msg.sender) {
uint256 _price = 0.1 ether;
for(uint i = 0 ; i < 20 ; i++){
perPhase[i].endTime = block.timestamp + (((i+1) * 90) * 1 days);
perPhase[i].price = _price;
perPhase[i].totalLicense = 5000;
_price += (_price * 5)/100;
}
for (uint z = 5; z < 10; z++) {
bonusRewards[z] = 500;
}
}
function buyLicense(uint256 phaseValue, uint256 quantity, address referral) public payable nonReentrant {
phase memory value = perPhase[phaseValue];
uint256 sendAmount = msg.value;
require(referral == address(0) || records[referral].amount > 0,"Invalid referral");
require(value.price > 0,"Price does not exist");
if (referral != address(0) && records[msg.sender].referral == address(0)){
records[msg.sender].referral = referral;
}
require(!isSaleStop, "Currently selling has been stoped");
require(
(value.totalLicense - value.quantitySale) > quantity,
"Invalid quantity"
);
require(
value.startTime < block.timestamp &&
value.endTime > block.timestamp,
"Either start or end time does not match our data"
);
uint256 totalAmount = quantity * value.price;
if (bonusRewards[quantity] > 0) {
uint bonus = (totalAmount * bonusRewards[quantity])/10000;
if (bonus > 0){
totalAmount -= bonus;
}
}
require(!value.isDeactivate, "Phase is deactivated");
require(totalAmount <= sendAmount, "Invalid amount for buying");
if (records[msg.sender].referral != address(0)){
uint256 amount = (sendAmount * referralPr)/10000;
payable(records[msg.sender].referral).transfer(amount);
emit referralIncome(msg.sender, referral, amount);
}
if (debPr > 0 ) reciverAdr.transfer((sendAmount * debPr)/10000);
uint256 balance = (address(this).balance).div(2);
if (balance > 0){
pool1.transfer(balance);
pool2.transfer(balance);
}
fetcher.mint(msg.sender, quantity);
records[msg.sender].amount += quantity;
perPhase[phaseValue].totalBuy += totalAmount;
perPhase[phaseValue].quantitySale += quantity;
}
function whiteListUser(address[] memory users, uint256[] memory quantity)
external
onlyOwner
{
require(users.length == quantity.length, "Invalid argument");
for (uint256 i = 0; i < users.length; ) {
fetcher.mint(users[i], quantity[i]);
unchecked {
i++;
}
}
}
function setMiningLicenseAdr(address adr) public onlyOwner {
fetcher = MiningLicenseNFT(adr);
}
function setPhase(phase memory value, uint256 index) public onlyOwner {
perPhase[index] = value;
}
function setPhasePrice(uint256 phaseIndex, uint256 newPrice)
external
onlyOwner
{
perPhase[phaseIndex].price = newPrice;
}
function setPhaseTotalLicense(uint256 phaseIndex, uint256 newTotalLicense)
external
onlyOwner
{
require(
newTotalLicense >= perPhase[phaseIndex].quantitySale,
"New total less than already sold"
);
perPhase[phaseIndex].totalLicense = newTotalLicense;
}
function setPhaseStartTime(uint256 phaseIndex, uint256 newStartTime)
external
onlyOwner
{
perPhase[phaseIndex].startTime = newStartTime;
}
function setPhaseEndTime(uint256 phaseIndex, uint256 newEndTime)
external
onlyOwner
{
perPhase[phaseIndex].endTime = newEndTime;
}
function setPhaseIsDeactivate(uint256 phaseIndex, bool deactivate)
external
onlyOwner
{
perPhase[phaseIndex].isDeactivate = deactivate;
}
function withdrawalFund(address payable receiver, uint256 amount)
public
onlyOwner
{
receiver.transfer(amount);
}
function setReferralPr(uint256 newPr) external onlyOwner {
referralPr = newPr;
}
function setDebtPr(uint256 newPr) external onlyOwner {
debPr = newPr;
}
function setReciverAdr(address adr) public onlyOwner{
reciverAdr = payable(adr);
}
function setBonus(uint256 key,uint256 value)public onlyOwner {
bonusRewards[key] = value;
}
function setPool1sAdr(address payable pool_)public onlyOwner {
pool1 = pool_;
}
function setPool2Adr(address payable pool_)public onlyOwner {
pool2 = pool_;
}
function setSaleStop() public onlyOwner {
isSaleStop = !isSaleStop;
}
}
Read Contract
bonusRewards 0x52024b86 → uint256
debPr 0x0ae0a7ef → uint256
fetcher 0xbed784e4 → address
isSaleStop 0xd0a40609 → bool
owner 0x8da5cb5b → address
perPhase 0xbfd85f67 → uint256, uint256, uint256, uint256, uint256, uint256, bool
pool1 0x05ea3ed5 → address
pool2 0xb941d3e0 → address
reciverAdr 0x7b496f4c → address
records 0x469e9067 → uint256, address, uint256
referralPr 0x2f516e31 → uint256
totalNumberOfPhases 0x59bdde53 → uint256
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
buyLicense 0xe538b340
uint256 phaseValue
uint256 quantity
address referral
renounceOwnership 0x715018a6
No parameters
setBonus 0x037c99b0
uint256 key
uint256 value
setDebtPr 0x3cef0c6a
uint256 newPr
setMiningLicenseAdr 0xd4b885ae
address adr
setPhase 0xf8755d1a
tuple value
uint256 index
setPhaseEndTime 0x55b986d9
uint256 phaseIndex
uint256 newEndTime
setPhaseIsDeactivate 0x000aa953
uint256 phaseIndex
bool deactivate
setPhasePrice 0x6fd8856d
uint256 phaseIndex
uint256 newPrice
setPhaseStartTime 0x1131b533
uint256 phaseIndex
uint256 newStartTime
setPhaseTotalLicense 0x37e59570
uint256 phaseIndex
uint256 newTotalLicense
setPool1sAdr 0x6516a6b6
address pool_
setPool2Adr 0x938db1c6
address pool_
setReciverAdr 0x7493ef2d
address adr
setReferralPr 0xe03a2eb2
uint256 newPr
setSaleStop 0x1c171005
No parameters
transferOwnership 0xf2fde38b
address newOwner
whiteListUser 0xe5516dbf
address[] users
uint256[] quantity
withdrawalFund 0x67c7ad80
address receiver
uint256 amount
Recent Transactions
No transactions found for this address