Address Contract Partially Verified
Address
0xED37c99f3000D751c460c5e386F02a6dE7581407
Balance
0 ETH
Nonce
1
Code Size
18844 bytes
Creator
0x1FcdB39d...0C71 at tx 0x213a7f27...e34c68
Indexed Transactions
0
Contract Bytecode
18844 bytes
0x6080604052600436106102305760003560e01c80637cf8cf3f1161012e578063b767a098116100ab578063c87b56dd1161006f578063c87b56dd146107fd578063d5abeb011461083a578063e985e9c514610865578063efbd73f4146108a2578063f2fde38b146108cb57610230565b8063b767a09814610729578063b88d4fde14610752578063c23dc68f1461076e578063c2d52560146107ab578063c6275255146107d457610230565b806395d89b41116100f257806395d89b411461065157806399a2557a1461067c578063a0712d68146106b9578063a22cb465146106d5578063a945bf80146106fe57610230565b80637cf8cf3f146105795780637ec4a659146105a45780638462151c146105cd5780638da5cb5b1461060a5780638e1568ee1461063557610230565b80633ccfd60b116101bc57806362b99ad41161018057806362b99ad4146104925780636352211e146104bd5780636caede3d146104fa57806370a0823114610525578063715018a61461056257610230565b80633ccfd60b146103cc57806342842e0e146103e35780635503a0e8146103ff5780635bbb21771461042a5780635c975abb1461046757610230565b80630d978785116102035780630d978785146102f657806316ba10e01461033357806316c38b3c1461035c57806318160ddd1461038557806323b872dd146103b057610230565b806301ffc9a71461023557806306fdde0314610272578063081812fc1461029d578063095ea7b3146102da575b600080fd5b34801561024157600080fd5b5061025c60048036038101906102579190613550565b6108f4565b6040516102699190613598565b60405180910390f35b34801561027e57600080fd5b50610287610986565b604051610294919061364c565b60405180910390f35b3480156102a957600080fd5b506102c460048036038101906102bf91906136a4565b610a18565b6040516102d19190613712565b60405180910390f35b6102f460048036038101906102ef9190613759565b610a97565b005b34801561030257600080fd5b5061031d60048036038101906103189190613799565b610bdb565b60405161032a9190613598565b60405180910390f35b34801561033f57600080fd5b5061035a600480360381019061035591906138fb565b610f30565b005b34801561036857600080fd5b50610383600480360381019061037e9190613970565b610fc6565b005b34801561039157600080fd5b5061039a61105f565b6040516103a791906139ac565b60405180910390f35b6103ca60048036038101906103c591906139c7565b611076565b005b3480156103d857600080fd5b506103e161139b565b005b6103fd60048036038101906103f891906139c7565b6114ed565b005b34801561040b57600080fd5b5061041461150d565b604051610421919061364c565b60405180910390f35b34801561043657600080fd5b50610451600480360381019061044c9190613a7a565b61159b565b60405161045e9190613c2a565b60405180910390f35b34801561047357600080fd5b5061047c61165e565b6040516104899190613598565b60405180910390f35b34801561049e57600080fd5b506104a7611671565b6040516104b4919061364c565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df91906136a4565b6116ff565b6040516104f19190613712565b60405180910390f35b34801561050657600080fd5b5061050f611711565b60405161051c9190613598565b60405180910390f35b34801561053157600080fd5b5061054c60048036038101906105479190613799565b611724565b60405161055991906139ac565b60405180910390f35b34801561056e57600080fd5b506105776117dd565b005b34801561058557600080fd5b5061058e611865565b60405161059b91906139ac565b60405180910390f35b3480156105b057600080fd5b506105cb60048036038101906105c691906138fb565b61186b565b005b3480156105d957600080fd5b506105f460048036038101906105ef9190613799565b611901565b6040516106019190613d0a565b60405180910390f35b34801561061657600080fd5b5061061f611a4b565b60405161062c9190613712565b60405180910390f35b61064f600480360381019061064a91906136a4565b611a75565b005b34801561065d57600080fd5b50610666611f41565b604051610673919061364c565b60405180910390f35b34801561068857600080fd5b506106a3600480360381019061069e9190613d2c565b611fd3565b6040516106b09190613d0a565b60405180910390f35b6106d360048036038101906106ce91906136a4565b6121e7565b005b3480156106e157600080fd5b506106fc60048036038101906106f79190613d7f565b612339565b005b34801561070a57600080fd5b50610713612444565b60405161072091906139ac565b60405180910390f35b34801561073557600080fd5b50610750600480360381019061074b9190613970565b61244a565b005b61076c60048036038101906107679190613e60565b6124e3565b005b34801561077a57600080fd5b50610795600480360381019061079091906136a4565b612556565b6040516107a29190613f38565b60405180910390f35b3480156107b757600080fd5b506107d260048036038101906107cd91906136a4565b6125c0565b005b3480156107e057600080fd5b506107fb60048036038101906107f691906136a4565b612646565b005b34801561080957600080fd5b50610824600480360381019061081f91906136a4565b6126cc565b604051610831919061364c565b60405180910390f35b34801561084657600080fd5b5061084f612776565b60405161085c91906139ac565b60405180910390f35b34801561087157600080fd5b5061088c60048036038101906108879190613f53565b61277c565b6040516108999190613598565b60405180910390f35b3480156108ae57600080fd5b506108c960048036038101906108c49190613f93565b612810565b005b3480156108d757600080fd5b506108f260048036038101906108ed9190613799565b612936565b005b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061094f57506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061097f5750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60606002805461099590614002565b80601f01602080910402602001604051908101604052809291908181526020018280546109c190614002565b8015610a0e5780601f106109e357610100808354040283529160200191610a0e565b820191906000526020600020905b8154815290600101906020018083116109f157829003601f168201915b5050505050905090565b6000610a2382612a2e565b610a59576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610aa2826116ff565b90508073ffffffffffffffffffffffffffffffffffffffff16610ac3612a8d565b73ffffffffffffffffffffffffffffffffffffffff1614610b2657610aef81610aea612a8d565b61277c565b610b25576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b60008073afe12842e3703a3cc3a71d9463389b1bf2c5bc1c73ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401610c2b9190613712565b60206040518083038186803b158015610c4357600080fd5b505afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b9190614049565b1180610d235750600073880a965fae95f72fe3a3c8e87ed2c9478c8e0a2973ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401610cd19190613712565b60206040518083038186803b158015610ce957600080fd5b505afa158015610cfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d219190614049565b115b80610dca57506000735af0d9827e0c53e4799bb226655a1de152a425a573ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401610d789190613712565b60206040518083038186803b158015610d9057600080fd5b505afa158015610da4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc89190614049565b115b80610e7157506000738fc0d90f2c45a5e7f94904075c952e0943cfccfd73ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401610e1f9190613712565b60206040518083038186803b158015610e3757600080fd5b505afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190614049565b115b80610f1857506000738fc0d90f2c45a5e7f94904075c952e0943cfccfd73ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401610ec69190613712565b60206040518083038186803b158015610ede57600080fd5b505afa158015610ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f169190614049565b115b15610f265760019050610f2b565b600090505b919050565b610f38612a95565b73ffffffffffffffffffffffffffffffffffffffff16610f56611a4b565b73ffffffffffffffffffffffffffffffffffffffff1614610fac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa3906140c2565b60405180910390fd5b80600b9080519060200190610fc29291906133f2565b5050565b610fce612a95565b73ffffffffffffffffffffffffffffffffffffffff16610fec611a4b565b73ffffffffffffffffffffffffffffffffffffffff1614611042576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611039906140c2565b60405180910390fd5b80600f60006101000a81548160ff02191690831515021790555050565b6000611069612a9d565b6001546000540303905090565b600061108182612aa6565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146110e8576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806110f484612b74565b9150915061110a8187611105612a8d565b612b9b565b6111565761111f8661111a612a8d565b61277c565b611155576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156111bd576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111ca8686866001612bdf565b80156111d557600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154600101919050819055506112a38561127f888887612be5565b7c020000000000000000000000000000000000000000000000000000000017612c0d565b600460008681526020019081526020016000208190555060007c02000000000000000000000000000000000000000000000000000000008416141561132b576000600185019050600060046000838152602001908152602001600020541415611329576000548114611328578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46113938686866001612c38565b505050505050565b6113a3612a95565b73ffffffffffffffffffffffffffffffffffffffff166113c1611a4b565b73ffffffffffffffffffffffffffffffffffffffff1614611417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140e906140c2565b60405180910390fd5b6002600954141561145d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114549061412e565b60405180910390fd5b6002600981905550600061146f611a4b565b73ffffffffffffffffffffffffffffffffffffffff16476040516114929061417f565b60006040518083038185875af1925050503d80600081146114cf576040519150601f19603f3d011682016040523d82523d6000602084013e6114d4565b606091505b50509050806114e257600080fd5b506001600981905550565b611508838383604051806020016040528060008152506124e3565b505050565b600b805461151a90614002565b80601f016020809104026020016040519081016040528092919081815260200182805461154690614002565b80156115935780601f1061156857610100808354040283529160200191611593565b820191906000526020600020905b81548152906001019060200180831161157657829003601f168201915b505050505081565b6060600083839050905060008167ffffffffffffffff8111156115c1576115c06137d0565b5b6040519080825280602002602001820160405280156115fa57816020015b6115e7613478565b8152602001906001900390816115df5790505b50905060005b8281146116525761162986868381811061161d5761161c614194565b5b90506020020135612556565b82828151811061163c5761163b614194565b5b6020026020010181905250806001019050611600565b50809250505092915050565b600f60009054906101000a900460ff1681565b600a805461167e90614002565b80601f01602080910402602001604051908101604052809291908181526020018280546116aa90614002565b80156116f75780601f106116cc576101008083540402835291602001916116f7565b820191906000526020600020905b8154815290600101906020018083116116da57829003601f168201915b505050505081565b600061170a82612aa6565b9050919050565b600f60019054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561178c576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b6117e5612a95565b73ffffffffffffffffffffffffffffffffffffffff16611803611a4b565b73ffffffffffffffffffffffffffffffffffffffff1614611859576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611850906140c2565b60405180910390fd5b6118636000612c3e565b565b600c5481565b611873612a95565b73ffffffffffffffffffffffffffffffffffffffff16611891611a4b565b73ffffffffffffffffffffffffffffffffffffffff16146118e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118de906140c2565b60405180910390fd5b80600a90805190602001906118fd9291906133f2565b5050565b6060600080600061191185611724565b905060008167ffffffffffffffff81111561192f5761192e6137d0565b5b60405190808252806020026020018201604052801561195d5781602001602082028036833780820191505090505b509050611968613478565b6000611972612a9d565b90505b838614611a3d5761198581612d04565b915081604001511561199657611a32565b600073ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff16146119d657816000015194505b8773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611a315780838780600101985081518110611a2457611a23614194565b5b6020026020010181815250505b5b806001019050611975565b508195505050505050919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b8060008111611ab9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab09061420f565b60405180910390fd5b600e5481611ac561105f565b611acf919061425e565b1115611b10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0790614300565b60405180910390fd5b33600073afe12842e3703a3cc3a71d9463389b1bf2c5bc1c73ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401611b609190613712565b60206040518083038186803b158015611b7857600080fd5b505afa158015611b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bb09190614049565b1180611c585750600073880a965fae95f72fe3a3c8e87ed2c9478c8e0a2973ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401611c069190613712565b60206040518083038186803b158015611c1e57600080fd5b505afa158015611c32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c569190614049565b115b80611cff57506000735af0d9827e0c53e4799bb226655a1de152a425a573ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401611cad9190613712565b60206040518083038186803b158015611cc557600080fd5b505afa158015611cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfd9190614049565b115b80611da657506000738fc0d90f2c45a5e7f94904075c952e0943cfccfd73ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401611d549190613712565b60206040518083038186803b158015611d6c57600080fd5b505afa158015611d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da49190614049565b115b80611e4d57506000738fc0d90f2c45a5e7f94904075c952e0943cfccfd73ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401611dfb9190613712565b60206040518083038186803b158015611e1357600080fd5b505afa158015611e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4b9190614049565b115b611e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e839061436c565b60405180910390fd5b600f60019054906101000a900460ff16611edb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed2906143fe565b60405180910390fd5b82600c54611ee9919061441e565b341015611f2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f22906144c4565b60405180910390fd5b611f3c611f36612a95565b84612d2f565b505050565b606060038054611f5090614002565b80601f0160208091040260200160405190810160405280929190818152602001828054611f7c90614002565b8015611fc95780601f10611f9e57610100808354040283529160200191611fc9565b820191906000526020600020905b815481529060010190602001808311611fac57829003601f168201915b5050505050905090565b606081831061200e576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080612019612d4d565b9050612023612a9d565b85101561203557612032612a9d565b94505b80841115612041578093505b600061204c87611724565b90508486101561206f576000868603905081811015612069578091505b50612074565b600090505b60008167ffffffffffffffff8111156120905761208f6137d0565b5b6040519080825280602002602001820160405280156120be5781602001602082028036833780820191505090505b50905060008214156120d657809450505050506121e0565b60006120e188612556565b9050600081604001516120f657816000015190505b60008990505b88811415801561210c5750848714155b156121d25761211a81612d04565b925082604001511561212b576121c7565b600073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff161461216b57826000015191505b8a73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156121c657808488806001019950815181106121b9576121b8614194565b5b6020026020010181815250505b5b8060010190506120fc565b508583528296505050505050505b9392505050565b806000811161222b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122229061420f565b60405180910390fd5b600e548161223761105f565b612241919061425e565b1115612282576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227990614300565b60405180910390fd5b8180600d54612291919061441e565b3410156122d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ca906144c4565b60405180910390fd5b600f60009054906101000a900460ff1615612323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231a90614530565b60405180910390fd5b61233461232e612a95565b84612d2f565b505050565b8060076000612346612a8d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166123f3612a8d565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516124389190613598565b60405180910390a35050565b600d5481565b612452612a95565b73ffffffffffffffffffffffffffffffffffffffff16612470611a4b565b73ffffffffffffffffffffffffffffffffffffffff16146124c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bd906140c2565b60405180910390fd5b80600f60016101000a81548160ff02191690831515021790555050565b6124ee848484611076565b60008373ffffffffffffffffffffffffffffffffffffffff163b146125505761251984848484612d56565b61254f576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b61255e613478565b612566613478565b61256e612a9d565b831080612582575061257e612d4d565b8310155b1561259057809150506125bb565b61259983612d04565b90508060400151156125ae57809150506125bb565b6125b783612eb6565b9150505b919050565b6125c8612a95565b73ffffffffffffffffffffffffffffffffffffffff166125e6611a4b565b73ffffffffffffffffffffffffffffffffffffffff161461263c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612633906140c2565b60405180910390fd5b80600c8190555050565b61264e612a95565b73ffffffffffffffffffffffffffffffffffffffff1661266c611a4b565b73ffffffffffffffffffffffffffffffffffffffff16146126c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b9906140c2565b60405180910390fd5b80600d8190555050565b60606126d782612a2e565b612716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270d906145c2565b60405180910390fd5b6000612720612ed6565b90506000815111612740576040518060200160405280600081525061276e565b8061274a84612f68565b600b60405160200161275e939291906146b2565b6040516020818303038152906040525b915050919050565b600e5481565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b8160008111612854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284b9061420f565b60405180910390fd5b600e548161286061105f565b61286a919061425e565b11156128ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a290614300565b60405180910390fd5b6128b3612a95565b73ffffffffffffffffffffffffffffffffffffffff166128d1611a4b565b73ffffffffffffffffffffffffffffffffffffffff1614612927576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291e906140c2565b60405180910390fd5b6129318284612d2f565b505050565b61293e612a95565b73ffffffffffffffffffffffffffffffffffffffff1661295c611a4b565b73ffffffffffffffffffffffffffffffffffffffff16146129b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129a9906140c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612a22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1990614755565b60405180910390fd5b612a2b81612c3e565b50565b600081612a39612a9d565b11158015612a48575060005482105b8015612a86575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b600033905090565b600033905090565b60006001905090565b60008082905080612ab5612a9d565b11612b3d57600054811015612b3c5760006004600083815260200190815260200160002054905060007c010000000000000000000000000000000000000000000000000000000082161415612b3a575b6000811415612b30576004600083600190039350838152602001908152602001600020549050612b05565b8092505050612b6f565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8612bfc8686846130c9565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612d0c613478565b612d2860046000848152602001908152602001600020546130d2565b9050919050565b612d49828260405180602001604052806000815250613188565b5050565b60008054905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612d7c612a8d565b8786866040518563ffffffff1660e01b8152600401612d9e94939291906147ca565b602060405180830381600087803b158015612db857600080fd5b505af1925050508015612de957506040513d601f19601f82011682018060405250810190612de6919061482b565b60015b612e63573d8060008114612e19576040519150601f19603f3d011682016040523d82523d6000602084013e612e1e565b606091505b50600081511415612e5b576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b612ebe613478565b612ecf612eca83612aa6565b6130d2565b9050919050565b6060600a8054612ee590614002565b80601f0160208091040260200160405190810160405280929190818152602001828054612f1190614002565b8015612f5e5780601f10612f3357610100808354040283529160200191612f5e565b820191906000526020600020905b815481529060010190602001808311612f4157829003601f168201915b5050505050905090565b60606000821415612fb0576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506130c4565b600082905060005b60008214612fe2578080612fcb90614858565b915050600a82612fdb91906148d0565b9150612fb8565b60008167ffffffffffffffff811115612ffe57612ffd6137d0565b5b6040519080825280601f01601f1916602001820160405280156130305781602001600182028036833780820191505090505b5090505b600085146130bd576001826130499190614901565b9150600a856130589190614935565b6030613064919061425e565b60f81b81838151811061307a57613079614194565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856130b691906148d0565b9450613034565b8093505050505b919050565b60009392505050565b6130da613478565b81816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060a082901c816020019067ffffffffffffffff16908167ffffffffffffffff168152505060007c01000000000000000000000000000000000000000000000000000000008316141581604001901515908115158152505060e882901c816060019062ffffff16908162ffffff1681525050919050565b6131928383613225565b60008373ffffffffffffffffffffffffffffffffffffffff163b1461322057600080549050600083820390505b6131d26000868380600101945086612d56565b613208576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8181106131bf57816000541461321d57600080fd5b50505b505050565b6000805490506000821415613266576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6132736000848385612bdf565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506132ea836132db6000866000612be5565b6132e4856133e2565b17612c0d565b6004600083815260200190815260200160002081905550600080838301905073ffffffffffffffffffffffffffffffffffffffff85169150828260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600183015b81811461338b57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600181019050613350565b5060008214156133c7576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060008190555050506133dd6000848385612c38565b505050565b60006001821460e11b9050919050565b8280546133fe90614002565b90600052602060002090601f0160209004810192826134205760008555613467565b82601f1061343957805160ff1916838001178555613467565b82800160010185558215613467579182015b8281111561346657825182559160200191906001019061344b565b5b50905061347491906134c7565b5090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600062ffffff1681525090565b5b808211156134e05760008160009055506001016134c8565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61352d816134f8565b811461353857600080fd5b50565b60008135905061354a81613524565b92915050565b600060208284031215613566576135656134ee565b5b60006135748482850161353b565b91505092915050565b60008115159050919050565b6135928161357d565b82525050565b60006020820190506135ad6000830184613589565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156135ed5780820151818401526020810190506135d2565b838111156135fc576000848401525b50505050565b6000601f19601f8301169050919050565b600061361e826135b3565b61362881856135be565b93506136388185602086016135cf565b61364181613602565b840191505092915050565b600060208201905081810360008301526136668184613613565b905092915050565b6000819050919050565b6136818161366e565b811461368c57600080fd5b50565b60008135905061369e81613678565b92915050565b6000602082840312156136ba576136b96134ee565b5b60006136c88482850161368f565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006136fc826136d1565b9050919050565b61370c816136f1565b82525050565b60006020820190506137276000830184613703565b92915050565b613736816136f1565b811461374157600080fd5b50565b6000813590506137538161372d565b92915050565b600080604083850312156137705761376f6134ee565b5b600061377e85828601613744565b925050602061378f8582860161368f565b9150509250929050565b6000602082840312156137af576137ae6134ee565b5b60006137bd84828501613744565b91505092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61380882613602565b810181811067ffffffffffffffff82111715613827576138266137d0565b5b80604052505050565b600061383a6134e4565b905061384682826137ff565b919050565b600067ffffffffffffffff821115613866576138656137d0565b5b61386f82613602565b9050602081019050919050565b82818337600083830152505050565b600061389e6138998461384b565b613830565b9050828152602081018484840111156138ba576138b96137cb565b5b6138c584828561387c565b509392505050565b600082601f8301126138e2576138e16137c6565b5b81356138f284826020860161388b565b91505092915050565b600060208284031215613911576139106134ee565b5b600082013567ffffffffffffffff81111561392f5761392e6134f3565b5b61393b848285016138cd565b91505092915050565b61394d8161357d565b811461395857600080fd5b50565b60008135905061396a81613944565b92915050565b600060208284031215613986576139856134ee565b5b60006139948482850161395b565b91505092915050565b6139a68161366e565b82525050565b60006020820190506139c1600083018461399d565b92915050565b6000806000606084860312156139e0576139df6134ee565b5b60006139ee86828701613744565b93505060206139ff86828701613744565b9250506040613a108682870161368f565b9150509250925092565b600080fd5b600080fd5b60008083601f840112613a3a57613a396137c6565b5b8235905067ffffffffffffffff811115613a5757613a56613a1a565b5b602083019150836020820283011115613a7357613a72613a1f565b5b9250929050565b60008060208385031215613a9157613a906134ee565b5b600083013567ffffffffffffffff811115613aaf57613aae6134f3565b5b613abb85828601613a24565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613afc816136f1565b82525050565b600067ffffffffffffffff82169050919050565b613b1f81613b02565b82525050565b613b2e8161357d565b82525050565b600062ffffff82169050919050565b613b4c81613b34565b82525050565b608082016000820151613b686000850182613af3565b506020820151613b7b6020850182613b16565b506040820151613b8e6040850182613b25565b506060820151613ba16060850182613b43565b50505050565b6000613bb38383613b52565b60808301905092915050565b6000602082019050919050565b6000613bd782613ac7565b613be18185613ad2565b9350613bec83613ae3565b8060005b83811015613c1d578151613c048882613ba7565b9750613c0f83613bbf565b925050600181019050613bf0565b5085935050505092915050565b60006020820190508181036000830152613c448184613bcc565b905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c818161366e565b82525050565b6000613c938383613c78565b60208301905092915050565b6000602082019050919050565b6000613cb782613c4c565b613cc18185613c57565b9350613ccc83613c68565b8060005b83811015613cfd578151613ce48882613c87565b9750613cef83613c9f565b925050600181019050613cd0565b5085935050505092915050565b60006020820190508181036000830152613d248184613cac565b905092915050565b600080600060608486031215613d4557613d446134ee565b5b6000613d5386828701613744565b9350506020613d648682870161368f565b9250506040613d758682870161368f565b9150509250925092565b60008060408385031215613d9657613d956134ee565b5b6000613da485828601613744565b9250506020613db58582860161395b565b9150509250929050565b600067ffffffffffffffff821115613dda57613dd96137d0565b5b613de382613602565b9050602081019050919050565b6000613e03613dfe84613dbf565b613830565b905082815260208101848484011115613e1f57613e1e6137cb565b5b613e2a84828561387c565b509392505050565b600082601f830112613e4757613e466137c6565b5b8135613e57848260208601613df0565b91505092915050565b60008060008060808587031215613e7a57613e796134ee565b5b6000613e8887828801613744565b9450506020613e9987828801613744565b9350506040613eaa8782880161368f565b925050606085013567ffffffffffffffff811115613ecb57613eca6134f3565b5b613ed787828801613e32565b91505092959194509250565b608082016000820151613ef96000850182613af3565b506020820151613f0c6020850182613b16565b506040820151613f1f6040850182613b25565b506060820151613f326060850182613b43565b50505050565b6000608082019050613f4d6000830184613ee3565b92915050565b60008060408385031215613f6a57613f696134ee565b5b6000613f7885828601613744565b9250506020613f8985828601613744565b9150509250929050565b60008060408385031215613faa57613fa96134ee565b5b6000613fb88582860161368f565b9250506020613fc985828601613744565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061401a57607f821691505b6020821081141561402e5761402d613fd3565b5b50919050565b60008151905061404381613678565b92915050565b60006020828403121561405f5761405e6134ee565b5b600061406d84828501614034565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006140ac6020836135be565b91506140b782614076565b602082019050919050565b600060208201905081810360008301526140db8161409f565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614118601f836135be565b9150614123826140e2565b602082019050919050565b600060208201905081810360008301526141478161410b565b9050919050565b600081905092915050565b50565b600061416960008361414e565b915061417482614159565b600082019050919050565b600061418a8261415c565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f496e76616c6964206d696e7420616d6f756e7421000000000000000000000000600082015250565b60006141f96014836135be565b9150614204826141c3565b602082019050919050565b60006020820190508181036000830152614228816141ec565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006142698261366e565b91506142748361366e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156142a9576142a861422f565b5b828201905092915050565b7f4d617820737570706c7920657863656564656421000000000000000000000000600082015250565b60006142ea6014836135be565b91506142f5826142b4565b602082019050919050565b60006020820190508181036000830152614319816142dd565b9050919050565b7f596f7520646f6e7420616e79204d696c61647927732100000000000000000000600082015250565b60006143566016836135be565b915061436182614320565b602082019050919050565b6000602082019050818103600083015261438581614349565b9050919050565b7f5468652077686974656c6973742073616c65206973206e6f7420656e61626c6560008201527f6421000000000000000000000000000000000000000000000000000000000000602082015250565b60006143e86022836135be565b91506143f38261438c565b604082019050919050565b60006020820190508181036000830152614417816143db565b9050919050565b60006144298261366e565b91506144348361366e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561446d5761446c61422f565b5b828202905092915050565b7f496e73756666696369656e742066756e64732100000000000000000000000000600082015250565b60006144ae6013836135be565b91506144b982614478565b602082019050919050565b600060208201905081810360008301526144dd816144a1565b9050919050565b7f54686520636f6e74726163742069732070617573656421000000000000000000600082015250565b600061451a6017836135be565b9150614525826144e4565b602082019050919050565b600060208201905081810360008301526145498161450d565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b60006145ac602f836135be565b91506145b782614550565b604082019050919050565b600060208201905081810360008301526145db8161459f565b9050919050565b600081905092915050565b60006145f8826135b3565b61460281856145e2565b93506146128185602086016135cf565b80840191505092915050565b60008190508160005260206000209050919050565b6000815461464081614002565b61464a81866145e2565b945060018216600081146146655760018114614676576146a9565b60ff198316865281860193506146a9565b61467f8561461e565b60005b838110156146a157815481890152600182019150602081019050614682565b838801955050505b50505092915050565b60006146be82866145ed565b91506146ca82856145ed565b91506146d68284614633565b9150819050949350505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061473f6026836135be565b915061474a826146e3565b604082019050919050565b6000602082019050818103600083015261476e81614732565b9050919050565b600081519050919050565b600082825260208201905092915050565b600061479c82614775565b6147a68185614780565b93506147b68185602086016135cf565b6147bf81613602565b840191505092915050565b60006080820190506147df6000830187613703565b6147ec6020830186613703565b6147f9604083018561399d565b818103606083015261480b8184614791565b905095945050505050565b60008151905061482581613524565b92915050565b600060208284031215614841576148406134ee565b5b600061484f84828501614816565b91505092915050565b60006148638261366e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156148965761489561422f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006148db8261366e565b91506148e68361366e565b9250826148f6576148f56148a1565b5b828204905092915050565b600061490c8261366e565b91506149178361366e565b92508282101561492a5761492961422f565b5b828203905092915050565b60006149408261366e565b915061494b8361366e565b92508261495b5761495a6148a1565b5b82820690509291505056fea2646970667358221220dd46f723963a1a271c3c75d34466e0acd16135e30b40eebc4c77efc2fba5ef2664736f6c63430008090033
Verified Source Code Partial Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: No
MiladyColombia.sol 2194 lines
// SPDX-License-Identifier: MIT
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.0 (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);
}
}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts v4.4.0 (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/v4.4.0/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, 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;
}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev 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);
}
}
// File: https://github.com/chiru-labs/ERC721A/blob/main/contracts/IERC721A.sol
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the
* ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// =============================================================
// IERC721
// =============================================================
/**
* @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,
bytes calldata data
) external payable;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Transfers `tokenId` 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 payable;
/**
* @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 payable;
/**
* @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 the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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);
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @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);
// =============================================================
// IERC2309
// =============================================================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId`
* (inclusive) is transferred from `from` to `to`, as defined in the
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
// File: https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721 token receiver.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @title ERC721A
*
* @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
* Non-Fungible Token Standard, including the Metadata extension.
* Optimized for lower gas during batch mints.
*
* Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
* starting from `_startTokenId()`.
*
* Assumptions:
*
* - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
* - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
struct TokenApprovalRef {
address value;
}
// =============================================================
// CONSTANTS
// =============================================================
// Mask of an entry in packed address data.
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
// The bit position of `numberMinted` in packed address data.
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
// The bit position of `numberBurned` in packed address data.
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
// The bit position of `aux` in packed address data.
uint256 private constant _BITPOS_AUX = 192;
// Mask of all 256 bits in packed address data except the 64 bits for `aux`.
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
// The bit position of `startTimestamp` in packed ownership.
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
// The bit mask of the `burned` bit in packed ownership.
uint256 private constant _BITMASK_BURNED = 1 << 224;
// The bit position of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
// The bit mask of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
// The bit position of `extraData` in packed ownership.
uint256 private constant _BITPOS_EXTRA_DATA = 232;
// Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
// The mask of the lower 160 bits for addresses.
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
// The maximum `quantity` that can be minted with {_mintERC2309}.
// This limit is to prevent overflows on the address data entries.
// For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
// is required to cause an overflow, which is unrealistic.
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
// The `Transfer` event signature is given by:
// `keccak256(bytes("Transfer(address,address,uint256)"))`.
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
// =============================================================
// STORAGE
// =============================================================
// The next token ID to be minted.
uint256 private _currentIndex;
// The number of tokens burned.
uint256 private _burnCounter;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned.
// See {_packedOwnershipOf} implementation for details.
//
// Bits Layout:
// - [0..159] `addr`
// - [160..223] `startTimestamp`
// - [224] `burned`
// - [225] `nextInitialized`
// - [232..255] `extraData`
mapping(uint256 => uint256) private _packedOwnerships;
// Mapping owner address to address data.
//
// Bits Layout:
// - [0..63] `balance`
// - [64..127] `numberMinted`
// - [128..191] `numberBurned`
// - [192..255] `aux`
mapping(address => uint256) private _packedAddressData;
// Mapping from token ID to approved address.
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// =============================================================
// CONSTRUCTOR
// =============================================================
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @dev Returns the starting token ID.
* To change the starting token ID, please override this function.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the next token ID to be minted.
*/
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() public view virtual override returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than `_currentIndex - _startTokenId()` times.
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view virtual returns (uint256) {
// Counter underflow is impossible as `_currentIndex` does not decrement,
// and it is initialized to `_startTokenId()`.
unchecked {
return _currentIndex - _startTokenId();
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
// =============================================================
// ADDRESS DATA OPERATIONS
// =============================================================
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
/**
* Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
// Cast `aux` with assembly to avoid redundant masking.
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes
// of the XOR of all function selectors in the interface.
// See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
// (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
/**
* @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, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return '';
}
// =============================================================
// OWNERSHIPS OPERATIONS
// =============================================================
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around over time.
*/
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
// If not burned.
if (packed & _BITMASK_BURNED == 0) {
// Invariant:
// There will always be an initialized ownership slot
// (i.e. `ownership.addr != address(0) && ownership.burned == false`)
// before an unintialized ownership slot
// (i.e. `ownership.addr == address(0) && ownership.burned == false`)
// Hence, `curr` will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed will be zero.
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* @dev Returns the unpacked `TokenOwnership` struct from `packed`.
*/
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
/**
* @dev Packs ownership data into a single uint256.
*/
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
/**
* @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
*/
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
// For branchless setting of the `nextInitialized` flag.
assembly {
// `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @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) public payable virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId].value;
}
/**
* @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) public virtual override {
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @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. See {_mint}.
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex && // If within bounds,
_packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
}
/**
* @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
*/
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
msgSender := and(msgSender, _BITMASK_ADDRESS)
// `msgSender == owner || msgSender == approvedAddress`.
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
/**
* @dev Returns the storage slot and value for the approved address of `tokenId`.
*/
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
// The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
// =============================================================
// TRANSFER OPERATIONS
// =============================================================
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* 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
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// We can directly increment and decrement the balances.
--_packedAddressData[from]; // Updates: `balance -= 1`.
++_packedAddressData[to]; // Updates: `balance += 1`.
// Updates:
// - `address` to the next owner.
// - `startTimestamp` to the timestamp of transfering.
// - `burned` to `false`.
// - `nextInitialized` to `true`.
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (_packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != _currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
/**
* @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 memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @dev Hook that is called before a set of serially-ordered token IDs
* are about to be transferred. This includes minting.
* And also called before burning one token.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* 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, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token IDs
* have been transferred. This includes minting.
* And also called after one token has been burned.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
* transferred to `to`.
* - When `from` is zero, `tokenId` has been minted for `to`.
* - When `to` is zero, `tokenId` has been burned by `from`.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* `from` - Previous owner of the given token ID.
* `to` - Target address that will receive the token.
* `tokenId` - Token ID to be transferred.
...
// [truncated — 79470 bytes total]
Read Contract
balanceOf 0x70a08231 → uint256
explicitOwnershipOf 0xc23dc68f → tuple
explicitOwnershipsOf 0x5bbb2177 → tuple[]
getApproved 0x081812fc → address
getIsMiladyHolder 0x0d978785 → bool
isApprovedForAll 0xe985e9c5 → bool
maxSupply 0xd5abeb01 → uint256
miladyPrice 0x7cf8cf3f → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
publicPrice 0xa945bf80 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
tokensOfOwnerIn 0x99a2557a → uint256[]
totalSupply 0x18160ddd → uint256
uriPrefix 0x62b99ad4 → string
uriSuffix 0x5503a0e8 → string
whitelistMintEnabled 0x6caede3d → bool
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 _mintAmount
mintAsHolder 0x8e1568ee
uint256 _mintAmount
mintForAddress 0xefbd73f4
uint256 _mintAmount
address _receiver
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
setMiladyPrice 0xc2d52560
uint256 _miladyPrice
setPaused 0x16c38b3c
bool _state
setPublicPrice 0xc6275255
uint256 _publicPrice
setUriPrefix 0x7ec4a659
string _uriPrefix
setUriSuffix 0x16ba10e0
string _uriSuffix
setWhitelistMintEnabled 0xb767a098
bool _state
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address