Address Contract Verified
Address
0x7c56085582492493af2EC1B7d29c638D9B76a477
Balance
0 ETH
Nonce
1
Code Size
9456 bytes
Creator
0xB5d1B0bD...dcEd at tx 0xcac805b2...3054eb
Indexed Transactions
0
Contract Bytecode
9456 bytes
0x6080604052600436106101e6575f3560e01c80635c975abb11610108578063a0712d681161009d578063c87b56dd1161006d578063c87b56dd1461051b578063d5abeb011461053a578063da3ef23f1461054f578063e985e9c51461056e578063f2fde38b146105b5575f5ffd5b8063a0712d68146104b6578063a22cb465146104c9578063b88d4fde146104e8578063c668286214610507575f5ffd5b8063715018a6116100d8578063715018a6146104715780638da5cb5b146104855780638ecad721146102b657806395d89b41146104a2575f5ffd5b80635c975abb146103fb5780636352211e14610414578063661e3e361461043357806370a0823114610452575f5ffd5b806323b872dd1161017e578063438b63001161014e578063438b63001461037257806344a0d68a1461039e5780634f6ccce7146103bd57806355f804b3146103dc575f5ffd5b806323b872dd146103015780632f745c59146103205780633ccfd60b1461033f57806342842e0e14610353575f5ffd5b8063095ea7b3116101b9578063095ea7b3146102975780630f2cdd6c146102b657806313faede6146102d857806318160ddd146102ed575f5ffd5b806301ffc9a7146101ea57806302329a291461021e57806306fdde031461023f578063081812fc14610260575b5f5ffd5b3480156101f5575f5ffd5b50610209610204366004611d61565b6105d4565b60405190151581526020015b60405180910390f35b348015610229575f5ffd5b5061023d610238366004611d90565b6105fe565b005b34801561024a575f5ffd5b50610253610644565b6040516102159190611dd7565b34801561026b575f5ffd5b5061027f61027a366004611de9565b6106d3565b6040516001600160a01b039091168152602001610215565b3480156102a2575f5ffd5b5061023d6102b1366004611e16565b610766565b3480156102c1575f5ffd5b506102ca600281565b604051908152602001610215565b3480156102e3575f5ffd5b506102ca600d5481565b3480156102f8575f5ffd5b506008546102ca565b34801561030c575f5ffd5b5061023d61031b366004611e3e565b61087a565b34801561032b575f5ffd5b506102ca61033a366004611e16565b6108ab565b34801561034a575f5ffd5b5061023d61093f565b34801561035e575f5ffd5b5061023d61036d366004611e3e565b610a0e565b34801561037d575f5ffd5b5061039161038c366004611e78565b610a28565b6040516102159190611e91565b3480156103a9575f5ffd5b5061023d6103b8366004611de9565b610abd565b3480156103c8575f5ffd5b506102ca6103d7366004611de9565b610aec565b3480156103e7575f5ffd5b5061023d6103f6366004611f5e565b610b7c565b348015610406575f5ffd5b50600f546102099060ff1681565b34801561041f575f5ffd5b5061027f61042e366004611de9565b610bb6565b34801561043e575f5ffd5b5061023d61044d366004611fa3565b610c2c565b34801561045d575f5ffd5b506102ca61046c366004611e78565b610d7f565b34801561047c575f5ffd5b5061023d610e04565b348015610490575f5ffd5b50600a546001600160a01b031661027f565b3480156104ad575f5ffd5b50610253610e39565b61023d6104c4366004611de9565b610e48565b3480156104d4575f5ffd5b5061023d6104e3366004612014565b611071565b3480156104f3575f5ffd5b5061023d610502366004612045565b611134565b348015610512575f5ffd5b50610253611166565b348015610526575f5ffd5b50610253610535366004611de9565b6111f2565b348015610545575f5ffd5b506102ca600e5481565b34801561055a575f5ffd5b5061023d610569366004611f5e565b6112cc565b348015610579575f5ffd5b506102096105883660046120bc565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b3480156105c0575f5ffd5b5061023d6105cf366004611e78565b611302565b5f6001600160e01b0319821663780e9d6360e01b14806105f857506105f88261139a565b92915050565b600a546001600160a01b031633146106315760405162461bcd60e51b8152600401610628906120e4565b60405180910390fd5b600f805460ff1916911515919091179055565b60605f805461065290612119565b80601f016020809104026020016040519081016040528092919081815260200182805461067e90612119565b80156106c95780601f106106a0576101008083540402835291602001916106c9565b820191905f5260205f20905b8154815290600101906020018083116106ac57829003601f168201915b5050505050905090565b5f818152600260205260408120546001600160a01b031661074b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610628565b505f908152600460205260409020546001600160a01b031690565b5f61077082610bb6565b9050806001600160a01b0316836001600160a01b0316036107dd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610628565b336001600160a01b03821614806107f957506107f98133610588565b61086b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610628565b61087583836113e9565b505050565b6108843382611456565b6108a05760405162461bcd60e51b815260040161062890612151565b61087583838361154a565b5f6108b583610d7f565b82106109175760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610628565b506001600160a01b03919091165f908152600660209081526040808320938352929052205490565b600a546001600160a01b031633146109695760405162461bcd60e51b8152600401610628906120e4565b5f61097c600a546001600160a01b031690565b6001600160a01b0316476040515f6040518083038185875af1925050503d805f81146109c3576040519150601f19603f3d011682016040523d82523d5f602084013e6109c8565b606091505b5050905080610a0b5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610628565b50565b61087583838360405180602001604052805f815250611134565b60605f610a3483610d7f565b90505f8167ffffffffffffffff811115610a5057610a50611ed3565b604051908082528060200260200182016040528015610a79578160200160208202803683370190505b5090505f5b82811015610ab557610a9085826108ab565b828281518110610aa257610aa26121a2565b6020908102919091010152600101610a7e565b509392505050565b600a546001600160a01b03163314610ae75760405162461bcd60e51b8152600401610628906120e4565b600d55565b5f610af660085490565b8210610b595760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610628565b60088281548110610b6c57610b6c6121a2565b905f5260205f2001549050919050565b600a546001600160a01b03163314610ba65760405162461bcd60e51b8152600401610628906120e4565b600b610bb28282612201565b5050565b5f818152600260205260408120546001600160a01b0316806105f85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610628565b600a546001600160a01b03163314610c565760405162461bcd60e51b8152600401610628906120e4565b5f610c6060085490565b600e54909150610c7083836122d0565b1115610cb35760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b6044820152606401610628565b5f5b82811015610d79575f848483818110610cd057610cd06121a2565b9050602002016020810190610ce59190611e78565b6001600160a01b031603610d2d5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610628565b610d71848483818110610d4257610d426121a2565b9050602002016020810190610d579190611e78565b610d6183856122d0565b610d6c9060016122d0565b6116f1565b600101610cb5565b50505050565b5f6001600160a01b038216610de95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610628565b506001600160a01b03165f9081526003602052604090205490565b600a546001600160a01b03163314610e2e5760405162461bcd60e51b8152600401610628906120e4565b610e375f61170a565b565b60606001805461065290612119565b5f610e5260085490565b600f5490915060ff1615610e9c5760405162461bcd60e51b8152602060048201526011602482015270135a5b9d1a5b99c81a5cc81c185d5cd959607a1b6044820152606401610628565b5f8211610ee45760405162461bcd60e51b81526020600482015260166024820152754d757374206d696e74206174206c65617374206f6e6560501b6044820152606401610628565b6002821115610f355760405162461bcd60e51b815260206004820152601760248201527f45786365656473206d6178206d696e7420616d6f756e740000000000000000006044820152606401610628565b600282610f4133610d7f565b610f4b91906122d0565b1115610f925760405162461bcd60e51b8152602060048201526016602482015275115e18d959591cc81b585e081c195c881dd85b1b195d60521b6044820152606401610628565b600e54610f9f83836122d0565b1115610fe25760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b6044820152606401610628565b600a546001600160a01b031633146110475781600d5461100291906122e3565b34146110475760405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0811551208185b5bdd5b9d60621b6044820152606401610628565b60015b8281116108755761105f33610d6c83856122d0565b80611069816122fa565b91505061104a565b336001600160a01b038316036110c95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610628565b335f8181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61113e3383611456565b61115a5760405162461bcd60e51b815260040161062890612151565b610d798484848461175b565b600c805461117390612119565b80601f016020809104026020016040519081016040528092919081815260200182805461119f90612119565b80156111ea5780601f106111c1576101008083540402835291602001916111ea565b820191905f5260205f20905b8154815290600101906020018083116111cd57829003601f168201915b505050505081565b5f818152600260205260409020546060906001600160a01b03166112705760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610628565b5f61127961178e565b90505f8151116112975760405180602001604052805f8152506112c5565b806112a18461179d565b600c6040516020016112b593929190612329565b6040516020818303038152906040525b9392505050565b600a546001600160a01b031633146112f65760405162461bcd60e51b8152600401610628906120e4565b600c610bb28282612201565b600a546001600160a01b0316331461132c5760405162461bcd60e51b8152600401610628906120e4565b6001600160a01b0381166113915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b610a0b8161170a565b5f6001600160e01b031982166380ac58cd60e01b14806113ca57506001600160e01b03198216635b5e139f60e01b145b806105f857506301ffc9a760e01b6001600160e01b03198316146105f8565b5f81815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061141d82610bb6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f818152600260205260408120546001600160a01b03166114ce5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610628565b5f6114d883610bb6565b9050806001600160a01b0316846001600160a01b031614806115135750836001600160a01b0316611508846106d3565b6001600160a01b0316145b8061154257506001600160a01b038082165f9081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661155d82610bb6565b6001600160a01b0316146115c55760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610628565b6001600160a01b0382166116275760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b61163283838361189a565b61163c5f826113e9565b6001600160a01b0383165f9081526003602052604081208054600192906116649084906123b0565b90915550506001600160a01b0382165f9081526003602052604081208054600192906116919084906122d0565b90915550505f8181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610bb2828260405180602001604052805f815250611951565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b61176684848461154a565b61177284848484611983565b610d795760405162461bcd60e51b8152600401610628906123c3565b6060600b805461065290612119565b6060815f036117c35750506040805180820190915260018152600360fc1b602082015290565b815f5b81156117ec57806117d6816122fa565b91506117e59050600a83612429565b91506117c6565b5f8167ffffffffffffffff81111561180657611806611ed3565b6040519080825280601f01601f191660200182016040528015611830576020820181803683370190505b5090505b8415611542576118456001836123b0565b9150611852600a8661243c565b61185d9060306122d0565b60f81b818381518110611872576118726121a2565b60200101906001600160f81b03191690815f1a905350611893600a86612429565b9450611834565b6001600160a01b0383166118f4576118ef81600880545f838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611917565b816001600160a01b0316836001600160a01b031614611917576119178382611a80565b6001600160a01b03821661192e5761087581611b19565b826001600160a01b0316826001600160a01b031614610875576108758282611bc0565b61195b8383611c02565b6119675f848484611983565b6108755760405162461bcd60e51b8152600401610628906123c3565b5f6001600160a01b0384163b15611a7557604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906119c690339089908890889060040161244f565b6020604051808303815f875af1925050508015611a00575060408051601f3d908101601f191682019092526119fd9181019061248b565b60015b611a5b573d808015611a2d576040519150601f19603f3d011682016040523d82523d5f602084013e611a32565b606091505b5080515f03611a535760405162461bcd60e51b8152600401610628906123c3565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611542565b506001949350505050565b5f6001611a8c84610d7f565b611a9691906123b0565b5f83815260076020526040902054909150808214611ae7576001600160a01b0384165f9081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b505f9182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008545f90611b2a906001906123b0565b5f8381526009602052604081205460088054939450909284908110611b5157611b516121a2565b905f5260205f20015490508060088381548110611b7057611b706121a2565b5f918252602080832090910192909255828152600990915260408082208490558582528120556008805480611ba757611ba76124a6565b600190038181905f5260205f20015f9055905550505050565b5f611bca83610d7f565b6001600160a01b039093165f908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b038216611c585760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610628565b5f818152600260205260409020546001600160a01b031615611cbc5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610628565b611cc75f838361189a565b6001600160a01b0382165f908152600360205260408120805460019290611cef9084906122d0565b90915550505f8181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114610a0b575f5ffd5b5f60208284031215611d71575f5ffd5b81356112c581611d4c565b80358015158114611d8b575f5ffd5b919050565b5f60208284031215611da0575f5ffd5b6112c582611d7c565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6112c56020830184611da9565b5f60208284031215611df9575f5ffd5b5035919050565b80356001600160a01b0381168114611d8b575f5ffd5b5f5f60408385031215611e27575f5ffd5b611e3083611e00565b946020939093013593505050565b5f5f5f60608486031215611e50575f5ffd5b611e5984611e00565b9250611e6760208501611e00565b929592945050506040919091013590565b5f60208284031215611e88575f5ffd5b6112c582611e00565b602080825282518282018190525f918401906040840190835b81811015611ec8578351835260209384019390920191600101611eaa565b509095945050505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f67ffffffffffffffff841115611f0157611f01611ed3565b50604051601f19601f85018116603f0116810181811067ffffffffffffffff82111715611f3057611f30611ed3565b604052838152905080828401851015611f47575f5ffd5b838360208301375f60208583010152509392505050565b5f60208284031215611f6e575f5ffd5b813567ffffffffffffffff811115611f84575f5ffd5b8201601f81018413611f94575f5ffd5b61154284823560208401611ee7565b5f5f60208385031215611fb4575f5ffd5b823567ffffffffffffffff811115611fca575f5ffd5b8301601f81018513611fda575f5ffd5b803567ffffffffffffffff811115611ff0575f5ffd5b8560208260051b8401011115612004575f5ffd5b6020919091019590945092505050565b5f5f60408385031215612025575f5ffd5b61202e83611e00565b915061203c60208401611d7c565b90509250929050565b5f5f5f5f60808587031215612058575f5ffd5b61206185611e00565b935061206f60208601611e00565b925060408501359150606085013567ffffffffffffffff811115612091575f5ffd5b8501601f810187136120a1575f5ffd5b6120b087823560208401611ee7565b91505092959194509250565b5f5f604083850312156120cd575f5ffd5b6120d683611e00565b915061203c60208401611e00565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061212d57607f821691505b60208210810361214b57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b5f52603260045260245ffd5b601f82111561087557805f5260205f20601f840160051c810160208510156121db5750805b601f840160051c820191505b818110156121fa575f81556001016121e7565b5050505050565b815167ffffffffffffffff81111561221b5761221b611ed3565b61222f816122298454612119565b846121b6565b6020601f821160018114612261575f831561224a5750848201515b5f19600385901b1c1916600184901b1784556121fa565b5f84815260208120601f198516915b828110156122905787850151825560209485019460019092019101612270565b50848210156122ad57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b808201808211156105f8576105f86122bc565b80820281158282048414176105f8576105f86122bc565b5f6001820161230b5761230b6122bc565b5060010190565b5f81518060208401855e5f93019283525090919050565b5f61233d6123378387612312565b85612312565b5f845461234981612119565b6001821680156123605760018114612375576123a2565b60ff19831685528115158202850193506123a2565b875f5260205f205f5b8381101561239a5781548782015260019091019060200161237e565b505081850193505b509198975050505050505050565b818103818111156105f8576105f86122bc565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b5f52601260045260245ffd5b5f8261243757612437612415565b500490565b5f8261244a5761244a612415565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061248190830184611da9565b9695505050505050565b5f6020828403121561249b575f5ffd5b81516112c581611d4c565b634e487b7160e01b5f52603160045260245ffdfea2646970667358221220116abf788a38aa65807408b454522f7076b1a27f3a2500c63b517a41ca459e5964736f6c634300081c0033
Verified Source Code Full Match
Compiler: v0.8.28+commit.7893614a
EVM: cancun
Optimization: Yes (200 runs)
AuthenticallyCryptoNFT.sol 1101 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
pragma solidity ^0.8.0;
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
pragma solidity ^0.8.0;
interface IERC721Enumerable is IERC721 {
function totalSupply() external view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
function tokenByIndex(uint256 index) external view returns (uint256);
}
pragma solidity ^0.8.0;
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
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);
}
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);
}
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);
}
}
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
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");
}
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);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
pragma solidity ^0.8.0;
/**
* @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);
}
// File: @openzeppelin/contracts/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);
}
// File: @openzeppelin/contracts/utils/Context.sol
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: 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 virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
pragma solidity ^0.8.0;
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() {
_setOwner(_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 {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract AuthenticallyCryptoNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.069 ether;
uint256 public maxSupply = 369;
uint256 public constant MAX_MINT_PER_TX = 2;
uint256 public constant MAX_PER_WALLET = 2;
bool public paused = false;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
setBaseURI(_initBaseURI);
paused = false;
for(uint256 i = 1; i <= 23; i++) {
_safeMint(msg.sender, i);
}
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "Minting is paused");
require(_mintAmount > 0, "Must mint at least one");
require(_mintAmount <= MAX_MINT_PER_TX, "Exceeds max mint amount");
require(balanceOf(msg.sender) + _mintAmount <= MAX_PER_WALLET, "Exceeds max per wallet");
require(supply + _mintAmount <= maxSupply, "Exceeds max supply");
if (msg.sender != owner()) {
require(msg.value == cost * _mintAmount, "Incorrect ETH amount");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 ownerTokenCount = balanceOf(_owner);
uint256[] memory tokenIds = new uint256[](ownerTokenCount);
for (uint256 i; i < ownerTokenCount; i++) {
tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokenIds;
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
: "";
}
function setCost(uint256 _newCost) public onlyOwner {
cost = _newCost;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
baseExtension = _newBaseExtension;
}
function pause(bool _state) public onlyOwner {
paused = _state;
}
function ownerMint(address[] calldata _to) public onlyOwner {
uint256 supply = totalSupply();
require(supply + _to.length <= maxSupply, "Exceeds max supply");
for(uint256 i = 0; i < _to.length; i++) {
require(_to[i] != address(0), "Invalid address");
_safeMint(_to[i], supply + i + 1);
}
}
function withdraw() public onlyOwner {
(bool success, ) = payable(owner()).call{value: address(this).balance}("");
require(success, "Transfer failed");
}
}
Read Contract
MAX_MINT_PER_TX 0x8ecad721 → uint256
MAX_PER_WALLET 0x0f2cdd6c → uint256
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
cost 0x13faede6 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxSupply 0xd5abeb01 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → 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 _mintAmount
ownerMint 0x661e3e36
address[] _to
pause 0x02329a29
bool _state
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseExtension 0xda3ef23f
string _newBaseExtension
setBaseURI 0x55f804b3
string _newBaseURI
setCost 0x44a0d68a
uint256 _newCost
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address