Address Contract Partially Verified
Address
0x7046E775726b8682E27e2B36D10242107789e633
Balance
0 ETH
Nonce
1
Code Size
20106 bytes
Creator
0x3ca34bD6...E0F7 at tx 0x5feab507...8bcbc8
Indexed Transactions
0
Contract Bytecode
20106 bytes
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80637ef758d41161011a578063c78c6a92116100ad578063d204c45e1161007c578063d204c45e146105f9578063d550c70714610615578063e985e9c514610645578063ed47d4d114610675578063f2fde38b146106a657610206565b8063c78c6a9214610575578063c87b56dd14610591578063cc526364146105c1578063cfbb0528146105dd57610206565b8063a22cb465116100e9578063a22cb46514610505578063a6487c5314610521578063a7e5bcd81461053d578063b88d4fde1461055957610206565b80637ef758d4146104685780638da5cb5b1461049957806395d89b41146104b75780639e66be12146104d557610206565b806339a0c6f91161019d5780634f6ccce71161016c5780634f6ccce7146103b257806356eb843a146103e25780636352211e146103fe57806370a082311461042e578063715018a61461045e57610206565b806339a0c6f91461034057806341f434341461035c57806342842e0e1461037a57806342966c681461039657610206565b806318160ddd116101d957806318160ddd146102a557806323b872dd146102c35780632a55205a146102df5780632f745c591461031057610206565b806301ffc9a71461020b57806306fdde031461023b578063081812fc14610259578063095ea7b314610289575b600080fd5b61022560048036038101906102209190613510565b6106c2565b6040516102329190613558565b60405180910390f35b6102436106d4565b6040516102509190613603565b60405180910390f35b610273600480360381019061026e919061365b565b610766565b60405161028091906136c9565b60405180910390f35b6102a3600480360381019061029e9190613710565b6107ac565b005b6102ad6107c5565b6040516102ba919061375f565b60405180910390f35b6102dd60048036038101906102d8919061377a565b6107d2565b005b6102f960048036038101906102f491906137cd565b610821565b60405161030792919061380d565b60405180910390f35b61032a60048036038101906103259190613710565b610a0d565b604051610337919061375f565b60405180910390f35b61035a6004803603810190610355919061396b565b610ab2565b005b610364610ace565b6040516103719190613a13565b60405180910390f35b610394600480360381019061038f919061377a565b610ae0565b005b6103b060048036038101906103ab919061365b565b610b2f565b005b6103cc60048036038101906103c7919061365b565b610b8b565b6040516103d9919061375f565b60405180910390f35b6103fc60048036038101906103f79190613a2e565b610bfc565b005b6104186004803603810190610413919061365b565b610c60565b60405161042591906136c9565b60405180910390f35b61044860048036038101906104439190613a2e565b610ce6565b604051610455919061375f565b60405180910390f35b610466610d9d565b005b610482600480360381019061047d919061365b565b610db1565b60405161049092919061380d565b60405180910390f35b6104a1610df6565b6040516104ae91906136c9565b60405180910390f35b6104bf610e21565b6040516104cc9190613603565b60405180910390f35b6104ef60048036038101906104ea9190613a2e565b610eb3565b6040516104fc9190613558565b60405180910390f35b61051f600480360381019061051a9190613a87565b610ed4565b005b61053b60048036038101906105369190613ac7565b610eed565b005b6105576004803603810190610552919061365b565b611061565b005b610573600480360381019061056e9190613c0f565b6110e7565b005b61058f600480360381019061058a919061377a565b611138565b005b6105ab60048036038101906105a6919061365b565b61119e565b6040516105b89190613603565b60405180910390f35b6105db60048036038101906105d69190613a2e565b6111b0565b005b6105f760048036038101906105f2919061377a565b611214565b005b610613600480360381019061060e9190613c92565b611327565b005b61062f600480360381019061062a9190613a2e565b611362565b60405161063c9190613558565b60405180910390f35b61065f600480360381019061065a9190613cee565b6113b9565b60405161066c9190613558565b60405180910390f35b61068f600480360381019061068a919061365b565b61144d565b60405161069d92919061380d565b60405180910390f35b6106c060048036038101906106bb9190613a2e565b6114a9565b005b60006106cd8261154f565b9050919050565b6060606580546106e390613d5d565b80601f016020809104026020016040519081016040528092919081815260200182805461070f90613d5d565b801561075c5780601f106107315761010080835404028352916020019161075c565b820191906000526020600020905b81548152906001019060200180831161073f57829003601f168201915b5050505050905090565b6000610771826115c9565b6069600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b816107b681611614565b6107c08383611711565b505050565b6000609980549050905090565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108105761080f33611614565b5b61081b848484611828565b50505050565b600080600061016060008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16036109b85761015f6040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b60006109c2611888565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff16866109ee9190613dbd565b6109f89190613e2e565b90508160000151819350935050509250929050565b6000610a1883610ce6565b8210610a59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5090613ed1565b60405180910390fd5b609760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610aba611892565b806101649081610aca9190614093565b5050565b6daaeb6d7670e522a718067333cd4e81565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b1e57610b1d33611614565b5b610b29848484611910565b50505050565b610b40610b3a611930565b82611938565b610b7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b76906141d7565b60405180910390fd5b610b88816119cd565b50565b6000610b956107c5565b8210610bd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcd90614269565b60405180910390fd5b60998281548110610bea57610be9614289565b5b90600052602060002001549050919050565b610c04611892565b600061016260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080610c6c836119d9565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610cdd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd490614304565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610d56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4d90614396565b60405180910390fd5b606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610da5611892565b610daf6000611a16565b565b6101636020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b600061012d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060668054610e3090613d5d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e5c90613d5d565b8015610ea95780601f10610e7e57610100808354040283529160200191610ea9565b820191906000526020600020905b815481529060010190602001808311610e8c57829003601f168201915b5050505050905090565b6101626020528060005260406000206000915054906101000a900460ff1681565b81610ede81611614565b610ee88383611ade565b505050565b60008060019054906101000a900460ff16159050808015610f1e5750600160008054906101000a900460ff1660ff16105b80610f4b5750610f2d3061152c565b158015610f4a5750600160008054906101000a900460ff1660ff16145b5b610f8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8190614428565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610fc7576001600060016101000a81548160ff0219169083151502179055505b610fd18484611af4565b610fd9611b51565b610fe1611ba2565b610fe9611bf3565b610ff1611c44565b8161016490816110019190614093565b50801561105b5760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516110529190614490565b60405180910390a15b50505050565b611069611892565b611072816119cd565b61107a613417565b80610163600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101559050505050565b833373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146111255761112433611614565b5b61113185858585611c9d565b5050505050565b6001151561114c611147611930565b611362565b15151461118e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111859061451d565b60405180910390fd5b611199838383611cff565b505050565b60606111a982611ff8565b9050919050565b6111b8611892565b600161016260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60011515611228611223611930565b611362565b15151461126a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112619061451d565b60405180910390fd5b600061127761016161210a565b9050611284610161612118565b61128e848261212e565b60405180604001604052808473ffffffffffffffffffffffffffffffffffffffff16815260200183815250610163600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015590505050505050565b61132f611892565b600061133c61016161210a565b9050611349610161612118565b611353838261212e565b61135d818361214c565b505050565b600061016260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000606a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600080610163600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016360008581526020019081526020016000206001015491509150915091565b6114b1611892565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611520576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611517906145af565b60405180910390fd5b61152981611a16565b50565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806115c257506115c1826121b9565b5b9050919050565b6115d281612223565b611611576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160890614304565b60405180910390fd5b50565b60006daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b111561170e576daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430836040518363ffffffff1660e01b815260040161168b9291906145cf565b602060405180830381865afa1580156116a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cc919061460d565b61170d57806040517fede71dcc00000000000000000000000000000000000000000000000000000000815260040161170491906136c9565b60405180910390fd5b5b50565b600061171c82610c60565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361178c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611783906146ac565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166117ab611930565b73ffffffffffffffffffffffffffffffffffffffff1614806117da57506117d9816117d4611930565b6113b9565b5b611819576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118109061473e565b60405180910390fd5b6118238383612264565b505050565b611839611833611930565b82611938565b611878576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186f906141d7565b60405180910390fd5b611883838383611cff565b505050565b6000612710905090565b61189a611930565b73ffffffffffffffffffffffffffffffffffffffff166118b8610df6565b73ffffffffffffffffffffffffffffffffffffffff161461190e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611905906147aa565b60405180910390fd5b565b61192b838383604051806020016040528060008152506110e7565b505050565b600033905090565b60008061194483610c60565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611986575061198581856113b9565b5b806119c457508373ffffffffffffffffffffffffffffffffffffffff166119ac84610766565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b6119d68161231d565b50565b60006067600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061012d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508161012d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b611af0611ae9611930565b8383612370565b5050565b600060019054906101000a900460ff16611b43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3a9061483c565b60405180910390fd5b611b4d82826124dc565b5050565b600060019054906101000a900460ff16611ba0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b979061483c565b60405180910390fd5b565b600060019054906101000a900460ff16611bf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be89061483c565b60405180910390fd5b565b600060019054906101000a900460ff16611c42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c399061483c565b60405180910390fd5b565b600060019054906101000a900460ff16611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a9061483c565b60405180910390fd5b611c9b61254f565b565b611cae611ca8611930565b83611938565b611ced576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce4906141d7565b60405180910390fd5b611cf9848484846125b0565b50505050565b8273ffffffffffffffffffffffffffffffffffffffff16611d1f82610c60565b73ffffffffffffffffffffffffffffffffffffffff1614611d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6c906148ce565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611de4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ddb90614960565b60405180910390fd5b611df1838383600161260c565b8273ffffffffffffffffffffffffffffffffffffffff16611e1182610c60565b73ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e906148ce565b60405180910390fd5b6069600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611ff3838383600161261e565b505050565b6060612003826115c9565b600060c96000848152602001908152602001600020805461202390613d5d565b80601f016020809104026020016040519081016040528092919081815260200182805461204f90613d5d565b801561209c5780601f106120715761010080835404028352916020019161209c565b820191906000526020600020905b81548152906001019060200180831161207f57829003601f168201915b5050505050905060006120ad612624565b905060008151036120c2578192505050612105565b6000825111156120f75780826040516020016120df9291906149bc565b60405160208183030381529060405292505050612105565b612100846126b7565b925050505b919050565b600081600001549050919050565b6001816000016000828254019250508190555050565b61214882826040518060200160405280600081525061271f565b5050565b61215582612223565b612194576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218b90614a52565b60405180910390fd5b8060c9600084815260200190815260200160002090816121b49190614093565b505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16612245836119d9565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816069600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166122d783610c60565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6123268161277a565b600060c96000838152602001908152602001600020805461234690613d5d565b90501461236d5760c96000828152602001908152602001600020600061236c9190613447565b5b50565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036123de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d590614abe565b60405180910390fd5b80606a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516124cf9190613558565b60405180910390a3505050565b600060019054906101000a900460ff1661252b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125229061483c565b60405180910390fd5b816065908161253a9190614093565b50806066908161254a9190614093565b505050565b600060019054906101000a900460ff1661259e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125959061483c565b60405180910390fd5b6125ae6125a9611930565b611a16565b565b6125bb848484611cff565b6125c7848484846128c8565b612606576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125fd90614b50565b60405180910390fd5b50505050565b61261884848484612a4f565b50505050565b50505050565b6060610164805461263490613d5d565b80601f016020809104026020016040519081016040528092919081815260200182805461266090613d5d565b80156126ad5780601f10612682576101008083540402835291602001916126ad565b820191906000526020600020905b81548152906001019060200180831161269057829003601f168201915b5050505050905090565b60606126c2826115c9565b60006126cc612624565b905060008151116126ec5760405180602001604052806000815250612717565b806126f684612bad565b6040516020016127079291906149bc565b6040516020818303038152906040525b915050919050565b6127298383612c7b565b61273660008484846128c8565b612775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276c90614b50565b60405180910390fd5b505050565b600061278582610c60565b905061279581600084600161260c565b61279e82610c60565b90506069600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506067600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46128c481600084600161261e565b5050565b60006128e98473ffffffffffffffffffffffffffffffffffffffff1661152c565b15612a42578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612912611930565b8786866040518563ffffffff1660e01b81526004016129349493929190614bc5565b6020604051808303816000875af192505050801561297057506040513d601f19601f8201168201806040525081019061296d9190614c26565b60015b6129f2573d80600081146129a0576040519150601f19603f3d011682016040523d82523d6000602084013e6129a5565b606091505b5060008151036129ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e190614b50565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612a47565b600190505b949350505050565b612a5b84848484612e98565b6001811115612a9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a9690614cc5565b60405180910390fd5b6000829050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603612ae657612ae181612fbe565b612b25565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614612b2457612b238582613007565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603612b6757612b6281613174565b612ba6565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614612ba557612ba48482613245565b5b5b5050505050565b606060006001612bbc846132c4565b01905060008167ffffffffffffffff811115612bdb57612bda613840565b5b6040519080825280601f01601f191660200182016040528015612c0d5781602001600182028036833780820191505090505b509050600082602001820190505b600115612c70578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581612c6457612c63613dff565b5b04945060008503612c1b575b819350505050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612cea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ce190614d31565b60405180910390fd5b612cf381612223565b15612d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d2a90614d9d565b60405180910390fd5b612d4160008383600161260c565b612d4a81612223565b15612d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8190614d9d565b60405180910390fd5b6001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612e9460008383600161261e565b5050565b6001811115612fb857600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614612f2c5780606860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612f249190614dbd565b925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612fb75780606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612faf9190614df1565b925050819055505b5b50505050565b609980549050609a600083815260200190815260200160002081905550609981908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161301484610ce6565b61301e9190614dbd565b9050600060986000848152602001908152602001600020549050818114613103576000609760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080609760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816098600083815260200190815260200160002081905550505b6098600084815260200190815260200160002060009055609760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016099805490506131889190614dbd565b90506000609a60008481526020019081526020016000205490506000609983815481106131b8576131b7614289565b5b9060005260206000200154905080609983815481106131da576131d9614289565b5b906000526020600020018190555081609a600083815260200190815260200160002081905550609a600085815260200190815260200160002060009055609980548061322957613228614e25565b5b6001900381819060005260206000200160009055905550505050565b600061325083610ce6565b905081609760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806098600084815260200190815260200160002081905550505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613322577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161331857613317613dff565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061335f576d04ee2d6d415b85acef8100000000838161335557613354613dff565b5b0492506020810190505b662386f26fc10000831061338e57662386f26fc10000838161338457613383613dff565b5b0492506010810190505b6305f5e10083106133b7576305f5e10083816133ad576133ac613dff565b5b0492506008810190505b61271083106133dc5761271083816133d2576133d1613dff565b5b0492506004810190505b606483106133ff57606483816133f5576133f4613dff565b5b0492506002810190505b600a831061340e576001810190505b80915050919050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b50805461345390613d5d565b6000825580601f106134655750613484565b601f0160209004906000526020600020908101906134839190613487565b5b50565b5b808211156134a0576000816000905550600101613488565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6134ed816134b8565b81146134f857600080fd5b50565b60008135905061350a816134e4565b92915050565b600060208284031215613526576135256134ae565b5b6000613534848285016134fb565b91505092915050565b60008115159050919050565b6135528161353d565b82525050565b600060208201905061356d6000830184613549565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156135ad578082015181840152602081019050613592565b60008484015250505050565b6000601f19601f8301169050919050565b60006135d582613573565b6135df818561357e565b93506135ef81856020860161358f565b6135f8816135b9565b840191505092915050565b6000602082019050818103600083015261361d81846135ca565b905092915050565b6000819050919050565b61363881613625565b811461364357600080fd5b50565b6000813590506136558161362f565b92915050565b600060208284031215613671576136706134ae565b5b600061367f84828501613646565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006136b382613688565b9050919050565b6136c3816136a8565b82525050565b60006020820190506136de60008301846136ba565b92915050565b6136ed816136a8565b81146136f857600080fd5b50565b60008135905061370a816136e4565b92915050565b60008060408385031215613727576137266134ae565b5b6000613735858286016136fb565b925050602061374685828601613646565b9150509250929050565b61375981613625565b82525050565b60006020820190506137746000830184613750565b92915050565b600080600060608486031215613793576137926134ae565b5b60006137a1868287016136fb565b93505060206137b2868287016136fb565b92505060406137c386828701613646565b9150509250925092565b600080604083850312156137e4576137e36134ae565b5b60006137f285828601613646565b925050602061380385828601613646565b9150509250929050565b600060408201905061382260008301856136ba565b61382f6020830184613750565b9392505050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613878826135b9565b810181811067ffffffffffffffff8211171561389757613896613840565b5b80604052505050565b60006138aa6134a4565b90506138b6828261386f565b919050565b600067ffffffffffffffff8211156138d6576138d5613840565b5b6138df826135b9565b9050602081019050919050565b82818337600083830152505050565b600061390e613909846138bb565b6138a0565b90508281526020810184848401111561392a5761392961383b565b5b6139358482856138ec565b509392505050565b600082601f83011261395257613951613836565b5b81356139628482602086016138fb565b91505092915050565b600060208284031215613981576139806134ae565b5b600082013567ffffffffffffffff81111561399f5761399e6134b3565b5b6139ab8482850161393d565b91505092915050565b6000819050919050565b60006139d96139d46139cf84613688565b6139b4565b613688565b9050919050565b60006139eb826139be565b9050919050565b60006139fd826139e0565b9050919050565b613a0d816139f2565b82525050565b6000602082019050613a286000830184613a04565b92915050565b600060208284031215613a4457613a436134ae565b5b6000613a52848285016136fb565b91505092915050565b613a648161353d565b8114613a6f57600080fd5b50565b600081359050613a8181613a5b565b92915050565b60008060408385031215613a9e57613a9d6134ae565b5b6000613aac858286016136fb565b9250506020613abd85828601613a72565b9150509250929050565b600080600060608486031215613ae057613adf6134ae565b5b600084013567ffffffffffffffff811115613afe57613afd6134b3565b5b613b0a8682870161393d565b935050602084013567ffffffffffffffff811115613b2b57613b2a6134b3565b5b613b378682870161393d565b925050604084013567ffffffffffffffff811115613b5857613b576134b3565b5b613b648682870161393d565b9150509250925092565b600067ffffffffffffffff821115613b8957613b88613840565b5b613b92826135b9565b9050602081019050919050565b6000613bb2613bad84613b6e565b6138a0565b905082815260208101848484011115613bce57613bcd61383b565b5b613bd98482856138ec565b509392505050565b600082601f830112613bf657613bf5613836565b5b8135613c06848260208601613b9f565b91505092915050565b60008060008060808587031215613c2957613c286134ae565b5b6000613c37878288016136fb565b9450506020613c48878288016136fb565b9350506040613c5987828801613646565b925050606085013567ffffffffffffffff811115613c7a57613c796134b3565b5b613c8687828801613be1565b91505092959194509250565b60008060408385031215613ca957613ca86134ae565b5b6000613cb7858286016136fb565b925050602083013567ffffffffffffffff811115613cd857613cd76134b3565b5b613ce48582860161393d565b9150509250929050565b60008060408385031215613d0557613d046134ae565b5b6000613d13858286016136fb565b9250506020613d24858286016136fb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613d7557607f821691505b602082108103613d8857613d87613d2e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613dc882613625565b9150613dd383613625565b9250828202613de181613625565b91508282048414831517613df857613df7613d8e565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613e3982613625565b9150613e4483613625565b925082613e5457613e53613dff565b5b828204905092915050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000613ebb602b8361357e565b9150613ec682613e5f565b604082019050919050565b60006020820190508181036000830152613eea81613eae565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302613f537fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613f16565b613f5d8683613f16565b95508019841693508086168417925050509392505050565b6000613f90613f8b613f8684613625565b6139b4565b613625565b9050919050565b6000819050919050565b613faa83613f75565b613fbe613fb682613f97565b848454613f23565b825550505050565b600090565b613fd3613fc6565b613fde818484613fa1565b505050565b5b8181101561400257613ff7600082613fcb565b600181019050613fe4565b5050565b601f8211156140475761401881613ef1565b61402184613f06565b81016020851015614030578190505b61404461403c85613f06565b830182613fe3565b50505b505050565b600082821c905092915050565b600061406a6000198460080261404c565b1980831691505092915050565b60006140838383614059565b9150826002028217905092915050565b61409c82613573565b67ffffffffffffffff8111156140b5576140b4613840565b5b6140bf8254613d5d565b6140ca828285614006565b600060209050601f8311600181146140fd57600084156140eb578287015190505b6140f58582614077565b86555061415d565b601f19841661410b86613ef1565b60005b828110156141335784890151825560018201915060208501945060208101905061410e565b86831015614150578489015161414c601f891682614059565b8355505b6001600288020188555050505b505050505050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b60006141c1602d8361357e565b91506141cc82614165565b604082019050919050565b600060208201905081810360008301526141f0816141b4565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b6000614253602c8361357e565b915061425e826141f7565b604082019050919050565b6000602082019050818103600083015261428281614246565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b60006142ee60188361357e565b91506142f9826142b8565b602082019050919050565b6000602082019050818103600083015261431d816142e1565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b600061438060298361357e565b915061438b82614324565b604082019050919050565b600060208201905081810360008301526143af81614373565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000614412602e8361357e565b915061441d826143b6565b604082019050919050565b6000602082019050818103600083015261444181614405565b9050919050565b6000819050919050565b600060ff82169050919050565b600061447a61447561447084614448565b6139b4565b614452565b9050919050565b61448a8161445f565b82525050565b60006020820190506144a56000830184614481565b92915050565b7f4f6e6c7920696e7465726e616c207472616465722063616e20706572666f726d60008201527f2074686973206f7065726174696f6e0000000000000000000000000000000000602082015250565b6000614507602f8361357e565b9150614512826144ab565b604082019050919050565b60006020820190508181036000830152614536816144fa565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061459960268361357e565b91506145a48261453d565b604082019050919050565b600060208201905081810360008301526145c88161458c565b9050919050565b60006040820190506145e460008301856136ba565b6145f160208301846136ba565b9392505050565b60008151905061460781613a5b565b92915050565b600060208284031215614623576146226134ae565b5b6000614631848285016145f8565b91505092915050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061469660218361357e565b91506146a18261463a565b604082019050919050565b600060208201905081810360008301526146c581614689565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000614728603d8361357e565b9150614733826146cc565b604082019050919050565b600060208201905081810360008301526147578161471b565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061479460208361357e565b915061479f8261475e565b602082019050919050565b600060208201905081810360008301526147c381614787565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000614826602b8361357e565b9150614831826147ca565b604082019050919050565b6000602082019050818103600083015261485581614819565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b60006148b860258361357e565b91506148c38261485c565b604082019050919050565b600060208201905081810360008301526148e7816148ab565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061494a60248361357e565b9150614955826148ee565b604082019050919050565b600060208201905081810360008301526149798161493d565b9050919050565b600081905092915050565b600061499682613573565b6149a08185614980565b93506149b081856020860161358f565b80840191505092915050565b60006149c8828561498b565b91506149d4828461498b565b91508190509392505050565b7f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60008201527f6578697374656e7420746f6b656e000000000000000000000000000000000000602082015250565b6000614a3c602e8361357e565b9150614a47826149e0565b604082019050919050565b60006020820190508181036000830152614a6b81614a2f565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614aa860198361357e565b9150614ab382614a72565b602082019050919050565b60006020820190508181036000830152614ad781614a9b565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614b3a60328361357e565b9150614b4582614ade565b604082019050919050565b60006020820190508181036000830152614b6981614b2d565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000614b9782614b70565b614ba18185614b7b565b9350614bb181856020860161358f565b614bba816135b9565b840191505092915050565b6000608082019050614bda60008301876136ba565b614be760208301866136ba565b614bf46040830185613750565b8181036060830152614c068184614b8c565b905095945050505050565b600081519050614c20816134e4565b92915050565b600060208284031215614c3c57614c3b6134ae565b5b6000614c4a84828501614c11565b91505092915050565b7f455243373231456e756d657261626c653a20636f6e736563757469766520747260008201527f616e7366657273206e6f7420737570706f727465640000000000000000000000602082015250565b6000614caf60358361357e565b9150614cba82614c53565b604082019050919050565b60006020820190508181036000830152614cde81614ca2565b9050919050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000614d1b60208361357e565b9150614d2682614ce5565b602082019050919050565b60006020820190508181036000830152614d4a81614d0e565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000614d87601c8361357e565b9150614d9282614d51565b602082019050919050565b60006020820190508181036000830152614db681614d7a565b9050919050565b6000614dc882613625565b9150614dd383613625565b9250828203905081811115614deb57614dea613d8e565b5b92915050565b6000614dfc82613625565b9150614e0783613625565b9250828201905080821115614e1f57614e1e613d8e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212206ac259c723c43999aa61276c71779d4d52f57035d85c1e6104f257b9c7f7234f64736f6c63430008110033
Verified Source Code Partial Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
OAROToken.sol 2569 lines
// File: ERC721-OperatorFilter/IOperatorFilterRegistry.sol
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}
// File: ERC721-OperatorFilter/OperatorFilterer.sol
pragma solidity ^0.8.13;
/**
* @title OperatorFilterer
* @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
* registrant's entries in the OperatorFilterRegistry.
* @dev This smart contract is meant to be inherited by token contracts so they can use the following:
* - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
* - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
*/
abstract contract OperatorFilterer {
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);
constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
// If an inheriting token contract is deployed to a network without the registry deployed, the modifier
// will not revert, but the contract will need to be registered with the registry once it is deployed in
// order for the modifier to filter addresses.
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (subscribe) {
OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
OPERATOR_FILTER_REGISTRY.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
// Allow spending tokens from addresses with balance
// Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
// from an EOA.
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
function _checkFilterOperator(address operator) internal view virtual {
// Check registry code length to facilitate testing in environments without a deployed registry.
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}
// File: ERC721-OperatorFilter/DefaultOperatorFilterer.sol
pragma solidity ^0.8.13;
/**
* @title DefaultOperatorFilterer
* @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
*/
abstract contract DefaultOperatorFilterer is OperatorFilterer {
address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);
constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/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: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/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: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/interfaces/IERC2981.sol
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view returns (address receiver, uint256 royaltyAmount);
}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
// File: @openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.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 CountersUpgradeable {
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-upgradeable/utils/math/MathUpgradeable.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 MathUpgradeable {
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-upgradeable/utils/StringsUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
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 = MathUpgradeable.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, MathUpgradeable.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-upgradeable/utils/AddressUpgradeable.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 AddressUpgradeable {
/**
* @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 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-upgradeable/proxy/utils/Initializable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Internal function that returns the initialized version. Returns `_initialized`
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Internal function that returns the initialized version. Returns `_initializing`
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
// File: @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_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);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
// File: @openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.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 IERC721ReceiverUpgradeable {
/**
* @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 ca...
// [truncated — 94460 bytes total]
Read Contract
OPERATOR_FILTER_REGISTRY 0x41f43434 → address
_internalTraders 0x9e66be12 → bool
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
getMintedToken 0xed47d4d1 → address, uint256
isApprovedForAll 0xe985e9c5 → bool
isInternalTrader 0xd550c707 → bool
mintedTokens 0x7ef758d4 → address, uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
addInternalTrader 0xcc526364
address _trader
approve 0x095ea7b3
address operator
uint256 tokenId
burn 0x42966c68
uint256 tokenId
changeBaseURI 0x39a0c6f9
string _newBaseURI
initialize 0xa6487c53
string _name
string _symbol
string _base
removeInternalTrader 0x56eb843a
address _trader
renounceOwnership 0x715018a6
No parameters
safeMint 0xd204c45e
address to
string uri
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
traderBurn 0xa7e5bcd8
uint256 _tokenId
traderMint 0xcfbb0528
address to
address artist
uint256 artistFee
traderTransfer 0xc78c6a92
address _from
address _to
uint256 _tokenId
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address