Address Contract Verified
Address
0x3E27ac534Fa21504dBCEB0ca45d6822F1D02C5Fe
Balance
0 ETH
Nonce
1
Code Size
15041 bytes
Creator
0x9779908B...6AD6 at tx 0xafa6309c...37ba43
Indexed Transactions
0
Contract Bytecode
15041 bytes
0x60806040526004361061038c5760003560e01c80636c0360eb116101dc578063c668286211610102578063d38a18e5116100a0578063e8fc18b91161006f578063e8fc18b914610a6c578063e985e9c514610a8c578063f2fde38b14610ad5578063f72f565b14610af557600080fd5b8063d38a18e5146109d9578063d5abeb0114610a06578063d936547e14610a1c578063da3ef23f14610a4c57600080fd5b8063cabadaa0116100dc578063cabadaa014610953578063d058d7fb14610969578063d282b3ed14610989578063d36b2816146109a957600080fd5b8063c66828621461090b578063c87b56dd14610920578063c9b298f11461094057600080fd5b8063999abb7b1161017a578063afd76e2811610149578063afd76e281461087e578063b88d4fde1461089e578063b96109f6146108be578063be1ea055146108eb57600080fd5b8063999abb7b146108085780639ad74f2414610828578063a05d03fd14610848578063a22cb4651461085e57600080fd5b80637d6c4247116101b65780637d6c4247146107785780638462151c146107a85780638da5cb5b146107d557806395d89b41146107f357600080fd5b80636c0360eb1461072e57806370a0823114610743578063715018a61461076357600080fd5b8063309a3686116102c15780634f6ccce71161025f5780636352211e1161022e5780636352211e146106b85780636519f6cb146106d8578063686b2812146106ee57806368c348841461070e57600080fd5b80634f6ccce71461064857806351ebb41c1461066857806355f804b31461067e5780635c975abb1461069e57600080fd5b8063408cbf941161029b578063408cbf94146105d357806341a7a948146105f357806342842e0e1461060957806343c323101461062957600080fd5b8063309a3686146105955780633ccfd60b146105ab5780633e7ef6a2146105b357600080fd5b806318160ddd1161032e57806323b872dd1161030857806323b872dd1461052c5780632db115441461054c5780632dd19d0e1461055f5780632f745c591461057557600080fd5b806318160ddd146104bd57806319d92333146104ec5780632283f13c1461050c57600080fd5b806306fdde031161036a57806306fdde0314610408578063081812fc1461042a578063095ea7b3146104625780631698c0f41461048257600080fd5b806301ffc9a71461039157806302329a29146103c657806306741578146103e8575b600080fd5b34801561039d57600080fd5b506103b16103ac366004613693565b610b0b565b60405190151581526020015b60405180910390f35b3480156103d257600080fd5b506103e66103e1366004613678565b610bdc565b005b3480156103f457600080fd5b506103e66104033660046135c4565b610c3c565b34801561041457600080fd5b5061041d610cf0565b6040516103bd91906138c1565b34801561043657600080fd5b5061044a610445366004613716565b610d82565b6040516001600160a01b0390911681526020016103bd565b34801561046e57600080fd5b506103e661047d36600461359a565b610ddf565b34801561048e57600080fd5b506104af61049d36600461346a565b60196020526000908152604090205481565b6040519081526020016103bd565b3480156104c957600080fd5b506104af6000546001600160801b03600160801b82048116918116919091031690565b3480156104f857600080fd5b506103e66105073660046135c4565b610e9f565b34801561051857600080fd5b506103e6610527366004613716565b610f4f565b34801561053857600080fd5b506103e66105473660046134b8565b610f9c565b6103e661055a366004613716565b610fa7565b34801561056b57600080fd5b506104af60115481565b34801561058157600080fd5b506104af61059036600461359a565b611244565b3480156105a157600080fd5b506104af600f5481565b6103e661135a565b3480156105bf57600080fd5b506103e66105ce3660046135c4565b611658565b3480156105df57600080fd5b506103e66105ee36600461359a565b611708565b3480156105ff57600080fd5b506104af600b5481565b34801561061557600080fd5b506103e66106243660046134b8565b6117d8565b34801561063557600080fd5b506013546103b190610100900460ff1681565b34801561065457600080fd5b506104af610663366004613716565b6117f3565b34801561067457600080fd5b506104af600a5481565b34801561068a57600080fd5b506103e66106993660046136cd565b6118b7565b3480156106aa57600080fd5b506013546103b19060ff1681565b3480156106c457600080fd5b5061044a6106d3366004613716565b611912565b3480156106e457600080fd5b506104af600c5481565b3480156106fa57600080fd5b506103e66107093660046135c4565b611924565b34801561071a57600080fd5b506103e66107293660046135c4565b6119d4565b34801561073a57600080fd5b5061041d611a84565b34801561074f57600080fd5b506104af61075e36600461346a565b611b12565b34801561076f57600080fd5b506103e6611b7a565b34801561078457600080fd5b506103b161079336600461346a565b60166020526000908152604090205460ff1681565b3480156107b457600080fd5b506107c86107c336600461346a565b611bce565b6040516103bd919061387d565b3480156107e157600080fd5b506007546001600160a01b031661044a565b3480156107ff57600080fd5b5061041d611c70565b34801561081457600080fd5b506103e66108233660046135c4565b611c7f565b34801561083457600080fd5b506103e6610843366004613678565b611d2f565b34801561085457600080fd5b506104af60125481565b34801561086a57600080fd5b506103e6610879366004613570565b611d91565b34801561088a57600080fd5b506103e6610899366004613716565b611e40565b3480156108aa57600080fd5b506103e66108b93660046134f4565b61216a565b3480156108ca57600080fd5b506104af6108d936600461346a565b60186020526000908152604090205481565b3480156108f757600080fd5b506103e661090636600461372f565b6121a4565b34801561091757600080fd5b5061041d6121f7565b34801561092c57600080fd5b5061041d61093b366004613716565b612204565b6103e661094e366004613716565b6122e0565b34801561095f57600080fd5b506104af60105481565b34801561097557600080fd5b506103e661098436600461372f565b61284e565b34801561099557600080fd5b506103e66109a436600461372f565b6128a1565b3480156109b557600080fd5b506103b16109c436600461346a565b60146020526000908152604090205460ff1681565b3480156109e557600080fd5b506104af6109f436600461346a565b60176020526000908152604090205481565b348015610a1257600080fd5b506104af600d5481565b348015610a2857600080fd5b506103b1610a3736600461346a565b60156020526000908152604090205460ff1681565b348015610a5857600080fd5b506103e6610a673660046136cd565b6128f4565b348015610a7857600080fd5b506103e6610a87366004613716565b61294f565b348015610a9857600080fd5b506103b1610aa7366004613485565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b348015610ae157600080fd5b506103e6610af036600461346a565b61299c565b348015610b0157600080fd5b506104af600e5481565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480610b6e57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610ba257506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b80610bd657507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6007546001600160a01b03163314610c295760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c83398151915260448201526064015b60405180910390fd5b6013805460ff1916911515919091179055565b6007546001600160a01b03163314610c845760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b60005b8151811015610cec57600060146000848481518110610ca857610ca8613a29565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610ce4816139ce565b915050610c87565b5050565b606060018054610cff90613993565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2b90613993565b8015610d785780601f10610d4d57610100808354040283529160200191610d78565b820191906000526020600020905b815481529060010190602001808311610d5b57829003601f168201915b5050505050905090565b6000610d8d82612a69565b610dc3576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610dea82611912565b9050806001600160a01b0316836001600160a01b03161415610e38576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610e585750610e568133610aa7565b155b15610e8f576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e9a838383612a9d565b505050565b6007546001600160a01b03163314610ee75760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b60005b8151811015610cec57600060166000848481518110610f0b57610f0b613a29565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610f47816139ce565b915050610eea565b6007546001600160a01b03163314610f975760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b601255565b610e9a838383612b06565b60135460ff1615610ffa5760405162461bcd60e51b815260206004820152601360248201527f5448433a2053616c6520697320706175736564000000000000000000000000006044820152606401610c20565b60125460031461104c5760405162461bcd60e51b815260206004820152601b60248201527f5448433a205075626c69632053616c65206e6f742061637469766500000000006044820152606401610c20565b6000811161109c5760405162461bcd60e51b815260206004820152601b60248201527f5448433a204d757374206d696e74206174206c65617374206f6e6500000000006044820152606401610c20565b600d54816110c26000546001600160801b03600160801b82048116918116919091031690565b6110cc9190613905565b111561111a5760405162461bcd60e51b815260206004820152601960248201527f5448433a2043616e6e6f742065786365656420737570706c79000000000000006044820152606401610c20565b60105433600090815260186020526040902054611138908390613905565b11156111ac5760405162461bcd60e51b815260206004820152602360248201527f5448433a204d6178205075626c6963204d696e7420636f756e7420657863656560448201527f64656400000000000000000000000000000000000000000000000000000000006064820152608401610c20565b80600c546111ba9190613931565b3410156112095760405162461bcd60e51b815260206004820152601760248201527f5448433a20436f7374206e6f74207265636569766564210000000000000000006044820152606401610c20565b33600090815260186020526040902054611224908290613905565b336000818152601860205260409020919091556112419082612d71565b50565b600061124f83611b12565b8210611287576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080546001600160801b03169080805b8381101561135457600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161580159282019290925290611300575061134c565b80516001600160a01b03161561131557805192505b876001600160a01b0316836001600160a01b0316141561134a578684141561134357509350610bd692505050565b6001909301925b505b600101611298565b50600080fd5b6007546001600160a01b031633146113a25760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b60006113af60644761391d565b9050600073d2a76bfb1275bd36a8299b8f00c634fb1e4200ca6113d3836023613931565b604051600081818185875af1925050503d806000811461140f576040519150601f19603f3d011682016040523d82523d6000602084013e611414565b606091505b505090508061142257600080fd5b600073f299955d204fd09cee7a0787993c2851e6dff497611444846023613931565b604051600081818185875af1925050503d8060008114611480576040519150601f19603f3d011682016040523d82523d6000602084013e611485565b606091505b505090508061149357600080fd5b60007328528eb8221dda7a145ac2fdf40bb5430fed02896114b5856006613931565b604051600081818185875af1925050503d80600081146114f1576040519150601f19603f3d011682016040523d82523d6000602084013e6114f6565b606091505b505090508061150457600080fd5b600073bd0fff1d40f14187d89e74369571d75aec4608a2611526866002613931565b604051600081818185875af1925050503d8060008114611562576040519150601f19603f3d011682016040523d82523d6000602084013e611567565b606091505b505090508061157557600080fd5b600073ee645d6a20f49639a6aa436d3cd334105bd12b41611597876003613931565b604051600081818185875af1925050503d80600081146115d3576040519150601f19603f3d011682016040523d82523d6000602084013e6115d8565b606091505b50509050806115e657600080fd5b604051600090739779908b8069e9cf38342dda4c14e7c3fcbf6ad69047908381818185875af1925050503d806000811461163c576040519150601f19603f3d011682016040523d82523d6000602084013e611641565b606091505b505090508061164f57600080fd5b50505050505050565b6007546001600160a01b031633146116a05760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b60005b8151811015610cec576001601660008484815181106116c4576116c4613a29565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611700816139ce565b9150506116a3565b6007546001600160a01b031633146117505760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b600d54816117766000546001600160801b03600160801b82048116918116919091031690565b6117809190613905565b11156117ce5760405162461bcd60e51b815260206004820152601960248201527f5448433a2043616e6e6f742065786365656420737570706c79000000000000006044820152606401610c20565b610cec8282612d71565b610e9a8383836040518060200160405280600081525061216a565b600080546001600160801b031681805b8281101561188457600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615159181018290529061187b57858314156118745750949350505050565b6001909201915b50600101611803565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007546001600160a01b031633146118ff5760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b8051610cec90600890602084019061334d565b600061191d82612d8b565b5192915050565b6007546001600160a01b0316331461196c5760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b60005b8151811015610cec5760016015600084848151811061199057611990613a29565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806119cc816139ce565b91505061196f565b6007546001600160a01b03163314611a1c5760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b60005b8151811015610cec57600160146000848481518110611a4057611a40613a29565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611a7c816139ce565b915050611a1f565b60088054611a9190613993565b80601f0160208091040260200160405190810160405280929190818152602001828054611abd90613993565b8015611b0a5780601f10611adf57610100808354040283529160200191611b0a565b820191906000526020600020905b815481529060010190602001808311611aed57829003601f168201915b505050505081565b60006001600160a01b038216611b54576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526004602052604090205467ffffffffffffffff1690565b6007546001600160a01b03163314611bc25760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b611bcc6000612ec8565b565b60606000611bdb83611b12565b905060008167ffffffffffffffff811115611bf857611bf8613a3f565b604051908082528060200260200182016040528015611c21578160200160208202803683370190505b50905060005b82811015611c6857611c398582611244565b828281518110611c4b57611c4b613a29565b602090810291909101015280611c60816139ce565b915050611c27565b509392505050565b606060028054610cff90613993565b6007546001600160a01b03163314611cc75760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b60005b8151811015610cec57600060156000848481518110611ceb57611ceb613a29565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611d27816139ce565b915050611cca565b6007546001600160a01b03163314611d775760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b601380549115156101000261ff0019909216919091179055565b6001600160a01b038216331415611dd4576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60135460ff1615611e935760405162461bcd60e51b815260206004820152601360248201527f5448433a2053616c6520697320706175736564000000000000000000000000006044820152606401610c20565b601354610100900460ff1615611eeb5760405162461bcd60e51b815260206004820152601760248201527f5448433a204170652050617373206973207061757365640000000000000000006044820152606401610c20565b600160125410158015611f015750600360125411155b611f4d5760405162461bcd60e51b815260206004820152601860248201527f5448433a2043616e6e6f742075736520417065205061737300000000000000006044820152606401610c20565b60008111611f9d5760405162461bcd60e51b815260206004820152601b60248201527f5448433a204d757374206d696e74206174206c65617374206f6e6500000000006044820152606401610c20565b600d5481611fc36000546001600160801b03600160801b82048116918116919091031690565b611fcd9190613905565b111561201b5760405162461bcd60e51b815260206004820152601960248201527f5448433a2043616e6e6f742065786365656420737570706c79000000000000006044820152606401610c20565b3360009081526016602052604090205460ff166120a05760405162461bcd60e51b815260206004820152602360248201527f5448433a20596f7520646f206e6f74206861766520612054484320417065205060448201527f61737300000000000000000000000000000000000000000000000000000000006064820152608401610c20565b601154336000908152601960205260409020546120be908390613905565b11156121325760405162461bcd60e51b815260206004820152602160248201527f5448433a204170652050617373204d696e7420636f756e74206578636565646560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610c20565b3360009081526019602052604090205461214d908290613905565b336000818152601960205260409020919091556112419082612d71565b612175848484612b06565b61218184848484612f27565b61219e576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6007546001600160a01b031633146121ec5760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b601091909155600c55565b60098054611a9190613993565b606061220f82612a69565b6122815760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610c20565b600061228b613036565b905060008151116122ab57604051806020016040528060008152506122d9565b806122b584613045565b60096040516020016122c99392919061377d565b6040516020818303038152906040525b9392505050565b60135460ff16156123335760405162461bcd60e51b815260206004820152601360248201527f5448433a2053616c6520697320706175736564000000000000000000000000006044820152606401610c20565b6012546001148061234657506012546002145b6123925760405162461bcd60e51b815260206004820152601460248201527f5448433a2053616c65206e6f74206163746976650000000000000000000000006044820152606401610c20565b600081116123e25760405162461bcd60e51b815260206004820152601b60248201527f5448433a204d757374206d696e74206174206c65617374206f6e6500000000006044820152606401610c20565b600d54816124086000546001600160801b03600160801b82048116918116919091031690565b6124129190613905565b11156124605760405162461bcd60e51b815260206004820152601960248201527f5448433a2043616e6e6f742065786365656420737570706c79000000000000006044820152606401610c20565b601254600114156125c3573360009081526014602052604090205460ff1615156001146124cf5760405162461bcd60e51b815260206004820152601e60248201527f5448433a2041646472657373206973206e6f7420486967686c697374656400006044820152606401610c20565b600e54336000908152601760205260409020546124ed908390613905565b11156125615760405162461bcd60e51b815260206004820152602560248201527f5448433a204d617820486967686c697374206d696e7420636f756e742065786360448201527f65656465640000000000000000000000000000000000000000000000000000006064820152608401610c20565b80600a5461256f9190613931565b3410156125be5760405162461bcd60e51b815260206004820152601760248201527f5448433a20436f7374206e6f74207265636569766564210000000000000000006044820152606401610c20565b612816565b60125460021415612816573360009081526014602052604090205460ff1615156001148061260557503360009081526015602052604090205460ff1615156001145b6126775760405162461bcd60e51b815260206004820152602a60248201527f5448433a20596f7520617265206e6f7420486967686c6973746564206f72205760448201527f686974656c6973746564000000000000000000000000000000000000000000006064820152608401610c20565b3360009081526015602052604090205460ff1615156001141561271457600f54336000908152601760205260409020546126b2908390613905565b111561270f5760405162461bcd60e51b815260206004820152602660248201527f5448433a204d61782057686974656c697374206d696e7420636f756e7420657860448201526518d95959195960d21b6064820152608401610c20565b6127b9565b3360009081526014602052604090205460ff161515600114156127b957600f54600e546127419190613905565b3360009081526017602052604090205461275c908390613905565b11156127b95760405162461bcd60e51b815260206004820152602660248201527f5448433a204d61782057686974656c697374206d696e7420636f756e7420657860448201526518d95959195960d21b6064820152608401610c20565b80600b546127c79190613931565b3410156128165760405162461bcd60e51b815260206004820152601760248201527f5448433a20436f7374206e6f74207265636569766564210000000000000000006044820152606401610c20565b33600090815260176020526040902054612831908290613905565b336000818152601760205260409020919091556112419082612d71565b6007546001600160a01b031633146128965760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b600e91909155600a55565b6007546001600160a01b031633146128e95760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b600f91909155600b55565b6007546001600160a01b0316331461293c5760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b8051610cec90600990602084019061334d565b6007546001600160a01b031633146129975760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b601155565b6007546001600160a01b031633146129e45760405162461bcd60e51b81526020600482018190526024820152600080516020613a6c8339815191526044820152606401610c20565b6001600160a01b038116612a605760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c20565b61124181612ec8565b600080546001600160801b031682108015610bd6575050600090815260036020526040902054600160e01b900460ff161590565b600082815260056020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000612b1182612d8b565b80519091506000906001600160a01b0316336001600160a01b03161480612b3f57508151612b3f9033610aa7565b80612b5a575033612b4f84610d82565b6001600160a01b0316145b905080612b93576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b031614612be2576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416612c22576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612c326000848460000151612a9d565b6001600160a01b038581166000908152600460209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600390945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116612d27576000546001600160801b0316811015612d27578251600082815260036020908152604090912080549186015167ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b610cec828260405180602001604052806000815250613177565b60408051606081018252600080825260208201819052918101829052905482906001600160801b0316811015612e9657600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff16151591810182905290612e945780516001600160a01b031615612e2a579392505050565b5060001901600081815260036020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612e8f579392505050565b612e2a565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160a01b0384163b1561302a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612f6b903390899088908890600401613841565b602060405180830381600087803b158015612f8557600080fd5b505af1925050508015612fb5575060408051601f3d908101601f19168201909252612fb2918101906136b0565b60015b613010573d808015612fe3576040519150601f19603f3d011682016040523d82523d6000602084013e612fe8565b606091505b508051613008576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061302e565b5060015b949350505050565b606060088054610cff90613993565b60608161308557505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156130af5780613099816139ce565b91506130a89050600a8361391d565b9150613089565b60008167ffffffffffffffff8111156130ca576130ca613a3f565b6040519080825280601f01601f1916602001820160405280156130f4576020820181803683370190505b5090505b841561302e57613109600183613950565b9150613116600a866139e9565b613121906030613905565b60f81b81838151811061313657613136613a29565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613170600a8661391d565b94506130f8565b610e9a83838360016000546001600160801b03166001600160a01b0385166131cb576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83613202576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260046020908152604080832080546fffffffffffffffffffffffffffffffff19811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c018116909202179091558584526003909252822080546001600160e01b031916909317600160a01b42909216919091021790915581905b8581101561331e5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48380156132f457506132f26000888488612f27565b155b15613312576040516368d2bf6b60e11b815260040160405180910390fd5b6001918201910161329d565b50600080546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055612d6a565b82805461335990613993565b90600052602060002090601f01602090048101928261337b57600085556133c1565b82601f1061339457805160ff19168380011785556133c1565b828001600101855582156133c1579182015b828111156133c15782518255916020019190600101906133a6565b506133cd9291506133d1565b5090565b5b808211156133cd57600081556001016133d2565b600067ffffffffffffffff83111561340057613400613a3f565b613413601f8401601f19166020016138d4565b905082815283838301111561342757600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b038116811461345557600080fd5b919050565b8035801515811461345557600080fd5b60006020828403121561347c57600080fd5b6122d98261343e565b6000806040838503121561349857600080fd5b6134a18361343e565b91506134af6020840161343e565b90509250929050565b6000806000606084860312156134cd57600080fd5b6134d68461343e565b92506134e46020850161343e565b9150604084013590509250925092565b6000806000806080858703121561350a57600080fd5b6135138561343e565b93506135216020860161343e565b925060408501359150606085013567ffffffffffffffff81111561354457600080fd5b8501601f8101871361355557600080fd5b613564878235602084016133e6565b91505092959194509250565b6000806040838503121561358357600080fd5b61358c8361343e565b91506134af6020840161345a565b600080604083850312156135ad57600080fd5b6135b68361343e565b946020939093013593505050565b600060208083850312156135d757600080fd5b823567ffffffffffffffff808211156135ef57600080fd5b818501915085601f83011261360357600080fd5b81358181111561361557613615613a3f565b8060051b91506136268483016138d4565b8181528481019084860184860187018a101561364157600080fd5b600095505b8386101561366b576136578161343e565b835260019590950194918601918601613646565b5098975050505050505050565b60006020828403121561368a57600080fd5b6122d98261345a565b6000602082840312156136a557600080fd5b81356122d981613a55565b6000602082840312156136c257600080fd5b81516122d981613a55565b6000602082840312156136df57600080fd5b813567ffffffffffffffff8111156136f657600080fd5b8201601f8101841361370757600080fd5b61302e848235602084016133e6565b60006020828403121561372857600080fd5b5035919050565b6000806040838503121561374257600080fd5b50508035926020909101359150565b60008151808452613769816020860160208601613967565b601f01601f19169290920160200192915050565b6000845160206137908285838a01613967565b8551918401916137a38184848a01613967565b8554920191600090600181811c90808316806137c057607f831692505b8583108114156137de57634e487b7160e01b85526022600452602485fd5b8080156137f2576001811461380357613830565b60ff19851688528388019550613830565b60008b81526020902060005b858110156138285781548a82015290840190880161380f565b505083880195505b50939b9a5050505050505050505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526138736080830184613751565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156138b557835183529284019291840191600101613899565b50909695505050505050565b6020815260006122d96020830184613751565b604051601f8201601f1916810167ffffffffffffffff811182821017156138fd576138fd613a3f565b604052919050565b60008219821115613918576139186139fd565b500190565b60008261392c5761392c613a13565b500490565b600081600019048311821515161561394b5761394b6139fd565b500290565b600082821015613962576139626139fd565b500390565b60005b8381101561398257818101518382015260200161396a565b8381111561219e5750506000910152565b600181811c908216806139a757607f821691505b602082108114156139c857634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156139e2576139e26139fd565b5060010190565b6000826139f8576139f8613a13565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461124157600080fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212201341c74a442ac07b1b5f6fe29eb76d5bc75de2428201fb154f0da5cad09ec6e464736f6c63430008070033
Verified Source Code Full Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: Yes (1000 runs)
TheHighApesClub.sol 303 lines
// SPDX-License-Identifier: MIT
///////////// //// //// ///////////
//// //// //// ///
//// //// //// ///
//// //////////////// ///
//// //// //// ///
//// //// //// ///
//// //// //// ///////////
//// //// ////////////// ///////////// //// ////
//// //// //// //// //// ////
//// //// //// //// //// ////
//////////////// //// //// /////// ////////////////
//// //// //// //// //// //// ////
//// //// //// //// //// //// ////
//// //// ///////////// ////////////// //// ////
///// ///////////// ////////////// ////////////////
//// //// /// /// //// ////
//// //// /// /// //// ////
/// /// /// /// //// ////
/////////////// ///////////// /////////// ////////////////
/// /////// /// /// //// ////
/// /// /// //// ////
/// /// /// ////////////// ////////////////
pragma solidity ^0.8.7;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract TheHighApesClub is ERC721A, Ownable {
using Strings for uint256;
// URI
string public baseURI;
string public baseExtension = ".json";
// Supply & Cost
uint256 public highlistcost = 0.05 ether;
uint256 public whitelistcost = 0.055 ether;
uint256 public publiccost = 0.06 ether;
uint256 public maxSupply = 4200;
// Mint Limits
uint256 public maxHighlistMint = 3;
uint256 public maxWhitelistMint = 3;
uint256 public maxPublicMint = 5;
uint256 public maxApePassMint = 1;
// Sale Info
// 0 = Inactive, 1 = Highlist, 2 = Whitelist, 3 = Public
uint256 public currentSale = 0;
bool public paused = false;
bool public apepaused = false;
// Wallets Segregation
mapping(address => bool) public highlisted;
mapping(address => bool) public whitelisted;
mapping(address => bool) public apelisted;
// Claimed High Apes
mapping(address => uint256) public _PreClaimed;
mapping(address => uint256) public _PublicClaimed;
mapping(address => uint256) public _ApeClaimed;
constructor(
string memory _initBaseURI
) ERC721A("The High Apes Club", "THC") {
setBaseURI(_initBaseURI);
}
// Minting
function presaleMint(uint256 _mintAmount) public payable
{
require(!paused, "THC: Sale is paused");
require(currentSale == 1 || currentSale == 2, "THC: Sale not active");
require(_mintAmount > 0, "THC: Must mint at least one");
require((totalSupply() + _mintAmount) <= maxSupply, "THC: Cannot exceed supply");
if (currentSale == 1)
{
// Highlist Mint
require(highlisted[msg.sender] == true, "THC: Address is not Highlisted");
require(_PreClaimed[msg.sender] + _mintAmount <= maxHighlistMint, "THC: Max Highlist mint count exceeded");
require(msg.value >= highlistcost * _mintAmount, "THC: Cost not received!");
}
else if (currentSale == 2)
{
// Whitelist Mint
require(highlisted[msg.sender] == true || whitelisted[msg.sender] == true, "THC: You are not Highlisted or Whitelisted");
if (whitelisted[msg.sender] == true)
{
require((_PreClaimed[msg.sender] + _mintAmount) <= maxWhitelistMint, "THC: Max Whitelist mint count exceeded");
}
else if (highlisted[msg.sender] == true)
{
require((_PreClaimed[msg.sender] + _mintAmount) <= (maxHighlistMint + maxWhitelistMint), "THC: Max Whitelist mint count exceeded");
}
require(msg.value >= whitelistcost * _mintAmount, "THC: Cost not received!");
}
_PreClaimed[msg.sender] = _PreClaimed[msg.sender] + _mintAmount;
_safeMint(msg.sender, _mintAmount);
}
function publicMint(uint256 _mintAmount) public payable
{
require(!paused, "THC: Sale is paused");
require(currentSale == 3, "THC: Public Sale not active");
require(_mintAmount > 0, "THC: Must mint at least one");
require((totalSupply() + _mintAmount) <= maxSupply, "THC: Cannot exceed supply");
require(_PublicClaimed[msg.sender] + _mintAmount <= maxPublicMint, "THC: Max Public Mint count exceeded");
require(msg.value >= publiccost * _mintAmount, "THC: Cost not received!");
_PublicClaimed[msg.sender] = _PublicClaimed[msg.sender] + _mintAmount;
_safeMint(msg.sender, _mintAmount);
}
function apePassMint(uint256 _mintAmount) public
{
require(!paused, "THC: Sale is paused");
require(!apepaused, "THC: Ape Pass is paused");
require(currentSale >= 1 && currentSale <= 3, "THC: Cannot use Ape Pass");
require(_mintAmount > 0, "THC: Must mint at least one");
require((totalSupply() + _mintAmount) <= maxSupply, "THC: Cannot exceed supply");
require(apelisted[msg.sender], "THC: You do not have a THC Ape Pass");
require(_ApeClaimed[msg.sender] + _mintAmount <= maxApePassMint, "THC: Ape Pass Mint count exceeded");
_ApeClaimed[msg.sender] = _ApeClaimed[msg.sender] + _mintAmount;
_safeMint(msg.sender, _mintAmount);
}
function tokensOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 ownerTokenCount = balanceOf(_owner);
uint256[] memory tokenIds = new uint256[](ownerTokenCount);
for (uint256 i; i < ownerTokenCount; i++) {
tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokenIds;
}
// Internal
function mintOwner(address _to, uint256 _mintAmount) public onlyOwner
{
require((totalSupply() + _mintAmount) <= maxSupply, "THC: Cannot exceed supply");
_safeMint(_to, _mintAmount);
}
function setCurrentSale(uint256 _newSale) public onlyOwner {
currentSale = _newSale;
}
function updateHighlist(uint256 _newHighlistMax, uint256 _newHighlistCost) public onlyOwner {
maxHighlistMint = _newHighlistMax;
highlistcost = _newHighlistCost;
}
function updateWhitelist(uint256 _newWhitelistMax, uint256 _newWhitelistCost) public onlyOwner {
maxWhitelistMint = _newWhitelistMax;
whitelistcost = _newWhitelistCost;
}
function updatePublic(uint256 _newPublicMax, uint256 _newPublicCost) public onlyOwner {
maxPublicMint = _newPublicMax;
publiccost = _newPublicCost;
}
function updateApePass(uint256 _newApePassMax) public onlyOwner {
maxApePassMint = _newApePassMax;
}
function pause(bool _state) public onlyOwner {
paused = _state;
}
function apepasspause(bool _state) public onlyOwner {
apepaused = _state;
}
// URI
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory currentBaseURI = _baseURI();
return
bytes(currentBaseURI).length > 0
? string(
abi.encodePacked(
currentBaseURI,
tokenId.toString(),
baseExtension
)
)
: "";
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
baseExtension = _newBaseExtension;
}
// Add Listings
function addHighlistedUsers(address[] memory _users) public onlyOwner {
for (uint256 i = 0; i < _users.length; i++) {
highlisted[_users[i]] = true;
}
}
function removeHighlistedUser(address[] memory _users) public onlyOwner {
for (uint256 i = 0; i < _users.length; i++) {
highlisted[_users[i]] = false;
}
}
function addWhitelistUsers(address[] memory _users) public onlyOwner {
for (uint256 i = 0; i < _users.length; i++) {
whitelisted[_users[i]] = true;
}
}
function removeWhitelistUser(address[] memory _users) public onlyOwner {
for (uint256 i = 0; i < _users.length; i++) {
whitelisted[_users[i]] = false;
}
}
function addApePassUsers(address[] memory _users) public onlyOwner {
for (uint256 i = 0; i < _users.length; i++) {
apelisted[_users[i]] = true;
}
}
function removeApePassUser(address[] memory _users) public onlyOwner {
for (uint256 i = 0; i < _users.length; i++) {
apelisted[_users[i]] = false;
}
}
// Withdraw
function withdraw() public payable onlyOwner {
uint colbal = address(this).balance / 100;
// Jay
(bool a, ) = payable(0xd2a76Bfb1275bd36a8299b8F00c634fB1E4200CA).call{value: colbal * 35}("");
require(a);
// Kush
(bool b, ) = payable(0xf299955D204fD09CEE7A0787993C2851e6DFf497).call{value: colbal * 35}("");
require(b);
// Staked Whole Percentages
(bool c, ) = payable(0x28528eb8221DDA7A145Ac2FdF40bb5430Fed0289).call{value: colbal * 6}("");
require(c);
(bool d, ) = payable(0xBd0fff1d40f14187D89E74369571d75aEC4608A2).call{value: colbal * 2}("");
require(d);
(bool e, ) = payable(0xeE645d6a20F49639A6AA436d3cd334105Bd12b41).call{value: colbal * 3}("");
require(e);
// Community Wallet (Disperse S1 + S2 Percentages [420Verse] + Remainder Used as Community Funds)
(bool f, ) = payable(0x9779908B8069E9cF38342DDa4C14e7C3fcbf6AD6).call{value: address(this).balance}("");
require(f);
}
}
ERC721A.sol 628 lines
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error BurnedQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
*
* Assumes that the maximum token id cannot exceed 2**128 - 1 (max value of uint128).
*/
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using Address for address;
using Strings for uint256;
// Compiler will pack this into a single 256bit word.
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps track of the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
}
// Compiler will pack this into a single 256bit word.
struct AddressData {
// Realistically, 2**64-1 is more than enough.
uint64 balance;
// Keeps track of mint count with minimal overhead for tokenomics.
uint64 numberMinted;
// Keeps track of burn count with minimal overhead for tokenomics.
uint64 numberBurned;
}
// Compiler will pack the following
// _currentIndex and _burnCounter into a single 256bit word.
// The tokenId of the next token to be minted.
uint128 internal _currentIndex;
// The number of tokens burned.
uint128 internal _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 ownershipOf implementation for details.
mapping(uint256 => TokenOwnership) internal _ownerships;
// Mapping owner address to address data
mapping(address => AddressData) private _addressData;
// 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;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than _currentIndex times
unchecked {
return _currentIndex - _burnCounter;
}
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
* This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
* It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
uint256 numMintedSoFar = _currentIndex;
uint256 tokenIdsIdx;
// Counter overflow is impossible as the loop breaks when
// uint256 i is equal to another uint256 numMintedSoFar.
unchecked {
for (uint256 i; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (!ownership.burned) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
}
revert TokenIndexOutOfBounds();
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
* It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds();
uint256 numMintedSoFar = _currentIndex;
uint256 tokenIdsIdx;
address currOwnershipAddr;
// Counter overflow is impossible as the loop breaks when
// uint256 i is equal to another uint256 numMintedSoFar.
unchecked {
for (uint256 i; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
}
// Execution should never reach this point.
revert();
}
/**
* @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 ||
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
if (owner == address(0)) revert MintedQueryForZeroAddress();
return uint256(_addressData[owner].numberMinted);
}
function _numberBurned(address owner) internal view returns (uint256) {
if (owner == address(0)) revert BurnedQueryForZeroAddress();
return uint256(_addressData[owner].numberBurned);
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
uint256 curr = tokenId;
unchecked {
if (curr < _currentIndex) {
TokenOwnership memory ownership = _ownerships[curr];
if (!ownership.burned) {
if (ownership.addr != address(0)) {
return ownership;
}
// Invariant:
// There will always be an ownership that has an address and is not burned
// before an ownership that does not have an address and is not burned.
// Hence, curr will not underflow.
while (true) {
curr--;
ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
}
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return ownershipOf(tokenId).addr;
}
/**
* @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) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
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 override {
address owner = ERC721A.ownerOf(tokenId);
if (to == owner) revert ApprovalToCurrentOwner();
if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
if (operator == _msgSender()) revert ApproveToCaller();
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_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 {
_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 {
_transfer(from, to, tokenId);
if (!_checkOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @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`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < _currentIndex && !_ownerships[tokenId].burned;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, '');
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
_mint(to, quantity, _data, true);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _mint(
address to,
uint256 quantity,
bytes memory _data,
bool safe
) internal {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
// updatedIndex overflows if _currentIndex + quantity > 3.4e38 (2**128) - 1
unchecked {
_addressData[to].balance += uint64(quantity);
_addressData[to].numberMinted += uint64(quantity);
_ownerships[startTokenId].addr = to;
_ownerships[startTokenId].startTimestamp = uint64(block.timestamp);
uint256 updatedIndex = startTokenId;
for (uint256 i; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
if (safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
updatedIndex++;
}
_currentIndex = uint128(updatedIndex);
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* 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
) private {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
isApprovedForAll(prevOwnership.addr, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
// 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**128.
unchecked {
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId].addr = to;
_ownerships[tokenId].startTimestamp = uint64(block.timestamp);
// If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
uint256 nextTokenId = tokenId + 1;
if (_ownerships[nextTokenId].addr == address(0)) {
// This will suffice for checking _exists(nextTokenId),
// as a burned slot cannot contain the zero address.
if (nextTokenId < _currentIndex) {
_ownerships[nextTokenId].addr = prevOwnership.addr;
_ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @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 {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
_beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
// 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**128.
unchecked {
_addressData[prevOwnership.addr].balance -= 1;
_addressData[prevOwnership.addr].numberBurned += 1;
// Keep track of who burned the token, and the timestamp of burning.
_ownerships[tokenId].addr = prevOwnership.addr;
_ownerships[tokenId].startTimestamp = uint64(block.timestamp);
_ownerships[tokenId].burned = true;
// If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
uint256 nextTokenId = tokenId + 1;
if (_ownerships[nextTokenId].addr == address(0)) {
// This will suffice for checking _exists(nextTokenId),
// as a burned slot cannot contain the zero address.
if (nextTokenId < _currentIndex) {
_ownerships[nextTokenId].addr = prevOwnership.addr;
_ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(prevOwnership.addr, address(0), tokenId);
_afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);
// Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
unchecked {
_burnCounter++;
}
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @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(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @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 {}
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return 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);
}
}
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);
}
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);
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (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);
/**
* @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
_ApeClaimed 0x1698c0f4 → uint256
_PreClaimed 0xd38a18e5 → uint256
_PublicClaimed 0xb96109f6 → uint256
apelisted 0x7d6c4247 → bool
apepaused 0x43c32310 → bool
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
baseURI 0x6c0360eb → string
currentSale 0xa05d03fd → uint256
getApproved 0x081812fc → address
highlistcost 0x51ebb41c → uint256
highlisted 0xd36b2816 → bool
isApprovedForAll 0xe985e9c5 → bool
maxApePassMint 0x2dd19d0e → uint256
maxHighlistMint 0xf72f565b → uint256
maxPublicMint 0xcabadaa0 → uint256
maxSupply 0xd5abeb01 → uint256
maxWhitelistMint 0x309a3686 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
publiccost 0x6519f6cb → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
totalSupply 0x18160ddd → uint256
whitelistcost 0x41a7a948 → uint256
whitelisted 0xd936547e → bool
Write Contract 27 functions
These functions modify contract state and require a wallet transaction to execute.
addApePassUsers 0x3e7ef6a2
address[] _users
addHighlistedUsers 0x68c34884
address[] _users
addWhitelistUsers 0x686b2812
address[] _users
apePassMint 0xafd76e28
uint256 _mintAmount
apepasspause 0x9ad74f24
bool _state
approve 0x095ea7b3
address to
uint256 tokenId
mintOwner 0x408cbf94
address _to
uint256 _mintAmount
pause 0x02329a29
bool _state
presaleMint 0xc9b298f1
uint256 _mintAmount
publicMint 0x2db11544
uint256 _mintAmount
removeApePassUser 0x19d92333
address[] _users
removeHighlistedUser 0x06741578
address[] _users
removeWhitelistUser 0x999abb7b
address[] _users
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseExtension 0xda3ef23f
string _newBaseExtension
setBaseURI 0x55f804b3
string _newBaseURI
setCurrentSale 0x2283f13c
uint256 _newSale
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
updateApePass 0xe8fc18b9
uint256 _newApePassMax
updateHighlist 0xd058d7fb
uint256 _newHighlistMax
uint256 _newHighlistCost
updatePublic 0xbe1ea055
uint256 _newPublicMax
uint256 _newPublicCost
updateWhitelist 0xd282b3ed
uint256 _newWhitelistMax
uint256 _newWhitelistCost
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address