Address Contract Verified
Address
0x44571Ef5f31eF014ACb68F4ACa7B0707fAd93886
Balance
0 ETH
Nonce
1
Code Size
24179 bytes
Creator
0x5978A4fF...0b2F at tx 0xc5485022...6ef78f
Indexed Transactions
0
Contract Bytecode
24179 bytes
0x6080604052600436106102e35760003560e01c8063760e6a4e11610190578063bd4cd56b116100dc578063d7224ba011610095578063e268e4d31161006f578063e268e4d314610ae8578063e3bb2a0214610b11578063e985e9c514610b3c578063f2fde38b14610b79576102e3565b8063d7224ba014610a57578063dc33e68114610a82578063ded2568114610abf576102e3565b8063bd4cd56b14610945578063c70bf41114610970578063c87b56dd1461099b578063cdc6dc7e146109d8578063cf93b6b114610a15578063d04af88114610a40576102e3565b806395d89b4111610149578063ad4ee73e11610123578063ad4ee73e146108ae578063b88d4fde146108d7578063bbcd5bbe14610900578063bc224f0714610929576102e3565b806395d89b4114610831578063a22cb4651461085c578063aca3ebf614610885576102e3565b8063760e6a4e146107445780637cb647591461076f5780638da5cb5b1461079857806391b7f5ed146107c3578063922d0af9146107ec578063936e984e14610815576102e3565b80633bafc5931161024f5780634f6ccce7116102085780636352211e116101e25780636352211e146106885780636c0360eb146106c557806370a08231146106f0578063715018a61461072d576102e3565b80634f6ccce7146105f757806355a373d61461063457806355f804b31461065f576102e3565b80633bafc5931461052e5780633ccfd60b146105595780633de909bd14610570578063410446141461058757806342842e0e146105a3578063453c2310146105cc576102e3565b806318160ddd116102a157806318160ddd1461041e57806323b872dd146104495780632aada986146104725780632eb4a7ab1461049d5780632f745c59146104c857806338719a5314610505576102e3565b8062b64888146102e857806301ffc9a71461032557806306fdde0314610362578063081812fc1461038d578063095ea7b3146103ca5780630b5c9878146103f3575b600080fd5b3480156102f457600080fd5b5061030f600480360381019061030a9190614134565b610ba2565b60405161031c9190614f9b565b60405180910390f35b34801561033157600080fd5b5061034c60048036038101906103479190614351565b610bba565b6040516103599190614b23565b60405180910390f35b34801561036e57600080fd5b50610377610d04565b6040516103849190614b59565b60405180910390f35b34801561039957600080fd5b506103b460048036038101906103af91906143f8565b610d96565b6040516103c19190614a85565b60405180910390f35b3480156103d657600080fd5b506103f160048036038101906103ec91906142b7565b610e1b565b005b3480156103ff57600080fd5b50610408610f34565b6040516104159190614b23565b60405180910390f35b34801561042a57600080fd5b50610433610f47565b6040516104409190614f9b565b60405180910390f35b34801561045557600080fd5b50610470600480360381019061046b91906141a1565b610f50565b005b34801561047e57600080fd5b50610487610f60565b6040516104949190614f9b565b60405180910390f35b3480156104a957600080fd5b506104b2610f66565b6040516104bf9190614b3e565b60405180910390f35b3480156104d457600080fd5b506104ef60048036038101906104ea91906142b7565b610f6c565b6040516104fc9190614f9b565b60405180910390f35b34801561051157600080fd5b5061052c600480360381019061052791906143f8565b61116a565b005b34801561053a57600080fd5b506105436111f0565b6040516105509190614f9b565b60405180910390f35b34801561056557600080fd5b5061056e6111f6565b005b34801561057c57600080fd5b506105856112d2565b005b6105a1600480360381019061059c91906143f8565b61137a565b005b3480156105af57600080fd5b506105ca60048036038101906105c591906141a1565b611452565b005b3480156105d857600080fd5b506105e1611472565b6040516105ee9190614f9b565b60405180910390f35b34801561060357600080fd5b5061061e600480360381019061061991906143f8565b611478565b60405161062b9190614f9b565b60405180910390f35b34801561064057600080fd5b506106496114cb565b6040516106569190614a85565b60405180910390f35b34801561066b57600080fd5b50610686600480360381019061068191906143ab565b6114f1565b005b34801561069457600080fd5b506106af60048036038101906106aa91906143f8565b611583565b6040516106bc9190614a85565b60405180910390f35b3480156106d157600080fd5b506106da611599565b6040516106e79190614b59565b60405180910390f35b3480156106fc57600080fd5b5061071760048036038101906107129190614134565b611627565b6040516107249190614f9b565b60405180910390f35b34801561073957600080fd5b50610742611710565b005b34801561075057600080fd5b50610759611798565b6040516107669190614f9b565b60405180910390f35b34801561077b57600080fd5b5061079660048036038101906107919190614324565b61179e565b005b3480156107a457600080fd5b506107ad611824565b6040516107ba9190614a85565b60405180910390f35b3480156107cf57600080fd5b506107ea60048036038101906107e591906143f8565b61184e565b005b3480156107f857600080fd5b50610813600480360381019061080e91906143f8565b6118d4565b005b61082f600480360381019061082a9190614425565b61195d565b005b34801561083d57600080fd5b50610846611bf4565b6040516108539190614b59565b60405180910390f35b34801561086857600080fd5b50610883600480360381019061087e9190614277565b611c86565b005b34801561089157600080fd5b506108ac60048036038101906108a791906143f8565b611e07565b005b3480156108ba57600080fd5b506108d560048036038101906108d091906142b7565b611e8d565b005b3480156108e357600080fd5b506108fe60048036038101906108f991906141f4565b611f17565b005b34801561090c57600080fd5b5061092760048036038101906109229190614134565b611f73565b005b610943600480360381019061093e91906143f8565b612033565b005b34801561095157600080fd5b5061095a6121b9565b6040516109679190614f9b565b60405180910390f35b34801561097c57600080fd5b506109856121bf565b6040516109929190614f9b565b60405180910390f35b3480156109a757600080fd5b506109c260048036038101906109bd91906143f8565b6121c5565b6040516109cf9190614b59565b60405180910390f35b3480156109e457600080fd5b506109ff60048036038101906109fa91906143f8565b61226c565b604051610a0c9190614f9b565b60405180910390f35b348015610a2157600080fd5b50610a2a612284565b604051610a379190614f9b565b60405180910390f35b348015610a4c57600080fd5b50610a5561228a565b005b348015610a6357600080fd5b50610a6c612332565b604051610a799190614f9b565b60405180910390f35b348015610a8e57600080fd5b50610aa96004803603810190610aa49190614134565b612338565b604051610ab69190614f9b565b60405180910390f35b348015610acb57600080fd5b50610ae66004803603810190610ae191906143f8565b61234a565b005b348015610af457600080fd5b50610b0f6004803603810190610b0a91906143f8565b6123d0565b005b348015610b1d57600080fd5b50610b26612456565b604051610b339190614b23565b60405180910390f35b348015610b4857600080fd5b50610b636004803603810190610b5e9190614161565b612469565b604051610b709190614b23565b60405180910390f35b348015610b8557600080fd5b50610ba06004803603810190610b9b9190614134565b6124fd565b005b600b6020528060005260406000206000915090505481565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610c8557507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610ced57507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610cfd5750610cfc826125f5565b5b9050919050565b606060018054610d13906152ef565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3f906152ef565b8015610d8c5780601f10610d6157610100808354040283529160200191610d8c565b820191906000526020600020905b815481529060010190602001808311610d6f57829003601f168201915b5050505050905090565b6000610da18261265f565b610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd790614edb565b60405180910390fd5b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610e2682611583565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8e90614c7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610eb661266c565b73ffffffffffffffffffffffffffffffffffffffff161480610ee55750610ee481610edf61266c565b612469565b5b610f24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1b90614b9b565b60405180910390fd5b610f2f838383612674565b505050565b600e60009054906101000a900460ff1681565b60008054905090565b610f5b838383612726565b505050565b60145481565b600f5481565b6000610f7783611627565b8210610fb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610faf90614d3b565b60405180910390fd5b6000610fc2610f47565b905060008060005b83811015611128576000600360008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16146110bc57806000015192505b8773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111145786841415611105578195505050505050611164565b838061111090615352565b9450505b50808061112090615352565b915050610fca565b506040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115b90614cdb565b60405180910390fd5b92915050565b61117261266c565b73ffffffffffffffffffffffffffffffffffffffff16611190611824565b73ffffffffffffffffffffffffffffffffffffffff16146111e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111dd90614d9b565b60405180910390fd5b8060138190555050565b60135481565b6111fe61266c565b73ffffffffffffffffffffffffffffffffffffffff1661121c611824565b73ffffffffffffffffffffffffffffffffffffffff1614611272576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126990614d9b565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156112cf573d6000803e3d6000fd5b50565b6112da61266c565b73ffffffffffffffffffffffffffffffffffffffff166112f8611824565b73ffffffffffffffffffffffffffffffffffffffff161461134e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134590614d9b565b60405180910390fd5b600e60009054906101000a900460ff1615600e60006101000a81548160ff021916908315150217905550565b6015543410156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690614efb565b60405180910390fd5b6114103330601654600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612cdf909392919063ffffffff16565b600c6000828152602001908152602001600020600081548092919061143490615352565b91905055600c60008381526020019081526020016000208190555050565b61146d83838360405180602001604052806000815250611f17565b505050565b60125481565b6000611482610f47565b82106114c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ba90614d5b565b60405180910390fd5b819050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6114f961266c565b73ffffffffffffffffffffffffffffffffffffffff16611517611824565b73ffffffffffffffffffffffffffffffffffffffff161461156d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156490614d9b565b60405180910390fd5b8181600d919061157e929190613ea8565b505050565b600061158e82612d68565b600001519050919050565b600d80546115a6906152ef565b80601f01602080910402602001604051908101604052809291908181526020018280546115d2906152ef565b801561161f5780601f106115f45761010080835404028352916020019161161f565b820191906000526020600020905b81548152906001019060200180831161160257829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611698576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168f90614cbb565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050919050565b61171861266c565b73ffffffffffffffffffffffffffffffffffffffff16611736611824565b73ffffffffffffffffffffffffffffffffffffffff161461178c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178390614d9b565b60405180910390fd5b6117966000612f6b565b565b60165481565b6117a661266c565b73ffffffffffffffffffffffffffffffffffffffff166117c4611824565b73ffffffffffffffffffffffffffffffffffffffff161461181a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181190614d9b565b60405180910390fd5b80600f8190555050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61185661266c565b73ffffffffffffffffffffffffffffffffffffffff16611874611824565b73ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c190614d9b565b60405180910390fd5b8060148190555050565b6118dc61266c565b73ffffffffffffffffffffffffffffffffffffffff166118fa611824565b73ffffffffffffffffffffffffffffffffffffffff1614611950576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194790614d9b565b60405180910390fd5b61195a3382613031565b50565b600e60009054906101000a900460ff166119ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a390614f7b565b60405180910390fd5b60125483600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119fa91906150a0565b1115611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3290614cfb565b60405180910390fd5b601154831115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790614ebb565b60405180910390fd5b600033604051602001611a939190614a2f565b604051602081830303815290604052805190602001209050611af9838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600f548361304f565b611b38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2f90614bbb565b60405180910390fd5b60135484611b44610f47565b611b4e91906150a0565b1115611b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8690614e7b565b60405180910390fd5b83600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bde91906150a0565b92505081905550611bee84613066565b50505050565b606060028054611c03906152ef565b80601f0160208091040260200160405190810160405280929190818152602001828054611c2f906152ef565b8015611c7c5780601f10611c5157610100808354040283529160200191611c7c565b820191906000526020600020905b815481529060010190602001808311611c5f57829003601f168201915b5050505050905090565b611c8e61266c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611cfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf390614c5b565b60405180910390fd5b8060066000611d0961266c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611db661266c565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611dfb9190614b23565b60405180910390a35050565b611e0f61266c565b73ffffffffffffffffffffffffffffffffffffffff16611e2d611824565b73ffffffffffffffffffffffffffffffffffffffff1614611e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7a90614d9b565b60405180910390fd5b8060108190555050565b611e9561266c565b73ffffffffffffffffffffffffffffffffffffffff16611eb3611824565b73ffffffffffffffffffffffffffffffffffffffff1614611f09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0090614d9b565b60405180910390fd5b611f138282613031565b5050565b611f22848484612726565b611f2e84848484613235565b611f6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6490614e3b565b60405180910390fd5b50505050565b611f7b61266c565b73ffffffffffffffffffffffffffffffffffffffff16611f99611824565b73ffffffffffffffffffffffffffffffffffffffff1614611fef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fe690614d9b565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600e60019054906101000a900460ff16612082576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207990614e5b565b60405180910390fd5b60125481600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120d091906150a0565b1115612111576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210890614cfb565b60405180910390fd5b601154811115612156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214d90614ebb565b60405180910390fd5b60135481612162610f47565b61216c91906150a0565b11156121ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a490614e7b565b60405180910390fd5b6121b681613066565b50565b60105481565b60155481565b60606121d08261265f565b61220f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220690614ddb565b60405180910390fd5b60006122196133cc565b905060008151116122395760405180602001604052806000815250612264565b806122438461345e565b604051602001612254929190614a61565b6040516020818303038152906040525b915050919050565b600c6020528060005260406000206000915090505481565b60115481565b61229261266c565b73ffffffffffffffffffffffffffffffffffffffff166122b0611824565b73ffffffffffffffffffffffffffffffffffffffff1614612306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122fd90614d9b565b60405180910390fd5b600e60019054906101000a900460ff1615600e60016101000a81548160ff021916908315150217905550565b60075481565b6000612343826135bf565b9050919050565b61235261266c565b73ffffffffffffffffffffffffffffffffffffffff16612370611824565b73ffffffffffffffffffffffffffffffffffffffff16146123c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123bd90614d9b565b60405180910390fd5b8060118190555050565b6123d861266c565b73ffffffffffffffffffffffffffffffffffffffff166123f6611824565b73ffffffffffffffffffffffffffffffffffffffff161461244c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244390614d9b565b60405180910390fd5b8060128190555050565b600e60019054906101000a900460ff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61250561266c565b73ffffffffffffffffffffffffffffffffffffffff16612523611824565b73ffffffffffffffffffffffffffffffffffffffff1614612579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257090614d9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e090614c1b565b60405180910390fd5b6125f281612f6b565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000805482109050919050565b600033905090565b826005600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b600061273182612d68565b90506000816000015173ffffffffffffffffffffffffffffffffffffffff1661275861266c565b73ffffffffffffffffffffffffffffffffffffffff1614806127b4575061277d61266c565b73ffffffffffffffffffffffffffffffffffffffff1661279c84610d96565b73ffffffffffffffffffffffffffffffffffffffff16145b806127d057506127cf82600001516127ca61266c565b612469565b5b905080612812576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280990614b7b565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1614612884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161287b90614f5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156128f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128eb90614dfb565b60405180910390fd5b61290185858560016136a8565b6129116000848460000151612674565b6001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff1661297f9190615181565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506001600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff16612a23919061505a565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060405180604001604052808573ffffffffffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff168152506003600085815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050506000600184612b2991906150a0565b9050600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612c6f57612b9f8161265f565b15612c6e576040518060400160405280846000015173ffffffffffffffffffffffffffffffffffffffff168152602001846020015167ffffffffffffffff168152506003600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b5b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612cd786868660016136ae565b505050505050565b612d62846323b872dd60e01b858585604051602401612d0093929190614aa0565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506136b4565b50505050565b612d70613f2e565b612d798261265f565b612db8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612daf90614dbb565b60405180910390fd5b60007f000000000000000000000000000000000000000000000000000000000000000a8310612e1c5760017f000000000000000000000000000000000000000000000000000000000000000a84612e0f91906151b5565b612e1991906150a0565b90505b60008390505b818110612f2a576000600360008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614612f1657809350505050612f66565b508080612f22906152c5565b915050612e22565b506040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5d90614d7b565b60405180910390fd5b919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61304b82826040518060200160405280600081525061377b565b5050565b60008261305c8584613c5a565b1490509392505050565b601054600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015613181576010548110156130bf5760105490505b601454601054826130d091906151b5565b6130da9190615127565b34101561311c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161311390614c3b565b60405180910390fd5b80600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461316b91906150a0565b9250508190555061317c3382613031565b613232565b6014548161318f9190615127565b3410156131d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c890614bdb565b60405180910390fd5b80600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461322091906150a0565b925050819055506132313382613031565b5b50565b60006132568473ffffffffffffffffffffffffffffffffffffffff16613cb0565b156133bf578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261327f61266c565b8786866040518563ffffffff1660e01b81526004016132a19493929190614ad7565b602060405180830381600087803b1580156132bb57600080fd5b505af19250505080156132ec57506040513d601f19601f820116820180604052508101906132e9919061437e565b60015b61336f573d806000811461331c576040519150601f19603f3d011682016040523d82523d6000602084013e613321565b606091505b50600081511415613367576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161335e90614e3b565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506133c4565b600190505b949350505050565b6060600d80546133db906152ef565b80601f0160208091040260200160405190810160405280929190818152602001828054613407906152ef565b80156134545780601f1061342957610100808354040283529160200191613454565b820191906000526020600020905b81548152906001019060200180831161343757829003601f168201915b5050505050905090565b606060008214156134a6576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506135ba565b600082905060005b600082146134d85780806134c190615352565b915050600a826134d191906150f6565b91506134ae565b60008167ffffffffffffffff8111156134f4576134f36154ac565b5b6040519080825280601f01601f1916602001820160405280156135265781602001600182028036833780820191505090505b5090505b600085146135b35760018261353f91906151b5565b9150600a8561354e91906153bf565b603061355a91906150a0565b60f81b8183815181106135705761356f61547d565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856135ac91906150f6565b945061352a565b8093505050505b919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161362790614f3b565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050919050565b50505050565b50505050565b6000613716826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613cd39092919063ffffffff16565b9050600081511115613776578080602001905181019061373691906142f7565b613775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161376c90614f1b565b60405180910390fd5b5b505050565b600080549050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156137f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137e890614e1b565b60405180910390fd5b6137fa8161265f565b1561383a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161383190614bfb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000a83111561389d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161389490614d1b565b60405180910390fd5b6138aa60008583866136a8565b6000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681525050905060405180604001604052808583600001516139a7919061505a565b6fffffffffffffffffffffffffffffffff1681526020018583602001516139ce919061505a565b6fffffffffffffffffffffffffffffffff16815250600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555090505060405180604001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff168152506003600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050600082905060005b85811015613c3d57818773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4613bdd6000888488613235565b613c1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613c1390614e3b565b60405180910390fd5b8180613c2790615352565b9250508080613c3590615352565b915050613b6c565b5080600081905550613c5260008785886136ae565b505050505050565b60008082905060005b8451811015613ca557613c9082868381518110613c8357613c8261547d565b5b6020026020010151613ceb565b91508080613c9d90615352565b915050613c63565b508091505092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6060613ce28484600085613d16565b90509392505050565b6000818310613d0357613cfe8284613e2a565b613d0e565b613d0d8383613e2a565b5b905092915050565b606082471015613d5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d5290614c9b565b60405180910390fd5b613d6485613cb0565b613da3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d9a90614e9b565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613dcc9190614a4a565b60006040518083038185875af1925050503d8060008114613e09576040519150601f19603f3d011682016040523d82523d6000602084013e613e0e565b606091505b5091509150613e1e828286613e41565b92505050949350505050565b600082600052816020526040600020905092915050565b60608315613e5157829050613ea1565b600083511115613e645782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613e989190614b59565b60405180910390fd5b9392505050565b828054613eb4906152ef565b90600052602060002090601f016020900481019282613ed65760008555613f1d565b82601f10613eef57803560ff1916838001178555613f1d565b82800160010185558215613f1d579182015b82811115613f1c578235825591602001919060010190613f01565b5b509050613f2a9190613f68565b5090565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681525090565b5b80821115613f81576000816000905550600101613f69565b5090565b6000613f98613f9384614fdb565b614fb6565b905082815260208101848484011115613fb457613fb36154ea565b5b613fbf848285615283565b509392505050565b600081359050613fd681615dca565b92915050565b60008083601f840112613ff257613ff16154e0565b5b8235905067ffffffffffffffff81111561400f5761400e6154db565b5b60208301915083602082028301111561402b5761402a6154e5565b5b9250929050565b60008135905061404181615de1565b92915050565b60008151905061405681615de1565b92915050565b60008135905061406b81615df8565b92915050565b60008135905061408081615e0f565b92915050565b60008151905061409581615e0f565b92915050565b600082601f8301126140b0576140af6154e0565b5b81356140c0848260208601613f85565b91505092915050565b60008083601f8401126140df576140de6154e0565b5b8235905067ffffffffffffffff8111156140fc576140fb6154db565b5b602083019150836001820283011115614118576141176154e5565b5b9250929050565b60008135905061412e81615e26565b92915050565b60006020828403121561414a576141496154f4565b5b600061415884828501613fc7565b91505092915050565b60008060408385031215614178576141776154f4565b5b600061418685828601613fc7565b925050602061419785828601613fc7565b9150509250929050565b6000806000606084860312156141ba576141b96154f4565b5b60006141c886828701613fc7565b93505060206141d986828701613fc7565b92505060406141ea8682870161411f565b9150509250925092565b6000806000806080858703121561420e5761420d6154f4565b5b600061421c87828801613fc7565b945050602061422d87828801613fc7565b935050604061423e8782880161411f565b925050606085013567ffffffffffffffff81111561425f5761425e6154ef565b5b61426b8782880161409b565b91505092959194509250565b6000806040838503121561428e5761428d6154f4565b5b600061429c85828601613fc7565b92505060206142ad85828601614032565b9150509250929050565b600080604083850312156142ce576142cd6154f4565b5b60006142dc85828601613fc7565b92505060206142ed8582860161411f565b9150509250929050565b60006020828403121561430d5761430c6154f4565b5b600061431b84828501614047565b91505092915050565b60006020828403121561433a576143396154f4565b5b60006143488482850161405c565b91505092915050565b600060208284031215614367576143666154f4565b5b600061437584828501614071565b91505092915050565b600060208284031215614394576143936154f4565b5b60006143a284828501614086565b91505092915050565b600080602083850312156143c2576143c16154f4565b5b600083013567ffffffffffffffff8111156143e0576143df6154ef565b5b6143ec858286016140c9565b92509250509250929050565b60006020828403121561440e5761440d6154f4565b5b600061441c8482850161411f565b91505092915050565b60008060006040848603121561443e5761443d6154f4565b5b600061444c8682870161411f565b935050602084013567ffffffffffffffff81111561446d5761446c6154ef565b5b61447986828701613fdc565b92509250509250925092565b61448e816151e9565b82525050565b6144a56144a0826151e9565b61539b565b82525050565b6144b4816151fb565b82525050565b6144c381615207565b82525050565b60006144d48261500c565b6144de8185615022565b93506144ee818560208601615292565b6144f7816154f9565b840191505092915050565b600061450d8261500c565b6145178185615033565b9350614527818560208601615292565b80840191505092915050565b600061453e82615017565b614548818561503e565b9350614558818560208601615292565b614561816154f9565b840191505092915050565b600061457782615017565b614581818561504f565b9350614591818560208601615292565b80840191505092915050565b60006145aa60368361503e565b91506145b582615517565b604082019050919050565b60006145cd603d8361503e565b91506145d882615566565b604082019050919050565b60006145f0601f8361503e565b91506145fb826155b5565b602082019050919050565b600061461360138361503e565b915061461e826155de565b602082019050919050565b600061463660218361503e565b915061464182615607565b604082019050919050565b600061465960268361503e565b915061466482615656565b604082019050919050565b600061467c60178361503e565b9150614687826156a5565b602082019050919050565b600061469f601e8361503e565b91506146aa826156ce565b602082019050919050565b60006146c260268361503e565b91506146cd826156f7565b604082019050919050565b60006146e560268361503e565b91506146f082615746565b604082019050919050565b6000614708602f8361503e565b915061471382615795565b604082019050919050565b600061472b60328361503e565b9150614736826157e4565b604082019050919050565b600061474e601b8361503e565b915061475982615833565b602082019050919050565b600061477160268361503e565b915061477c8261585c565b604082019050919050565b600061479460268361503e565b915061479f826158ab565b604082019050919050565b60006147b760278361503e565b91506147c2826158fa565b604082019050919050565b60006147da60338361503e565b91506147e582615949565b604082019050919050565b60006147fd60208361503e565b915061480882615998565b602082019050919050565b6000614820602e8361503e565b915061482b826159c1565b604082019050919050565b6000614843602f8361503e565b915061484e82615a10565b604082019050919050565b600061486660298361503e565b915061487182615a5f565b604082019050919050565b600061488960258361503e565b915061489482615aae565b604082019050919050565b60006148ac60378361503e565b91506148b782615afd565b604082019050919050565b60006148cf60218361503e565b91506148da82615b4c565b604082019050919050565b60006148f260148361503e565b91506148fd82615b9b565b602082019050919050565b6000614915601d8361503e565b915061492082615bc4565b602082019050919050565b600061493860208361503e565b915061494382615bed565b602082019050919050565b600061495b60318361503e565b915061496682615c16565b604082019050919050565b600061497e601b8361503e565b915061498982615c65565b602082019050919050565b60006149a1602a8361503e565b91506149ac82615c8e565b604082019050919050565b60006149c460358361503e565b91506149cf82615cdd565b604082019050919050565b60006149e7602a8361503e565b91506149f282615d2c565b604082019050919050565b6000614a0a60248361503e565b9150614a1582615d7b565b604082019050919050565b614a2981615279565b82525050565b6000614a3b8284614494565b60148201915081905092915050565b6000614a568284614502565b915081905092915050565b6000614a6d828561456c565b9150614a79828461456c565b91508190509392505050565b6000602082019050614a9a6000830184614485565b92915050565b6000606082019050614ab56000830186614485565b614ac26020830185614485565b614acf6040830184614a20565b949350505050565b6000608082019050614aec6000830187614485565b614af96020830186614485565b614b066040830185614a20565b8181036060830152614b1881846144c9565b905095945050505050565b6000602082019050614b3860008301846144ab565b92915050565b6000602082019050614b5360008301846144ba565b92915050565b60006020820190508181036000830152614b738184614533565b905092915050565b60006020820190508181036000830152614b948161459d565b9050919050565b60006020820190508181036000830152614bb4816145c0565b9050919050565b60006020820190508181036000830152614bd4816145e3565b9050919050565b60006020820190508181036000830152614bf481614606565b9050919050565b60006020820190508181036000830152614c1481614629565b9050919050565b60006020820190508181036000830152614c348161464c565b9050919050565b60006020820190508181036000830152614c548161466f565b9050919050565b60006020820190508181036000830152614c7481614692565b9050919050565b60006020820190508181036000830152614c94816146b5565b9050919050565b60006020820190508181036000830152614cb4816146d8565b9050919050565b60006020820190508181036000830152614cd4816146fb565b9050919050565b60006020820190508181036000830152614cf48161471e565b9050919050565b60006020820190508181036000830152614d1481614741565b9050919050565b60006020820190508181036000830152614d3481614764565b9050919050565b60006020820190508181036000830152614d5481614787565b9050919050565b60006020820190508181036000830152614d74816147aa565b9050919050565b60006020820190508181036000830152614d94816147cd565b9050919050565b60006020820190508181036000830152614db4816147f0565b9050919050565b60006020820190508181036000830152614dd481614813565b9050919050565b60006020820190508181036000830152614df481614836565b9050919050565b60006020820190508181036000830152614e1481614859565b9050919050565b60006020820190508181036000830152614e348161487c565b9050919050565b60006020820190508181036000830152614e548161489f565b9050919050565b60006020820190508181036000830152614e74816148c2565b9050919050565b60006020820190508181036000830152614e94816148e5565b9050919050565b60006020820190508181036000830152614eb481614908565b9050919050565b60006020820190508181036000830152614ed48161492b565b9050919050565b60006020820190508181036000830152614ef48161494e565b9050919050565b60006020820190508181036000830152614f1481614971565b9050919050565b60006020820190508181036000830152614f3481614994565b9050919050565b60006020820190508181036000830152614f54816149b7565b9050919050565b60006020820190508181036000830152614f74816149da565b9050919050565b60006020820190508181036000830152614f94816149fd565b9050919050565b6000602082019050614fb06000830184614a20565b92915050565b6000614fc0614fd1565b9050614fcc8282615321565b919050565b6000604051905090565b600067ffffffffffffffff821115614ff657614ff56154ac565b5b614fff826154f9565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006150658261523d565b91506150708361523d565b9250826fffffffffffffffffffffffffffffffff03821115615095576150946153f0565b5b828201905092915050565b60006150ab82615279565b91506150b683615279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156150eb576150ea6153f0565b5b828201905092915050565b600061510182615279565b915061510c83615279565b92508261511c5761511b61541f565b5b828204905092915050565b600061513282615279565b915061513d83615279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615615176576151756153f0565b5b828202905092915050565b600061518c8261523d565b91506151978361523d565b9250828210156151aa576151a96153f0565b5b828203905092915050565b60006151c082615279565b91506151cb83615279565b9250828210156151de576151dd6153f0565b5b828203905092915050565b60006151f482615259565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156152b0578082015181840152602081019050615295565b838111156152bf576000848401525b50505050565b60006152d082615279565b915060008214156152e4576152e36153f0565b5b600182039050919050565b6000600282049050600182168061530757607f821691505b6020821081141561531b5761531a61544e565b5b50919050565b61532a826154f9565b810181811067ffffffffffffffff82111715615349576153486154ac565b5b80604052505050565b600061535d82615279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156153905761538f6153f0565b5b600182019050919050565b60006153a6826153ad565b9050919050565b60006153b88261550a565b9050919050565b60006153ca82615279565b91506153d583615279565b9250826153e5576153e461541f565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f45524337323150756e6b6f3a207472616e736665722063616c6c65722069732060008201527f6e6f74206f776e6572206e6f7220617070726f76656400000000000000000000602082015250565b7f45524337323150756e6b6f3a20617070726f76652063616c6c6572206973206e60008201527f6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c000000602082015250565b7f50756e6b6f20506978656c3a204e6f7420696e2077686974656c697374656400600082015250565b7f50756e6b6f20506978656c3a204e6f726d616c00000000000000000000000000600082015250565b7f45524337323150756e6b6f3a20746f6b656e20616c7265616479206d696e746560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f50756e6b6f20506978656c3a20436c61696d2046726565000000000000000000600082015250565b7f45524337323150756e6b6f3a20617070726f766520746f2063616c6c65720000600082015250565b7f45524337323150756e6b6f3a20617070726f76616c20746f2063757272656e7460008201527f206f776e65720000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a2062616c616e636520717565727920666f72207460008201527f6865207a65726f20616464726573730000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a20756e61626c6520746f2067657420746f6b656e60008201527f206f66206f776e657220627920696e6465780000000000000000000000000000602082015250565b7f50756e6b6f20506978656c3a204d6178205065722057616c6c65740000000000600082015250565b7f45524337323150756e6b6f3a207175616e7469747920746f206d696e7420746f60008201527f6f20686967680000000000000000000000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a206f776e657220696e646578206f7574206f662060008201527f626f756e64730000000000000000000000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a20676c6f62616c20696e646578206f7574206f6660008201527f20626f756e647300000000000000000000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a20756e61626c6520746f2064657465726d696e6560008201527f20746865206f776e6572206f6620746f6b656e00000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524337323150756e6b6f3a206f776e657220717565727920666f72206e6f6e60008201527f6578697374656e7420746f6b656e000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a207472616e7366657220746f20746865207a657260008201527f6f20616464726573730000000000000000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a206d696e7420746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a207472616e7366657220746f206e6f6e2045524360008201527f373231526563656976657220696d706c656d656e746572000000000000000000602082015250565b7f50756e6b6f20506978656c3a204d696e74696e67205075626c6963205061757360008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b7f50756e6b6f20506978656c3a20536f6c646f7574000000000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f50756e6b6f20506978656c3a204d617820506572205472616e73616374696f6e600082015250565b7f45524337323150756e6b6f3a20617070726f76656420717565727920666f722060008201527f6e6f6e6578697374656e7420746f6b656e000000000000000000000000000000602082015250565b7f506978656c617465643a20496e73756666696369656e74204574680000000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f45524337323150756e6b6f3a206e756d626572206d696e74656420717565727960008201527f20666f7220746865207a65726f20616464726573730000000000000000000000602082015250565b7f45524337323150756e6b6f3a207472616e736665722066726f6d20696e636f7260008201527f72656374206f776e657200000000000000000000000000000000000000000000602082015250565b7f50756e6b6f20506978656c3a204d696e74696e672057686974656c697374205060008201527f6175736500000000000000000000000000000000000000000000000000000000602082015250565b615dd3816151e9565b8114615dde57600080fd5b50565b615dea816151fb565b8114615df557600080fd5b50565b615e0181615207565b8114615e0c57600080fd5b50565b615e1881615211565b8114615e2357600080fd5b50565b615e2f81615279565b8114615e3a57600080fd5b5056fea2646970667358221220007279335e3d2cf3159f9dd85c4d20274546b09f26e7dca7068e72d94094c82664736f6c63430008070033
Verified Source Code Full Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
MerkleProof.sol 212 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
* consuming from one or the other at each step according to the instructions given by
* `proofFlags`.
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
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;
}
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
ERC721Punko.sol 557 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Assumes the number of issuable tokens (collection size) is capped and fits in a uint128.
*
* Does not support burning tokens to address(0).
*/
contract ERC721Punko is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable
{
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 private currentIndex = 0;
uint256 internal immutable collectionSize;
uint256 internal immutable maxBatchSize;
// 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 ownershipOf implementation for details.
mapping(uint256 => TokenOwnership) private _ownerships;
// Mapping owner address to address data
mapping(address => AddressData) private _addressData;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev
* `maxBatchSize` refers to how much a minter can mint at a time.
* `collectionSize_` refers to how many tokens are in the collection.
*/
constructor(
string memory name_,
string memory symbol_,
uint256 maxBatchSize_,
uint256 collectionSize_
) {
require(
collectionSize_ > 0,
"ERC721Punko: collection must have a nonzero supply"
);
require(maxBatchSize_ > 0, "ERC721Punko: max batch size must be nonzero");
_name = name_;
_symbol = symbol_;
maxBatchSize = maxBatchSize_;
collectionSize = collectionSize_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return currentIndex;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
require(index < totalSupply(), "ERC721Punko: global index out of bounds");
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(collectionSize). If calling from a separate contract, be sure to test gas first.
* It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
override
returns (uint256)
{
require(index < balanceOf(owner), "ERC721Punko: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
for (uint256 i = 0; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
revert("ERC721Punko: unable to get token of owner by index");
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), "ERC721Punko: balance query for the zero address");
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
require(
owner != address(0),
"ERC721Punko: number minted query for the zero address"
);
return uint256(_addressData[owner].numberMinted);
}
function ownershipOf(uint256 tokenId)
internal
view
returns (TokenOwnership memory)
{
require(_exists(tokenId), "ERC721Punko: owner query for nonexistent token");
uint256 lowestTokenToCheck;
if (tokenId >= maxBatchSize) {
lowestTokenToCheck = tokenId - maxBatchSize + 1;
}
for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
revert("ERC721Punko: unable to determine the owner of token");
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return ownershipOf(tokenId).addr;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
address owner = ERC721Punko.ownerOf(tokenId);
require(to != owner, "ERC721Punko: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721Punko: approve caller is not owner nor approved for all"
);
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721Punko: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), "ERC721Punko: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721Punko: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, "");
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - there must be `quantity` tokens remaining unminted in the total collection.
* - `to` cannot be the zero address.
* - `quantity` cannot be larger than the max batch size.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
uint256 startTokenId = currentIndex;
require(to != address(0), "ERC721Punko: mint to the zero address");
// We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering.
require(!_exists(startTokenId), "ERC721Punko: token already minted");
require(quantity <= maxBatchSize, "ERC721Punko: quantity to mint too high");
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
addressData.balance + uint128(quantity),
addressData.numberMinted + uint128(quantity)
);
_ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));
uint256 updatedIndex = startTokenId;
for (uint256 i = 0; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
require(
_checkOnERC721Received(address(0), to, updatedIndex, _data),
"ERC721Punko: transfer to non ERC721Receiver implementer"
);
updatedIndex++;
}
currentIndex = updatedIndex;
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @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 _transfer(
address from,
address to,
uint256 tokenId
) private {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwnership.addr, _msgSender()));
require(
isApprovedOrOwner,
"ERC721Punko: transfer caller is not owner nor approved"
);
require(
prevOwnership.addr == from,
"ERC721Punko: transfer from incorrect owner"
);
require(to != address(0), "ERC721Punko: transfer to the zero address");
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId] = TokenOwnership(to, uint64(block.timestamp));
// If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
uint256 nextTokenId = tokenId + 1;
if (_ownerships[nextTokenId].addr == address(0)) {
if (_exists(nextTokenId)) {
_ownerships[nextTokenId] = TokenOwnership(
prevOwnership.addr,
prevOwnership.startTimestamp
);
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
uint256 public nextOwnerToExplicitlySet = 0;
/**
* @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
*/
function _setOwnersExplicit(uint256 quantity) internal {
uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet;
require(quantity > 0, "quantity must be nonzero");
uint256 endIndex = oldNextOwnerToSet + quantity - 1;
if (endIndex > collectionSize - 1) {
endIndex = collectionSize - 1;
}
// We know if the last one in the group exists, all in the group exist, due to serial ordering.
require(_exists(endIndex), "not enough minted yet for this cleanup");
for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) {
if (_ownerships[i].addr == address(0)) {
TokenOwnership memory ownership = ownershipOf(i);
_ownerships[i] = TokenOwnership(
ownership.addr,
ownership.startTimestamp
);
}
}
nextOwnerToExplicitlySet = endIndex + 1;
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try
IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data)
returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721Punko: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
*
* 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`.
*/
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.
*
* 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` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
SafeERC20.sol 116 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
draft-IERC20Permit.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_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);
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
Strings.sol 75 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
PixelPunko.sol 168 lines
// SPDX-License-Identifier: MIT
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//(((((((((((((((((((((((((((((#&&&&&&&&&&&&&&&&&&&&&(((((((((((((((((((((((((((((
//(((((((((((((((((((((&&&&&&&&#.....................&&&&&&&&&((((((((((((((((((((
//((((((((((((((((%&&&& ..................................... &&&&((((((((((((((((
//((((((((((((((&&/ ........................................ &&&(((((((((((((
//((((((((((((&&....................................................,&&(((((((((((
//((((((((((&&.........................................................&&(((((((((
//((((((((((&&.........................................................&&(((((((((
//((((((((((&&.........................................................&&(((((((((
//((((((((((&&.........................................................&&(((((((((
//((((((((((&&.........................................................&&(((((((((
//((((((((((&&...... ..................................................&&(((((((((
//((((((((##&&....,**&&&&((**..........................,**&&&&((**.....&&##(((((((
//(((((&&& .&&..&&&&&&&&&&&&&@&#.....................&&@&&&&&&&&&&&&%..&&..&&(((((
//(((((&&&. &&..&&&&&&&&&&&&&&&#.....................&&&&&&&&&&&&&&&%..&& .&&(((((
//(((((&&&,,&&..&&&&&&&&&&&&&&&#.....................&&&&&&&&&&&&&&&%..&&,,&&(((((
//(((((&&&,,&&....(&& &&&&&&........................../&& &&&&&&.....&&,,&&(((((
//((((((((@@&&..... .&&&&&&...............................&&&&&&.......&&&&(((((((
//((((((((((&&..........................&&&&&..........................&&(((((((((
//((((((((((&&.. ......................................................&&(((((((((
//((((((((((((&&,,................................................,,*&&(((((((((((
//((((((((((((((&&(,,,,,,...................................,,,,,,&&&(((((((((((((
//((((((((((((((((%&&&&&&,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,&&&&&&((((((((((((((((
//(((((((((((((((((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
//((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./ERC721Punko.sol";
contract PunkoPixel is ERC721Punko, Ownable, ReentrancyGuard {
address public tokenContract;
using SafeERC20 for IERC20;
mapping (address => uint256) public walletPunko;
mapping(uint256 => uint256) public PunkoTokenUpgrade;
string public baseURI;
bool public mintPunkolistedEnabled = false;
bool public mintPublicPunkoEnabled = false;
bytes32 public merkleRoot;
uint public freePunko = 1;
uint public maxPankoPerTx = 2;
uint public maxPerWallet = 2;
uint public maxPanko = 777;
uint public pankoPrice = 77000000000000000; //0.077 ETH
uint public PriceETHpunkoUpgrade = 0;
uint public PricePuncoinPunkoUpgrade = 0;
constructor() ERC721Punko("Punko Pixel", "Punko",10,777){}
function PunkolistedMint(uint256 qty, bytes32[] calldata _merkleProof) external payable
{
require(mintPunkolistedEnabled , "Punko Pixel: Minting Whitelist Pause");
require(walletPunko[msg.sender] + qty <= maxPerWallet,"Punko Pixel: Max Per Wallet");
require(qty <= maxPankoPerTx, "Punko Pixel: Max Per Transaction");
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(_merkleProof, merkleRoot, leaf), "Punko Pixel: Not in whitelisted");
require(totalSupply() + qty <= maxPanko,"Punko Pixel: Soldout");
walletPunko[msg.sender] += qty;
_mint(qty);
}
function PublicPankoMint(uint256 qty) external payable
{
require(mintPublicPunkoEnabled , "Punko Pixel: Minting Public Pause");
require(walletPunko[msg.sender] + qty <= maxPerWallet,"Punko Pixel: Max Per Wallet");
require(qty <= maxPankoPerTx, "Punko Pixel: Max Per Transaction");
require(totalSupply() + qty <= maxPanko,"Punko Pixel: Soldout");
_mint(qty);
}
function Upgrading(uint256 tokenId) external payable{
require(msg.value >= PriceETHpunkoUpgrade ,"Pixelated: Insufficient Eth");
IERC20(tokenContract).safeTransferFrom(msg.sender, address(this), PricePuncoinPunkoUpgrade);
PunkoTokenUpgrade[tokenId] = PunkoTokenUpgrade[tokenId]++;
}
function _mint(uint qty) internal {
if(walletPunko[msg.sender] < freePunko)
{
if(qty < freePunko) qty = freePunko;
require(msg.value >= (qty - freePunko) * pankoPrice,"Punko Pixel: Claim Free");
walletPunko[msg.sender] += qty;
_safeMint(msg.sender, qty);
}
else
{
require(msg.value >= qty * pankoPrice,"Punko Pixel: Normal");
walletPunko[msg.sender] += qty;
_safeMint(msg.sender, qty);
}
}
function numberMinted(address owner) public view returns (uint256) {
return _numberMinted(owner);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function setMerkleRoot(bytes32 root) public onlyOwner {
merkleRoot = root;
}
function airdropPunko(address to ,uint256 qty) external onlyOwner
{
_safeMint(to, qty);
}
function PunkoOwnerMint(uint256 qty) external onlyOwner
{
_safeMint(msg.sender, qty);
}
function togglePublicPunkoMinting() external onlyOwner {
mintPublicPunkoEnabled = !mintPublicPunkoEnabled ;
}
function toggleWhitelistPunkoMinting() external onlyOwner {
mintPunkolistedEnabled = !mintPunkolistedEnabled ;
}
function setTokenContract(address _tokenContract) external onlyOwner{
tokenContract = _tokenContract;
}
function setBaseURI(string calldata baseURI_) external onlyOwner {
baseURI = baseURI_;
}
function setPrice(uint256 price_) external onlyOwner {
pankoPrice = price_;
}
function setmaxPankoPerTx(uint256 maxPankoPerTx_) external onlyOwner {
maxPankoPerTx = maxPankoPerTx_;
}
function setmaxFreePankoPerTx(uint256 freePunko_) external onlyOwner {
freePunko = freePunko_;
}
function setMaxPerWallet(uint256 maxPerWallet_) external onlyOwner {
maxPerWallet = maxPerWallet_;
}
function setmaxPanko(uint256 maxPanko_) external onlyOwner {
maxPanko = maxPanko_;
}
function withdraw() public onlyOwner {
payable(msg.sender).transfer(payable(address(this)).balance);
}
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
Read Contract
PriceETHpunkoUpgrade 0xc70bf411 → uint256
PricePuncoinPunkoUpgrade 0x760e6a4e → uint256
PunkoTokenUpgrade 0xcdc6dc7e → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
freePunko 0xbd4cd56b → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxPanko 0x3bafc593 → uint256
maxPankoPerTx 0xcf93b6b1 → uint256
maxPerWallet 0x453c2310 → uint256
merkleRoot 0x2eb4a7ab → bytes32
mintPublicPunkoEnabled 0xe3bb2a02 → bool
mintPunkolistedEnabled 0x0b5c9878 → bool
name 0x06fdde03 → string
nextOwnerToExplicitlySet 0xd7224ba0 → uint256
numberMinted 0xdc33e681 → uint256
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
pankoPrice 0x2aada986 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenContract 0x55a373d6 → address
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletPunko 0x00b64888 → uint256
Write Contract 23 functions
These functions modify contract state and require a wallet transaction to execute.
PublicPankoMint 0xbc224f07
uint256 qty
PunkoOwnerMint 0x922d0af9
uint256 qty
PunkolistedMint 0x936e984e
uint256 qty
bytes32[] _merkleProof
Upgrading 0x41044614
uint256 tokenId
airdropPunko 0xad4ee73e
address to
uint256 qty
approve 0x095ea7b3
address to
uint256 tokenId
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_
setMaxPerWallet 0xe268e4d3
uint256 maxPerWallet_
setMerkleRoot 0x7cb64759
bytes32 root
setPrice 0x91b7f5ed
uint256 price_
setTokenContract 0xbbcd5bbe
address _tokenContract
setmaxFreePankoPerTx 0xaca3ebf6
uint256 freePunko_
setmaxPanko 0x38719a53
uint256 maxPanko_
setmaxPankoPerTx 0xded25681
uint256 maxPankoPerTx_
togglePublicPunkoMinting 0xd04af881
No parameters
toggleWhitelistPunkoMinting 0x3de909bd
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address