Address Contract Verified
Address
0x4db61258AED4e592Db3e62a07951f6cbC009627A
Balance
0 ETH
Nonce
1
Code Size
11635 bytes
Creator
0x513513D0...c94C at tx 0xf7a566db...872596
Indexed Transactions
0 (1 on-chain, 1.3% indexed)
Contract Bytecode
11635 bytes
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806370a08231116100f9578063a22cb46511610097578063cfc2058c11610071578063cfc2058c14610496578063e834a834146104b2578063e985e9c5146104d0578063f2fde38b14610500576101a9565b8063a22cb4651461042e578063b88d4fde1461044a578063c87b56dd14610466576101a9565b8063772dc32f116100d3578063772dc32f146103a65780638da5cb5b146103d657806395d89b41146103f4578063a0712d6814610412576101a9565b806370a082311461034e578063715018a61461037e578063730026b514610388576101a9565b80631fcb0c2b1161016657806342842e0e1161014057806342842e0e146102dc57806355f804b3146102f85780636352211e146103145780636ae146c214610344576101a9565b80631fcb0c2b1461028457806323b872dd146102a25780633c8303eb146102be576101a9565b806301ffc9a7146101ae57806306fdde03146101de578063081812fc146101fc578063095ea7b31461022c57806318160ddd146102485780631f2698ab14610266575b600080fd5b6101c860048036038101906101c39190611c8a565b61051c565b6040516101d59190611cd2565b60405180910390f35b6101e66105ae565b6040516101f39190611d86565b60405180910390f35b61021660048036038101906102119190611dde565b610640565b6040516102239190611e4c565b60405180910390f35b61024660048036038101906102419190611e93565b6106bc565b005b6102506107fd565b60405161025d9190611ee2565b60405180910390f35b61026e610814565b60405161027b9190611cd2565b60405180910390f35b61028c610827565b6040516102999190611ee2565b60405180910390f35b6102bc60048036038101906102b79190611efd565b61082c565b005b6102c6610b4e565b6040516102d39190611ee2565b60405180910390f35b6102f660048036038101906102f19190611efd565b610b54565b005b610312600480360381019061030d9190612085565b610b74565b005b61032e60048036038101906103299190611dde565b610b8f565b60405161033b9190611e4c565b60405180910390f35b61034c610ba1565b005b610368600480360381019061036391906120ce565b610c35565b6040516103759190611ee2565b60405180910390f35b610386610ced565b005b610390610d01565b60405161039d9190611ee2565b60405180910390f35b6103c060048036038101906103bb91906120ce565b610d06565b6040516103cd9190611ee2565b60405180910390f35b6103de610d1e565b6040516103eb9190611e4c565b60405180910390f35b6103fc610d48565b6040516104099190611d86565b60405180910390f35b61042c60048036038101906104279190611dde565b610dda565b005b61044860048036038101906104439190612127565b61100f565b005b610464600480360381019061045f9190612208565b611186565b005b610480600480360381019061047b9190611dde565b6111f9565b60405161048d9190611d86565b60405180910390f35b6104b060048036038101906104ab919061228b565b6112a0565b005b6104ba6112c5565b6040516104c79190611cd2565b60405180910390f35b6104ea60048036038101906104e591906122b8565b6112d8565b6040516104f79190611cd2565b60405180910390f35b61051a600480360381019061051591906120ce565b61136c565b005b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061057757506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806105a75750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b6060600280546105bd90612327565b80601f01602080910402602001604051908101604052809291908181526020018280546105e990612327565b80156106365780601f1061060b57610100808354040283529160200191610636565b820191906000526020600020905b81548152906001019060200180831161061957829003601f168201915b5050505050905090565b600061064b826113ef565b610681576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006106c782610b8f565b90508073ffffffffffffffffffffffffffffffffffffffff166106e861144e565b73ffffffffffffffffffffffffffffffffffffffff161461074b576107148161070f61144e565b6112d8565b61074a576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b6000610807611456565b6001546000540303905090565b600a60009054906101000a900460ff1681565b600481565b60006108378261145f565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461089e576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806108aa8461152b565b915091506108c081876108bb61144e565b61154d565b61090c576108d5866108d061144e565b6112d8565b61090b576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603610972576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61097f8686866001611591565b801561098a57600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815460010191905081905550610a5885610a34888887611597565b7c0200000000000000000000000000000000000000000000000000000000176115bf565b600460008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841603610ade5760006001850190506000600460008381526020019081526020016000205403610adc576000548114610adb578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610b4686868660016115ea565b505050505050565b61145a81565b610b6f83838360405180602001604052806000815250611186565b505050565b610b7c6115f0565b8060099081610b8b9190612504565b5050565b6000610b9a8261145f565b9050919050565b610ba96115f0565b600a60019054906101000a900460ff1615610bf9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf090612648565b60405180910390fd5b610c187349086328e44966de791ac99353c203b039b63e5160d261166e565b6001600a60016101000a81548160ff021916908315150217905550565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610c9c576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b610cf56115f0565b610cff600061168c565b565b60d281565b600b6020528060005260406000206000915090505481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610d5790612327565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8390612327565b8015610dd05780601f10610da557610100808354040283529160200191610dd0565b820191906000526020600020905b815481529060010190602001808311610db357829003601f168201915b5050505050905090565b6000610de46107fd565b90506000600a60009054906101000a900460ff16610e37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2e90612700565b60405180910390fd5b808311610e79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7090612792565b60405180910390fd5b61145a8383610e8891906127e1565b1115610ec9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec0906128a9565b60405180910390fd5b600483600b6000610ed8611752565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f1d91906127e1565b1115610f5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5590612961565b60405180910390fd5b61145a821115610fa3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9a906129f3565b60405180910390fd5b82600b6000610fb0611752565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ff991906127e1565b9250508190555061100a338461166e565b505050565b61101761144e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361107b576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806007600061108861144e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff1661113561144e565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161117a9190611cd2565b60405180910390a35050565b61119184848461082c565b60008373ffffffffffffffffffffffffffffffffffffffff163b146111f3576111bc8484848461175a565b6111f2576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b6060611204826113ef565b611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a90612a85565b60405180910390fd5b600061124d6118aa565b9050600081511161126d5760405180602001604052806000815250611298565b806112778461193c565b604051602001611288929190612b2d565b6040516020818303038152906040525b915050919050565b6112a86115f0565b80600a60006101000a81548160ff02191690831515021790555050565b600a60019054906101000a900460ff1681565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6113746115f0565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036113e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113da90612bce565b60405180910390fd5b6113ec8161168c565b50565b6000816113fa611456565b11158015611409575060005482105b8015611447575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b600033905090565b60006001905090565b6000808290508061146e611456565b116114f4576000548110156114f35760006004600083815260200190815260200160002054905060007c01000000000000000000000000000000000000000000000000000000008216036114f1575b600081036114e75760046000836001900393508381526020019081526020016000205490506114bd565b8092505050611526565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b6000806000600690508360005280602052604060002092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e86115ae868684611996565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b6115f8611752565b73ffffffffffffffffffffffffffffffffffffffff16611616610d1e565b73ffffffffffffffffffffffffffffffffffffffff161461166c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166390612c3a565b60405180910390fd5b565b61168882826040518060200160405280600081525061199f565b5050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261178061144e565b8786866040518563ffffffff1660e01b81526004016117a29493929190612caf565b6020604051808303816000875af19250505080156117de57506040513d601f19601f820116820180604052508101906117db9190612d10565b60015b611857573d806000811461180e576040519150601f19603f3d011682016040523d82523d6000602084013e611813565b606091505b50600081510361184f576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b6060600980546118b990612327565b80601f01602080910402602001604051908101604052809291908181526020018280546118e590612327565b80156119325780601f1061190757610100808354040283529160200191611932565b820191906000526020600020905b81548152906001019060200180831161191557829003601f168201915b5050505050905090565b60606080604051019050806040528082600183039250600a81066030018353600a810490505b801561198257600183039250600a81066030018353600a81049050611962565b508181036020830392508083525050919050565b60009392505050565b6119a98383611a3c565b60008373ffffffffffffffffffffffffffffffffffffffff163b14611a3757600080549050600083820390505b6119e9600086838060010194508661175a565b611a1f576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8181106119d6578160005414611a3457600080fd5b50505b505050565b600080549050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611aa8576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008203611ae2576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611aef6000848385611591565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550611b6683611b576000866000611597565b611b6085611c0e565b176115bf565b60046000838152602001908152602001600020819055506000819050600083830190505b818060010192508573ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4808210611b8a57806000819055505050611c0960008483856115ea565b505050565b60006001821460e11b9050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c6781611c32565b8114611c7257600080fd5b50565b600081359050611c8481611c5e565b92915050565b600060208284031215611ca057611c9f611c28565b5b6000611cae84828501611c75565b91505092915050565b60008115159050919050565b611ccc81611cb7565b82525050565b6000602082019050611ce76000830184611cc3565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611d27578082015181840152602081019050611d0c565b83811115611d36576000848401525b50505050565b6000601f19601f8301169050919050565b6000611d5882611ced565b611d628185611cf8565b9350611d72818560208601611d09565b611d7b81611d3c565b840191505092915050565b60006020820190508181036000830152611da08184611d4d565b905092915050565b6000819050919050565b611dbb81611da8565b8114611dc657600080fd5b50565b600081359050611dd881611db2565b92915050565b600060208284031215611df457611df3611c28565b5b6000611e0284828501611dc9565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611e3682611e0b565b9050919050565b611e4681611e2b565b82525050565b6000602082019050611e616000830184611e3d565b92915050565b611e7081611e2b565b8114611e7b57600080fd5b50565b600081359050611e8d81611e67565b92915050565b60008060408385031215611eaa57611ea9611c28565b5b6000611eb885828601611e7e565b9250506020611ec985828601611dc9565b9150509250929050565b611edc81611da8565b82525050565b6000602082019050611ef76000830184611ed3565b92915050565b600080600060608486031215611f1657611f15611c28565b5b6000611f2486828701611e7e565b9350506020611f3586828701611e7e565b9250506040611f4686828701611dc9565b9150509250925092565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611f9282611d3c565b810181811067ffffffffffffffff82111715611fb157611fb0611f5a565b5b80604052505050565b6000611fc4611c1e565b9050611fd08282611f89565b919050565b600067ffffffffffffffff821115611ff057611fef611f5a565b5b611ff982611d3c565b9050602081019050919050565b82818337600083830152505050565b600061202861202384611fd5565b611fba565b90508281526020810184848401111561204457612043611f55565b5b61204f848285612006565b509392505050565b600082601f83011261206c5761206b611f50565b5b813561207c848260208601612015565b91505092915050565b60006020828403121561209b5761209a611c28565b5b600082013567ffffffffffffffff8111156120b9576120b8611c2d565b5b6120c584828501612057565b91505092915050565b6000602082840312156120e4576120e3611c28565b5b60006120f284828501611e7e565b91505092915050565b61210481611cb7565b811461210f57600080fd5b50565b600081359050612121816120fb565b92915050565b6000806040838503121561213e5761213d611c28565b5b600061214c85828601611e7e565b925050602061215d85828601612112565b9150509250929050565b600067ffffffffffffffff82111561218257612181611f5a565b5b61218b82611d3c565b9050602081019050919050565b60006121ab6121a684612167565b611fba565b9050828152602081018484840111156121c7576121c6611f55565b5b6121d2848285612006565b509392505050565b600082601f8301126121ef576121ee611f50565b5b81356121ff848260208601612198565b91505092915050565b6000806000806080858703121561222257612221611c28565b5b600061223087828801611e7e565b945050602061224187828801611e7e565b935050604061225287828801611dc9565b925050606085013567ffffffffffffffff81111561227357612272611c2d565b5b61227f878288016121da565b91505092959194509250565b6000602082840312156122a1576122a0611c28565b5b60006122af84828501612112565b91505092915050565b600080604083850312156122cf576122ce611c28565b5b60006122dd85828601611e7e565b92505060206122ee85828601611e7e565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061233f57607f821691505b602082108103612352576123516122f8565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026123ba7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261237d565b6123c4868361237d565b95508019841693508086168417925050509392505050565b6000819050919050565b60006124016123fc6123f784611da8565b6123dc565b611da8565b9050919050565b6000819050919050565b61241b836123e6565b61242f61242782612408565b84845461238a565b825550505050565b600090565b612444612437565b61244f818484612412565b505050565b5b818110156124735761246860008261243c565b600181019050612455565b5050565b601f8211156124b85761248981612358565b6124928461236d565b810160208510156124a1578190505b6124b56124ad8561236d565b830182612454565b50505b505050565b600082821c905092915050565b60006124db600019846008026124bd565b1980831691505092915050565b60006124f483836124ca565b9150826002028217905092915050565b61250d82611ced565b67ffffffffffffffff81111561252657612525611f5a565b5b6125308254612327565b61253b828285612477565b600060209050601f83116001811461256e576000841561255c578287015190505b61256685826124e8565b8655506125ce565b601f19841661257c86612358565b60005b828110156125a45784890151825560018201915060208501945060208101905061257f565b868310156125c157848901516125bd601f8916826124ca565b8355505b6001600288020188555050505b505050505050565b7f3a272820544845534520434c4f574e5320415245205354494c4c20574f524b4960008201527f4e4720464f5220555320292c3a00000000000000000000000000000000000000602082015250565b6000612632602d83611cf8565b915061263d826125d6565b604082019050919050565b6000602082019050818103600083015261266181612625565b9050919050565b7f48414841484168616861684841686168616820596f752077616e74656420746f60008201527f206d696e743f2054484520434952435553204953204e4f5420494e20544f574e60208201527f20594554202a484f4e4b484f4e4b2a2048414841484148410000000000000000604082015250565b60006126ea605883611cf8565b91506126f582612668565b606082019050919050565b60006020820190508181036000830152612719816126dd565b9050919050565b7f2a484f4e4b484f4e4b2a2053696c6c7920796f752120596f75206e656564207460008201527f6f206d696e74206174206c65617374206f6e6520484148414841484121000000602082015250565b600061277c603d83611cf8565b915061278782612720565b604082019050919050565b600060208201905081810360008301526127ab8161276f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006127ec82611da8565b91506127f783611da8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561282c5761282b6127b2565b5b828201905092915050565b7f41637475616c6c7920776520646f6e277420686176652074686174206d616e7960008201527f20434c4f574e5320696e2068657265202a484f4e4b484f4e4b484f4e4b2a2100602082015250565b6000612893603f83611cf8565b915061289e82612837565b604082019050919050565b600060208201905081810360008301526128c281612886565b9050919050565b7f2a484f4e4b484f4e4b2a20446f6e277420676574204752454544592c2049207760008201527f6f6e2774206769766520796f75206d6f7265207468616e20746861742048414860208201527f4148412100000000000000000000000000000000000000000000000000000000604082015250565b600061294b604483611cf8565b9150612956826128c9565b606082019050919050565b6000602082019050818103600083015261297a8161293e565b9050919050565b7f2a484f4e4b484f4e4b2a205448452043495243555320495320494e20544f574e60008201527f202a484f4e4b484f4e4b2a000000000000000000000000000000000000000000602082015250565b60006129dd602b83611cf8565b91506129e882612981565b604082019050919050565b60006020820190508181036000830152612a0c816129d0565b9050919050565b7f293a3c205448455245204953204e4f20434c4f574e205749544820544841542060008201527f494420293a3c0000000000000000000000000000000000000000000000000000602082015250565b6000612a6f602683611cf8565b9150612a7a82612a13565b604082019050919050565b60006020820190508181036000830152612a9e81612a62565b9050919050565b600081905092915050565b6000612abb82611ced565b612ac58185612aa5565b9350612ad5818560208601611d09565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b6000612b17600583612aa5565b9150612b2282612ae1565b600582019050919050565b6000612b398285612ab0565b9150612b458284612ab0565b9150612b5082612b0a565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612bb8602683611cf8565b9150612bc382612b5c565b604082019050919050565b60006020820190508181036000830152612be781612bab565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c24602083611cf8565b9150612c2f82612bee565b602082019050919050565b60006020820190508181036000830152612c5381612c17565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000612c8182612c5a565b612c8b8185612c65565b9350612c9b818560208601611d09565b612ca481611d3c565b840191505092915050565b6000608082019050612cc46000830187611e3d565b612cd16020830186611e3d565b612cde6040830185611ed3565b8181036060830152612cf08184612c76565b905095945050505050565b600081519050612d0a81611c5e565b92915050565b600060208284031215612d2657612d25611c28565b5b6000612d3484828501612cfb565b9150509291505056fea264697066735822122043ead85a6df0470cef1314b34fe903d3bfd0d0a63c0bdbf5b3f1ab624c932d5c64736f6c634300080f0033
Verified Source Code Full Match
Compiler: v0.8.15+commit.e14f2714
EVM: london
Optimization: No
NFTInvestrsClub.sol 79 lines
// SPDX-License-Identifier: MIT
/*///////////////////////////////////////////////////////////////////////////////////
▐ ▄ ·▄▄▄▄▄▄▄▄ ▪ ▐ ▄ ▌ ▐·▄▄▄ ..▄▄ · ▄▄▄▄▄▄▄▄ .▄▄ · ▄▄· ▄▄▌ ▄• ▄▌▄▄▄▄·
•█▌▐█▐▄▄·•██ ██ •█▌▐█▪█·█▌▀▄.▀·▐█ ▀. •██ ▀▄ █·▐█ ▀. ▐█ ▌▪██• █▪██▌▐█ ▀█▪
▐█▐▐▌██▪ ▐█.▪ ▐█·▐█▐▐▌▐█▐█•▐▀▀▪▄▄▀▀▀█▄ ▐█.▪▐▀▀▄ ▄▀▀▀█▄ ██ ▄▄██▪ █▌▐█▌▐█▀▀█▄
██▐█▌██▌. ▐█▌· ▐█▌██▐█▌ ███ ▐█▄▄▌▐█▄▪▐█ ▐█▌·▐█•█▌▐█▄▪▐█ ▐███▌▐█▌▐▌▐█▄█▌██▄▪▐█
▀▀ █▪▀▀▀ ▀▀▀ ▀▀▀▀▀ █▪. ▀ ▀▀▀ ▀▀▀▀ ▀▀▀ .▀ ▀ ▀▀▀▀ ·▀▀▀ .▀▀▀ ▀▀▀ ·▀▀▀▀
*////////////////////////////////////////////////////////////////////////////////////
// ARTWORK LICENSE: CC0
// No Roadmap, No Utility, 0% Royalties
pragma solidity 0.8.15;
import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
contract NFTInvestrsClub is ERC721A, Ownable {
// "not for everyone" Variables
address private constant RINGMASTER = 0x49086328e44966dE791aC99353c203B039b63e51;
string private baseURI;
// "for everyone" Variables
bool public started = false;
bool public claimed = false;
uint256 public constant CLOWN_STAFF = 5210;
uint256 public constant FUN_LIMIT = 4;
uint256 public constant CAPTIVE_CLOWNS = 210;
mapping(address => uint) public addressClaimed;
constructor() ERC721A("nftinvestrs", "NIC") {}
// Start at Clown 1, Clown 0 does not exist
function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
function mint(uint256 _count) external {
uint256 total = totalSupply();
uint256 minCount = 0;
require(started, "HAHAHAhahahHAhahah You wanted to mint? THE CIRCUS IS NOT IN TOWN YET *HONKHONK* HAHAHAHA");
require(_count > minCount, "*HONKHONK* Silly you! You need to mint at least one HAHAHAHA!");
require(total + _count <= CLOWN_STAFF, "Actually we don't have that many CLOWNS in here *HONKHONKHONK*!");
require(addressClaimed[_msgSender()] + _count <= FUN_LIMIT, "*HONKHONK* Don't get GREEDY, I won't give you more than that HAHAHA!");
require(total <= CLOWN_STAFF, "*HONKHONK* THE CIRCUS IS IN TOWN *HONKHONK*");
// Flash Clone Clown
addressClaimed[_msgSender()] += _count;
_safeMint(msg.sender, _count);
}
function teamClaim() external onlyOwner {
require(!claimed, ":'( THESE CLOWNS ARE STILL WORKING FOR US ),:");
// Transfer Clowns to the RINGMASTER
_safeMint(RINGMASTER, CAPTIVE_CLOWNS);
claimed = true;
}
function setBaseURI(string memory baseURI_) external onlyOwner {
baseURI = baseURI_;
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function startCircus(bool circusStarted) external onlyOwner {
started = circusStarted;
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
require(_exists(_tokenId), '):< THERE IS NO CLOWN WITH THAT ID ):<');
//CLOWN IDENTIFIER DNA
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, _toString(_tokenId), '.json'))
: '';
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev 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);
}
}
ERC721A.sol 950 lines
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721A.sol';
/**
* @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()))
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++;
}
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _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))
}
}
}
}
/**
* @dev Directly sets the extra data for the ownership data `index`.
*/
function _setExtraDataAt(uint256 index, uint24 extraData) internal {
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 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;
}
/**
* @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 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 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 returns (string memory ptr) {
assembly {
// The maximum value of a uint256 contains 78 digits (1 byte per digit),
// but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.
// We will need 1 32-byte word to store the length,
// and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.
ptr := add(mload(0x40), 128)
// Update the free memory pointer to allocate.
mstore(0x40, ptr)
// Cache the end of the memory to calculate the length later.
let end := ptr
// We write the string from the rightmost digit to the leftmost digit.
// The following is essentially a do-while loop that also handles the zero case.
// Costs a bit more than early returning for the zero case,
// but cheaper in terms of deployment and overall runtime costs.
for {
// Initialize and perform the first pass without check.
let temp := value
// Move the pointer 1 byte leftwards to point to an empty character slot.
ptr := sub(ptr, 1)
// Write the character to the pointer. 48 is the ASCII index of '0'.
mstore8(ptr, add(48, mod(temp, 10)))
temp := div(temp, 10)
} temp {
// Keep dividing `temp` until zero.
temp := div(temp, 10)
} {
// Body of the for loop.
ptr := sub(ptr, 1)
mstore8(ptr, add(48, mod(temp, 10)))
}
let length := sub(end, ptr)
// Move the pointer 32 bytes leftwards to make room for the length.
ptr := sub(ptr, 32)
// Store the length.
mstore(ptr, length)
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
IERC721A.sol 277 lines
// SPDX-License-Identifier: MIT
// 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);
}
Read Contract
CAPTIVE_CLOWNS 0x730026b5 → uint256
CLOWN_STAFF 0x3c8303eb → uint256
FUN_LIMIT 0x1fcb0c2b → uint256
addressClaimed 0x772dc32f → uint256
balanceOf 0x70a08231 → uint256
claimed 0xe834a834 → bool
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
started 0x1f2698ab → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 _count
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURI_
startCircus 0xcfc2058c
bool circusStarted
teamClaim 0x6ae146c2
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
This address has 1 on-chain transactions, but only 1.3% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →