Address Contract Partially Verified
Address
0xffed35bc5fB514098Df353840E4EdA01C4c7c776
Balance
0 ETH
Nonce
1
Code Size
16899 bytes
Creator
0x08F77D96...Be24 at tx 0xc984ab48...ac5786
Indexed Transactions
0 (1 on-chain, 0.7% indexed)
Contract Bytecode
16899 bytes
0x6080604052600436106102e35760003560e01c806370a0823111610190578063c8151d02116100dc578063e985e9c511610095578063f2c4ce1e1161006f578063f2c4ce1e14610ac2578063f2fde38b14610aeb578063f3257cdd14610b14578063fea0e05814610b3d576102e3565b8063e985e9c514610a31578063eff6011014610a6e578063f12f6d5d14610a99576102e3565b8063c8151d0214610923578063c87b56dd1461094c578063d5abeb0114610989578063d8ed370c146109b4578063da3ef23f146109df578063e268e4d314610a08576102e3565b806395d89b4111610149578063b88d4fde11610123578063b88d4fde1461087b578063bd7a1998146108a4578063bde0608a146108cf578063c6682862146108f8576102e3565b806395d89b411461080b578063a0712d6814610836578063a22cb46514610852576102e3565b806370a0823114610711578063715018a61461074e5780637cb647591461076557806383a076be1461078e5780638da5cb5b146107b7578063940cd05b146107e2576102e3565b806323b872dd1161024f57806351830227116102085780635c975abb116101e25780635c975abb146106535780636352211e1461067e5780636c0360eb146106bb5780636c2d3c4f146106e6576102e3565b806351830227146105d457806355f804b3146105ff5780635a7adf7f14610628576102e3565b806323b872dd146104f95780632eb4a7ab1461052257806333bc1c5c1461054d5780633ccfd60b1461057857806342842e0e1461058257806344a0d68a146105ab576102e3565b8063081c8c44116102a1578063081c8c44146103fd578063095ea7b31461042857806313faede614610451578063149835a01461047c57806318160ddd146104a55780631866756c146104d0576102e3565b806277ec05146102e857806301ffc9a71461031357806302329a2914610350578063036e4cb51461037957806306fdde0314610395578063081812fc146103c0575b600080fd5b3480156102f457600080fd5b506102fd610b66565b60405161030a9190613895565b60405180910390f35b34801561031f57600080fd5b5061033a6004803603810190610335919061303d565b610b6c565b604051610347919061363d565b60405180910390f35b34801561035c57600080fd5b5061037760048036038101906103729190612fe3565b610bfe565b005b610393600480360381019061038e919061314d565b610c23565b005b3480156103a157600080fd5b506103aa610f25565b6040516103b79190613673565b60405180910390f35b3480156103cc57600080fd5b506103e760048036038101906103e291906130e0565b610fb7565b6040516103f491906135d6565b60405180910390f35b34801561040957600080fd5b50610412611033565b60405161041f9190613673565b60405180910390f35b34801561043457600080fd5b5061044f600480360381019061044a9190612fa3565b6110c1565b005b34801561045d57600080fd5b50610466611202565b6040516104739190613895565b60405180910390f35b34801561048857600080fd5b506104a3600480360381019061049e91906130e0565b611208565b005b3480156104b157600080fd5b506104ba61121a565b6040516104c79190613895565b60405180910390f35b3480156104dc57600080fd5b506104f760048036038101906104f291906130e0565b611231565b005b34801561050557600080fd5b50610520600480360381019061051b9190612e8d565b611243565b005b34801561052e57600080fd5b50610537611568565b6040516105449190613658565b60405180910390f35b34801561055957600080fd5b5061056261156e565b60405161056f919061363d565b60405180910390f35b610580611581565b005b34801561058e57600080fd5b506105a960048036038101906105a49190612e8d565b611602565b005b3480156105b757600080fd5b506105d260048036038101906105cd91906130e0565b611622565b005b3480156105e057600080fd5b506105e9611634565b6040516105f6919061363d565b60405180910390f35b34801561060b57600080fd5b5061062660048036038101906106219190613097565b611647565b005b34801561063457600080fd5b5061063d611669565b60405161064a919061363d565b60405180910390f35b34801561065f57600080fd5b5061066861167c565b604051610675919061363d565b60405180910390f35b34801561068a57600080fd5b506106a560048036038101906106a091906130e0565b61168f565b6040516106b291906135d6565b60405180910390f35b3480156106c757600080fd5b506106d06116a1565b6040516106dd9190613673565b60405180910390f35b3480156106f257600080fd5b506106fb61172f565b6040516107089190613895565b60405180910390f35b34801561071d57600080fd5b5061073860048036038101906107339190612e20565b611735565b6040516107459190613895565b60405180910390f35b34801561075a57600080fd5b506107636117ee565b005b34801561077157600080fd5b5061078c60048036038101906107879190613010565b611802565b005b34801561079a57600080fd5b506107b560048036038101906107b0919061310d565b611814565b005b3480156107c357600080fd5b506107cc6118ca565b6040516107d991906135d6565b60405180910390f35b3480156107ee57600080fd5b5061080960048036038101906108049190612fe3565b6118f4565b005b34801561081757600080fd5b50610820611919565b60405161082d9190613673565b60405180910390f35b610850600480360381019061084b91906130e0565b6119ab565b005b34801561085e57600080fd5b5061087960048036038101906108749190612f63565b611bf8565b005b34801561088757600080fd5b506108a2600480360381019061089d9190612ee0565b611d70565b005b3480156108b057600080fd5b506108b9611de3565b6040516108c69190613895565b60405180910390f35b3480156108db57600080fd5b506108f660048036038101906108f191906130e0565b611de9565b005b34801561090457600080fd5b5061090d611dfb565b60405161091a9190613673565b60405180910390f35b34801561092f57600080fd5b5061094a600480360381019061094591906130e0565b611e89565b005b34801561095857600080fd5b50610973600480360381019061096e91906130e0565b611e9b565b6040516109809190613673565b60405180910390f35b34801561099557600080fd5b5061099e611ff4565b6040516109ab9190613895565b60405180910390f35b3480156109c057600080fd5b506109c9611ffa565b6040516109d69190613895565b60405180910390f35b3480156109eb57600080fd5b50610a066004803603810190610a019190613097565b612000565b005b348015610a1457600080fd5b50610a2f6004803603810190610a2a91906130e0565b612022565b005b348015610a3d57600080fd5b50610a586004803603810190610a539190612e4d565b612034565b604051610a65919061363d565b60405180910390f35b348015610a7a57600080fd5b50610a836120c8565b604051610a909190613895565b60405180910390f35b348015610aa557600080fd5b50610ac06004803603810190610abb91906130e0565b6120ce565b005b348015610ace57600080fd5b50610ae96004803603810190610ae49190613097565b6120e0565b005b348015610af757600080fd5b50610b126004803603810190610b0d9190612e20565b612102565b005b348015610b2057600080fd5b50610b3b6004803603810190610b369190612fe3565b612186565b005b348015610b4957600080fd5b50610b646004803603810190610b5f9190612fe3565b6121ab565b005b60105481565b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610bc757506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610bf75750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b610c066121d0565b80601360006101000a81548160ff02191690831515021790555050565b601360009054906101000a900460ff1615610c73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6a90613755565b60405180910390fd5b601360029054906101000a900460ff16610cc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb9906136d5565b60405180910390fd5b610d36828280806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505060145433604051602001610d1b9190613575565b6040516020818303038152906040528051906020012061224e565b610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90613775565b60405180910390fd5b6000610d7f61121a565b90506000610d93610d8e612265565b611735565b90506010548582610da4919061399a565b1115610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc906137b5565b60405180910390fd5b60008511610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1f90613855565b60405180910390fd5b601154851115610e6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e64906136f5565b60405180910390fd5b600e548583610e7c919061399a565b1115610ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb490613715565b60405180910390fd5b84600d54610ecb9190613a21565b341015610f0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0490613815565b60405180910390fd5b610f1e610f18612265565b8661226d565b5050505050565b606060028054610f3490613b6f565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6090613b6f565b8015610fad5780601f10610f8257610100808354040283529160200191610fad565b820191906000526020600020905b815481529060010190602001808311610f9057829003601f168201915b5050505050905090565b6000610fc28261228b565b610ff8576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600b805461104090613b6f565b80601f016020809104026020016040519081016040528092919081815260200182805461106c90613b6f565b80156110b95780601f1061108e576101008083540402835291602001916110b9565b820191906000526020600020905b81548152906001019060200180831161109c57829003601f168201915b505050505081565b60006110cc8261168f565b90508073ffffffffffffffffffffffffffffffffffffffff166110ed6122ea565b73ffffffffffffffffffffffffffffffffffffffff161461115057611119816111146122ea565b612034565b61114f576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b600c5481565b6112106121d0565b80600e8190555050565b60006112246122f2565b6001546000540303905090565b6112396121d0565b8060118190555050565b600061124e826122fb565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146112b5576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806112c1846123c9565b915091506112d781876112d26122ea565b6123eb565b611323576112ec866112e76122ea565b612034565b611322576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561138a576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611397868686600161242f565b80156113a257600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154600101919050819055506114708561144c888887612435565b7c02000000000000000000000000000000000000000000000000000000001761245d565b600460008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841614156114f85760006001850190506000600460008381526020019081526020016000205414156114f65760005481146114f5578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46115608686866001612488565b505050505050565b60145481565b601360039054906101000a900460ff1681565b6115896121d0565b60003373ffffffffffffffffffffffffffffffffffffffff16476040516115af906135c1565b60006040518083038185875af1925050503d80600081146115ec576040519150601f19603f3d011682016040523d82523d6000602084013e6115f1565b606091505b50509050806115ff57600080fd5b50565b61161d83838360405180602001604052806000815250611d70565b505050565b61162a6121d0565b80600c8190555050565b601360019054906101000a900460ff1681565b61164f6121d0565b8060099080519060200190611665929190612bc9565b5050565b601360029054906101000a900460ff1681565b601360009054906101000a900460ff1681565b600061169a826122fb565b9050919050565b600980546116ae90613b6f565b80601f01602080910402602001604051908101604052809291908181526020018280546116da90613b6f565b80156117275780601f106116fc57610100808354040283529160200191611727565b820191906000526020600020905b81548152906001019060200180831161170a57829003601f168201915b505050505081565b600d5481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b6117f66121d0565b611800600061248e565b565b61180a6121d0565b8060148190555050565b61181c6121d0565b6000821161185f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185690613875565b60405180910390fd5b600061186961121a565b9050600e54838261187a919061399a565b11156118bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b290613795565b60405180910390fd5b6118c5828461226d565b505050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6118fc6121d0565b80601360016101000a81548160ff02191690831515021790555050565b60606003805461192890613b6f565b80601f016020809104026020016040519081016040528092919081815260200182805461195490613b6f565b80156119a15780601f10611976576101008083540402835291602001916119a1565b820191906000526020600020905b81548152906001019060200180831161198457829003601f168201915b5050505050905090565b601360009054906101000a900460ff16156119fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f290613755565b60405180910390fd5b601360039054906101000a900460ff16611a4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a41906136b5565b60405180910390fd5b6000611a5461121a565b90506000611a68611a63612265565b611735565b905060008311611aad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa490613855565b60405180910390fd5b601254831115611af2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae990613835565b60405180910390fd5b600e548383611b01919061399a565b1115611b42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b39906137d5565b60405180910390fd5b600f548382611b51919061399a565b1115611b92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b89906137b5565b60405180910390fd5b82600c54611ba09190613a21565b341015611be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd990613815565b60405180910390fd5b611bf3611bed612265565b8461226d565b505050565b611c006122ea565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c65576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060076000611c726122ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611d1f6122ea565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611d64919061363d565b60405180910390a35050565b611d7b848484611243565b60008373ffffffffffffffffffffffffffffffffffffffff163b14611ddd57611da684848484612554565b611ddc576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b600f5481565b611df16121d0565b8060108190555050565b600a8054611e0890613b6f565b80601f0160208091040260200160405190810160405280929190818152602001828054611e3490613b6f565b8015611e815780601f10611e5657610100808354040283529160200191611e81565b820191906000526020600020905b815481529060010190602001808311611e6457829003601f168201915b505050505081565b611e916121d0565b8060128190555050565b6060611ea68261228b565b611ee5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611edc90613695565b60405180910390fd5b60001515601360019054906101000a900460ff1615151415611f9357600b8054611f0e90613b6f565b80601f0160208091040260200160405190810160405280929190818152602001828054611f3a90613b6f565b8015611f875780601f10611f5c57610100808354040283529160200191611f87565b820191906000526020600020905b815481529060010190602001808311611f6a57829003601f168201915b50505050509050611fef565b6000611f9d6126b4565b90506000815111611fbd5760405180602001604052806000815250611feb565b80611fc784612746565b600a604051602001611fdb93929190613590565b6040516020818303038152906040525b9150505b919050565b600e5481565b60115481565b6120086121d0565b80600a908051906020019061201e929190612bc9565b5050565b61202a6121d0565b80600f8190555050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60125481565b6120d66121d0565b80600d8190555050565b6120e86121d0565b80600b90805190602001906120fe929190612bc9565b5050565b61210a6121d0565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561217a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217190613735565b60405180910390fd5b6121838161248e565b50565b61218e6121d0565b80601360036101000a81548160ff02191690831515021790555050565b6121b36121d0565b80601360026101000a81548160ff02191690831515021790555050565b6121d8612265565b73ffffffffffffffffffffffffffffffffffffffff166121f66118ca565b73ffffffffffffffffffffffffffffffffffffffff161461224c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612243906137f5565b60405180910390fd5b565b60008261225b85846128a7565b1490509392505050565b600033905090565b6122878282604051806020016040528060008152506128fd565b5050565b6000816122966122f2565b111580156122a5575060005482105b80156122e3575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b600033905090565b60006001905090565b6000808290508061230a6122f2565b11612392576000548110156123915760006004600083815260200190815260200160002054905060007c01000000000000000000000000000000000000000000000000000000008216141561238f575b600081141561238557600460008360019003935083815260200190815260200160002054905061235a565b80925050506123c4565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b6000806000600690508360005280602052604060002092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e861244c86868461299a565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261257a6122ea565b8786866040518563ffffffff1660e01b815260040161259c94939291906135f1565b602060405180830381600087803b1580156125b657600080fd5b505af19250505080156125e757506040513d601f19601f820116820180604052508101906125e4919061306a565b60015b612661573d8060008114612617576040519150601f19603f3d011682016040523d82523d6000602084013e61261c565b606091505b50600081511415612659576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b6060600980546126c390613b6f565b80601f01602080910402602001604051908101604052809291908181526020018280546126ef90613b6f565b801561273c5780601f106127115761010080835404028352916020019161273c565b820191906000526020600020905b81548152906001019060200180831161271f57829003601f168201915b5050505050905090565b6060600082141561278e576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506128a2565b600082905060005b600082146127c05780806127a990613bd2565b915050600a826127b991906139f0565b9150612796565b60008167ffffffffffffffff8111156127dc576127db613d2c565b5b6040519080825280601f01601f19166020018201604052801561280e5781602001600182028036833780820191505090505b5090505b6000851461289b576001826128279190613a7b565b9150600a856128369190613c3f565b6030612842919061399a565b60f81b81838151811061285857612857613cfd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561289491906139f0565b9450612812565b8093505050505b919050565b60008082905060005b84518110156128f2576128dd828683815181106128d0576128cf613cfd565b5b60200260200101516129a3565b915080806128ea90613bd2565b9150506128b0565b508091505092915050565b61290783836129ce565b60008373ffffffffffffffffffffffffffffffffffffffff163b1461299557600080549050600083820390505b6129476000868380600101945086612554565b61297d576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81811061293457816000541461299257600080fd5b50505b505050565b60009392505050565b60008183106129bb576129b68284612ba2565b6129c6565b6129c58383612ba2565b5b905092915050565b600080549050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a3b576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000821415612a76576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a83600084838561242f565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550612afa83612aeb6000866000612435565b612af485612bb9565b1761245d565b60046000838152602001908152602001600020819055506000819050600083830190505b818060010192508573ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4808210612b1e57806000819055505050612b9d6000848385612488565b505050565b600082600052816020526040600020905092915050565b60006001821460e11b9050919050565b828054612bd590613b6f565b90600052602060002090601f016020900481019282612bf75760008555612c3e565b82601f10612c1057805160ff1916838001178555612c3e565b82800160010185558215612c3e579182015b82811115612c3d578251825591602001919060010190612c22565b5b509050612c4b9190612c4f565b5090565b5b80821115612c68576000816000905550600101612c50565b5090565b6000612c7f612c7a846138d5565b6138b0565b905082815260208101848484011115612c9b57612c9a613d6a565b5b612ca6848285613b2d565b509392505050565b6000612cc1612cbc84613906565b6138b0565b905082815260208101848484011115612cdd57612cdc613d6a565b5b612ce8848285613b2d565b509392505050565b600081359050612cff8161415a565b92915050565b60008083601f840112612d1b57612d1a613d60565b5b8235905067ffffffffffffffff811115612d3857612d37613d5b565b5b602083019150836020820283011115612d5457612d53613d65565b5b9250929050565b600081359050612d6a81614171565b92915050565b600081359050612d7f81614188565b92915050565b600081359050612d948161419f565b92915050565b600081519050612da98161419f565b92915050565b600082601f830112612dc457612dc3613d60565b5b8135612dd4848260208601612c6c565b91505092915050565b600082601f830112612df257612df1613d60565b5b8135612e02848260208601612cae565b91505092915050565b600081359050612e1a816141b6565b92915050565b600060208284031215612e3657612e35613d74565b5b6000612e4484828501612cf0565b91505092915050565b60008060408385031215612e6457612e63613d74565b5b6000612e7285828601612cf0565b9250506020612e8385828601612cf0565b9150509250929050565b600080600060608486031215612ea657612ea5613d74565b5b6000612eb486828701612cf0565b9350506020612ec586828701612cf0565b9250506040612ed686828701612e0b565b9150509250925092565b60008060008060808587031215612efa57612ef9613d74565b5b6000612f0887828801612cf0565b9450506020612f1987828801612cf0565b9350506040612f2a87828801612e0b565b925050606085013567ffffffffffffffff811115612f4b57612f4a613d6f565b5b612f5787828801612daf565b91505092959194509250565b60008060408385031215612f7a57612f79613d74565b5b6000612f8885828601612cf0565b9250506020612f9985828601612d5b565b9150509250929050565b60008060408385031215612fba57612fb9613d74565b5b6000612fc885828601612cf0565b9250506020612fd985828601612e0b565b9150509250929050565b600060208284031215612ff957612ff8613d74565b5b600061300784828501612d5b565b91505092915050565b60006020828403121561302657613025613d74565b5b600061303484828501612d70565b91505092915050565b60006020828403121561305357613052613d74565b5b600061306184828501612d85565b91505092915050565b6000602082840312156130805761307f613d74565b5b600061308e84828501612d9a565b91505092915050565b6000602082840312156130ad576130ac613d74565b5b600082013567ffffffffffffffff8111156130cb576130ca613d6f565b5b6130d784828501612ddd565b91505092915050565b6000602082840312156130f6576130f5613d74565b5b600061310484828501612e0b565b91505092915050565b6000806040838503121561312457613123613d74565b5b600061313285828601612e0b565b925050602061314385828601612cf0565b9150509250929050565b60008060006040848603121561316657613165613d74565b5b600061317486828701612e0b565b935050602084013567ffffffffffffffff81111561319557613194613d6f565b5b6131a186828701612d05565b92509250509250925092565b6131b681613aaf565b82525050565b6131cd6131c882613aaf565b613c1b565b82525050565b6131dc81613ac1565b82525050565b6131eb81613acd565b82525050565b60006131fc8261394c565b6132068185613962565b9350613216818560208601613b3c565b61321f81613d79565b840191505092915050565b600061323582613957565b61323f818561397e565b935061324f818560208601613b3c565b61325881613d79565b840191505092915050565b600061326e82613957565b613278818561398f565b9350613288818560208601613b3c565b80840191505092915050565b600081546132a181613b6f565b6132ab818661398f565b945060018216600081146132c657600181146132d75761330a565b60ff1983168652818601935061330a565b6132e085613937565b60005b83811015613302578154818901526001820191506020810190506132e3565b838801955050505b50505092915050565b600061332060308361397e565b915061332b82613d97565b604082019050919050565b600061334360208361397e565b915061334e82613de6565b602082019050919050565b600061336660238361397e565b915061337182613e0f565b604082019050919050565b600061338960218361397e565b915061339482613e5e565b604082019050919050565b60006133ac60258361397e565b91506133b782613ead565b604082019050919050565b60006133cf60268361397e565b91506133da82613efc565b604082019050919050565b60006133f260208361397e565b91506133fd82613f4b565b602082019050919050565b600061341560208361397e565b915061342082613f74565b602082019050919050565b600061343860168361397e565b915061344382613f9d565b602082019050919050565b600061345b60248361397e565b915061346682613fc6565b604082019050919050565b600061347e60148361397e565b915061348982614015565b602082019050919050565b60006134a160208361397e565b91506134ac8261403e565b602082019050919050565b60006134c4601b8361397e565b91506134cf82614067565b602082019050919050565b60006134e7600083613973565b91506134f282614090565b600082019050919050565b600061350a60288361397e565b915061351582614093565b604082019050919050565b600061352d60248361397e565b9150613538826140e2565b604082019050919050565b6000613550601b8361397e565b915061355b82614131565b602082019050919050565b61356f81613b23565b82525050565b600061358182846131bc565b60148201915081905092915050565b600061359c8286613263565b91506135a88285613263565b91506135b48284613294565b9150819050949350505050565b60006135cc826134da565b9150819050919050565b60006020820190506135eb60008301846131ad565b92915050565b600060808201905061360660008301876131ad565b61361360208301866131ad565b6136206040830185613566565b818103606083015261363281846131f1565b905095945050505050565b600060208201905061365260008301846131d3565b92915050565b600060208201905061366d60008301846131e2565b92915050565b6000602082019050818103600083015261368d818461322a565b905092915050565b600060208201905081810360008301526136ae81613313565b9050919050565b600060208201905081810360008301526136ce81613336565b9050919050565b600060208201905081810360008301526136ee81613359565b9050919050565b6000602082019050818103600083015261370e8161337c565b9050919050565b6000602082019050818103600083015261372e8161339f565b9050919050565b6000602082019050818103600083015261374e816133c2565b9050919050565b6000602082019050818103600083015261376e816133e5565b9050919050565b6000602082019050818103600083015261378e81613408565b9050919050565b600060208201905081810360008301526137ae8161342b565b9050919050565b600060208201905081810360008301526137ce8161344e565b9050919050565b600060208201905081810360008301526137ee81613471565b9050919050565b6000602082019050818103600083015261380e81613494565b9050919050565b6000602082019050818103600083015261382e816134b7565b9050919050565b6000602082019050818103600083015261384e816134fd565b9050919050565b6000602082019050818103600083015261386e81613520565b9050919050565b6000602082019050818103600083015261388e81613543565b9050919050565b60006020820190506138aa6000830184613566565b92915050565b60006138ba6138cb565b90506138c68282613ba1565b919050565b6000604051905090565b600067ffffffffffffffff8211156138f0576138ef613d2c565b5b6138f982613d79565b9050602081019050919050565b600067ffffffffffffffff82111561392157613920613d2c565b5b61392a82613d79565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006139a582613b23565b91506139b083613b23565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156139e5576139e4613c70565b5b828201905092915050565b60006139fb82613b23565b9150613a0683613b23565b925082613a1657613a15613c9f565b5b828204905092915050565b6000613a2c82613b23565b9150613a3783613b23565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a7057613a6f613c70565b5b828202905092915050565b6000613a8682613b23565b9150613a9183613b23565b925082821015613aa457613aa3613c70565b5b828203905092915050565b6000613aba82613b03565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015613b5a578082015181840152602081019050613b3f565b83811115613b69576000848401525b50505050565b60006002820490506001821680613b8757607f821691505b60208210811415613b9b57613b9a613cce565b5b50919050565b613baa82613d79565b810181811067ffffffffffffffff82111715613bc957613bc8613d2c565b5b80604052505050565b6000613bdd82613b23565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613c1057613c0f613c70565b5b600182019050919050565b6000613c2682613c2d565b9050919050565b6000613c3882613d8a565b9050919050565b6000613c4a82613b23565b9150613c5583613b23565b925082613c6557613c64613c9f565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f455243373231414d657461646174613a2055524920717565727920666f72206e60008201527f6f6e6578697374656e7420746f6b656e00000000000000000000000000000000602082015250565b7f446f776e7369653a2053616c65204861736e2774207374617274656420796574600082015250565b7f446f776e7369653a2050726573616c65204861736e277420737461727465642060008201527f7965740000000000000000000000000000000000000000000000000000000000602082015250565b7f446f776e7369653a206d6178206d696e7420706572205478206578636565646560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b7f446f776e7369653a2057686974656c697374204d6178537570706c792065786360008201527f6565646564000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f446f776e7369653a206f6f707320636f6e747261637420697320706175736564600082015250565b7f446f776e7369653a20596f7520617265206e6f742057686974656c6973746564600082015250565b7f6d6178204e4654206c696d697420657863656564656400000000000000000000600082015250565b7f446f776e7369653a204d6178204e4654205065722057616c6c6574206578636560008201527f6564656400000000000000000000000000000000000000000000000000000000602082015250565b7f446f776e7369653a20576520536f6c64204f7574000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f446f776e7369653a20696e73756666696369656e742066756e64730000000000600082015250565b50565b7f446f776e7369653a206d6178206d696e7420616d6f756e74207065722074782060008201527f6578636565646564000000000000000000000000000000000000000000000000602082015250565b7f446f776e7369653a206e65656420746f206d696e74206174206c65617374203160008201527f204e465400000000000000000000000000000000000000000000000000000000602082015250565b7f6e65656420746f206d696e74206174206c656173742031204e46540000000000600082015250565b61416381613aaf565b811461416e57600080fd5b50565b61417a81613ac1565b811461418557600080fd5b50565b61419181613acd565b811461419c57600080fd5b50565b6141a881613ad7565b81146141b357600080fd5b50565b6141bf81613b23565b81146141ca57600080fd5b5056fea2646970667358221220f3f1fc37e55abe7bdeed7077533d2037c3c520340a9e2037d72cd29bf03f8a9564736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
Downsies.sol 1820 lines
// SPDX-License-Identifier: GPL-3.0
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
* consuming from one or the other at each step according to the instructions given by
* `proofFlags`.
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: erc721a/contracts/IERC721A.sol
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of an ERC721A compliant contract.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* The caller cannot approve to their own address.
*/
error ApproveToCaller();
/**
* 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();
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps track of the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set through `_extraData`.
uint24 extraData;
}
/**
* @dev Returns the total amount of tokens stored by the contract.
*
* Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
*/
function totalSupply() external view returns (uint256);
// ==============================
// IERC165
// ==============================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// ==============================
// 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`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev 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 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.1.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev ERC721 token receiver interface.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard,
* including the Metadata extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at `_startTokenId()`
* (defaults to 0, e.g. 0, 1, 2, 3..).
*
* Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
*
* Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// 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 tokenId of the next token 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 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
/**
* @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 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 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 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 returns (uint256) {
return _burnCounter;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
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: 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.
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view 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 {
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;
}
/**
* 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 ownership that has an address and is not burned
// before an ownership that does not have an address and is not burned.
// Hence, curr will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed is zero.
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* 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);
}
/**
* Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @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 See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _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 '';
}
/**
* @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))
}
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
if (operator == _msgSenderERC721A()) revert ApproveToCaller();
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), 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-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 {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex && // If within bounds,
_packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned.
}
/**
* @dev Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, '');
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* See {_mint}.
*
* Emits a {Transfer} event for each mint.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
_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 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 {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// `balance` 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 tokenId = startTokenId;
uint256 end = startTokenId + quantity;
do {
emit Transfer(address(0), to, tokenId++);
} while (tokenId < end);
_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 {
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 Returns the storage slot and value for the approved address of `tokenId`.
*/
function _getApprovedAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
mapping(uint256 => address) storage tokenApprovalsPtr = _tokenApprovals;
// The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`.
assembly {
// Compute the slot.
mstore(0x00, tokenId)
mstore(0x20, tokenApprovalsPtr.slot)
approvedAddressSlot := keccak256(0x00, 0x40)
// Load the slot's value from storage.
approvedAddress := sload(approvedAddressSlot)
}
}
/**
* @dev Returns whether the `approvedAddress` is equals to `from` or `msgSender`.
*/
function _isOwnerOrApproved(
address approvedAddress,
address from,
address msgSender
) private pure returns (bool result) {
assembly {
// Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
from := and(from, BITMASK_ADDRESS)
// Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
msgSender := and(msgSender, BITMASK_ADDRESS)
// `msgSender == from || msgSender == approvedAddress`.
result := or(eq(msgSender, from), eq(msgSender, approvedAddress))
}
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedAddress(tokenId);
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isOwnerOrApproved(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 `_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) = _getApprovedAddress(tokenId);
if (approvalCheck) {
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isOwnerOrApproved(approvedAddress, from, _msgSenderERC721A()))
...
// [truncated — 65014 bytes total]
Read Contract
MaxperTxWl 0xd8ed370c → uint256
MaxperWallet 0xbd7a1998 → uint256
MaxperWalletWl 0x0077ec05 → uint256
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
baseURI 0x6c0360eb → string
cost 0x13faede6 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxSupply 0xd5abeb01 → uint256
maxpertx 0xeff60110 → uint256
merkleRoot 0x2eb4a7ab → bytes32
name 0x06fdde03 → string
notRevealedUri 0x081c8c44 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
preSale 0x5a7adf7f → bool
publicSale 0x33bc1c5c → bool
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
wlcost 0x6c2d3c4f → uint256
Write Contract 26 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
gift 0x83a076be
uint256 _mintAmount
address destination
mint 0xa0712d68
uint256 tokens
pause 0x02329a29
bool _state
presalemint 0x036e4cb5
uint256 tokens
bytes32[] merkleProof
renounceOwnership 0x715018a6
No parameters
reveal 0x940cd05b
bool _state
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
setMaxPerWallet 0xe268e4d3
uint256 _limit
setMaxsupply 0x149835a0
uint256 _newsupply
setMerkleRoot 0x7cb64759
bytes32 _merkleRoot
setNotRevealedURI 0xf2c4ce1e
string _notRevealedURI
setWLMaxpertx 0x1866756c
uint256 _wlmaxpertx
setWlCost 0xf12f6d5d
uint256 _newWlCost
setWlMaxPerWallet 0xbde0608a
uint256 _limit
setmaxpertx 0xc8151d02
uint256 _maxpertx
togglepreSale 0xfea0e058
bool _state
togglepublicSale 0xf3257cdd
bool _state
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
This address has 1 on-chain transactions, but only 0.7% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →