Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x328E95b46Ac9DEDec1437009AF82DD47cafb8546
Balance 0 ETH
Nonce 1
Code Size 19333 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

19333 bytes
0x6080604052600436106103975760003560e01c806355f804b3116101dc578063a475b5dd11610102578063cca6aae2116100a0578063e26274831161006f578063e262748314610cc6578063e985e9c514610cef578063f2c4ce1e14610d2c578063f2fde38b14610d5557610397565b8063cca6aae214610c2b578063d00631bc14610c47578063d5abeb0114610c72578063da3ef23f14610c9d57610397565b8063bc951b91116100dc578063bc951b9114610b6f578063bedb86fb14610b9a578063c668286214610bc3578063c87b56dd14610bee57610397565b8063a475b5dd14610b20578063b88d4fde14610b37578063bb462de114610b5357610397565b80638692a6b51161017a578063952bd5da11610149578063952bd5da14610a7857806395d89b4114610aa15780639c960b3b14610acc578063a22cb46514610af757610397565b80638692a6b5146109be578063887467d3146109e75780638da5cb5b14610a24578063939f769b14610a4f57610397565b80636383269a116101b65780636383269a1461091657806370a0823114610941578063715018a61461097e5780637b35fb4a1461099557610397565b806355f804b3146108855780635c975abb146108ae5780636352211e146108d957610397565b806328b60d15116102c15780633ccfd60b1161025f578063483209921161022e57806348320992146107c75780634c4a0054146107f2578063511899d61461082f578063518302271461085a57610397565b80633ccfd60b1461074d57806341842b441461075757806342842e0e1461078257806344a0d68a1461079e57610397565b806333f88d221161029b57806333f88d22146106a757806337c886ce146106d05780633a56af50146106f95780633a5bcda81461072257610397565b806328b60d15146106285780632959d3031461065157806333511cd21461067c57610397565b806314f499ba11610339578063237849de11610308578063237849de1461059a57806323b872dd146105c557806323ff9846146105e15780632806b8fb146105fd57610397565b806314f499ba146104de578063157be9b11461050757806318160ddd14610532578063198f4b241461055d57610397565b8063095ea7b311610375578063095ea7b3146104415780630a6a4d191461045d5780630c41f4971461048857806313faede6146104b357610397565b806301ffc9a71461039c57806306fdde03146103d9578063081812fc14610404575b600080fd5b3480156103a857600080fd5b506103c360048036038101906103be9190613a87565b610d7e565b6040516103d09190614072565b60405180910390f35b3480156103e557600080fd5b506103ee610e10565b6040516103fb919061408d565b60405180910390f35b34801561041057600080fd5b5061042b60048036038101906104269190613b2a565b610ea2565b604051610438919061400b565b60405180910390f35b61045b600480360381019061045691906139da565b610f21565b005b34801561046957600080fd5b50610472611065565b60405161047f919061426a565b60405180910390f35b34801561049457600080fd5b5061049d611078565b6040516104aa9190614072565b60405180910390f35b3480156104bf57600080fd5b506104c861108b565b6040516104d5919061424f565b60405180910390f35b3480156104ea57600080fd5b5061050560048036038101906105009190613a47565b611091565b005b34801561051357600080fd5b5061051c6110ab565b604051610529919061424f565b60405180910390f35b34801561053e57600080fd5b506105476110b1565b604051610554919061424f565b60405180910390f35b34801561056957600080fd5b50610584600480360381019061057f919061393a565b6110c8565b6040516105919190614072565b60405180910390f35b3480156105a657600080fd5b506105af61114c565b6040516105bc9190614072565b60405180910390f35b6105df60048036038101906105da9190613864565b61115f565b005b6105fb60048036038101906105f69190613bbe565b611484565b005b34801561060957600080fd5b506106126116a7565b60405161061f919061424f565b60405180910390f35b34801561063457600080fd5b5061064f600480360381019061064a9190613bbe565b6116ad565b005b34801561065d57600080fd5b506106666116d3565b604051610673919061424f565b60405180910390f35b34801561068857600080fd5b506106916116d9565b60405161069e919061424f565b60405180910390f35b3480156106b357600080fd5b506106ce60048036038101906106c99190613b2a565b6116df565b005b3480156106dc57600080fd5b506106f760048036038101906106f29190613a1a565b6116f4565b005b34801561070557600080fd5b50610720600480360381019061071b9190613bbe565b611719565b005b34801561072e57600080fd5b5061073761173f565b604051610744919061426a565b60405180910390f35b610755611752565b005b34801561076357600080fd5b5061076c6117da565b604051610779919061424f565b60405180910390f35b61079c60048036038101906107979190613864565b6117e0565b005b3480156107aa57600080fd5b506107c560048036038101906107c09190613b2a565b611800565b005b3480156107d357600080fd5b506107dc611812565b6040516107e9919061424f565b60405180910390f35b3480156107fe57600080fd5b50610819600480360381019061081491906137f7565b611818565b604051610826919061426a565b60405180910390f35b34801561083b57600080fd5b5061084461186e565b604051610851919061424f565b60405180910390f35b34801561086657600080fd5b5061086f611874565b60405161087c9190614072565b60405180910390f35b34801561089157600080fd5b506108ac60048036038101906108a79190613ae1565b611887565b005b3480156108ba57600080fd5b506108c36118a9565b6040516108d09190614072565b60405180910390f35b3480156108e557600080fd5b5061090060048036038101906108fb9190613b2a565b6118bc565b60405161090d919061400b565b60405180910390f35b34801561092257600080fd5b5061092b6118ce565b604051610938919061426a565b60405180910390f35b34801561094d57600080fd5b50610968600480360381019061096391906137f7565b6118e1565b604051610975919061424f565b60405180910390f35b34801561098a57600080fd5b5061099361199a565b005b3480156109a157600080fd5b506109bc60048036038101906109b79190613bbe565b6119ae565b005b3480156109ca57600080fd5b506109e560048036038101906109e09190613b57565b6119d4565b005b3480156109f357600080fd5b50610a0e6004803603810190610a09919061393a565b6119fe565b604051610a1b9190614072565b60405180910390f35b348015610a3057600080fd5b50610a39611a82565b604051610a46919061400b565b60405180910390f35b348015610a5b57600080fd5b50610a766004803603810190610a719190613a1a565b611aac565b005b348015610a8457600080fd5b50610a9f6004803603810190610a9a9190613bbe565b611ad1565b005b348015610aad57600080fd5b50610ab6611af7565b604051610ac3919061408d565b60405180910390f35b348015610ad857600080fd5b50610ae1611b89565b604051610aee9190614072565b60405180910390f35b348015610b0357600080fd5b50610b1e6004803603810190610b19919061399a565b611b9c565b005b348015610b2c57600080fd5b50610b35611ca7565b005b610b516004803603810190610b4c91906138b7565b611ccc565b005b610b6d6004803603810190610b689190613beb565b611d3f565b005b348015610b7b57600080fd5b50610b84611fae565b604051610b91919061426a565b60405180910390f35b348015610ba657600080fd5b50610bc16004803603810190610bbc9190613a1a565b611fc1565b005b348015610bcf57600080fd5b50610bd8611fe6565b604051610be5919061408d565b60405180910390f35b348015610bfa57600080fd5b50610c156004803603810190610c109190613b2a565b612074565b604051610c22919061408d565b60405180910390f35b610c456004803603810190610c409190613beb565b6121d0565b005b348015610c5357600080fd5b50610c5c61243f565b604051610c69919061424f565b60405180910390f35b348015610c7e57600080fd5b50610c87612445565b604051610c94919061424f565b60405180910390f35b348015610ca957600080fd5b50610cc46004803603810190610cbf9190613ae1565b61244b565b005b348015610cd257600080fd5b50610ced6004803603810190610ce89190613a1a565b61246d565b005b348015610cfb57600080fd5b50610d166004803603810190610d119190613824565b612492565b604051610d239190614072565b60405180910390f35b348015610d3857600080fd5b50610d536004803603810190610d4e9190613ae1565b612526565b005b348015610d6157600080fd5b50610d7c6004803603810190610d7791906137f7565b612548565b005b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610dd957506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610e095750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b606060028054610e1f90614557565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4b90614557565b8015610e985780601f10610e6d57610100808354040283529160200191610e98565b820191906000526020600020905b815481529060010190602001808311610e7b57829003601f168201915b5050505050905090565b6000610ead826125cc565b610ee3576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610f2c826118bc565b90508073ffffffffffffffffffffffffffffffffffffffff16610f4d61262b565b73ffffffffffffffffffffffffffffffffffffffff1614610fb057610f7981610f7461262b565b612492565b610faf576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b6008601c9054906101000a900460ff1681565b600860189054906101000a900460ff1681565b60095481565b611099612633565b81601781905550806018819055505050565b600c5481565b60006110bb6126b1565b6001546000540303905090565b600080846040516020016110dc9190613faa565b604051602081830303815290604052805190602001209050611142848480806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050601754836126b6565b9150509392505050565b600860169054906101000a900460ff1681565b600061116a826126cd565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146111d1576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806111dd8461279b565b915091506111f381876111ee61262b565b6127c2565b61123f576112088661120361262b565b612492565b61123e576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156112a6576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112b38686866001612806565b80156112be57600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001019190508190555061138c8561136888888761280c565b7c020000000000000000000000000000000000000000000000000000000017612834565b600460008681526020019081526020016000208190555060007c020000000000000000000000000000000000000000000000000000000084161415611414576000600185019050600060046000838152602001908152602001600020541415611412576000548114611411578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461147c868686600161285f565b505050505050565b80600860149054906101000a900460ff16156114d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cc906141ef565b60405180910390fd5b60008160ff161161151b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115129061420f565b60405180910390fd5b600a548160ff1661152a6110b1565b611534919061436f565b1115611575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156c9061410f565b60405180910390fd5b600860199054906101000a900460ff1660ff16601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16826115e091906143c5565b60ff161115611624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161b9061416f565b60405180910390fd5b600860189054906101000a900460ff1615611674576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166b9061412f565b60405180910390fd5b60006116936008601c9054906101000a900460ff1660ff166002612865565b90506116a28334836002612a4a565b505050565b600e5481565b6116b5612633565b80600860196101000a81548160ff021916908360ff16021790555050565b60105481565b600d5481565b6116e7612633565b6116f13382612d77565b50565b6116fc612633565b80600860186101000a81548160ff02191690831515021790555050565b611721612633565b806008601b6101000a81548160ff021916908360ff16021790555050565b6008601a9054906101000a900460ff1681565b61175a612633565b6000611764611a82565b73ffffffffffffffffffffffffffffffffffffffff164760405161178790613ff6565b60006040518083038185875af1925050503d80600081146117c4576040519150601f19603f3d011682016040523d82523d6000602084013e6117c9565b606091505b50509050806117d757600080fd5b50565b60125481565b6117fb83838360405180602001604052806000815250611ccc565b505050565b611808612633565b8060098190555050565b600b5481565b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60115481565b600860159054906101000a900460ff1681565b61188f612633565b80601390805190602001906118a592919061358b565b5050565b600860149054906101000a900460ff1681565b60006118c7826126cd565b9050919050565b6008601b9054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611949576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b6119a2612633565b6119ac6000612d95565b565b6119b6612633565b806008601c6101000a81548160ff021916908360ff16021790555050565b6119dc612633565b83600f8190555082601081905550816011819055508060128190555050505050565b60008084604051602001611a129190613faa565b604051602081830303815290604052805190602001209050611a78848480806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050601854836126b6565b9150509392505050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611ab4612633565b80600860166101000a81548160ff02191690831515021790555050565b611ad9612633565b806008601a6101000a81548160ff021916908360ff16021790555050565b606060038054611b0690614557565b80601f0160208091040260200160405190810160405280929190818152602001828054611b3290614557565b8015611b7f5780601f10611b5457610100808354040283529160200191611b7f565b820191906000526020600020905b815481529060010190602001808311611b6257829003601f168201915b5050505050905090565b600860179054906101000a900460ff1681565b8060076000611ba961262b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611c5661262b565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611c9b9190614072565b60405180910390a35050565b611caf612633565b6001600860156101000a81548160ff021916908315150217905550565b611cd784848461115f565b60008373ffffffffffffffffffffffffffffffffffffffff163b14611d3957611d0284848484612e5b565b611d38576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b82600860149054906101000a900460ff1615611d90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d87906141ef565b60405180910390fd5b60008160ff1611611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd9061420f565b60405180910390fd5b600a548160ff16611de56110b1565b611def919061436f565b1115611e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e279061410f565b60405180910390fd5b600860199054906101000a900460ff1660ff16601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1682611e9b91906143c5565b60ff161115611edf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed69061416f565b60405180910390fd5b600860169054906101000a900460ff1615611f2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f26906141cf565b60405180910390fd5b611f3a3384846110c8565b611f79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f709061422f565b60405180910390fd5b6000611f986008601a9054906101000a900460ff1660ff166000612865565b9050611fa78534836000612a4a565b5050505050565b600860199054906101000a900460ff1681565b611fc9612633565b80600860146101000a81548160ff02191690831515021790555050565b60148054611ff390614557565b80601f016020809104026020016040519081016040528092919081815260200182805461201f90614557565b801561206c5780601f106120415761010080835404028352916020019161206c565b820191906000526020600020905b81548152906001019060200180831161204f57829003601f168201915b505050505081565b606061207f826125cc565b6120be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b5906141af565b60405180910390fd5b60001515600860159054906101000a900460ff161515141561216c57601580546120e790614557565b80601f016020809104026020016040519081016040528092919081815260200182805461211390614557565b80156121605780601f1061213557610100808354040283529160200191612160565b820191906000526020600020905b81548152906001019060200180831161214357829003601f168201915b505050505090506121cb565b6000612176612fbb565b90506000815111156121b7578061218c8461304d565b60146040516020016121a093929190613fc5565b6040516020818303038152906040529150506121cb565b604051806020016040528060008152509150505b919050565b82600860149054906101000a900460ff1615612221576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612218906141ef565b60405180910390fd5b60008160ff1611612267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225e9061420f565b60405180910390fd5b600a548160ff166122766110b1565b612280919061436f565b11156122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b89061410f565b60405180910390fd5b600860199054906101000a900460ff1660ff16601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168261232c91906143c5565b60ff161115612370576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123679061416f565b60405180910390fd5b600860179054906101000a900460ff16156123c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b79061414f565b60405180910390fd5b6123cb3384846119fe565b61240a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124019061422f565b60405180910390fd5b60006124296008601b9054906101000a900460ff1660ff166001612865565b90506124388534836001612a4a565b5050505050565b600f5481565b600a5481565b612453612633565b806014908051906020019061246992919061358b565b5050565b612475612633565b80600860176101000a81548160ff02191690831515021790555050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61252e612633565b806015908051906020019061254492919061358b565b5050565b612550612633565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b7906140ef565b60405180910390fd5b6125c981612d95565b50565b6000816125d76126b1565b111580156125e6575060005482105b8015612624575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b600033905090565b61263b613125565b73ffffffffffffffffffffffffffffffffffffffff16612659611a82565b73ffffffffffffffffffffffffffffffffffffffff16146126af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a69061418f565b60405180910390fd5b565b600090565b6000826126c3858461312d565b1490509392505050565b600080829050806126dc6126b1565b11612764576000548110156127635760006004600083815260200190815260200160002054905060007c010000000000000000000000000000000000000000000000000000000082161415612761575b600081141561275757600460008360019003935083815260200190815260200160002054905061272c565b8092505050612796565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8612823868684613183565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b600080601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16905080841115612a3e57600081856128d09190614456565b9050600060028111156128e6576128e5614685565b5b8460028111156128f9576128f8614685565b5b1480156129095750600f54600b54105b1561294857600b54600f5461291e9190614456565b81101561292f578092505050612a44565b600b54600f5461293f9190614456565b92505050612a44565b6001600281111561295c5761295b614685565b5b84600281111561296f5761296e614685565b5b14801561297f5750601054600c54105b156129be57600c546010546129949190614456565b8110156129a5578092505050612a44565b600c546010546129b59190614456565b92505050612a44565b6002808111156129d1576129d0614685565b5b8460028111156129e4576129e3614685565b5b1480156129f45750601154600d54105b15612a3357600d54601154612a099190614456565b811015612a1a578092505050612a44565b600d54601154612a2a9190614456565b92505050612a44565b600092505050612a44565b60009150505b92915050565b818460ff1611612b845760006002811115612a6857612a67614685565b5b816002811115612a7b57612a7a614685565b5b1415612a9d578360ff16600b54612a92919061436f565b600b81905550612aff565b60016002811115612ab157612ab0614685565b5b816002811115612ac457612ac3614685565b5b1415612ae6578360ff16600c54612adb919061436f565b600c81905550612afe565b8360ff16600d54612af7919061436f565b600d819055505b5b612b0c338560ff16612d77565b83601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a900460ff16612b6791906143c5565b92506101000a81548160ff021916908360ff160217905550612d71565b60006002811115612b9857612b97614685565b5b816002811115612bab57612baa614685565b5b1415612bca5781600b54612bbf919061436f565b600b81905550612c26565b60016002811115612bde57612bdd614685565b5b816002811115612bf157612bf0614685565b5b1415612c105781600c54612c05919061436f565b600c81905550612c25565b81600d54612c1e919061436f565b600d819055505b5b6000828560ff16612c379190614456565b905060095481612c4791906143fc565b841015612c89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c80906140af565b60405180910390fd5b60125481600e54612c9a919061436f565b1115612cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cd2906140cf565b60405180910390fd5b612ce8338660ff16612d77565b84601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a900460ff16612d4391906143c5565b92506101000a81548160ff021916908360ff16021790555080600e54612d69919061436f565b600e81905550505b50505050565b612d9182826040518060200160405280600081525061318c565b5050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612e8161262b565b8786866040518563ffffffff1660e01b8152600401612ea39493929190614026565b602060405180830381600087803b158015612ebd57600080fd5b505af1925050508015612eee57506040513d601f19601f82011682018060405250810190612eeb9190613ab4565b60015b612f68573d8060008114612f1e576040519150601f19603f3d011682016040523d82523d6000602084013e612f23565b606091505b50600081511415612f60576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b606060138054612fca90614557565b80601f0160208091040260200160405190810160405280929190818152602001828054612ff690614557565b80156130435780601f1061301857610100808354040283529160200191613043565b820191906000526020600020905b81548152906001019060200180831161302657829003601f168201915b5050505050905090565b60606000600161305c84613229565b01905060008167ffffffffffffffff81111561307b5761307a614712565b5b6040519080825280601f01601f1916602001820160405280156130ad5781602001600182028036833780820191505090505b509050600082602001820190505b60011561311a578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161310457613103614656565b5b04945060008514156131155761311a565b6130bb565b819350505050919050565b600033905090565b60008082905060005b84518110156131785761316382868381518110613156576131556146e3565b5b602002602001015161337c565b91508080613170906145ba565b915050613136565b508091505092915050565b60009392505050565b61319683836133a7565b60008373ffffffffffffffffffffffffffffffffffffffff163b1461322457600080549050600083820390505b6131d66000868380600101945086612e5b565b61320c576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8181106131c357816000541461322157600080fd5b50505b505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613287577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161327d5761327c614656565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106132c4576d04ee2d6d415b85acef810000000083816132ba576132b9614656565b5b0492506020810190505b662386f26fc1000083106132f357662386f26fc1000083816132e9576132e8614656565b5b0492506010810190505b6305f5e100831061331c576305f5e100838161331257613311614656565b5b0492506008810190505b612710831061334157612710838161333757613336614656565b5b0492506004810190505b60648310613364576064838161335a57613359614656565b5b0492506002810190505b600a8310613373576001810190505b80915050919050565b60008183106133945761338f8284613564565b61339f565b61339e8383613564565b5b905092915050565b60008054905060008214156133e8576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6133f56000848385612806565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061346c8361345d600086600061280c565b6134668561357b565b17612834565b6004600083815260200190815260200160002081905550600080838301905073ffffffffffffffffffffffffffffffffffffffff85169150828260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600183015b81811461350d57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a46001810190506134d2565b506000821415613549576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600081905550505061355f600084838561285f565b505050565b600082600052816020526040600020905092915050565b60006001821460e11b9050919050565b82805461359790614557565b90600052602060002090601f0160209004810192826135b95760008555613600565b82601f106135d257805160ff1916838001178555613600565b82800160010185558215613600579182015b828111156135ff5782518255916020019190600101906135e4565b5b50905061360d9190613611565b5090565b5b8082111561362a576000816000905550600101613612565b5090565b600061364161363c846142aa565b614285565b90508281526020810184848401111561365d5761365c614750565b5b613668848285614515565b509392505050565b600061368361367e846142db565b614285565b90508281526020810184848401111561369f5761369e614750565b5b6136aa848285614515565b509392505050565b6000813590506136c181614ac5565b92915050565b60008083601f8401126136dd576136dc614746565b5b8235905067ffffffffffffffff8111156136fa576136f9614741565b5b6020830191508360208202830111156137165761371561474b565b5b9250929050565b60008135905061372c81614adc565b92915050565b60008135905061374181614af3565b92915050565b60008135905061375681614b0a565b92915050565b60008151905061376b81614b0a565b92915050565b600082601f83011261378657613785614746565b5b813561379684826020860161362e565b91505092915050565b600082601f8301126137b4576137b3614746565b5b81356137c4848260208601613670565b91505092915050565b6000813590506137dc81614b21565b92915050565b6000813590506137f181614b38565b92915050565b60006020828403121561380d5761380c61475a565b5b600061381b848285016136b2565b91505092915050565b6000806040838503121561383b5761383a61475a565b5b6000613849858286016136b2565b925050602061385a858286016136b2565b9150509250929050565b60008060006060848603121561387d5761387c61475a565b5b600061388b868287016136b2565b935050602061389c868287016136b2565b92505060406138ad868287016137cd565b9150509250925092565b600080600080608085870312156138d1576138d061475a565b5b60006138df878288016136b2565b94505060206138f0878288016136b2565b9350506040613901878288016137cd565b925050606085013567ffffffffffffffff81111561392257613921614755565b5b61392e87828801613771565b91505092959194509250565b6000806000604084860312156139535761395261475a565b5b6000613961868287016136b2565b935050602084013567ffffffffffffffff81111561398257613981614755565b5b61398e868287016136c7565b92509250509250925092565b600080604083850312156139b1576139b061475a565b5b60006139bf858286016136b2565b92505060206139d08582860161371d565b9150509250929050565b600080604083850312156139f1576139f061475a565b5b60006139ff858286016136b2565b9250506020613a10858286016137cd565b9150509250929050565b600060208284031215613a3057613a2f61475a565b5b6000613a3e8482850161371d565b91505092915050565b60008060408385031215613a5e57613a5d61475a565b5b6000613a6c85828601613732565b9250506020613a7d85828601613732565b9150509250929050565b600060208284031215613a9d57613a9c61475a565b5b6000613aab84828501613747565b91505092915050565b600060208284031215613aca57613ac961475a565b5b6000613ad88482850161375c565b91505092915050565b600060208284031215613af757613af661475a565b5b600082013567ffffffffffffffff811115613b1557613b14614755565b5b613b218482850161379f565b91505092915050565b600060208284031215613b4057613b3f61475a565b5b6000613b4e848285016137cd565b91505092915050565b60008060008060808587031215613b7157613b7061475a565b5b6000613b7f878288016137cd565b9450506020613b90878288016137cd565b9350506040613ba1878288016137cd565b9250506060613bb2878288016137cd565b91505092959194509250565b600060208284031215613bd457613bd361475a565b5b6000613be2848285016137e2565b91505092915050565b600080600060408486031215613c0457613c0361475a565b5b6000613c12868287016137e2565b935050602084013567ffffffffffffffff811115613c3357613c32614755565b5b613c3f868287016136c7565b92509250509250925092565b613c548161448a565b82525050565b613c6b613c668261448a565b614603565b82525050565b613c7a8161449c565b82525050565b6000613c8b82614321565b613c958185614337565b9350613ca5818560208601614524565b613cae8161475f565b840191505092915050565b6000613cc48261432c565b613cce8185614353565b9350613cde818560208601614524565b613ce78161475f565b840191505092915050565b6000613cfd8261432c565b613d078185614364565b9350613d17818560208601614524565b80840191505092915050565b60008154613d3081614557565b613d3a8186614364565b94506001821660008114613d555760018114613d6657613d99565b60ff19831686528186019350613d99565b613d6f8561430c565b60005b83811015613d9157815481890152600182019150602081019050613d72565b838801955050505b50505092915050565b6000613daf601e83614353565b9150613dba8261477d565b602082019050919050565b6000613dd2601583614353565b9150613ddd826147a6565b602082019050919050565b6000613df5602683614353565b9150613e00826147cf565b604082019050919050565b6000613e18601e83614353565b9150613e238261481e565b602082019050919050565b6000613e3b602183614353565b9150613e4682614847565b604082019050919050565b6000613e5e602383614353565b9150613e6982614896565b604082019050919050565b6000613e81601b83614353565b9150613e8c826148e5565b602082019050919050565b6000613ea4602083614353565b9150613eaf8261490e565b602082019050919050565b6000613ec7602f83614353565b9150613ed282614937565b604082019050919050565b6000613eea602383614353565b9150613ef582614986565b604082019050919050565b6000613f0d601b83614353565b9150613f18826149d5565b602082019050919050565b6000613f30600083614348565b9150613f3b826149fe565b600082019050919050565b6000613f53602483614353565b9150613f5e82614a01565b604082019050919050565b6000613f76604b83614353565b9150613f8182614a50565b606082019050919050565b613f95816144fe565b82525050565b613fa481614508565b82525050565b6000613fb68284613c5a565b60148201915081905092915050565b6000613fd18286613cf2565b9150613fdd8285613cf2565b9150613fe98284613d23565b9150819050949350505050565b600061400182613f23565b9150819050919050565b60006020820190506140206000830184613c4b565b92915050565b600060808201905061403b6000830187613c4b565b6140486020830186613c4b565b6140556040830185613f8c565b81810360608301526140678184613c80565b905095945050505050565b60006020820190506140876000830184613c71565b92915050565b600060208201905081810360008301526140a78184613cb9565b905092915050565b600060208201905081810360008301526140c881613da2565b9050919050565b600060208201905081810360008301526140e881613dc5565b9050919050565b6000602082019050818103600083015261410881613de8565b9050919050565b6000602082019050818103600083015261412881613e0b565b9050919050565b6000602082019050818103600083015261414881613e2e565b9050919050565b6000602082019050818103600083015261416881613e51565b9050919050565b6000602082019050818103600083015261418881613e74565b9050919050565b600060208201905081810360008301526141a881613e97565b9050919050565b600060208201905081810360008301526141c881613eba565b9050919050565b600060208201905081810360008301526141e881613edd565b9050919050565b6000602082019050818103600083015261420881613f00565b9050919050565b6000602082019050818103600083015261422881613f46565b9050919050565b6000602082019050818103600083015261424881613f69565b9050919050565b60006020820190506142646000830184613f8c565b92915050565b600060208201905061427f6000830184613f9b565b92915050565b600061428f6142a0565b905061429b8282614589565b919050565b6000604051905090565b600067ffffffffffffffff8211156142c5576142c4614712565b5b6142ce8261475f565b9050602081019050919050565b600067ffffffffffffffff8211156142f6576142f5614712565b5b6142ff8261475f565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061437a826144fe565b9150614385836144fe565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156143ba576143b9614627565b5b828201905092915050565b60006143d082614508565b91506143db83614508565b92508260ff038211156143f1576143f0614627565b5b828201905092915050565b6000614407826144fe565b9150614412836144fe565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561444b5761444a614627565b5b828202905092915050565b6000614461826144fe565b915061446c836144fe565b92508282101561447f5761447e614627565b5b828203905092915050565b6000614495826144de565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015614542578082015181840152602081019050614527565b83811115614551576000848401525b50505050565b6000600282049050600182168061456f57607f821691505b60208210811415614583576145826146b4565b5b50919050565b6145928261475f565b810181811067ffffffffffffffff821117156145b1576145b0614712565b5b80604052505050565b60006145c5826144fe565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156145f8576145f7614627565b5b600182019050919050565b600061460e82614615565b9050919050565b600061462082614770565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f496e7375666669656369656e742066756e6473207472616e7366657265640000600082015250565b7f70616964206c696d697420697320657863656465640000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f496e7375666669656369656e7420746f6b656e7320617661696c61626c650000600082015250565b7f5075626c69632073616c652069732063757272656e746c7920696e616374697660008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b7f5072652073616c6520574c206973206e6f74206163746976652063757272656e60008201527f746c790000000000000000000000000000000000000000000000000000000000602082015250565b7f4d6178206c6d6974206f6620746f6b656e732065786365656465640000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f5072652073616c65204f47206973206e6f74206163746976652063757272656e60008201527f746c790000000000000000000000000000000000000000000000000000000000602082015250565b7f4d696e74696e672069732063757272656e746c79207061757365640000000000600082015250565b50565b7f4d696e7420616d6f756e742073686f756c64206265206772656174657220746860008201527f616e203000000000000000000000000000000000000000000000000000000000602082015250565b7f54686973204164726573736573206973206e6f742077686974656c697374656460008201527f2c20596f752063616e204d696e74204d61657374726f2773204d697820696e2060208201527f5075626c69632053616c65000000000000000000000000000000000000000000604082015250565b614ace8161448a565b8114614ad957600080fd5b50565b614ae58161449c565b8114614af057600080fd5b50565b614afc816144a8565b8114614b0757600080fd5b50565b614b13816144b2565b8114614b1e57600080fd5b50565b614b2a816144fe565b8114614b3557600080fd5b50565b614b4181614508565b8114614b4c57600080fd5b5056fea264697066735822122036c8f2a826211312cb325a13e3a5b99798f46ba548a4a2ce98022d5529df4aa864736f6c63430008070033

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: No
MaestrosMix.sol 2581 lines
//SPDX-License-Identifier: GPL-3.0
// File: erc721a/contracts/IERC721A.sol


// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables
     * (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`,
     * checking first that contract recipients are aware of the ERC721 protocol
     * to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move
     * this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the
     * zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external payable;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom}
     * for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

// File: erc721a/contracts/ERC721A.sol


// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;


/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

    // Mapping from token ID to approved address.
    mapping(uint256 => TokenApprovalRef) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        // Counter underflow is impossible as `_currentIndex` does not decrement,
        // and it is initialized to `_startTokenId()`.
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the
     * zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) public payable virtual override {
        address owner = ownerOf(tokenId);

        if (_msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                revert ApprovalCallerNotOwnerNorApproved();
            }

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom}
     * for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word a...

// [truncated — 99173 bytes total]

Read Contract

OGMinted 0x48320992 → uint256
WLMinted 0x157be9b1 → uint256
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
cost 0x13faede6 → uint256
getApproved 0x081812fc → address
getTokensMintedPerWallet 0x4c4a0054 → uint8
isApprovedForAll 0xe985e9c5 → bool
isWalletOG 0x198f4b24 → bool
isWalletWL 0x887467d3 → bool
maxMintAmountPerWallet 0xbc951b91 → uint8
maxOGFreePerWallet 0x3a5bcda8 → uint8
maxPublicFreePerWallet 0x0a6a4d19 → uint8
maxSupply 0xd5abeb01 → uint256
maxWLFreePerWallet 0x6383269a → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paidMinted 0x2806b8fb → uint256
pauseOG 0x237849de → bool
pausePublicSale 0x0c41f497 → bool
pauseWL 0x9c960b3b → bool
paused 0x5c975abb → bool
publicFreeMinted 0x33511cd2 → uint256
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalOGLimit 0xd00631bc → uint256
totalPaidLimit 0x41842b44 → uint256
totalPublicFreeLimit 0x511899d6 → uint256
totalSupply 0x18160ddd → uint256
totalWLLimit 0x2959d303 → uint256

Write Contract 27 functions

These functions modify contract state and require a wallet transaction to execute.

OGMint 0xbb462de1
uint8 _mintAmount
bytes32[] proof
PublicMint 0x23ff9846
uint8 _mintAmount
WLMint 0xcca6aae2
uint8 _mintAmount
bytes32[] proof
approve 0x095ea7b3
address to
uint256 tokenId
mintOwner 0x33f88d22
uint256 _mintAmount
renounceOwnership 0x715018a6
No parameters
reveal 0xa475b5dd
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
setMaxMintAmountPerWallet 0x28b60d15
uint8 _maxMintAmountPerWallet
setMaxOGFreePerWallet 0x952bd5da
uint8 _maxOGFreePerWallet
setMaxPublicFreePerWallet 0x7b35fb4a
uint8 _maxPublicFreePerWallet
setMaxWLFreePerWallet 0x3a56af50
uint8 _maxWLFreePerWallet
setNotRevealedURI 0xf2c4ce1e
string _notRevealedURI
setPause 0xbedb86fb
bool _state
setPauseOG 0x939f769b
bool _pauseOG
setPausePublicSale 0x37c886ce
bool _pausePublicSale
setPauseWL 0xe2627483
bool _pauseWL
setProofs 0x14f499ba
bytes32 _OGRoot
bytes32 _WLRoot
setTotalLimitsOfMint 0x8692a6b5
uint256 _totalOGLimit
uint256 _totalWLLimit
uint256 _totalPublicFreeLimit
uint256 _totalPaidLimit
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters

Recent Transactions

No transactions found for this address