Address Contract Partially Verified
Address
0xce85c91dE3386c3B16239B8638007eaBEb82C187
Balance
0 ETH
Nonce
1
Code Size
21203 bytes
Creator
0x269C6Ba1...c659 at tx 0xfd8b0be5...7e584f
Indexed Transactions
0
Contract Bytecode
21203 bytes
0x608060405234801561001057600080fd5b506004361061027f5760003560e01c80636c0360eb1161015c578063b88d4fde116100ce578063dacee34711610087578063dacee3471461074a578063daf9c21014610768578063e136f65f14610798578063e30c3978146107b6578063e985e9c5146107d4578063f2fde38b146108045761027f565b8063b88d4fde1461068a578063bedb86fb146106a6578063c6682862146106c2578063c87b56dd146106e0578063d5abeb0114610710578063da3ef23f1461072e5761027f565b80637f6e36d4116101205780637f6e36d4146105ca57806389476069146105e65780638da5cb5b146106025780639253ed041461062057806395d89b4114610650578063a22cb4651461066e5761027f565b80636c0360eb1461054c57806370a082311461056a578063715018a61461059a57806379ba5097146105a45780637f00c7a6146105ae5761027f565b80633410fc44116101f557806342842e0e116101b957806342842e0e1461047a5780634782e407146104965780634f6ccce7146104b257806355f804b3146104e25780635c975abb146104fe5780636352211e1461051c5761027f565b80633410fc44146103fe57806339a7919f1461041a5780633ccfd60b146104365780633e413bee1461044057806340c10f191461045e5761027f565b806318160ddd1161024757806318160ddd1461033c5780631ff415d91461035a578063239c70ae1461037657806323b872dd146103945780632f48ab7d146103b05780632f745c59146103ce5761027f565b806301ffc9a71461028457806306661abd146102b457806306fdde03146102d2578063081812fc146102f0578063095ea7b314610320575b600080fd5b61029e6004803603810190610299919061399c565b610820565b6040516102ab91906139e4565b60405180910390f35b6102bc61089a565b6040516102c99190613a18565b60405180910390f35b6102da6108ab565b6040516102e79190613acc565b60405180910390f35b61030a60048036038101906103059190613b1a565b61093d565b6040516103179190613b88565b60405180910390f35b61033a60048036038101906103359190613bcf565b610983565b005b610344610a9a565b6040516103519190613a18565b60405180910390f35b610374600480360381019061036f9190613c4d565b610aa7565b005b61037e610c4c565b60405161038b9190613a18565b60405180910390f35b6103ae60048036038101906103a99190613c7a565b610c52565b005b6103b8610cb2565b6040516103c59190613d2c565b60405180910390f35b6103e860048036038101906103e39190613bcf565b610cd8565b6040516103f59190613a18565b60405180910390f35b61041860048036038101906104139190613b1a565b610d7d565b005b610434600480360381019061042f9190613b1a565b610d8f565b005b61043e610da1565b005b610448610e29565b6040516104559190613d2c565b60405180910390f35b61047860048036038101906104739190613d47565b610e4f565b005b610494600480360381019061048f9190613c7a565b61133a565b005b6104b060048036038101906104ab9190613c4d565b61135a565b005b6104cc60048036038101906104c79190613b1a565b6114ff565b6040516104d99190613a18565b60405180910390f35b6104fc60048036038101906104f79190613ebc565b611570565b005b610506611592565b60405161051391906139e4565b60405180910390f35b61053660048036038101906105319190613b1a565b6115a5565b6040516105439190613b88565b60405180910390f35b61055461162b565b6040516105619190613acc565b60405180910390f35b610584600480360381019061057f9190613f05565b6116b9565b6040516105919190613a18565b60405180910390f35b6105a2611770565b005b6105ac611784565b005b6105c860048036038101906105c39190613b1a565b611811565b005b6105e460048036038101906105df9190613b1a565b611823565b005b61060060048036038101906105fb9190613c4d565b611835565b005b61060a61196e565b6040516106179190613b88565b60405180910390f35b61063a60048036038101906106359190613f05565b611998565b6040516106479190613ff0565b60405180910390f35b610658611a46565b6040516106659190613acc565b60405180910390f35b6106886004803603810190610683919061403e565b611ad8565b005b6106a4600480360381019061069f919061411f565b611aee565b005b6106c060048036038101906106bb91906141a2565b611b50565b005b6106ca611b75565b6040516106d79190613acc565b60405180910390f35b6106fa60048036038101906106f59190613b1a565b611c03565b6040516107079190613acc565b60405180910390f35b610718611cad565b6040516107259190613a18565b60405180910390f35b61074860048036038101906107439190613ebc565b611cb3565b005b610752611cd5565b60405161075f9190613a18565b60405180910390f35b610782600480360381019061077d9190613c4d565b611cdb565b60405161078f91906139e4565b60405180910390f35b6107a0611cfb565b6040516107ad9190613a18565b60405180910390f35b6107be611d01565b6040516107cb9190613b88565b60405180910390f35b6107ee60048036038101906107e991906141cf565b611d2b565b6040516107fb91906139e4565b60405180910390f35b61081e60048036038101906108199190613f05565b611dbf565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610893575061089282611f32565b5b9050919050565b60006108a6600d612014565b905090565b6060600080546108ba9061423e565b80601f01602080910402602001604051908101604052809291908181526020018280546108e69061423e565b80156109335780601f1061090857610100808354040283529160200191610933565b820191906000526020600020905b81548152906001019060200180831161091657829003601f168201915b5050505050905090565b600061094882612022565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061098e826115a5565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036109fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f5906142e1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610a1d61206d565b73ffffffffffffffffffffffffffffffffffffffff161480610a4c5750610a4b81610a4661206d565b611d2b565b5b610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290614373565b60405180910390fd5b610a958383612075565b505050565b6000600880549050905090565b610aaf61212e565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610b36576040517f9957f83800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060106000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60165481565b610c63610c5d61206d565b826121ac565b610ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9990614405565b60405180910390fd5b610cad838383612241565b505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610ce3836116b9565b8210610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b90614497565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610d8561212e565b8060148190555050565b610d9761212e565b8060158190555050565b610da961212e565b6000610db361196e565b73ffffffffffffffffffffffffffffffffffffffff1647604051610dd6906144e8565b60006040518083038185875af1925050503d8060008114610e13576040519150601f19603f3d011682016040523d82523d6000602084013e610e18565b606091505b5050905080610e2657600080fd5b50565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e5761253a565b601760009054906101000a900460ff1615610e9e576040517f58fc318200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610f47576040517f9957f83800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60011515601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610fd1576040517fa0f3feea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601654811180610fe15750600081145b15611018576040517ffae9feb900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60165481611025336116b9565b61102f919061452c565b1115611067576040517ffae9feb900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611071610a9a565b90506015548282611082919061452c565b106110b9576040517fc30436e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600190505b8281116110f9576110dc3382846110d7919061452c565b612589565b6110e6600d6125a7565b80806110f190614582565b9150506110c0565b5061110261196e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132d57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112305760008260145461119991906145ca565b90506111ea333083600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125bd909392919063ffffffff16565b803373ffffffffffffffffffffffffffffffffffffffff167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe60405160405180910390a3505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361132c5760008260135461129591906145ca565b90506112e6333083600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166125bd909392919063ffffffff16565b803373ffffffffffffffffffffffffffffffffffffffff167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe60405160405180910390a3505b5b50611336612646565b5050565b61135583838360405180602001604052806000815250611aee565b505050565b61136261212e565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036113e9576040517f9957f83800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060106000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000611509610a9a565b821061154a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154190614696565b60405180910390fd5b6008828154811061155e5761155d6146b6565b5b90600052602060002001549050919050565b61157861212e565b806011908051906020019061158e92919061388d565b5050565b601760009054906101000a900460ff1681565b6000806115b183612650565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161990614731565b60405180910390fd5b80915050919050565b601180546116389061423e565b80601f01602080910402602001604051908101604052809291908181526020018280546116649061423e565b80156116b15780601f10611686576101008083540402835291602001916116b1565b820191906000526020600020905b81548152906001019060200180831161169457829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611729576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611720906147c3565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61177861212e565b611782600061268d565b565b600061178e61206d565b90508073ffffffffffffffffffffffffffffffffffffffff166117af611d01565b73ffffffffffffffffffffffffffffffffffffffff1614611805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117fc90614855565b60405180910390fd5b61180e8161268d565b50565b61181961212e565b8060168190555050565b61182b61212e565b8060138190555050565b61183d61212e565b60011515601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146118c7576040517fa0f3feea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61196b338273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016119049190613b88565b602060405180830381865afa158015611921573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611945919061488a565b8373ffffffffffffffffffffffffffffffffffffffff166126be9092919063ffffffff16565b50565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060006119a5836116b9565b905060008167ffffffffffffffff8111156119c3576119c2613d91565b5b6040519080825280602002602001820160405280156119f15781602001602082028036833780820191505090505b50905060005b82811015611a3b57611a098582610cd8565b828281518110611a1c57611a1b6146b6565b5b6020026020010181815250508080611a3390614582565b9150506119f7565b508092505050919050565b606060018054611a559061423e565b80601f0160208091040260200160405190810160405280929190818152602001828054611a819061423e565b8015611ace5780601f10611aa357610100808354040283529160200191611ace565b820191906000526020600020905b815481529060010190602001808311611ab157829003601f168201915b5050505050905090565b611aea611ae361206d565b8383612744565b5050565b611aff611af961206d565b836121ac565b611b3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3590614405565b60405180910390fd5b611b4a848484846128b0565b50505050565b611b5861212e565b80601760006101000a81548160ff02191690831515021790555050565b60128054611b829061423e565b80601f0160208091040260200160405190810160405280929190818152602001828054611bae9061423e565b8015611bfb5780601f10611bd057610100808354040283529160200191611bfb565b820191906000526020600020905b815481529060010190602001808311611bde57829003601f168201915b505050505081565b6060611c0e8261290c565b611c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4490614929565b60405180910390fd5b6000611c5761294d565b90506000815111611c775760405180602001604052806000815250611ca5565b80611c81846129df565b6012604051602001611c9593929190614a19565b6040516020818303038152906040525b915050919050565b60155481565b611cbb61212e565b8060129080519060200190611cd192919061388d565b5050565b60135481565b60106020528060005260406000206000915054906101000a900460ff1681565b60145481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611dc761212e565b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16611e2761196e565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611ffd57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061200d575061200c82612aad565b5b9050919050565b600081600001549050919050565b61202b8161290c565b61206a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206190614731565b60405180910390fd5b50565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166120e8836115a5565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61213661206d565b73ffffffffffffffffffffffffffffffffffffffff1661215461196e565b73ffffffffffffffffffffffffffffffffffffffff16146121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a190614a96565b60405180910390fd5b565b6000806121b8836115a5565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806121fa57506121f98185611d2b565b5b8061223857508373ffffffffffffffffffffffffffffffffffffffff166122208461093d565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612261826115a5565b73ffffffffffffffffffffffffffffffffffffffff16146122b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ae90614b28565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231d90614bba565b60405180910390fd5b6123338383836001612b17565b8273ffffffffffffffffffffffffffffffffffffffff16612353826115a5565b73ffffffffffffffffffffffffffffffffffffffff16146123a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a090614b28565b60405180910390fd5b6004600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46125358383836001612c75565b505050565b6002600c540361257f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257690614c26565b60405180910390fd5b6002600c81905550565b6125a3828260405180602001604052806000815250612c7b565b5050565b6001816000016000828254019250508190555050565b612640846323b872dd60e01b8585856040516024016125de93929190614c46565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612cd6565b50505050565b6001600c81905550565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600b60006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556126bb81611e6c565b50565b61273f8363a9059cbb60e01b84846040516024016126dd929190614c7d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612cd6565b505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036127b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a990614cf2565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516128a391906139e4565b60405180910390a3505050565b6128bb848484612241565b6128c784848484612d9d565b612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90614d84565b60405180910390fd5b50505050565b60008073ffffffffffffffffffffffffffffffffffffffff1661292e83612650565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60606011805461295c9061423e565b80601f01602080910402602001604051908101604052809291908181526020018280546129889061423e565b80156129d55780601f106129aa576101008083540402835291602001916129d5565b820191906000526020600020905b8154815290600101906020018083116129b857829003601f168201915b5050505050905090565b6060600060016129ee84612f24565b01905060008167ffffffffffffffff811115612a0d57612a0c613d91565b5b6040519080825280601f01601f191660200182016040528015612a3f5781602001600182028036833780820191505090505b509050600082602001820190505b600115612aa2578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581612a9657612a95614da4565b5b04945060008503612a4d575b819350505050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612b2384848484613077565b6001811115612b67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5e90614e45565b60405180910390fd5b6000829050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603612bae57612ba98161319d565b612bed565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614612bec57612beb85826131e6565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603612c2f57612c2a81613353565b612c6e565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614612c6d57612c6c8482613424565b5b5b5050505050565b50505050565b612c8583836134a3565b612c926000848484612d9d565b612cd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cc890614d84565b60405180910390fd5b505050565b6000612d38826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166136c09092919063ffffffff16565b9050600081511115612d985780806020019051810190612d589190614e7a565b612d97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8e90614f19565b60405180910390fd5b5b505050565b6000612dbe8473ffffffffffffffffffffffffffffffffffffffff166136d8565b15612f17578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612de761206d565b8786866040518563ffffffff1660e01b8152600401612e099493929190614f8e565b6020604051808303816000875af1925050508015612e4557506040513d601f19601f82011682018060405250810190612e429190614fef565b60015b612ec7573d8060008114612e75576040519150601f19603f3d011682016040523d82523d6000602084013e612e7a565b606091505b506000815103612ebf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eb690614d84565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612f1c565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612f82577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612f7857612f77614da4565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612fbf576d04ee2d6d415b85acef81000000008381612fb557612fb4614da4565b5b0492506020810190505b662386f26fc100008310612fee57662386f26fc100008381612fe457612fe3614da4565b5b0492506010810190505b6305f5e1008310613017576305f5e100838161300d5761300c614da4565b5b0492506008810190505b612710831061303c57612710838161303257613031614da4565b5b0492506004810190505b6064831061305f576064838161305557613054614da4565b5b0492506002810190505b600a831061306e576001810190505b80915050919050565b600181111561319757600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461310b5780600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613103919061501c565b925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146131965780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461318e919061452c565b925050819055505b5b50505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600060016131f3846116b9565b6131fd919061501c565b90506000600760008481526020019081526020016000205490508181146132e2576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050613367919061501c565b9050600060096000848152602001908152602001600020549050600060088381548110613397576133966146b6565b5b9060005260206000200154905080600883815481106133b9576133b86146b6565b5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061340857613407615050565b5b6001900381819060005260206000200160009055905550505050565b600061342f836116b9565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613512576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613509906150cb565b60405180910390fd5b61351b8161290c565b1561355b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161355290615137565b60405180910390fd5b613569600083836001612b17565b6135728161290c565b156135b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135a990615137565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46136bc600083836001612c75565b5050565b60606136cf84846000856136fb565b90509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606082471015613740576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613737906151c9565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613769919061521a565b60006040518083038185875af1925050503d80600081146137a6576040519150601f19603f3d011682016040523d82523d6000602084013e6137ab565b606091505b50915091506137bc878383876137c8565b92505050949350505050565b6060831561382a576000835103613822576137e2856136d8565b613821576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016138189061527d565b60405180910390fd5b5b829050613835565b613834838361383d565b5b949350505050565b6000825111156138505781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016138849190613acc565b60405180910390fd5b8280546138999061423e565b90600052602060002090601f0160209004810192826138bb5760008555613902565b82601f106138d457805160ff1916838001178555613902565b82800160010185558215613902579182015b828111156139015782518255916020019190600101906138e6565b5b50905061390f9190613913565b5090565b5b8082111561392c576000816000905550600101613914565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61397981613944565b811461398457600080fd5b50565b60008135905061399681613970565b92915050565b6000602082840312156139b2576139b161393a565b5b60006139c084828501613987565b91505092915050565b60008115159050919050565b6139de816139c9565b82525050565b60006020820190506139f960008301846139d5565b92915050565b6000819050919050565b613a12816139ff565b82525050565b6000602082019050613a2d6000830184613a09565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613a6d578082015181840152602081019050613a52565b83811115613a7c576000848401525b50505050565b6000601f19601f8301169050919050565b6000613a9e82613a33565b613aa88185613a3e565b9350613ab8818560208601613a4f565b613ac181613a82565b840191505092915050565b60006020820190508181036000830152613ae68184613a93565b905092915050565b613af7816139ff565b8114613b0257600080fd5b50565b600081359050613b1481613aee565b92915050565b600060208284031215613b3057613b2f61393a565b5b6000613b3e84828501613b05565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613b7282613b47565b9050919050565b613b8281613b67565b82525050565b6000602082019050613b9d6000830184613b79565b92915050565b613bac81613b67565b8114613bb757600080fd5b50565b600081359050613bc981613ba3565b92915050565b60008060408385031215613be657613be561393a565b5b6000613bf485828601613bba565b9250506020613c0585828601613b05565b9150509250929050565b6000613c1a82613b67565b9050919050565b613c2a81613c0f565b8114613c3557600080fd5b50565b600081359050613c4781613c21565b92915050565b600060208284031215613c6357613c6261393a565b5b6000613c7184828501613c38565b91505092915050565b600080600060608486031215613c9357613c9261393a565b5b6000613ca186828701613bba565b9350506020613cb286828701613bba565b9250506040613cc386828701613b05565b9150509250925092565b6000819050919050565b6000613cf2613ced613ce884613b47565b613ccd565b613b47565b9050919050565b6000613d0482613cd7565b9050919050565b6000613d1682613cf9565b9050919050565b613d2681613d0b565b82525050565b6000602082019050613d416000830184613d1d565b92915050565b60008060408385031215613d5e57613d5d61393a565b5b6000613d6c85828601613c38565b9250506020613d7d85828601613b05565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613dc982613a82565b810181811067ffffffffffffffff82111715613de857613de7613d91565b5b80604052505050565b6000613dfb613930565b9050613e078282613dc0565b919050565b600067ffffffffffffffff821115613e2757613e26613d91565b5b613e3082613a82565b9050602081019050919050565b82818337600083830152505050565b6000613e5f613e5a84613e0c565b613df1565b905082815260208101848484011115613e7b57613e7a613d8c565b5b613e86848285613e3d565b509392505050565b600082601f830112613ea357613ea2613d87565b5b8135613eb3848260208601613e4c565b91505092915050565b600060208284031215613ed257613ed161393a565b5b600082013567ffffffffffffffff811115613ef057613eef61393f565b5b613efc84828501613e8e565b91505092915050565b600060208284031215613f1b57613f1a61393a565b5b6000613f2984828501613bba565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613f67816139ff565b82525050565b6000613f798383613f5e565b60208301905092915050565b6000602082019050919050565b6000613f9d82613f32565b613fa78185613f3d565b9350613fb283613f4e565b8060005b83811015613fe3578151613fca8882613f6d565b9750613fd583613f85565b925050600181019050613fb6565b5085935050505092915050565b6000602082019050818103600083015261400a8184613f92565b905092915050565b61401b816139c9565b811461402657600080fd5b50565b60008135905061403881614012565b92915050565b600080604083850312156140555761405461393a565b5b600061406385828601613bba565b925050602061407485828601614029565b9150509250929050565b600067ffffffffffffffff82111561409957614098613d91565b5b6140a282613a82565b9050602081019050919050565b60006140c26140bd8461407e565b613df1565b9050828152602081018484840111156140de576140dd613d8c565b5b6140e9848285613e3d565b509392505050565b600082601f83011261410657614105613d87565b5b81356141168482602086016140af565b91505092915050565b600080600080608085870312156141395761413861393a565b5b600061414787828801613bba565b945050602061415887828801613bba565b935050604061416987828801613b05565b925050606085013567ffffffffffffffff81111561418a5761418961393f565b5b614196878288016140f1565b91505092959194509250565b6000602082840312156141b8576141b761393a565b5b60006141c684828501614029565b91505092915050565b600080604083850312156141e6576141e561393a565b5b60006141f485828601613bba565b925050602061420585828601613bba565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061425657607f821691505b6020821081036142695761426861420f565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006142cb602183613a3e565b91506142d68261426f565b604082019050919050565b600060208201905081810360008301526142fa816142be565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b600061435d603d83613a3e565b915061436882614301565b604082019050919050565b6000602082019050818103600083015261438c81614350565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b60006143ef602d83613a3e565b91506143fa82614393565b604082019050919050565b6000602082019050818103600083015261441e816143e2565b9050919050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000614481602b83613a3e565b915061448c82614425565b604082019050919050565b600060208201905081810360008301526144b081614474565b9050919050565b600081905092915050565b50565b60006144d26000836144b7565b91506144dd826144c2565b600082019050919050565b60006144f3826144c5565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614537826139ff565b9150614542836139ff565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614577576145766144fd565b5b828201905092915050565b600061458d826139ff565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036145bf576145be6144fd565b5b600182019050919050565b60006145d5826139ff565b91506145e0836139ff565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614619576146186144fd565b5b828202905092915050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b6000614680602c83613a3e565b915061468b82614624565b604082019050919050565b600060208201905081810360008301526146af81614673565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b600061471b601883613a3e565b9150614726826146e5565b602082019050919050565b6000602082019050818103600083015261474a8161470e565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b60006147ad602983613a3e565b91506147b882614751565b604082019050919050565b600060208201905081810360008301526147dc816147a0565b9050919050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b600061483f602983613a3e565b915061484a826147e3565b604082019050919050565b6000602082019050818103600083015261486e81614832565b9050919050565b60008151905061488481613aee565b92915050565b6000602082840312156148a05761489f61393a565b5b60006148ae84828501614875565b91505092915050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b6000614913602f83613a3e565b915061491e826148b7565b604082019050919050565b6000602082019050818103600083015261494281614906565b9050919050565b600081905092915050565b600061495f82613a33565b6149698185614949565b9350614979818560208601613a4f565b80840191505092915050565b60008190508160005260206000209050919050565b600081546149a78161423e565b6149b18186614949565b945060018216600081146149cc57600181146149dd57614a10565b60ff19831686528186019350614a10565b6149e685614985565b60005b83811015614a08578154818901526001820191506020810190506149e9565b838801955050505b50505092915050565b6000614a258286614954565b9150614a318285614954565b9150614a3d828461499a565b9150819050949350505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614a80602083613a3e565b9150614a8b82614a4a565b602082019050919050565b60006020820190508181036000830152614aaf81614a73565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b6000614b12602583613a3e565b9150614b1d82614ab6565b604082019050919050565b60006020820190508181036000830152614b4181614b05565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000614ba4602483613a3e565b9150614baf82614b48565b604082019050919050565b60006020820190508181036000830152614bd381614b97565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614c10601f83613a3e565b9150614c1b82614bda565b602082019050919050565b60006020820190508181036000830152614c3f81614c03565b9050919050565b6000606082019050614c5b6000830186613b79565b614c686020830185613b79565b614c756040830184613a09565b949350505050565b6000604082019050614c926000830185613b79565b614c9f6020830184613a09565b9392505050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614cdc601983613a3e565b9150614ce782614ca6565b602082019050919050565b60006020820190508181036000830152614d0b81614ccf565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614d6e603283613a3e565b9150614d7982614d12565b604082019050919050565b60006020820190508181036000830152614d9d81614d61565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f455243373231456e756d657261626c653a20636f6e736563757469766520747260008201527f616e7366657273206e6f7420737570706f727465640000000000000000000000602082015250565b6000614e2f603583613a3e565b9150614e3a82614dd3565b604082019050919050565b60006020820190508181036000830152614e5e81614e22565b9050919050565b600081519050614e7481614012565b92915050565b600060208284031215614e9057614e8f61393a565b5b6000614e9e84828501614e65565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614f03602a83613a3e565b9150614f0e82614ea7565b604082019050919050565b60006020820190508181036000830152614f3281614ef6565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000614f6082614f39565b614f6a8185614f44565b9350614f7a818560208601613a4f565b614f8381613a82565b840191505092915050565b6000608082019050614fa36000830187613b79565b614fb06020830186613b79565b614fbd6040830185613a09565b8181036060830152614fcf8184614f55565b905095945050505050565b600081519050614fe981613970565b92915050565b6000602082840312156150055761500461393a565b5b600061501384828501614fda565b91505092915050565b6000615027826139ff565b9150615032836139ff565b925082821015615045576150446144fd565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006150b5602083613a3e565b91506150c08261507f565b602082019050919050565b600060208201905081810360008301526150e4816150a8565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000615121601c83613a3e565b915061512c826150eb565b602082019050919050565b6000602082019050818103600083015261515081615114565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b60006151b3602683613a3e565b91506151be82615157565b604082019050919050565b600060208201905081810360008301526151e2816151a6565b9050919050565b60006151f482614f39565b6151fe81856144b7565b935061520e818560208601613a4f565b80840191505092915050565b600061522682846151e9565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000615267601d83613a3e565b915061527282615231565b602082019050919050565b600060208201905081810360008301526152968161525a565b905091905056fea2646970667358221220ea41f2b0a4219327a4c7794bab6619198f8b51e3460e3c360c346e6782e872c864736f6c634300080e0033
Verified Source Code Partial Match
Compiler: v0.8.14+commit.80d49f37
EVM: london
Optimization: No
BRTGenerals2.sol 2457 lines
// File: @openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.8.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;
}
}
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin/contracts/utils/math/Math.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/access/Ownable2Step.sol
// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() external {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
}
}
}
// File: @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @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 v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @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);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is c...
// [truncated — 88671 bytes total]
Read Contract
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
baseURI 0x6c0360eb → string
checkTokensOwned 0x9253ed04 → uint256[]
count 0x06661abd → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxMintAmount 0x239c70ae → uint256
maxSupply 0xd5abeb01 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
pendingOwner 0xe30c3978 → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
usdc 0x3e413bee → address
usdcPrice 0xdacee347 → uint256
usdt 0x2f48ab7d → address
usdtPrice 0xe136f65f → uint256
whitelistedTokens 0xdaf9c210 → bool
Write Contract 20 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
approve 0x095ea7b3
address to
uint256 tokenId
changePriceUSDC 0x7f6e36d4
uint256 _price
changePriceUSDT 0x3410fc44
uint256 _price
changeSupply 0x39a7919f
uint256 _supply
changeUSDC 0x1ff415d9
address _usdc
changeUSDT 0x4782e407
address _usdt
mint 0x40c10f19
address _token
uint256 _mintAmount
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseExtension 0xda3ef23f
string _newBaseExtension
setBaseURI 0x55f804b3
string _newBaseURI
setPause 0xbedb86fb
bool _paused
setmaxMintAmount 0x7f00c7a6
uint256 _newmaxMintAmount
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
withdrawToken 0x89476069
address _token
Recent Transactions
No transactions found for this address