Address Contract Partially Verified
Address
0xf62Be1feA70b1eDccDc5657C1fb8D229CCe31bb7
Balance
0 ETH
Nonce
1
Code Size
10943 bytes
Creator
0x11519597...8174 at tx 0x32e12456...5645b7
Indexed Transactions
0 (1 on-chain, 1.4% indexed)
Contract Bytecode
10943 bytes
0x6080604052600436106102045760003560e01c806355f804b31161011857806395d89b41116100a0578063b88d4fde1161006f578063b88d4fde14610583578063c87b56dd146105a3578063d7224ba0146105c3578063e985e9c5146105d9578063f2fde38b1461062257600080fd5b806395d89b411461051b5780639f15df1214610530578063a0712d6814610550578063a22cb4651461056357600080fd5b80636c0360eb116100e75780636c0360eb1461049357806370a08231146104a8578063715018a6146104c85780637cb64759146104dd5780638da5cb5b146104fd57600080fd5b806355f804b314610421578063614bfc55146104415780636352211e146104575780636bde26271461047757600080fd5b806323b872dd1161019b5780632f745c591161016a5780632f745c591461039657806332cb6b0c146103b65780633ccfd60b146103cc57806342842e0e146103e15780634f6ccce71461040157600080fd5b806323b872dd1461032557806327b6fb33146103455780632a234e57146103655780632eb4a7ab1461038057600080fd5b8063081812fc116101d7578063081812fc14610298578063095ea7b3146102d057806318160ddd146102f05780631ff8f6021461030557600080fd5b806301ffc9a714610209578063027752401461023e578063061431a81461026157806306fdde0314610276575b600080fd5b34801561021557600080fd5b506102296102243660046122d1565b610642565b60405190151581526020015b60405180910390f35b34801561024a57600080fd5b50610253600281565b604051908152602001610235565b61027461026f3660046122ee565b6106af565b005b34801561028257600080fd5b5061028b6108ac565b60405161023591906123c5565b3480156102a457600080fd5b506102b86102b33660046123d8565b61093e565b6040516001600160a01b039091168152602001610235565b3480156102dc57600080fd5b506102746102eb36600461240d565b6109c9565b3480156102fc57600080fd5b50600154610253565b34801561031157600080fd5b50610253610320366004612437565b610adb565b34801561033157600080fd5b50610274610340366004612452565b610ae6565b34801561035157600080fd5b506102746103603660046123d8565b610af1565b34801561037157600080fd5b5061025366e6ed27d666800081565b34801561038c57600080fd5b50610253600b5481565b3480156103a257600080fd5b506102536103b136600461240d565b610b20565b3480156103c257600080fd5b50610253610d0581565b3480156103d857600080fd5b50610274610c97565b3480156103ed57600080fd5b506102746103fc366004612452565b610faf565b34801561040d57600080fd5b5061025361041c3660046123d8565b610fca565b34801561042d57600080fd5b5061027461043c36600461248e565b611033565b34801561044d57600080fd5b50610253600a5481565b34801561046357600080fd5b506102b86104723660046123d8565b61106a565b34801561048357600080fd5b5061025367011c37937e08000081565b34801561049f57600080fd5b5061028b61107c565b3480156104b457600080fd5b506102536104c3366004612437565b61110a565b3480156104d457600080fd5b5061027461119b565b3480156104e957600080fd5b506102746104f83660046123d8565b6111d1565b34801561050957600080fd5b506000546001600160a01b03166102b8565b34801561052757600080fd5b5061028b611200565b34801561053c57600080fd5b5061027461054b366004612500565b61120f565b61027461055e3660046123d8565b61127c565b34801561056f57600080fd5b5061027461057e36600461252c565b6113c6565b34801561058f57600080fd5b5061027461059e36600461257e565b61148a565b3480156105af57600080fd5b5061028b6105be3660046123d8565b6114c3565b3480156105cf57600080fd5b5061025360085481565b3480156105e557600080fd5b506102296105f436600461265a565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561062e57600080fd5b5061027461063d366004612437565b611590565b60006001600160e01b031982166380ac58cd60e01b148061067357506001600160e01b03198216635b5e139f60e01b145b8061068e57506001600160e01b0319821663780e9d6360e01b145b806106a957506301ffc9a760e01b6001600160e01b03198316145b92915050565b610d05836106bc60015490565b6106c6919061269a565b11156106ed5760405162461bcd60e51b81526004016106e4906126b2565b60405180910390fd5b600a546001146107305760405162461bcd60e51b815260206004820152600e60248201526d13525395125391d7d4105554d15160921b60448201526064016106e4565b61073a8282611628565b61077d5760405162461bcd60e51b815260206004820152601460248201527324a72b20a624a22fa6a2a925a622afa82927a7a360611b60448201526064016106e4565b336000908152600d602052604090205460029061079b90859061269a565b11156107fa5760405162461bcd60e51b815260206004820152602860248201527f4d494e545f455843454544535f4c494d49545f414c4c4f5745445f464f525f5760448201526712125511531254d560c21b60648201526084016106e4565b60008311801561080b575060028311155b6108275760405162461bcd60e51b81526004016106e4906126e9565b346108398466e6ed27d6668000612733565b11156108785760405162461bcd60e51b815260206004820152600e60248201526d414d4f554e545f544f4f5f4c4f5760901b60448201526064016106e4565b336000908152600d60205260408120805485929061089790849061269a565b909155506108a7905033846116af565b505050565b6060600280546108bb90612752565b80601f01602080910402602001604051908101604052809291908181526020018280546108e790612752565b80156109345780601f1061090957610100808354040283529160200191610934565b820191906000526020600020905b81548152906001019060200180831161091757829003601f168201915b5050505050905090565b600061094b826001541190565b6109ad5760405162461bcd60e51b815260206004820152602d60248201527f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560448201526c3c34b9ba32b73a103a37b5b2b760991b60648201526084016106e4565b506000908152600660205260409020546001600160a01b031690565b60006109d48261106a565b9050806001600160a01b0316836001600160a01b031603610a425760405162461bcd60e51b815260206004820152602260248201527f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60448201526132b960f11b60648201526084016106e4565b336001600160a01b0382161480610a5e5750610a5e81336105f4565b610ad05760405162461bcd60e51b815260206004820152603960248201527f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656420666f7220616c6c0000000000000060648201526084016106e4565b6108a78383836116c9565b60006106a982611725565b6108a78383836117c3565b6000546001600160a01b03163314610b1b5760405162461bcd60e51b81526004016106e49061278c565b600a55565b6000610b2b8361110a565b8210610b845760405162461bcd60e51b815260206004820152602260248201527f455243373231413a206f776e657220696e646578206f7574206f6620626f756e604482015261647360f01b60648201526084016106e4565b6000610b8f60015490565b905060008060005b83811015610c37576000818152600460209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff169183019190915215610bea57805192505b876001600160a01b0316836001600160a01b031603610c2457868403610c16575093506106a992505050565b83610c20816127c1565b9450505b5080610c2f816127c1565b915050610b97565b5060405162461bcd60e51b815260206004820152602e60248201527f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060448201526d0deeedccae440c4f240d2dcc8caf60931b60648201526084016106e4565b6000546001600160a01b03163314610cc15760405162461bcd60e51b81526004016106e49061278c565b600260095403610d135760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106e4565b60026009556000610d27620186a0476127f0565b90506000725957b04afa8a1b65c4632753d2c4da6d84b64f610d4b836161a8612733565b604051600081818185875af1925050503d8060008114610d87576040519150601f19603f3d011682016040523d82523d6000602084013e610d8c565b606091505b509091506000905073ec4f373a70d5bb5371df8a33951b898b7219f82c610db5846161a8612733565b604051600081818185875af1925050503d8060008114610df1576040519150601f19603f3d011682016040523d82523d6000602084013e610df6565b606091505b5090915060009050734494949245c3c432177c66adf32e272477d6aafc610e1f856161a8612733565b604051600081818185875af1925050503d8060008114610e5b576040519150601f19603f3d011682016040523d82523d6000602084013e610e60565b606091505b5090915060009050736e1af0e043c18ead53a5b9886d4901dd6b67a22f610e8986612bd9612733565b604051600081818185875af1925050503d8060008114610ec5576040519150601f19603f3d011682016040523d82523d6000602084013e610eca565b606091505b509091506000905073e0c5123b0fd1a7d94bb8d84bbaf1026b699c6dc6610ef387612bd9612733565b604051600081818185875af1925050503d8060008114610f2f576040519150601f19603f3d011682016040523d82523d6000602084013e610f34565b606091505b509091506000905073e8f46fad3478eea1c67ec027952b5120aa8848b2610f5d886109f6612733565b604051600081818185875af1925050503d8060008114610f99576040519150601f19603f3d011682016040523d82523d6000602084013e610f9e565b606091505b505060016009555050505050505050565b6108a78383836040518060200160405280600081525061148a565b6000610fd560015490565b821061102f5760405162461bcd60e51b815260206004820152602360248201527f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f756044820152626e647360e81b60648201526084016106e4565b5090565b6000546001600160a01b0316331461105d5760405162461bcd60e51b81526004016106e49061278c565b600c6108a782848361284a565b600061107582611b4b565b5192915050565b600c805461108990612752565b80601f01602080910402602001604051908101604052809291908181526020018280546110b590612752565b80156111025780601f106110d757610100808354040283529160200191611102565b820191906000526020600020905b8154815290600101906020018083116110e557829003601f168201915b505050505081565b60006001600160a01b0382166111765760405162461bcd60e51b815260206004820152602b60248201527f455243373231413a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084016106e4565b506001600160a01b03166000908152600560205260409020546001600160801b031690565b6000546001600160a01b031633146111c55760405162461bcd60e51b81526004016106e49061278c565b6111cf6000611cf5565b565b6000546001600160a01b031633146111fb5760405162461bcd60e51b81526004016106e49061278c565b600b55565b6060600380546108bb90612752565b6000546001600160a01b031633146112395760405162461bcd60e51b81526004016106e49061278c565b610d058261124660015490565b611250919061269a565b111561126e5760405162461bcd60e51b81526004016106e4906126b2565b61127881836116af565b5050565b610d058161128960015490565b611293919061269a565b11156112b15760405162461bcd60e51b81526004016106e4906126b2565b600a546002146112f45760405162461bcd60e51b815260206004820152600e60248201526d13525395125391d7d4105554d15160921b60448201526064016106e4565b600081118015611305575060028111155b6113215760405162461bcd60e51b81526004016106e4906126e9565b346113348267011c37937e080000612733565b11156113735760405162461bcd60e51b815260206004820152600e60248201526d414d4f554e545f544f4f5f4c4f5760901b60448201526064016106e4565b3233146113b95760405162461bcd60e51b815260206004820152601460248201527353454e4445525f49535f4e4f545f414e5f454f4160601b60448201526064016106e4565b6113c333826116af565b50565b336001600160a01b0383160361141e5760405162461bcd60e51b815260206004820152601a60248201527f455243373231413a20617070726f766520746f2063616c6c657200000000000060448201526064016106e4565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6114958484846117c3565b6114a184848484611d45565b6114bd5760405162461bcd60e51b81526004016106e49061290b565b50505050565b60606114d0826001541190565b6115345760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016106e4565b600061153e611e46565b9050600081511161155e5760405180602001604052806000815250611589565b8061156884611e55565b60405160200161157992919061295e565b6040516020818303038152906040525b9392505050565b6000546001600160a01b031633146115ba5760405162461bcd60e51b81526004016106e49061278c565b6001600160a01b03811661161f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e4565b6113c381611cf5565b6040516bffffffffffffffffffffffff193360601b16602082015260009081906034016040516020818303038152906040528051906020012090506116a7600b5482868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929493925050611f569050565b949350505050565b611278828260405180602001604052806000815250611f6c565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006001600160a01b0382166117975760405162461bcd60e51b815260206004820152603160248201527f455243373231413a206e756d626572206d696e74656420717565727920666f7260448201527020746865207a65726f206164647265737360781b60648201526084016106e4565b506001600160a01b0316600090815260056020526040902054600160801b90046001600160801b031690565b60006117ce82611b4b565b80519091506000906001600160a01b0316336001600160a01b031614806118055750336117fa8461093e565b6001600160a01b0316145b806118175750815161181790336105f4565b9050806118815760405162461bcd60e51b815260206004820152603260248201527f455243373231413a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016106e4565b846001600160a01b031682600001516001600160a01b0316146118f55760405162461bcd60e51b815260206004820152602660248201527f455243373231413a207472616e736665722066726f6d20696e636f72726563746044820152651037bbb732b960d11b60648201526084016106e4565b6001600160a01b0384166119595760405162461bcd60e51b815260206004820152602560248201527f455243373231413a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016106e4565b61196960008484600001516116c9565b6001600160a01b038516600090815260056020526040812080546001929061199b9084906001600160801b031661298d565b82546101009290920a6001600160801b038181021990931691831602179091556001600160a01b038616600090815260056020526040812080546001945090926119e7918591166129b5565b82546001600160801b039182166101009390930a9283029190920219909116179055506040805180820182526001600160a01b03808716825267ffffffffffffffff428116602080850191825260008981526004909152948520935184549151909216600160a01b026001600160e01b03199091169190921617179055611a6f84600161269a565b6000818152600460205260409020549091506001600160a01b0316611b0157611a99816001541190565b15611b015760408051808201825284516001600160a01b03908116825260208087015167ffffffffffffffff9081168285019081526000878152600490935294909120925183549451909116600160a01b026001600160e01b03199094169116179190911790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b6040805180820190915260008082526020820152611b6a826001541190565b611bc95760405162461bcd60e51b815260206004820152602a60248201527f455243373231413a206f776e657220717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b60648201526084016106e4565b60007f00000000000000000000000000000000000000000000000000000000000000328310611c2a57611c1c7f0000000000000000000000000000000000000000000000000000000000000032846129d7565b611c2790600161269a565b90505b825b818110611c94576000818152600460209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff169183019190915215611c8157949350505050565b5080611c8c816129ee565b915050611c2c565b5060405162461bcd60e51b815260206004820152602f60248201527f455243373231413a20756e61626c6520746f2064657465726d696e652074686560448201526e1037bbb732b91037b3103a37b5b2b760891b60648201526084016106e4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b0384163b15611e3b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611d89903390899088908890600401612a05565b6020604051808303816000875af1925050508015611dc4575060408051601f3d908101601f19168201909252611dc191810190612a42565b60015b611e21573d808015611df2576040519150601f19603f3d011682016040523d82523d6000602084013e611df7565b606091505b508051600003611e195760405162461bcd60e51b81526004016106e49061290b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506116a7565b506001949350505050565b6060600c80546108bb90612752565b606081600003611e7c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611ea65780611e90816127c1565b9150611e9f9050600a836127f0565b9150611e80565b60008167ffffffffffffffff811115611ec157611ec1612568565b6040519080825280601f01601f191660200182016040528015611eeb576020820181803683370190505b5090505b84156116a757611f006001836129d7565b9150611f0d600a86612a5f565b611f1890603061269a565b60f81b818381518110611f2d57611f2d612a73565b60200101906001600160f81b031916908160001a905350611f4f600a866127f0565b9450611eef565b600082611f638584612247565b14949350505050565b6001546001600160a01b038416611fcf5760405162461bcd60e51b815260206004820152602160248201527f455243373231413a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016106e4565b611fda816001541190565b156120275760405162461bcd60e51b815260206004820152601d60248201527f455243373231413a20746f6b656e20616c7265616479206d696e74656400000060448201526064016106e4565b7f00000000000000000000000000000000000000000000000000000000000000328311156120a25760405162461bcd60e51b815260206004820152602260248201527f455243373231413a207175616e7469747920746f206d696e7420746f6f2068696044820152610ced60f31b60648201526084016106e4565b6001600160a01b0384166000908152600560209081526040918290208251808401845290546001600160801b038082168352600160801b90910416918101919091528151808301909252805190919081906120fe9087906129b5565b6001600160801b0316815260200185836020015161211c91906129b5565b6001600160801b039081169091526001600160a01b0380881660008181526005602090815260408083208751978301518716600160801b0297909616969096179094558451808601865291825267ffffffffffffffff4281168386019081528883526004909552948120915182549451909516600160a01b026001600160e01b031990941694909216939093179190911790915582905b8581101561223c5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46122006000888488611d45565b61221c5760405162461bcd60e51b81526004016106e49061290b565b81612226816127c1565b9250508080612234906127c1565b9150506121b3565b506001819055611b43565b600081815b84518110156122b357600085828151811061226957612269612a73565b6020026020010151905080831161228f57600083815260208290526040902092506122a0565b600081815260208490526040902092505b50806122ab816127c1565b91505061224c565b509392505050565b6001600160e01b0319811681146113c357600080fd5b6000602082840312156122e357600080fd5b8135611589816122bb565b60008060006040848603121561230357600080fd5b83359250602084013567ffffffffffffffff8082111561232257600080fd5b818601915086601f83011261233657600080fd5b81358181111561234557600080fd5b8760208260051b850101111561235a57600080fd5b6020830194508093505050509250925092565b60005b83811015612388578181015183820152602001612370565b838111156114bd5750506000910152565b600081518084526123b181602086016020860161236d565b601f01601f19169290920160200192915050565b6020815260006115896020830184612399565b6000602082840312156123ea57600080fd5b5035919050565b80356001600160a01b038116811461240857600080fd5b919050565b6000806040838503121561242057600080fd5b612429836123f1565b946020939093013593505050565b60006020828403121561244957600080fd5b611589826123f1565b60008060006060848603121561246757600080fd5b612470846123f1565b925061247e602085016123f1565b9150604084013590509250925092565b600080602083850312156124a157600080fd5b823567ffffffffffffffff808211156124b957600080fd5b818501915085601f8301126124cd57600080fd5b8135818111156124dc57600080fd5b8660208285010111156124ee57600080fd5b60209290920196919550909350505050565b6000806040838503121561251357600080fd5b82359150612523602084016123f1565b90509250929050565b6000806040838503121561253f57600080fd5b612548836123f1565b91506020830135801515811461255d57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561259457600080fd5b61259d856123f1565b93506125ab602086016123f1565b925060408501359150606085013567ffffffffffffffff808211156125cf57600080fd5b818701915087601f8301126125e357600080fd5b8135818111156125f5576125f5612568565b604051601f8201601f19908116603f0116810190838211818310171561261d5761261d612568565b816040528281528a602084870101111561263657600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561266d57600080fd5b612676836123f1565b9150612523602084016123f1565b634e487b7160e01b600052601160045260246000fd5b600082198211156126ad576126ad612684565b500190565b60208082526019908201527f4d494e545f455843454544535f544f54414c5f535550504c5900000000000000604082015260600190565b6020808252602a908201527f4d494e545f455843454544535f4c494d49545f414c4c4f5745445f5045525f546040820152692920a729a0a1aa24a7a760b11b606082015260800190565b600081600019048311821515161561274d5761274d612684565b500290565b600181811c9082168061276657607f821691505b60208210810361278657634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000600182016127d3576127d3612684565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826127ff576127ff6127da565b500490565b601f8211156108a757600081815260208120601f850160051c8101602086101561282b5750805b601f850160051c820191505b81811015611b4357828155600101612837565b67ffffffffffffffff83111561286257612862612568565b612876836128708354612752565b83612804565b6000601f8411600181146128aa57600085156128925750838201355b600019600387901b1c1916600186901b178355612904565b600083815260209020601f19861690835b828110156128db57868501358255602094850194600190920191016128bb565b50868210156128f85760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60208082526033908201527f455243373231413a207472616e7366657220746f206e6f6e204552433732315260408201527232b1b2b4bb32b91034b6b83632b6b2b73a32b960691b606082015260800190565b6000835161297081846020880161236d565b83519083019061298481836020880161236d565b01949350505050565b60006001600160801b03838116908316818110156129ad576129ad612684565b039392505050565b60006001600160801b0380831681851680830382111561298457612984612684565b6000828210156129e9576129e9612684565b500390565b6000816129fd576129fd612684565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612a3890830184612399565b9695505050505050565b600060208284031215612a5457600080fd5b8151611589816122bb565b600082612a6e57612a6e6127da565b500690565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220ca30f33f5d99628720d138a26a66e60e3fdef366ac24c9decfe6cd0f6fd1188464736f6c634300080f0033
Verified Source Code Partial Match
Compiler: v0.8.15+commit.e14f2714
EVM: london
Optimization: Yes (200 runs)
Heiki.sol 110 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
/*
░▒█░▒█░▒█▀▀▀░▀█▀░▒█░▄▀░▀█▀
░▒█▀▀█░▒█▀▀▀░▒█░░▒█▀▄░░▒█░
░▒█░▒█░▒█▄▄▄░▄█▄░▒█░▒█░▄█▄
卄乇丨Ҝ丨 / 2022 / V1.0
▬▬ι═══════ﺤ
*/
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ERC721A.sol";
contract Heiki is Ownable, ERC721A, ReentrancyGuard {
using MerkleProof for bytes32[];
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant MINT_LIMIT = 2;
uint256 public constant PRESALE_MINT_PRICE = 0.065 ether;
uint256 public constant PUBLIC_MINT_PRICE = 0.08 ether;
/// @dev Inactive = 0; Presale = 1; Public = 2
uint256 public saleFlag;
bytes32 public merkleRoot;
string public baseURI;
mapping(address => uint256) private whitelistMints;
constructor() ERC721A("Heiki", "HEIKI", 50, MAX_SUPPLY) {}
function verifyProof(bytes32[] calldata _proof) internal view returns (bool) {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
return _proof.verify(merkleRoot, leaf);
}
function getNMinted(address owner) public view returns (uint256) {
return _numberMinted(owner);
}
function setBaseURI(string calldata _base) external onlyOwner {
baseURI = _base;
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function setSaleFlag(uint256 _flag) external onlyOwner {
saleFlag = _flag;
}
function setMerkleRoot(bytes32 _new) external onlyOwner {
merkleRoot = _new;
}
function mint(uint256 _quantity) external payable {
require(totalSupply() + _quantity <= MAX_SUPPLY, "MINT_EXCEEDS_TOTAL_SUPPLY");
require(saleFlag == 2, "MINTING_PAUSED");
require(_quantity > 0 && _quantity <= MINT_LIMIT, "MINT_EXCEEDS_LIMIT_ALLOWED_PER_TRANSACTION");
require(PUBLIC_MINT_PRICE * _quantity <= msg.value, "AMOUNT_TOO_LOW");
require(tx.origin == msg.sender, "SENDER_IS_NOT_AN_EOA");
_safeMint(msg.sender, _quantity);
}
function mintWhitelist(uint256 _quantity, bytes32[] calldata _proof) external payable {
require(totalSupply() + _quantity <= MAX_SUPPLY, "MINT_EXCEEDS_TOTAL_SUPPLY");
require(saleFlag == 1, "MINTING_PAUSED");
require(verifyProof(_proof), "INVALID_MERKLE_PROOF");
require(whitelistMints[msg.sender] + _quantity <= MINT_LIMIT, "MINT_EXCEEDS_LIMIT_ALLOWED_FOR_WHITELIST");
require(_quantity > 0 && _quantity <= MINT_LIMIT, "MINT_EXCEEDS_LIMIT_ALLOWED_PER_TRANSACTION");
require(PRESALE_MINT_PRICE * _quantity <= msg.value, "AMOUNT_TOO_LOW");
whitelistMints[msg.sender] += _quantity;
_safeMint(msg.sender, _quantity);
}
function mintOwner(uint256 _quantity, address _to) external onlyOwner {
require(totalSupply() + _quantity <= MAX_SUPPLY, "MINT_EXCEEDS_TOTAL_SUPPLY");
_safeMint(_to, _quantity);
}
/** @notice
* ALLOCATIONS:
* - Community Multisig: 25% (Signers: Bitquence, sOwner1, sOwner2 / 2 of 2 signatures)
* - Owners: 50%
* - Developpers: 22.45%
* - Artist: 2.55%
*/
function withdraw() external onlyOwner nonReentrant {
uint256 balanceDividend = address(this).balance / 100000;
(bool sComm,) = address(0x005957b04Afa8A1B65C4632753d2C4dA6d84b64f).call{value: balanceDividend * 25000}("");
(bool sOwner1,) = address(0xEC4f373A70d5Bb5371df8A33951B898B7219f82C).call{value: balanceDividend * 25000}("");
(bool sOwner2,) = address(0x4494949245C3C432177C66adf32e272477D6aaFc).call{value: balanceDividend * 25000}("");
(bool sDev1,) = address(0x6e1af0E043C18eAd53A5B9886D4901Dd6B67a22f).call{value: balanceDividend * 11225}("");
(bool sDev2,) = address(0xe0C5123B0FD1A7D94bB8D84bBAF1026B699C6dC6).call{value: balanceDividend * 11225}("");
(bool sArt,) = address(0xe8f46FaD3478EEa1c67eC027952B5120aA8848B2).call{value: balanceDividend * 2550}("");
}
}
ERC721A.sol 557 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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";
/**
* @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 the number of issuable tokens (collection size) is capped and fits in a uint128.
*
* Does not support burning tokens to address(0).
*/
contract ERC721A is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable
{
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 private currentIndex = 0;
uint256 internal immutable collectionSize;
uint256 internal immutable maxBatchSize;
// 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) private _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;
/**
* @dev
* `maxBatchSize` refers to how much a minter can mint at a time.
* `collectionSize_` refers to how many tokens are in the collection.
*/
constructor(
string memory name_,
string memory symbol_,
uint256 maxBatchSize_,
uint256 collectionSize_
) {
require(
collectionSize_ > 0,
"ERC721A: collection must have a nonzero supply"
);
require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero");
_name = name_;
_symbol = symbol_;
maxBatchSize = maxBatchSize_;
collectionSize = collectionSize_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return currentIndex;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
require(index < totalSupply(), "ERC721A: global index out of bounds");
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(collectionSize). 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)
{
require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
for (uint256 i = 0; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
revert("ERC721A: unable to get token of owner by index");
}
/**
* @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) {
require(owner != address(0), "ERC721A: balance query for the zero address");
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
require(
owner != address(0),
"ERC721A: number minted query for the zero address"
);
return uint256(_addressData[owner].numberMinted);
}
function ownershipOf(uint256 tokenId)
internal
view
returns (TokenOwnership memory)
{
require(_exists(tokenId), "ERC721A: owner query for nonexistent token");
uint256 lowestTokenToCheck;
if (tokenId >= maxBatchSize) {
lowestTokenToCheck = tokenId - maxBatchSize + 1;
}
for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
revert("ERC721A: unable to determine the owner of token");
}
/**
* @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)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
address owner = ERC721A.ownerOf(tokenId);
require(to != owner, "ERC721A: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721A: approve caller is not owner nor approved for all"
);
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721A: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), "ERC721A: approve to caller");
_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 override {
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, "");
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - there must be `quantity` tokens remaining unminted in the total collection.
* - `to` cannot be the zero address.
* - `quantity` cannot be larger than the max batch size.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
uint256 startTokenId = currentIndex;
require(to != address(0), "ERC721A: mint to the zero address");
// We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering.
require(!_exists(startTokenId), "ERC721A: token already minted");
require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
addressData.balance + uint128(quantity),
addressData.numberMinted + uint128(quantity)
);
_ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));
uint256 updatedIndex = startTokenId;
for (uint256 i = 0; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
require(
_checkOnERC721Received(address(0), to, updatedIndex, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
updatedIndex++;
}
currentIndex = 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 ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwnership.addr, _msgSender()));
require(
isApprovedOrOwner,
"ERC721A: transfer caller is not owner nor approved"
);
require(
prevOwnership.addr == from,
"ERC721A: transfer from incorrect owner"
);
require(to != address(0), "ERC721A: transfer to the zero address");
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId] = TokenOwnership(to, 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)) {
if (_exists(nextTokenId)) {
_ownerships[nextTokenId] = TokenOwnership(
prevOwnership.addr,
prevOwnership.startTimestamp
);
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @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);
}
uint256 public nextOwnerToExplicitlySet = 0;
/**
* @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
*/
function _setOwnersExplicit(uint256 quantity) internal {
uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet;
require(quantity > 0, "quantity must be nonzero");
uint256 endIndex = oldNextOwnerToSet + quantity - 1;
if (endIndex > collectionSize - 1) {
endIndex = collectionSize - 1;
}
// We know if the last one in the group exists, all in the group exist, due to serial ordering.
require(_exists(endIndex), "not enough minted yet for this cleanup");
for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) {
if (_ownerships[i].addr == address(0)) {
TokenOwnership memory ownership = ownershipOf(i);
_ownerships[i] = TokenOwnership(
ownership.addr,
ownership.startTimestamp
);
}
}
nextOwnerToExplicitlySet = endIndex + 1;
}
/**
* @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("ERC721A: transfer to non ERC721Receiver implementer");
} 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.
*
* 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`.
*/
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.
*
* 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` 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;
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
MerkleProof.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
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
MAX_SUPPLY 0x32cb6b0c → uint256
MINT_LIMIT 0x02775240 → uint256
PRESALE_MINT_PRICE 0x2a234e57 → uint256
PUBLIC_MINT_PRICE 0x6bde2627 → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
getApproved 0x081812fc → address
getNMinted 0x1ff8f602 → uint256
isApprovedForAll 0xe985e9c5 → bool
merkleRoot 0x2eb4a7ab → bytes32
name 0x06fdde03 → string
nextOwnerToExplicitlySet 0xd7224ba0 → uint256
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
saleFlag 0x614bfc55 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 _quantity
mintOwner 0x9f15df12
uint256 _quantity
address _to
mintWhitelist 0x061431a8
uint256 _quantity
bytes32[] _proof
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _base
setMerkleRoot 0x7cb64759
bytes32 _new
setSaleFlag 0x27b6fb33
uint256 _flag
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
This address has 1 on-chain transactions, but only 1.4% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →