Address Contract Partially Verified
Address
0x0f451825d54934d75b5dD8C2d7033bb4e60322B8
Balance
0 ETH
Nonce
1
Code Size
10108 bytes
Creator
0x3A5ED00d...7569 at tx 0xd2215ed7...42e67b
Indexed Transactions
0 (1 on-chain, 1.7% indexed)
Contract Bytecode
10108 bytes
0x60806040526004361061023d5760003560e01c80636c0360eb1161012d578063c87b56dd116100b0578063dbf0b84411610077578063dbf0b8441461068d578063e985e9c5146106ad578063ed57d4ab146106f6578063efd0cbf91461070e578063f6d8259914610721578063f78375b41461073457005b8063c87b56dd146105f5578063c8f7a0c914610615578063cdbce03d14610632578063d082e38114610657578063d419201d1461066d57005b8063a22cb465116100f4578063a22cb46514610555578063a6f9dae114610575578063aa99b6e814610595578063b88d4fde146105b5578063c782912a146105d557005b80636c0360eb146104c457806370a08231146104d95780638da5cb5b146104f957806395d89b41146105205780639d7e8d5f1461053557005b806336c9cfe7116101c05780634d84200b116101875780634d84200b1461042c57806355f804b3146104425780635c065600146104625780635f45d10714610478578063607db4d31461048e5780636352211e146104a457005b806336c9cfe71461039757806338faf9fd146103b75780633ccfd60b146103d757806342842e0e146103ec57806342966c681461040c57005b8063095ea7b311610204578063095ea7b3146102ff57806318160ddd1461031f5780631fa93aa71461034357806323b872dd1461036157806326a5cb911461038157005b806301ffc9a714610246578063062100df1461027b5780630624ac0e1461029057806306fdde03146102a5578063081812fc146102c757005b3661024457005b005b34801561025257600080fd5b5061026661026136600461205b565b610749565b60405190151581526020015b60405180910390f35b34801561028757600080fd5b5061024461079b565b34801561029c57600080fd5b50610244610806565b3480156102b157600080fd5b506102ba61085c565b60405161027291906120d0565b3480156102d357600080fd5b506102e76102e23660046120e3565b6108ee565b6040516001600160a01b039091168152602001610272565b34801561030b57600080fd5b5061024461031a366004612118565b610915565b34801561032b57600080fd5b50610335610d0581565b604051908152602001610272565b34801561034f57600080fd5b50600e5462010000900460ff16610266565b34801561036d57600080fd5b5061024461037c366004612142565b610a2b565b34801561038d57600080fd5b50610335600a5481565b3480156103a357600080fd5b506102446103b23660046120e3565b610a5c565b3480156103c357600080fd5b506102446103d23660046120e3565b610a92565b3480156103e357600080fd5b50610244610b79565b3480156103f857600080fd5b50610244610407366004612142565b610bd9565b34801561041857600080fd5b506102446104273660046120e3565b610bf4565b34801561043857600080fd5b5061033560075481565b34801561044e57600080fd5b5061024461045d36600461220a565b610c2e565b34801561046e57600080fd5b50610335600b5481565b34801561048457600080fd5b5061033560095481565b34801561049a57600080fd5b5061033560085481565b3480156104b057600080fd5b506102e76104bf3660046120e3565b610c72565b3480156104d057600080fd5b506102ba610cd2565b3480156104e557600080fd5b506103356104f4366004612253565b610d60565b34801561050557600080fd5b50600e546102e790630100000090046001600160a01b031681565b34801561052c57600080fd5b506102ba610de6565b34801561054157600080fd5b506102446105503660046120e3565b610df5565b34801561056157600080fd5b5061024461057036600461226e565b610e2b565b34801561058157600080fd5b50610244610590366004612253565b610e36565b3480156105a157600080fd5b506102446105b03660046120e3565b610e93565b3480156105c157600080fd5b506102446105d03660046122aa565b610ec9565b3480156105e157600080fd5b506102446105f03660046120e3565b610f01565b34801561060157600080fd5b506102ba6106103660046120e3565b610f37565b34801561062157600080fd5b50600e54610100900460ff16610266565b34801561063e57600080fd5b50600e54630100000090046001600160a01b03166102e7565b34801561066357600080fd5b5061033560065481565b34801561067957600080fd5b50610244610688366004612372565b610fbc565b34801561069957600080fd5b506102446106a83660046120e3565b6111fe565b3480156106b957600080fd5b506102666106c83660046123b4565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561070257600080fd5b50600e5460ff16610266565b61024461071c3660046120e3565b611234565b61024461072f3660046123e7565b6113df565b34801561074057600080fd5b5061024461169b565b60006001600160e01b031982166380ac58cd60e01b148061077a57506001600160e01b03198216635b5e139f60e01b145b8061079557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600e54630100000090046001600160a01b031633146107d55760405162461bcd60e51b81526004016107cc90612433565b60405180910390fd5b600e5462010000900460ff166107f857600e805462ff0000191662010000179055565b600e805462ff000019169055565b600e54630100000090046001600160a01b031633146108375760405162461bcd60e51b81526004016107cc90612433565b600e5460ff1661085057600e805460ff19166001179055565b600e805460ff19169055565b60606000805461086b90612475565b80601f016020809104026020016040519081016040528092919081815260200182805461089790612475565b80156108e45780601f106108b9576101008083540402835291602001916108e4565b820191906000526020600020905b8154815290600101906020018083116108c757829003601f168201915b5050505050905090565b60006108f9826116f9565b506000908152600460205260409020546001600160a01b031690565b600061092082610c72565b9050806001600160a01b0316836001600160a01b0316141561098e5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107cc565b336001600160a01b03821614806109aa57506109aa81336106c8565b610a1c5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016107cc565b610a268383611758565b505050565b610a3533826117c6565b610a515760405162461bcd60e51b81526004016107cc906124b0565b610a26838383611844565b600e54630100000090046001600160a01b03163314610a8d5760405162461bcd60e51b81526004016107cc90612433565b600c55565b600e54630100000090046001600160a01b03163314610ac35760405162461bcd60e51b81526004016107cc90612433565b610d0581600654610ad49190612514565b1115610b225760405162461bcd60e51b815260206004820152601b60248201527f596f752072656163686564206d6178746f74616c20737570706c79000000000060448201526064016107cc565b60005b81811015610b7557600e54600654610b4d91630100000090046001600160a01b0316906119e0565b60068054906000610b5d8361252c565b91905055508080610b6d9061252c565b915050610b25565b5050565b600e54630100000090046001600160a01b03163314610baa5760405162461bcd60e51b81526004016107cc90612433565b60405133904780156108fc02916000818181858888f19350505050158015610bd6573d6000803e3d6000fd5b50565b610a2683838360405180602001604052806000815250610ec9565b600e54630100000090046001600160a01b03163314610c255760405162461bcd60e51b81526004016107cc90612433565b610bd6816119fa565b600e54630100000090046001600160a01b03163314610c5f5760405162461bcd60e51b81526004016107cc90612433565b8051610b7590600f906020840190611fac565b6000818152600260205260408120546001600160a01b0316806107955760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107cc565b600f8054610cdf90612475565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0b90612475565b8015610d585780601f10610d2d57610100808354040283529160200191610d58565b820191906000526020600020905b815481529060010190602001808311610d3b57829003601f168201915b505050505081565b60006001600160a01b038216610dca5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016107cc565b506001600160a01b031660009081526003602052604090205490565b60606001805461086b90612475565b600e54630100000090046001600160a01b03163314610e265760405162461bcd60e51b81526004016107cc90612433565b600b55565b610b75338383611a95565b600e54630100000090046001600160a01b03163314610e675760405162461bcd60e51b81526004016107cc90612433565b600e80546001600160a01b039092166301000000026301000000600160b81b0319909216919091179055565b600e54630100000090046001600160a01b03163314610ec45760405162461bcd60e51b81526004016107cc90612433565b600d55565b610ed333836117c6565b610eef5760405162461bcd60e51b81526004016107cc906124b0565b610efb84848484611b64565b50505050565b600e54630100000090046001600160a01b03163314610f325760405162461bcd60e51b81526004016107cc90612433565b600a55565b6060610f42826116f9565b6000610f4c611b97565b604080518082019091526005815264173539b7b760d91b6020820152815191925090610f875760405180602001604052806000815250610fb4565b81610f9185611ba6565b82604051602001610fa493929190612547565b6040516020818303038152906040525b949350505050565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405280519060200120905061103683838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600c549150849050611ca4565b6110825760405162461bcd60e51b815260206004820152601960248201527f596f7520617265206e6f7420696e2077686974656c697374210000000000000060448201526064016107cc565b600e5460ff1615156001146110ce5760405162461bcd60e51b8152602060048201526012602482015271576c206d696e7420697320636c6f7365642160701b60448201526064016107cc565b6103e860075411156111195760405162461bcd60e51b8152602060048201526014602482015273576c206c696d697420697320726561636865642160601b60448201526064016107cc565b3360009081526013602052604090205460ff16156111875760405162461bcd60e51b815260206004820152602560248201527f596f75206861766520616c7265616479206d696e74656420796f757220574c2060448201526473706f742160d81b60648201526084016107cc565b610d0560065411156111ab5760405162461bcd60e51b81526004016107cc9061258a565b6111b7336006546119e0565b600680549060006111c78361252c565b9091555050336000908152601360205260408120805460ff1916600117905560078054916111f48361252c565b9190505550505050565b600e54630100000090046001600160a01b0316331461122f5760405162461bcd60e51b81526004016107cc90612433565b600955565b80600b5461124291906125cc565b3410156112835760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420656e6f756768204554482160881b60448201526064016107cc565b600e5462010000900460ff1615156001146112e05760405162461bcd60e51b815260206004820152601b60248201527f5075626c6963206d696e74206973206e6f74207374617274656421000000000060448201526064016107cc565b600954336000908152601260205260409020546112fe908390612514565b111561131c5760405162461bcd60e51b81526004016107cc906125eb565b610d058160065461132d9190612514565b111561137b5760405162461bcd60e51b815260206004820152601c60248201527f596f752072656163686564206d6178746f74616c20737570706c79210000000060448201526064016107cc565b60005b81811015610b7557611392336006546119e0565b600680549060006113a28361252c565b90915550503360009081526012602052604081208054600192906113c7908490612514565b909155508190506113d78161252c565b91505061137e565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405280519060200120905061145984848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600d549150849050611ca4565b6114a55760405162461bcd60e51b815260206004820152601960248201527f596f7520617265206e6f7420696e20416c6c6f776c697374210000000000000060448201526064016107cc565b81600a546114b391906125cc565b3410156114f45760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420656e6f756768204554482160881b60448201526064016107cc565b600e5460ff6101009091041615156001146115515760405162461bcd60e51b815260206004820152601960248201527f416c6c6f776c697374206d696e7420697320636c6f736564210000000000000060448201526064016107cc565b3360009081526011602052604090205460029061156f908490612514565b111561158d5760405162461bcd60e51b81526004016107cc906125eb565b6103e88260085461159e9190612514565b11156115ec5760405162461bcd60e51b815260206004820152601b60248201527f416c6c776f6c697374206c696d6974206973207265616368656421000000000060448201526064016107cc565b610d05826008546115fd9190612514565b111561161b5760405162461bcd60e51b81526004016107cc9061258a565b60005b8281101561169457611632336006546119e0565b600680549060006116428361252c565b9091555050336000908152601160205260408120805460019290611667908490612514565b90915550506008805490600061167c8361252c565b9190505550808061168c9061252c565b91505061161e565b5050505050565b600e54630100000090046001600160a01b031633146116cc5760405162461bcd60e51b81526004016107cc90612433565b600e54610100900460ff166116ec57600e805461ff001916610100179055565b600e805461ff0019169055565b6000818152600260205260409020546001600160a01b0316610bd65760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107cc565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061178d82610c72565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806117d283610c72565b9050806001600160a01b0316846001600160a01b0316148061181957506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610fb45750836001600160a01b0316611832846108ee565b6001600160a01b031614949350505050565b826001600160a01b031661185782610c72565b6001600160a01b0316146118bb5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016107cc565b6001600160a01b03821661191d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107cc565b611928600082611758565b6001600160a01b038316600090815260036020526040812080546001929061195190849061262f565b90915550506001600160a01b038216600090815260036020526040812080546001929061197f908490612514565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610b75828260405180602001604052806000815250611cba565b6000611a0582610c72565b9050611a12600083611758565b6001600160a01b0381166000908152600360205260408120805460019290611a3b90849061262f565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b03161415611af75760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107cc565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611b6f848484611844565b611b7b84848484611ced565b610efb5760405162461bcd60e51b81526004016107cc90612646565b6060600f805461086b90612475565b606081611bca5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611bf45780611bde8161252c565b9150611bed9050600a836126ae565b9150611bce565b60008167ffffffffffffffff811115611c0f57611c0f61217e565b6040519080825280601f01601f191660200182016040528015611c39576020820181803683370190505b5090505b8415610fb457611c4e60018361262f565b9150611c5b600a866126c2565b611c66906030612514565b60f81b818381518110611c7b57611c7b6126d6565b60200101906001600160f81b031916908160001a905350611c9d600a866126ae565b9450611c3d565b600082611cb18584611deb565b14949350505050565b611cc48383611e38565b611cd16000848484611ced565b610a265760405162461bcd60e51b81526004016107cc90612646565b60006001600160a01b0384163b15611de057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611d319033908990889088906004016126ec565b6020604051808303816000875af1925050508015611d6c575060408051601f3d908101601f19168201909252611d6991810190612729565b60015b611dc6573d808015611d9a576040519150601f19603f3d011682016040523d82523d6000602084013e611d9f565b606091505b508051611dbe5760405162461bcd60e51b81526004016107cc90612646565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610fb4565b506001949350505050565b600081815b8451811015611e3057611e1c82868381518110611e0f57611e0f6126d6565b6020026020010151611f7a565b915080611e288161252c565b915050611df0565b509392505050565b6001600160a01b038216611e8e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107cc565b6000818152600260205260409020546001600160a01b031615611ef35760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107cc565b6001600160a01b0382166000908152600360205260408120805460019290611f1c908490612514565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000818310611f96576000828152602084905260409020611fa5565b60008381526020839052604090205b9392505050565b828054611fb890612475565b90600052602060002090601f016020900481019282611fda5760008555612020565b82601f10611ff357805160ff1916838001178555612020565b82800160010185558215612020579182015b82811115612020578251825591602001919060010190612005565b5061202c929150612030565b5090565b5b8082111561202c5760008155600101612031565b6001600160e01b031981168114610bd657600080fd5b60006020828403121561206d57600080fd5b8135611fa581612045565b60005b8381101561209357818101518382015260200161207b565b83811115610efb5750506000910152565b600081518084526120bc816020860160208601612078565b601f01601f19169290920160200192915050565b602081526000611fa560208301846120a4565b6000602082840312156120f557600080fd5b5035919050565b80356001600160a01b038116811461211357600080fd5b919050565b6000806040838503121561212b57600080fd5b612134836120fc565b946020939093013593505050565b60008060006060848603121561215757600080fd5b612160846120fc565b925061216e602085016120fc565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156121af576121af61217e565b604051601f8501601f19908116603f011681019082821181831017156121d7576121d761217e565b816040528093508581528686860111156121f057600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561221c57600080fd5b813567ffffffffffffffff81111561223357600080fd5b8201601f8101841361224457600080fd5b610fb484823560208401612194565b60006020828403121561226557600080fd5b611fa5826120fc565b6000806040838503121561228157600080fd5b61228a836120fc565b91506020830135801515811461229f57600080fd5b809150509250929050565b600080600080608085870312156122c057600080fd5b6122c9856120fc565b93506122d7602086016120fc565b925060408501359150606085013567ffffffffffffffff8111156122fa57600080fd5b8501601f8101871361230b57600080fd5b61231a87823560208401612194565b91505092959194509250565b60008083601f84011261233857600080fd5b50813567ffffffffffffffff81111561235057600080fd5b6020830191508360208260051b850101111561236b57600080fd5b9250929050565b6000806020838503121561238557600080fd5b823567ffffffffffffffff81111561239c57600080fd5b6123a885828601612326565b90969095509350505050565b600080604083850312156123c757600080fd5b6123d0836120fc565b91506123de602084016120fc565b90509250929050565b6000806000604084860312156123fc57600080fd5b833567ffffffffffffffff81111561241357600080fd5b61241f86828701612326565b909790965060209590950135949350505050565b60208082526022908201527f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f6040820152616e2160f01b606082015260800190565b600181811c9082168061248957607f821691505b602082108114156124aa57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115612527576125276124fe565b500190565b6000600019821415612540576125406124fe565b5060010190565b60008451612559818460208901612078565b84519083019061256d818360208901612078565b8451910190612580818360208801612078565b0195945050505050565b60208082526022908201527f596f7520686176652072656163686564206d617820746f74616c20737570706c604082015261792160f01b606082015260800190565b60008160001904831182151516156125e6576125e66124fe565b500290565b60208082526024908201527f596f752068617665206d696e746564206d61782070657220796f7520616464726040820152636573732160e01b606082015260800190565b600082821015612641576126416124fe565b500390565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b6000826126bd576126bd612698565b500490565b6000826126d1576126d1612698565b500690565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061271f908301846120a4565b9695505050505050565b60006020828403121561273b57600080fd5b8151611fa58161204556fea26469706673582212209e77053160b309785f2290fae7c72238b424ad13c8f765995cad17023f51b82f64736f6c634300080c0033
Verified Source Code Partial Match
Compiler: v0.8.12+commit.f00d7308
EVM: istanbul
Optimization: Yes (200 runs)
EternalMages.sol 225 lines
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8;
import "ERC721.sol";
import "Strings.sol";
import "MerkleProof.sol";
contract EternalMages is ERC721 {
using Strings for uint256;
uint256 public tokenCounter;
uint256 public MaxtoWL;
uint256 public MaxtoAllowlist;
uint256 public constant totalSupply = 3333;
uint256 public maxPerPublicMint = 2;
uint256 public AllowlistPrice = 9000000000000000 wei;
uint256 public PublicPrice = 15000000000000000 wei;
bytes32 private MerkleRootWL;
bytes32 private MerkleRootAllowlist;
bool private mintWlOpen = false;
bool private mintAllowlistOpen = false;
bool private mintPublicOpen = false;
address public owner;
string public baseURI;
mapping(uint256 => string) private _tokenURIs;
mapping(address => uint256) private AddressesAllowlistMinted;
mapping(address => uint256) private AddressesPublictMinted;
mapping(address => bool) private AddressWlMint;
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can call this function!");
_;
}
constructor(string memory name, string memory symbol) ERC721(name, symbol) {
tokenCounter = 1;
owner = msg.sender;
}
function changeAllPrice(uint256 _price) public onlyOwner {
AllowlistPrice = _price;
}
function changePublicPrice(uint256 _price) public onlyOwner {
PublicPrice = _price;
}
function changeMaxPerPublicMint(uint256 _amount) public onlyOwner {
maxPerPublicMint = _amount;
}
function addMerkleRootWL(bytes32 _MerkleRoot) public onlyOwner {
MerkleRootWL = _MerkleRoot;
}
function addMerkleRootAllowlist(bytes32 _MerkleRoot) public onlyOwner {
MerkleRootAllowlist = _MerkleRoot;
}
function checkWlMint() public view returns (bool) {
return mintWlOpen;
}
function checkPublicMint() public view returns (bool) {
return mintPublicOpen;
}
function checkAllowlistMint() public view returns (bool) {
return mintAllowlistOpen;
}
function turnWLMint() public onlyOwner {
if (mintWlOpen == false) {
mintWlOpen = true;
} else {
mintWlOpen = false;
}
}
function turnAllowlistMint() public onlyOwner {
if (mintAllowlistOpen == false) {
mintAllowlistOpen = true;
} else {
mintAllowlistOpen = false;
}
}
function turnPublicMint() public onlyOwner {
if (mintPublicOpen == false) {
mintPublicOpen = true;
} else {
mintPublicOpen = false;
}
}
function mintWl(bytes32[] calldata _merkleProof) public {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(
MerkleProof.verify(_merkleProof, MerkleRootWL, leaf),
"You are not in whitelist!"
);
require(mintWlOpen == true, "Wl mint is closed!");
require(MaxtoWL <= 1000, "Wl limit is reached!");
require(
AddressWlMint[msg.sender] == false,
"You have already minted your WL spot!"
);
require(
tokenCounter <= totalSupply,
"You have reached max total supply!"
);
_safeMint(msg.sender, tokenCounter);
tokenCounter++;
AddressWlMint[msg.sender] = true;
MaxtoWL++;
}
function mintAllowlist(bytes32[] calldata _merkleProof, uint256 _amount)
public
payable
{
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(
MerkleProof.verify(_merkleProof, MerkleRootAllowlist, leaf),
"You are not in Allowlist!"
);
require(msg.value >= AllowlistPrice * _amount, "Not enough ETH!");
require(mintAllowlistOpen == true, "Allowlist mint is closed!");
require(
AddressesAllowlistMinted[msg.sender] + _amount <= 2,
"You have minted max per you address!"
);
require(
MaxtoAllowlist + _amount <= 1000,
"Allwolist limit is reached!"
);
require(
MaxtoAllowlist + _amount <= totalSupply,
"You have reached max total supply!"
);
for (uint256 i; i < _amount; i++) {
_safeMint(msg.sender, tokenCounter);
tokenCounter++;
AddressesAllowlistMinted[msg.sender] += 1;
MaxtoAllowlist++;
}
}
function mintPublic(uint256 _amount) public payable {
require(msg.value >= PublicPrice * _amount, "Not enough ETH!");
require(mintPublicOpen == true, "Public mint is not started!");
require(
AddressesPublictMinted[msg.sender] + _amount <= maxPerPublicMint,
"You have minted max per you address!"
);
require(
tokenCounter + _amount <= totalSupply,
"You reached maxtotal supply!"
);
for (uint256 i; i < _amount; i++) {
_safeMint(msg.sender, tokenCounter);
tokenCounter++;
AddressesPublictMinted[msg.sender] += 1;
}
}
function setBaseURI(string memory _set) public onlyOwner {
baseURI = _set;
}
function baseurl() internal view virtual returns (string memory) {
return baseURI;
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
_requireMinted(tokenId);
string memory url = baseurl();
string memory f = ".json";
return
bytes(url).length > 0
? string(abi.encodePacked(url, tokenId.toString(), f))
: "";
}
function withdraw() public onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function changeOwner(address _owner) public onlyOwner {
owner = _owner;
}
function checkOwner() public view returns (address) {
return owner;
}
function burn(uint256 _tokenid) public onlyOwner {
_burn(_tokenid);
}
fallback() external payable {}
receive() external payable {}
function TresuareMint(uint256 _amount) public onlyOwner {
require(
tokenCounter + _amount <= totalSupply,
"You reached maxtotal supply"
);
for (uint256 i; i < _amount; i++) {
_safeMint(owner, tokenCounter);
tokenCounter++;
}
}
}
ERC721.sol 454 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "IERC721.sol";
import "IERC721Receiver.sol";
import "IERC721Metadata.sol";
import "Address.sol";
import "Context.sol";
import "Strings.sol";
import "ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
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 overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
_safeTransfer(from, to, tokenId, data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "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`.
*
* 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;
/**
* @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 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 Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
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 (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface 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 `IERC721Receiver.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);
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
/// @solidity memory-safe-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 75 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// 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);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
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;
}
}
MerkleProof.sol 212 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree 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.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
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 Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle 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++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
* consuming from one or the other at each step according to the instructions given by
* `proofFlags`.
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
Read Contract
AllowlistPrice 0x26a5cb91 → uint256
MaxtoAllowlist 0x607db4d3 → uint256
MaxtoWL 0x4d84200b → uint256
PublicPrice 0x5c065600 → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
checkAllowlistMint 0xc8f7a0c9 → bool
checkOwner 0xcdbce03d → address
checkPublicMint 0x1fa93aa7 → bool
checkWlMint 0xed57d4ab → bool
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxPerPublicMint 0x5f45d107 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenCounter 0xd082e381 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 21 functions
These functions modify contract state and require a wallet transaction to execute.
TresuareMint 0x38faf9fd
uint256 _amount
addMerkleRootAllowlist 0xaa99b6e8
bytes32 _MerkleRoot
addMerkleRootWL 0x36c9cfe7
bytes32 _MerkleRoot
approve 0x095ea7b3
address to
uint256 tokenId
burn 0x42966c68
uint256 _tokenid
changeAllPrice 0xc782912a
uint256 _price
changeMaxPerPublicMint 0xdbf0b844
uint256 _amount
changeOwner 0xa6f9dae1
address _owner
changePublicPrice 0x9d7e8d5f
uint256 _price
mintAllowlist 0xf6d82599
bytes32[] _merkleProof
uint256 _amount
mintPublic 0xefd0cbf9
uint256 _amount
mintWl 0xd419201d
bytes32[] _merkleProof
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 _set
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
turnAllowlistMint 0xf78375b4
No parameters
turnPublicMint 0x062100df
No parameters
turnWLMint 0x0624ac0e
No parameters
withdraw 0x3ccfd60b
No parameters
Recent Transactions
This address has 1 on-chain transactions, but only 1.7% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →