Address Contract Verified
Address
0x0974e6c435C18DdfBbc1F500EDE24F99C3cf07F2
Balance
0 ETH
Nonce
1
Code Size
22008 bytes
Creator
0x04745b45...fD9a at tx 0xf39602f3...ac3df0
Indexed Transactions
0 (1 on-chain, 1.2% indexed)
Contract Bytecode
22008 bytes
0x6080604052600436106102465760003560e01c80637890b2c911610139578063bc8893b4116100b6578063e3e1e8ef1161007a578063e3e1e8ef1461082a578063e985e9c514610846578063f190190214610883578063f2fde38b146108ac578063f4a0a528146108d5578063f5aa406d146108fe57610246565b8063bc8893b414610741578063c4e41b221461076c578063c87b56dd14610797578063cf309012146107d4578063d5abeb01146107ff57610246565b8063977b055b116100fd578063977b055b14610691578063989bdbb6146106bc578063a0712d68146106d3578063a22cb465146106ef578063b88d4fde1461071857610246565b80637890b2c9146105f15780637bffb4ce1461060d578063853828b6146106245780638da5cb5b1461063b57806395d89b411461066657610246565b8063438b6300116101c75780636352211e1161018b5780636352211e1461050c5780636817c76c1461054957806370a082311461057457806371189742146105b1578063715018a6146105da57610246565b8063438b630014610415578063484b973c146104525780634f6ccce71461047b57806353135ca0146104b857806355f804b3146104e357610246565b806318160ddd1161020e57806318160ddd146103305780631bf961821461035b57806323b872dd146103865780632f745c59146103af57806342842e0e146103ec57610246565b806301ffc9a71461024b578063049c5c491461028857806306fdde031461029f578063081812fc146102ca578063095ea7b314610307575b600080fd5b34801561025757600080fd5b50610272600480360381019061026d9190613d7b565b610927565b60405161027f9190614519565b60405180910390f35b34801561029457600080fd5b5061029d6109a1565b005b3480156102ab57600080fd5b506102b4610a8f565b6040516102c19190614534565b60405180910390f35b3480156102d657600080fd5b506102f160048036038101906102ec9190613e1e565b610b21565b6040516102fe9190614490565b60405180910390f35b34801561031357600080fd5b5061032e60048036038101906103299190613d0e565b610ba6565b005b34801561033c57600080fd5b50610345610cbe565b60405161035291906148f6565b60405180910390f35b34801561036757600080fd5b50610370610ccb565b60405161037d91906148f6565b60405180910390f35b34801561039257600080fd5b506103ad60048036038101906103a89190613bf8565b610cd1565b005b3480156103bb57600080fd5b506103d660048036038101906103d19190613d0e565b610d31565b6040516103e391906148f6565b60405180910390f35b3480156103f857600080fd5b50610413600480360381019061040e9190613bf8565b610dd6565b005b34801561042157600080fd5b5061043c60048036038101906104379190613b8b565b610df6565b60405161044991906144f7565b60405180910390f35b34801561045e57600080fd5b5061047960048036038101906104749190613d0e565b610ea4565b005b34801561048757600080fd5b506104a2600480360381019061049d9190613e1e565b610fb1565b6040516104af91906148f6565b60405180910390f35b3480156104c457600080fd5b506104cd611022565b6040516104da9190614519565b60405180910390f35b3480156104ef57600080fd5b5061050a60048036038101906105059190613dd5565b611035565b005b34801561051857600080fd5b50610533600480360381019061052e9190613e1e565b61111b565b6040516105409190614490565b60405180910390f35b34801561055557600080fd5b5061055e6111cd565b60405161056b91906148f6565b60405180910390f35b34801561058057600080fd5b5061059b60048036038101906105969190613b8b565b6111d3565b6040516105a891906148f6565b60405180910390f35b3480156105bd57600080fd5b506105d860048036038101906105d39190613e1e565b61128b565b005b3480156105e657600080fd5b506105ef611311565b005b61060b60048036038101906106069190613e4b565b611399565b005b34801561061957600080fd5b50610622611681565b005b34801561063057600080fd5b5061063961176f565b005b34801561064757600080fd5b506106506119fc565b60405161065d9190614490565b60405180910390f35b34801561067257600080fd5b5061067b611a26565b6040516106889190614534565b60405180910390f35b34801561069d57600080fd5b506106a6611ab8565b6040516106b391906148f6565b60405180910390f35b3480156106c857600080fd5b506106d1611abe565b005b6106ed60048036038101906106e89190613e1e565b611b57565b005b3480156106fb57600080fd5b5061071660048036038101906107119190613cce565b611e35565b005b34801561072457600080fd5b5061073f600480360381019061073a9190613c4b565b611e4b565b005b34801561074d57600080fd5b50610756611ead565b6040516107639190614519565b60405180910390f35b34801561077857600080fd5b50610781611ec0565b60405161078e91906148f6565b60405180910390f35b3480156107a357600080fd5b506107be60048036038101906107b99190613e1e565b611ecf565b6040516107cb9190614534565b60405180910390f35b3480156107e057600080fd5b506107e9611f76565b6040516107f69190614519565b60405180910390f35b34801561080b57600080fd5b50610814611f89565b60405161082191906148f6565b60405180910390f35b610844600480360381019061083f9190613e4b565b611f8f565b005b34801561085257600080fd5b5061086d60048036038101906108689190613bb8565b612277565b60405161087a9190614519565b60405180910390f35b34801561088f57600080fd5b506108aa60048036038101906108a59190613d4e565b61230b565b005b3480156108b857600080fd5b506108d360048036038101906108ce9190613b8b565b612391565b005b3480156108e157600080fd5b506108fc60048036038101906108f79190613e1e565b612489565b005b34801561090a57600080fd5b5061092560048036038101906109209190613d4e565b61250f565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061099a575061099982612595565b5b9050919050565b6109a9612677565b73ffffffffffffffffffffffffffffffffffffffff166109c76119fc565b73ffffffffffffffffffffffffffffffffffffffff1614610a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a14906147b6565b60405180910390fd5b600f60029054906101000a900460ff1615600f60026101000a81548160ff0219169083151502179055507f1c27adbe19c2f592844c4b67508b6e5dce275dc961a69a647af7c4d768de0f8e600f60029054906101000a900460ff16604051610a859190614519565b60405180910390a1565b606060008054610a9e90614be9565b80601f0160208091040260200160405190810160405280929190818152602001828054610aca90614be9565b8015610b175780601f10610aec57610100808354040283529160200191610b17565b820191906000526020600020905b815481529060010190602001808311610afa57829003601f168201915b5050505050905090565b6000610b2c8261267f565b610b6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6290614796565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610bb18261111b565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1990614856565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610c41612677565b73ffffffffffffffffffffffffffffffffffffffff161480610c705750610c6f81610c6a612677565b612277565b5b610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca6906146f6565b60405180910390fd5b610cb983836126eb565b505050565b6000600880549050905090565b600e5481565b610ce2610cdc612677565b826127a4565b610d21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1890614876565b60405180910390fd5b610d2c838383612882565b505050565b6000610d3c836111d3565b8210610d7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7490614596565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610df183838360405180602001604052806000815250611e4b565b505050565b60606000610e03836111d3565b905060008167ffffffffffffffff811115610e2157610e20614ddf565b5b604051908082528060200260200182016040528015610e4f5781602001602082028036833780820191505090505b50905060005b82811015610e9957610e678582610d31565b828281518110610e7a57610e79614db0565b5b6020026020010181815250508080610e9190614c4c565b915050610e55565b508092505050919050565b610eac612677565b73ffffffffffffffffffffffffffffffffffffffff16610eca6119fc565b73ffffffffffffffffffffffffffffffffffffffff1614610f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f17906147b6565b60405180910390fd5b600b5481610f2c610cbe565b610f369190614a14565b1115610f77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6e906146d6565b60405180910390fd5b60005b81811015610fac576000610f8c610cbe565b9050610f988482612ade565b508080610fa490614c4c565b915050610f7a565b505050565b6000610fbb610cbe565b8210610ffc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff390614896565b60405180910390fd5b600882815481106110105761100f614db0565b5b90600052602060002001549050919050565b600f60019054906101000a900460ff1681565b61103d612677565b73ffffffffffffffffffffffffffffffffffffffff1661105b6119fc565b73ffffffffffffffffffffffffffffffffffffffff16146110b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a8906147b6565b60405180910390fd5b600f60009054906101000a900460ff1615611101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f890614836565b60405180910390fd5b8060139080519060200190611117929190613934565b5050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bb90614736565b60405180910390fd5b80915050919050565b600c5481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123b90614716565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611293612677565b73ffffffffffffffffffffffffffffffffffffffff166112b16119fc565b73ffffffffffffffffffffffffffffffffffffffff1614611307576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112fe906147b6565b60405180910390fd5b80600d8190555050565b611319612677565b73ffffffffffffffffffffffffffffffffffffffff166113376119fc565b73ffffffffffffffffffffffffffffffffffffffff161461138d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611384906147b6565b60405180910390fd5b6113976000612afc565b565b600f60019054906101000a900460ff166113e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113df906147d6565b60405180910390fd5b6113f6338383601154612bc2565b611435576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142c90614636565b60405180910390fd5b600e5483611442336111d3565b61144c9190614a14565b111561148d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611484906148b6565b60405180910390fd5b600b5483611499610cbe565b6114a39190614a14565b11156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db906146d6565b60405180910390fd5b3483600c546114f39190614a9b565b1115611534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152b90614696565b60405180910390fd5b82601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157f9190614a14565b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e54601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163d90614776565b60405180910390fd5b60005b8381101561167b57600061165b610cbe565b90506116673382612ade565b50808061167390614c4c565b915050611649565b50505050565b611689612677565b73ffffffffffffffffffffffffffffffffffffffff166116a76119fc565b73ffffffffffffffffffffffffffffffffffffffff16146116fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f4906147b6565b60405180910390fd5b600f60019054906101000a900460ff1615600f60016101000a81548160ff0219169083151502179055507f42133c3a5199a92c96a540af6aee25899ebc1da7cc9ac9e3536653b61c3c60d7600f60019054906101000a900460ff166040516117659190614519565b60405180910390a1565b611777612677565b73ffffffffffffffffffffffffffffffffffffffff166117956119fc565b73ffffffffffffffffffffffffffffffffffffffff16146117eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e2906147b6565b60405180910390fd5b600047905060008111611833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182a90614576565b60405180910390fd5b600060026064836118449190614a6a565b61184e9190614a9b565b9050600060036064846118619190614a6a565b61186b9190614a9b565b90506000600260648561187e9190614a6a565b6118889190614a9b565b9050730c36922266e6ce0f92a357e20399f295c2b9ff1073ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156118e4573d6000803e3d6000fd5b50731ea3a4f1b89f3ada30e7110e87b74a58fc1d33c373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561193f573d6000803e3d6000fd5b5073a286fee51f2faaddc79f921aaf8a559bba77ce6673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561199a573d6000803e3d6000fd5b5073d11351387b941f464e3a2bb11f3a0a63922f0dee73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156119f5573d6000803e3d6000fd5b5050505050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054611a3590614be9565b80601f0160208091040260200160405190810160405280929190818152602001828054611a6190614be9565b8015611aae5780601f10611a8357610100808354040283529160200191611aae565b820191906000526020600020905b815481529060010190602001808311611a9157829003601f168201915b5050505050905090565b600d5481565b611ac6612677565b73ffffffffffffffffffffffffffffffffffffffff16611ae46119fc565b73ffffffffffffffffffffffffffffffffffffffff1614611b3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b31906147b6565b60405180910390fd5b6001600f60006101000a81548160ff021916908315150217905550565b600f60029054906101000a900460ff16611ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9d90614556565b60405180910390fd5b600d54811115611beb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be2906145d6565b60405180910390fd5b600d5481611bf8336111d3565b611c029190614a14565b1115611c43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3a90614776565b60405180910390fd5b600b5481611c4f610cbe565b611c599190614a14565b1115611c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c91906146d6565b60405180910390fd5b3481600c54611ca99190614a9b565b1115611cea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce190614696565b60405180910390fd5b80601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d359190614a14565b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611dfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df390614776565b60405180910390fd5b60005b81811015611e31576000611e11610cbe565b9050611e1d3382612ade565b508080611e2990614c4c565b915050611dff565b5050565b611e47611e40612677565b8383612c22565b5050565b611e5c611e56612677565b836127a4565b611e9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9290614876565b60405180910390fd5b611ea784848484612d8f565b50505050565b600f60029054906101000a900460ff1681565b6000611eca610cbe565b905090565b6060611eda8261267f565b611f19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1090614816565b60405180910390fd5b6000611f23612deb565b90506000815111611f435760405180602001604052806000815250611f6e565b80611f4d84612e7d565b604051602001611f5e92919061446c565b6040516020818303038152906040525b915050919050565b600f60009054906101000a900460ff1681565b600b5481565b600f60019054906101000a900460ff16611fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd5906147d6565b60405180910390fd5b611fec338383601054612bc2565b61202b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612022906148d6565b60405180910390fd5b600d5483612038336111d3565b6120429190614a14565b1115612083576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207a90614776565b60405180910390fd5b600b548361208f610cbe565b6120999190614a14565b11156120da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d1906146d6565b60405180910390fd5b3483600c546120e99190614a9b565b111561212a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212190614696565b60405180910390fd5b82601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121759190614a14565b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223390614776565b60405180910390fd5b60005b83811015612271576000612251610cbe565b905061225d3382612ade565b50808061226990614c4c565b91505061223f565b50505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b612313612677565b73ffffffffffffffffffffffffffffffffffffffff166123316119fc565b73ffffffffffffffffffffffffffffffffffffffff1614612387576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237e906147b6565b60405180910390fd5b8060118190555050565b612399612677565b73ffffffffffffffffffffffffffffffffffffffff166123b76119fc565b73ffffffffffffffffffffffffffffffffffffffff161461240d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612404906147b6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561247d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612474906145f6565b60405180910390fd5b61248681612afc565b50565b612491612677565b73ffffffffffffffffffffffffffffffffffffffff166124af6119fc565b73ffffffffffffffffffffffffffffffffffffffff1614612505576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fc906147b6565b60405180910390fd5b80600c8190555050565b612517612677565b73ffffffffffffffffffffffffffffffffffffffff166125356119fc565b73ffffffffffffffffffffffffffffffffffffffff161461258b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612582906147b6565b60405180910390fd5b8060108190555050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061266057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612670575061266f82612fde565b5b9050919050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661275e8361111b565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006127af8261267f565b6127ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127e5906146b6565b60405180910390fd5b60006127f98361111b565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061286857508373ffffffffffffffffffffffffffffffffffffffff1661285084610b21565b73ffffffffffffffffffffffffffffffffffffffff16145b8061287957506128788185612277565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166128a28261111b565b73ffffffffffffffffffffffffffffffffffffffff16146128f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ef906147f6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612968576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295f90614656565b60405180910390fd5b612973838383613048565b61297e6000826126eb565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546129ce9190614af5565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612a259190614a14565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b612af882826040518060200160405280600081525061315c565b5050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000612c18848480806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505083612c13886131b7565b6131e7565b9050949350505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612c91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c8890614676565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612d829190614519565b60405180910390a3505050565b612d9a848484612882565b612da6848484846131fe565b612de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ddc906145b6565b60405180910390fd5b50505050565b606060138054612dfa90614be9565b80601f0160208091040260200160405190810160405280929190818152602001828054612e2690614be9565b8015612e735780601f10612e4857610100808354040283529160200191612e73565b820191906000526020600020905b815481529060010190602001808311612e5657829003601f168201915b5050505050905090565b60606000821415612ec5576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612fd9565b600082905060005b60008214612ef7578080612ee090614c4c565b915050600a82612ef09190614a6a565b9150612ecd565b60008167ffffffffffffffff811115612f1357612f12614ddf565b5b6040519080825280601f01601f191660200182016040528015612f455781602001600182028036833780820191505090505b5090505b60008514612fd257600182612f5e9190614af5565b9150600a85612f6d9190614cc3565b6030612f799190614a14565b60f81b818381518110612f8f57612f8e614db0565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612fcb9190614a6a565b9450612f49565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b613053838383613395565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415613096576130918161339a565b6130d5565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146130d4576130d383826133e3565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156131185761311381613550565b613157565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614613156576131558282613621565b5b5b505050565b61316683836136a0565b61317360008484846131fe565b6131b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131a9906145b6565b60405180910390fd5b505050565b6000816040516020016131ca9190614425565b604051602081830303815290604052805190602001209050919050565b6000826131f4858461386e565b1490509392505050565b600061321f8473ffffffffffffffffffffffffffffffffffffffff16613921565b15613388578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02613248612677565b8786866040518563ffffffff1660e01b815260040161326a94939291906144ab565b602060405180830381600087803b15801561328457600080fd5b505af19250505080156132b557506040513d601f19601f820116820180604052508101906132b29190613da8565b60015b613338573d80600081146132e5576040519150601f19603f3d011682016040523d82523d6000602084013e6132ea565b606091505b50600081511415613330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613327906145b6565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161491505061338d565b600190505b949350505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600060016133f0846111d3565b6133fa9190614af5565b90506000600760008481526020019081526020016000205490508181146134df576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016008805490506135649190614af5565b905060006009600084815260200190815260200160002054905060006008838154811061359457613593614db0565b5b9060005260206000200154905080600883815481106135b6576135b5614db0565b5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061360557613604614d81565b5b6001900381819060005260206000200160009055905550505050565b600061362c836111d3565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613710576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161370790614756565b60405180910390fd5b6137198161267f565b15613759576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161375090614616565b60405180910390fd5b61376560008383613048565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546137b59190614a14565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b60008082905060005b845181101561391657600085828151811061389557613894614db0565b5b602002602001015190508083116138d65782816040516020016138b9929190614440565b604051602081830303815290604052805190602001209250613902565b80836040516020016138e9929190614440565b6040516020818303038152906040528051906020012092505b50808061390e90614c4c565b915050613877565b508091505092915050565b600080823b905060008111915050919050565b82805461394090614be9565b90600052602060002090601f01602090048101928261396257600085556139a9565b82601f1061397b57805160ff19168380011785556139a9565b828001600101855582156139a9579182015b828111156139a857825182559160200191906001019061398d565b5b5090506139b691906139ba565b5090565b5b808211156139d35760008160009055506001016139bb565b5090565b60006139ea6139e584614936565b614911565b905082815260208101848484011115613a0657613a05614e1d565b5b613a11848285614ba7565b509392505050565b6000613a2c613a2784614967565b614911565b905082815260208101848484011115613a4857613a47614e1d565b5b613a53848285614ba7565b509392505050565b600081359050613a6a8161554f565b92915050565b60008083601f840112613a8657613a85614e13565b5b8235905067ffffffffffffffff811115613aa357613aa2614e0e565b5b602083019150836020820283011115613abf57613abe614e18565b5b9250929050565b600081359050613ad581615566565b92915050565b600081359050613aea8161557d565b92915050565b600081359050613aff81615594565b92915050565b600081519050613b1481615594565b92915050565b600082601f830112613b2f57613b2e614e13565b5b8135613b3f8482602086016139d7565b91505092915050565b600082601f830112613b5d57613b5c614e13565b5b8135613b6d848260208601613a19565b91505092915050565b600081359050613b85816155ab565b92915050565b600060208284031215613ba157613ba0614e27565b5b6000613baf84828501613a5b565b91505092915050565b60008060408385031215613bcf57613bce614e27565b5b6000613bdd85828601613a5b565b9250506020613bee85828601613a5b565b9150509250929050565b600080600060608486031215613c1157613c10614e27565b5b6000613c1f86828701613a5b565b9350506020613c3086828701613a5b565b9250506040613c4186828701613b76565b9150509250925092565b60008060008060808587031215613c6557613c64614e27565b5b6000613c7387828801613a5b565b9450506020613c8487828801613a5b565b9350506040613c9587828801613b76565b925050606085013567ffffffffffffffff811115613cb657613cb5614e22565b5b613cc287828801613b1a565b91505092959194509250565b60008060408385031215613ce557613ce4614e27565b5b6000613cf385828601613a5b565b9250506020613d0485828601613ac6565b9150509250929050565b60008060408385031215613d2557613d24614e27565b5b6000613d3385828601613a5b565b9250506020613d4485828601613b76565b9150509250929050565b600060208284031215613d6457613d63614e27565b5b6000613d7284828501613adb565b91505092915050565b600060208284031215613d9157613d90614e27565b5b6000613d9f84828501613af0565b91505092915050565b600060208284031215613dbe57613dbd614e27565b5b6000613dcc84828501613b05565b91505092915050565b600060208284031215613deb57613dea614e27565b5b600082013567ffffffffffffffff811115613e0957613e08614e22565b5b613e1584828501613b48565b91505092915050565b600060208284031215613e3457613e33614e27565b5b6000613e4284828501613b76565b91505092915050565b600080600060408486031215613e6457613e63614e27565b5b6000613e7286828701613b76565b935050602084013567ffffffffffffffff811115613e9357613e92614e22565b5b613e9f86828701613a70565b92509250509250925092565b6000613eb78383614407565b60208301905092915050565b613ecc81614b29565b82525050565b613ee3613ede82614b29565b614c95565b82525050565b6000613ef4826149a8565b613efe81856149d6565b9350613f0983614998565b8060005b83811015613f3a578151613f218882613eab565b9750613f2c836149c9565b925050600181019050613f0d565b5085935050505092915050565b613f5081614b3b565b82525050565b613f67613f6282614b47565b614ca7565b82525050565b6000613f78826149b3565b613f8281856149e7565b9350613f92818560208601614bb6565b613f9b81614e2c565b840191505092915050565b6000613fb1826149be565b613fbb81856149f8565b9350613fcb818560208601614bb6565b613fd481614e2c565b840191505092915050565b6000613fea826149be565b613ff48185614a09565b9350614004818560208601614bb6565b80840191505092915050565b600061401d6013836149f8565b915061402882614e4a565b602082019050919050565b60006140406015836149f8565b915061404b82614e73565b602082019050919050565b6000614063602b836149f8565b915061406e82614e9c565b604082019050919050565b60006140866032836149f8565b915061409182614eeb565b604082019050919050565b60006140a9601f836149f8565b91506140b482614f3a565b602082019050919050565b60006140cc6026836149f8565b91506140d782614f63565b604082019050919050565b60006140ef601c836149f8565b91506140fa82614fb2565b602082019050919050565b60006141126017836149f8565b915061411d82614fdb565b602082019050919050565b60006141356024836149f8565b915061414082615004565b604082019050919050565b60006141586019836149f8565b915061416382615053565b602082019050919050565b600061417b601f836149f8565b91506141868261507c565b602082019050919050565b600061419e602c836149f8565b91506141a9826150a5565b604082019050919050565b60006141c16012836149f8565b91506141cc826150f4565b602082019050919050565b60006141e46038836149f8565b91506141ef8261511d565b604082019050919050565b6000614207602a836149f8565b91506142128261516c565b604082019050919050565b600061422a6029836149f8565b9150614235826151bb565b604082019050919050565b600061424d6020836149f8565b91506142588261520a565b602082019050919050565b6000614270601b836149f8565b915061427b82615233565b602082019050919050565b6000614293602c836149f8565b915061429e8261525c565b604082019050919050565b60006142b66020836149f8565b91506142c1826152ab565b602082019050919050565b60006142d96016836149f8565b91506142e4826152d4565b602082019050919050565b60006142fc6029836149f8565b9150614307826152fd565b604082019050919050565b600061431f602f836149f8565b915061432a8261534c565b604082019050919050565b60006143426024836149f8565b915061434d8261539b565b604082019050919050565b60006143656021836149f8565b9150614370826153ea565b604082019050919050565b60006143886031836149f8565b915061439382615439565b604082019050919050565b60006143ab602c836149f8565b91506143b682615488565b604082019050919050565b60006143ce6023836149f8565b91506143d9826154d7565b604082019050919050565b60006143f1601b836149f8565b91506143fc82615526565b602082019050919050565b61441081614b9d565b82525050565b61441f81614b9d565b82525050565b60006144318284613ed2565b60148201915081905092915050565b600061444c8285613f56565b60208201915061445c8284613f56565b6020820191508190509392505050565b60006144788285613fdf565b91506144848284613fdf565b91508190509392505050565b60006020820190506144a56000830184613ec3565b92915050565b60006080820190506144c06000830187613ec3565b6144cd6020830186613ec3565b6144da6040830185614416565b81810360608301526144ec8184613f6d565b905095945050505050565b600060208201905081810360008301526145118184613ee9565b905092915050565b600060208201905061452e6000830184613f47565b92915050565b6000602082019050818103600083015261454e8184613fa6565b905092915050565b6000602082019050818103600083015261456f81614010565b9050919050565b6000602082019050818103600083015261458f81614033565b9050919050565b600060208201905081810360008301526145af81614056565b9050919050565b600060208201905081810360008301526145cf81614079565b9050919050565b600060208201905081810360008301526145ef8161409c565b9050919050565b6000602082019050818103600083015261460f816140bf565b9050919050565b6000602082019050818103600083015261462f816140e2565b9050919050565b6000602082019050818103600083015261464f81614105565b9050919050565b6000602082019050818103600083015261466f81614128565b9050919050565b6000602082019050818103600083015261468f8161414b565b9050919050565b600060208201905081810360008301526146af8161416e565b9050919050565b600060208201905081810360008301526146cf81614191565b9050919050565b600060208201905081810360008301526146ef816141b4565b9050919050565b6000602082019050818103600083015261470f816141d7565b9050919050565b6000602082019050818103600083015261472f816141fa565b9050919050565b6000602082019050818103600083015261474f8161421d565b9050919050565b6000602082019050818103600083015261476f81614240565b9050919050565b6000602082019050818103600083015261478f81614263565b9050919050565b600060208201905081810360008301526147af81614286565b9050919050565b600060208201905081810360008301526147cf816142a9565b9050919050565b600060208201905081810360008301526147ef816142cc565b9050919050565b6000602082019050818103600083015261480f816142ef565b9050919050565b6000602082019050818103600083015261482f81614312565b9050919050565b6000602082019050818103600083015261484f81614335565b9050919050565b6000602082019050818103600083015261486f81614358565b9050919050565b6000602082019050818103600083015261488f8161437b565b9050919050565b600060208201905081810360008301526148af8161439e565b9050919050565b600060208201905081810360008301526148cf816143c1565b9050919050565b600060208201905081810360008301526148ef816143e4565b9050919050565b600060208201905061490b6000830184614416565b92915050565b600061491b61492c565b90506149278282614c1b565b919050565b6000604051905090565b600067ffffffffffffffff82111561495157614950614ddf565b5b61495a82614e2c565b9050602081019050919050565b600067ffffffffffffffff82111561498257614981614ddf565b5b61498b82614e2c565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000614a1f82614b9d565b9150614a2a83614b9d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614a5f57614a5e614cf4565b5b828201905092915050565b6000614a7582614b9d565b9150614a8083614b9d565b925082614a9057614a8f614d23565b5b828204905092915050565b6000614aa682614b9d565b9150614ab183614b9d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614aea57614ae9614cf4565b5b828202905092915050565b6000614b0082614b9d565b9150614b0b83614b9d565b925082821015614b1e57614b1d614cf4565b5b828203905092915050565b6000614b3482614b7d565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015614bd4578082015181840152602081019050614bb9565b83811115614be3576000848401525b50505050565b60006002820490506001821680614c0157607f821691505b60208210811415614c1557614c14614d52565b5b50919050565b614c2482614e2c565b810181811067ffffffffffffffff82111715614c4357614c42614ddf565b5b80604052505050565b6000614c5782614b9d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614c8a57614c89614cf4565b5b600182019050919050565b6000614ca082614cb1565b9050919050565b6000819050919050565b6000614cbc82614e3d565b9050919050565b6000614cce82614b9d565b9150614cd983614b9d565b925082614ce957614ce8614d23565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f53616c65206d7573742062652061637469766500000000000000000000000000600082015250565b7f42616c616e63652063616e2774206265207a65726f0000000000000000000000600082015250565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f65786365656473206d6178696d756d20707572636861736520616d6f756e7400600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4e6f74206f6e20726166666c652077686974656c697374000000000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f45746865722076616c75652073656e74206973206e6f7420636f727265637400600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f65786365656473206d617820737570706c790000000000000000000000000000600082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f6578636565647320746865206163636f756e7427732071756f74610000000000600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f50726573616c65206d7573742062652061637469766500000000000000000000600082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f436f6e7472616374206d65746164617461206d6574686f647320617265206c6f60008201527f636b656400000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f6578636565647320746865206163636f756e7427732070726573616c6520717560008201527f6f74610000000000000000000000000000000000000000000000000000000000602082015250565b7f6e6f742077686974656c697374656420666f722070726573616c650000000000600082015250565b61555881614b29565b811461556357600080fd5b50565b61556f81614b3b565b811461557a57600080fd5b50565b61558681614b47565b811461559157600080fd5b50565b61559d81614b51565b81146155a857600080fd5b50565b6155b481614b9d565b81146155bf57600080fd5b5056fea2646970667358221220472fcf3a0f48936985cd51eea975c3bff3b9b4d90d9c2c202f3dc040b9f1480264736f6c63430008070033
Verified Source Code Full Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
RoyalCubs.sol 206 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract RoyalCubs is ERC721Enumerable, Ownable {
// Accounts
address
private constant creator0Address = 0xd11351387b941F464e3A2bB11f3A0a63922f0DeE;
address
private constant creator1Address = 0x0C36922266e6cE0f92a357E20399F295c2b9ff10;
address
private constant creator2Address = 0x1eA3A4f1b89F3aDA30e7110e87b74a58fC1D33c3;
address
private constant creator3Address = 0xA286fee51f2FAAdDC79f921AaF8a559BBa77ce66;
// Minting Variables
uint256 public maxSupply = 8888;
uint256 public mintPrice = 0.22 ether;
uint256 public maxPurchase = 3;
uint256 public maxRafflePurchase = 2;
// Sale Status
bool public locked;
bool public presaleActive;
bool public publicSaleActive;
// Merkle Roots
bytes32 private whitelistRoot;
bytes32 private raffleRoot;
mapping(address => uint256) private mintCounts;
// Metadata
string _baseTokenURI;
// Events
event PublicSaleActivation(bool isActive);
event PresaleActivation(bool isActive);
// Contract
constructor() ERC721("The Royal Cubs", "TRC") {}
// Merkle Proofs
function setWhitelistRoot(bytes32 _root) external onlyOwner {
whitelistRoot = _root;
}
function setRaffleRoot(bytes32 _root) external onlyOwner {
raffleRoot = _root;
}
function _leaf(address _account) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(_account));
}
function isInTree(
address _account,
bytes32[] calldata _proof,
bytes32 _root
) internal pure returns (bool) {
return MerkleProof.verify(_proof, _root, _leaf(_account));
}
// Minting
function ownerMint(address _to, uint256 _count) external onlyOwner {
require(totalSupply() + _count <= maxSupply, "exceeds max supply");
for (uint256 i = 0; i < _count; i++) {
uint256 mintIndex = totalSupply();
_safeMint(_to, mintIndex);
}
}
function raffleMint(uint256 _count, bytes32[] calldata _proof)
external
payable
{
require(presaleActive, "Presale must be active");
require(isInTree(msg.sender, _proof, raffleRoot), "Not on raffle whitelist");
require(
balanceOf(msg.sender) + _count <= maxRafflePurchase,
"exceeds the account's presale quota"
);
require(totalSupply() + _count <= maxSupply, "exceeds max supply");
require(mintPrice * _count <= msg.value, "Ether value sent is not correct");
mintCounts[msg.sender] = mintCounts[msg.sender] + _count;
require(mintCounts[msg.sender] <= maxRafflePurchase, "exceeds the account's quota");
for (uint256 i = 0; i < _count; i++) {
uint256 mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
}
}
function presaleMint(uint256 _count, bytes32[] calldata _proof)
external
payable
{
require(presaleActive, "Presale must be active");
require(
isInTree(msg.sender, _proof, whitelistRoot),
"not whitelisted for presale"
);
require(
balanceOf(msg.sender) + _count <= maxPurchase,
"exceeds the account's quota"
);
require(totalSupply() + _count <= maxSupply, "exceeds max supply");
require(mintPrice * _count <= msg.value, "Ether value sent is not correct");
mintCounts[msg.sender] = mintCounts[msg.sender] + _count;
require(mintCounts[msg.sender] <= maxPurchase, "exceeds the account's quota");
for (uint256 i = 0; i < _count; i++) {
uint256 mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
}
}
function mint(uint256 _count) external payable {
require(publicSaleActive, "Sale must be active");
require(_count <= maxPurchase, "exceeds maximum purchase amount");
require(
balanceOf(msg.sender) + _count <= maxPurchase,
"exceeds the account's quota"
);
require(totalSupply() + _count <= maxSupply, "exceeds max supply");
require(mintPrice * _count <= msg.value, "Ether value sent is not correct");
mintCounts[msg.sender] = mintCounts[msg.sender] + _count;
require(mintCounts[msg.sender] <= maxPurchase, "exceeds the account's quota");
for (uint256 i = 0; i < _count; i++) {
uint256 mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
}
}
// Configurations
function lockMetadata() external onlyOwner {
locked = true;
}
function togglePresaleStatus() external onlyOwner {
presaleActive = !presaleActive;
emit PresaleActivation(presaleActive);
}
function toggleSaleStatus() external onlyOwner {
publicSaleActive = !publicSaleActive;
emit PublicSaleActivation(publicSaleActive);
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
mintPrice = _mintPrice;
}
function setMaxPurchase(uint256 _maxPurchase) external onlyOwner {
maxPurchase = _maxPurchase;
}
function withdrawAll() public onlyOwner {
uint256 balance = address(this).balance;
require(balance > 0, "Balance can't be zero");
uint256 creator1Dividend = (balance / 100) * 2;
uint256 creator2Dividend = (balance / 100) * 3;
uint256 creator3Dividend = (balance / 100) * 2;
payable(creator1Address).transfer(creator1Dividend);
payable(creator2Address).transfer(creator2Dividend);
payable(creator3Address).transfer(creator3Dividend);
payable(creator0Address).transfer(address(this).balance);
}
function getTotalSupply() external view returns (uint256) {
return totalSupply();
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function setBaseURI(string memory baseURI) external onlyOwner {
require(!locked, "Contract metadata methods are locked");
_baseTokenURI = baseURI;
}
function _baseURI() internal view virtual override returns (string memory) {
return _baseTokenURI;
}
}
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @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] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* 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 Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
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);
}
}
ERC721.sol 424 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @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.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @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`, 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 be 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 called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @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;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @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;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// 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);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
MerkleProof.sol 52 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
ERC721Enumerable.sol 163 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
Read Contract
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
getTotalSupply 0xc4e41b22 → uint256
isApprovedForAll 0xe985e9c5 → bool
locked 0xcf309012 → bool
maxPurchase 0x977b055b → uint256
maxRafflePurchase 0x1bf96182 → uint256
maxSupply 0xd5abeb01 → uint256
mintPrice 0x6817c76c → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
presaleActive 0x53135ca0 → bool
publicSaleActive 0xbc8893b4 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]
Write Contract 20 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
lockMetadata 0x989bdbb6
No parameters
mint 0xa0712d68
uint256 _count
ownerMint 0x484b973c
address _to
uint256 _count
presaleMint 0xe3e1e8ef
uint256 _count
bytes32[] _proof
raffleMint 0x7890b2c9
uint256 _count
bytes32[] _proof
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
setBaseURI 0x55f804b3
string baseURI
setMaxPurchase 0x71189742
uint256 _maxPurchase
setMintPrice 0xf4a0a528
uint256 _mintPrice
setRaffleRoot 0xf1901902
bytes32 _root
setWhitelistRoot 0xf5aa406d
bytes32 _root
togglePresaleStatus 0x7bffb4ce
No parameters
toggleSaleStatus 0x049c5c49
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdrawAll 0x853828b6
No parameters
Recent Transactions
This address has 1 on-chain transactions, but only 1.2% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →