Address Contract Partially Verified
Address
0x8ECA14963a31a35FdE3238DF5339064566a56f49
Balance
0 ETH
Nonce
1
Code Size
20520 bytes
Creator
0x6B382B9c...77dD at tx 0x96482e28...b6bfbb
Indexed Transactions
0
Contract Bytecode
20520 bytes
0x6080604052600436106102675760003560e01c806391b7f5ed11610144578063c87b56dd116100b6578063e945971c1161007a578063e945971c146108e0578063e985e9c514610909578063f2c4ce1e14610946578063f2fde38b1461096f578063f4db2acb14610998578063f968adbe146109d557610267565b8063c87b56dd146107f9578063d123973014610836578063d5abeb0114610861578063da3ef23f1461088c578063dad7b5c9146108b557610267565b8063a22cb46511610108578063a22cb4651461070f578063a475b5dd14610738578063a70273571461074f578063b88d4fde1461077a578063c6682862146107a3578063c7c39ffc146107ce57610267565b806391b7f5ed1461064b57806395d89b411461067457806396ea3a471461069f578063a035b1fe146106c8578063a0712d68146106f357610267565b806342842e0e116101dd5780635c975abb116101a15780635c975abb146105395780636352211e146105645780636c0360eb146105a157806370a08231146105cc578063715018a6146106095780638da5cb5b1461062057610267565b806342842e0e146104565780634f6ccce71461047f57806351830227146104bc57806355f804b3146104e75780635a963f1b1461051057610267565b806318160ddd1161022f57806318160ddd1461036557806323b872dd146103905780632f745c59146103b9578063333e44e6146103f657806334c8fd75146104215780633ccfd60b1461044c57610267565b806301ffc9a71461026c57806306fdde03146102a9578063081812fc146102d4578063081c8c4414610311578063095ea7b31461033c575b600080fd5b34801561027857600080fd5b50610293600480360381019061028e9190613a68565b610a00565b6040516102a091906140c2565b60405180910390f35b3480156102b557600080fd5b506102be610b4a565b6040516102cb91906140dd565b60405180910390f35b3480156102e057600080fd5b506102fb60048036038101906102f69190613b0b565b610bdc565b604051610308919061405b565b60405180910390f35b34801561031d57600080fd5b50610326610c61565b60405161033391906140dd565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e91906139a7565b610cef565b005b34801561037157600080fd5b5061037a610e08565b604051610387919061441f565b60405180910390f35b34801561039c57600080fd5b506103b760048036038101906103b29190613891565b610e11565b005b3480156103c557600080fd5b506103e060048036038101906103db91906139a7565b610e21565b6040516103ed919061441f565b60405180910390f35b34801561040257600080fd5b5061040b611013565b604051610418919061441f565b60405180910390f35b34801561042d57600080fd5b50610436611019565b604051610443919061441f565b60405180910390f35b61045461101f565b005b34801561046257600080fd5b5061047d60048036038101906104789190613891565b611114565b005b34801561048b57600080fd5b506104a660048036038101906104a19190613b0b565b611134565b6040516104b3919061441f565b60405180910390f35b3480156104c857600080fd5b506104d1611187565b6040516104de91906140c2565b60405180910390f35b3480156104f357600080fd5b5061050e60048036038101906105099190613ac2565b61119a565b005b34801561051c57600080fd5b5061053760048036038101906105329190613b0b565b611230565b005b34801561054557600080fd5b5061054e6112b6565b60405161055b91906140c2565b60405180910390f35b34801561057057600080fd5b5061058b60048036038101906105869190613b0b565b6112cd565b604051610598919061405b565b60405180910390f35b3480156105ad57600080fd5b506105b66112e3565b6040516105c391906140dd565b60405180910390f35b3480156105d857600080fd5b506105f360048036038101906105ee9190613824565b611371565b604051610600919061441f565b60405180910390f35b34801561061557600080fd5b5061061e61145a565b005b34801561062c57600080fd5b506106356114e2565b604051610642919061405b565b60405180910390f35b34801561065757600080fd5b50610672600480360381019061066d9190613b0b565b61150c565b005b34801561068057600080fd5b50610689611592565b60405161069691906140dd565b60405180910390f35b3480156106ab57600080fd5b506106c660048036038101906106c191906139e7565b611624565b005b3480156106d457600080fd5b506106dd611806565b6040516106ea919061441f565b60405180910390f35b61070d60048036038101906107089190613b0b565b61180c565b005b34801561071b57600080fd5b5061073660048036038101906107319190613967565b611d32565b005b34801561074457600080fd5b5061074d611eb3565b005b34801561075b57600080fd5b50610764611f4c565b604051610771919061441f565b60405180910390f35b34801561078657600080fd5b506107a1600480360381019061079c91906138e4565b611f56565b005b3480156107af57600080fd5b506107b8611fb2565b6040516107c591906140dd565b60405180910390f35b3480156107da57600080fd5b506107e3612040565b6040516107f0919061441f565b60405180910390f35b34801561080557600080fd5b50610820600480360381019061081b9190613b0b565b612046565b60405161082d91906140dd565b60405180910390f35b34801561084257600080fd5b5061084b61219f565b60405161085891906140c2565b60405180910390f35b34801561086d57600080fd5b506108766121b2565b604051610883919061441f565b60405180910390f35b34801561089857600080fd5b506108b360048036038101906108ae9190613ac2565b6121b8565b005b3480156108c157600080fd5b506108ca61224e565b6040516108d7919061441f565b60405180910390f35b3480156108ec57600080fd5b5061090760048036038101906109029190613b0b565b612254565b005b34801561091557600080fd5b50610930600480360381019061092b9190613851565b6122da565b60405161093d91906140c2565b60405180910390f35b34801561095257600080fd5b5061096d60048036038101906109689190613ac2565b61236e565b005b34801561097b57600080fd5b5061099660048036038101906109919190613824565b612404565b005b3480156109a457600080fd5b506109bf60048036038101906109ba9190613824565b6124fc565b6040516109cc919061441f565b60405180910390f35b3480156109e157600080fd5b506109ea612514565b6040516109f7919061441f565b60405180910390f35b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610acb57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610b3357507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610b435750610b428261253d565b5b9050919050565b606060018054610b59906146ef565b80601f0160208091040260200160405190810160405280929190818152602001828054610b85906146ef565b8015610bd25780601f10610ba757610100808354040283529160200191610bd2565b820191906000526020600020905b815481529060010190602001808311610bb557829003601f168201915b5050505050905090565b6000610be7826125a7565b610c26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1d906143ff565b60405180910390fd5b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600b8054610c6e906146ef565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9a906146ef565b8015610ce75780601f10610cbc57610100808354040283529160200191610ce7565b820191906000526020600020905b815481529060010190602001808311610cca57829003601f168201915b505050505081565b6000610cfa826112cd565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d629061431f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610d8a6125b4565b73ffffffffffffffffffffffffffffffffffffffff161480610db95750610db881610db36125b4565b6122da565b5b610df8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610def906141ff565b60405180910390fd5b610e038383836125bc565b505050565b60008054905090565b610e1c83838361266e565b505050565b6000610e2c83611371565b8210610e6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e64906140ff565b60405180910390fd5b6000610e77610e08565b905060008060005b83811015610fd1576000600360008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614610f7157806000015192505b8773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fc35786841415610fba57819550505050505061100d565b83806001019450505b508080600101915050610e7f565b506040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611004906143bf565b60405180910390fd5b92915050565b600f5481565b60125481565b6110276125b4565b73ffffffffffffffffffffffffffffffffffffffff166110456114e2565b73ffffffffffffffffffffffffffffffffffffffff161461109b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110929061429f565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff16476040516110c190614046565b60006040518083038185875af1925050503d80600081146110fe576040519150601f19603f3d011682016040523d82523d6000602084013e611103565b606091505b505090508061111157600080fd5b50565b61112f83838360405180602001604052806000815250611f56565b505050565b600061113e610e08565b821061117f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111769061419f565b60405180910390fd5b819050919050565b600c60009054906101000a900460ff1681565b6111a26125b4565b73ffffffffffffffffffffffffffffffffffffffff166111c06114e2565b73ffffffffffffffffffffffffffffffffffffffff1614611216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120d9061429f565b60405180910390fd5b806009908051906020019061122c929190613552565b5050565b6112386125b4565b73ffffffffffffffffffffffffffffffffffffffff166112566114e2565b73ffffffffffffffffffffffffffffffffffffffff16146112ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a39061429f565b60405180910390fd5b80600f8190555050565b6000600760149054906101000a900460ff16905090565b60006112d882612bae565b600001519050919050565b600980546112f0906146ef565b80601f016020809104026020016040519081016040528092919081815260200182805461131c906146ef565b80156113695780601f1061133e57610100808354040283529160200191611369565b820191906000526020600020905b81548152906001019060200180831161134c57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d99061421f565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050919050565b6114626125b4565b73ffffffffffffffffffffffffffffffffffffffff166114806114e2565b73ffffffffffffffffffffffffffffffffffffffff16146114d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cd9061429f565b60405180910390fd5b6114e06000612d48565b565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6115146125b4565b73ffffffffffffffffffffffffffffffffffffffff166115326114e2565b73ffffffffffffffffffffffffffffffffffffffff1614611588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157f9061429f565b60405180910390fd5b8060108190555050565b6060600280546115a1906146ef565b80601f01602080910402602001604051908101604052809291908181526020018280546115cd906146ef565b801561161a5780601f106115ef5761010080835404028352916020019161161a565b820191906000526020600020905b8154815290600101906020018083116115fd57829003601f168201915b5050505050905090565b61162c6125b4565b73ffffffffffffffffffffffffffffffffffffffff1661164a6114e2565b73ffffffffffffffffffffffffffffffffffffffff16146116a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116979061429f565b60405180910390fd5b8181905084849050146116e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116df906141df565b60405180910390fd5b6000806116f3610e08565b905060005b8686905081101561173b5786868281811061171657611715614859565b5b90506020020135836117289190614524565b92508061173490614752565b90506116f8565b50601154828261174b9190614524565b111561178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117839061427f565b60405180910390fd5b6000915060005b848490508110156117f9576117e88585838181106117b4576117b3614859565b5b90506020020160208101906117c99190613824565b8888848181106117dc576117db614859565b5b90506020020135612e0e565b806117f290614752565b9050611793565b5060009050505050505050565b60105481565b6000601054905060006001600f546118249190614524565b836014546118329190614524565b10801561187f5750600e54601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054105b90508015611be957601360009054906101000a900460ff166118d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cd9061411f565b60405180910390fd5b601154836118e2610e08565b6118ec9190614524565b111561192d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119249061413f565b60405180910390fd5b600d54831115611972576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119699061439f565b60405180910390fd5b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600e546119bf9190614605565b8310611adb5781601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600e54611a139190614605565b611a1d91906145ab565b8284611a2991906145ab565b611a339190614605565b341015611a75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6c9061423f565b60405180910390fd5b600e54601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e5460146000828254611acf9190614524565b92505081905550611be4565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600e54611b289190614605565b831015611be3576000341015611b73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6a9061423f565b60405180910390fd5b82601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bc29190614524565b925050819055508260146000828254611bdb9190614524565b925050819055505b5b611d23565b601360009054906101000a900460ff16611c38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2f9061411f565b60405180910390fd5b8183611c4491906145ab565b341015611c86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7d9061423f565b60405180910390fd5b60115483611c92610e08565b611c9c9190614524565b1115611cdd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd49061413f565b60405180910390fd5b600d54831115611d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d199061439f565b60405180910390fd5b5b611d2d3384612e0e565b505050565b611d3a6125b4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611da8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9f906142df565b60405180910390fd5b8060066000611db56125b4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611e626125b4565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611ea791906140c2565b60405180910390a35050565b611ebb6125b4565b73ffffffffffffffffffffffffffffffffffffffff16611ed96114e2565b73ffffffffffffffffffffffffffffffffffffffff1614611f2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f269061429f565b60405180910390fd5b6001600c60006101000a81548160ff021916908315150217905550565b6000600e54905090565b611f6184848461266e565b611f6d84848484612e2c565b611fac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa39061433f565b60405180910390fd5b50505050565b600a8054611fbf906146ef565b80601f0160208091040260200160405190810160405280929190818152602001828054611feb906146ef565b80156120385780601f1061200d57610100808354040283529160200191612038565b820191906000526020600020905b81548152906001019060200180831161201b57829003601f168201915b505050505081565b600e5481565b6060612051826125a7565b612090576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612087906142bf565b60405180910390fd5b60001515600c60009054906101000a900460ff161515141561213e57600b80546120b9906146ef565b80601f01602080910402602001604051908101604052809291908181526020018280546120e5906146ef565b80156121325780601f1061210757610100808354040283529160200191612132565b820191906000526020600020905b81548152906001019060200180831161211557829003601f168201915b5050505050905061219a565b6000612148612fc3565b905060008151116121685760405180602001604052806000815250612196565b8061217284613055565b600a60405160200161218693929190614015565b6040516020818303038152906040525b9150505b919050565b601360009054906101000a900460ff1681565b60115481565b6121c06125b4565b73ffffffffffffffffffffffffffffffffffffffff166121de6114e2565b73ffffffffffffffffffffffffffffffffffffffff1614612234576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222b9061429f565b60405180910390fd5b80600a908051906020019061224a929190613552565b5050565b60145481565b61225c6125b4565b73ffffffffffffffffffffffffffffffffffffffff1661227a6114e2565b73ffffffffffffffffffffffffffffffffffffffff16146122d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c79061429f565b60405180910390fd5b80600e8190555050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6123766125b4565b73ffffffffffffffffffffffffffffffffffffffff166123946114e2565b73ffffffffffffffffffffffffffffffffffffffff16146123ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123e19061429f565b60405180910390fd5b80600b9080519060200190612400929190613552565b5050565b61240c6125b4565b73ffffffffffffffffffffffffffffffffffffffff1661242a6114e2565b73ffffffffffffffffffffffffffffffffffffffff1614612480576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124779061429f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156124f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124e79061415f565b60405180910390fd5b6124f981612d48565b50565b60156020528060005260406000206000915090505481565b600d5481565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000805482109050919050565b600033905090565b826005600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b600061267982612bae565b90506000816000015173ffffffffffffffffffffffffffffffffffffffff166126a06125b4565b73ffffffffffffffffffffffffffffffffffffffff1614806126fc57506126c56125b4565b73ffffffffffffffffffffffffffffffffffffffff166126e484610bdc565b73ffffffffffffffffffffffffffffffffffffffff16145b80612718575061271782600001516127126125b4565b6122da565b5b90508061275a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612751906142ff565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff16146127cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c39061425f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561283c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612833906141bf565b60405180910390fd5b61284985858560016131b6565b61285960008484600001516125bc565b6001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506001600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836003600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426003600085815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000600184019050600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612b3e57612a9d816125a7565b15612b3d5782600001516003600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082602001516003600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b5b50828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612ba785858560016131bc565b5050505050565b612bb66135d8565b612bbf826125a7565b612bfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bf59061417f565b60405180910390fd5b60008290505b60008110612d07576000600360008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614612cf8578092505050612d43565b50808060019003915050612c04565b506040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d3a906143df565b60405180910390fd5b919050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612e288282604051806020016040528060008152506131c2565b5050565b6000612e4d8473ffffffffffffffffffffffffffffffffffffffff1661251a565b15612fb6578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612e766125b4565b8786866040518563ffffffff1660e01b8152600401612e989493929190614076565b602060405180830381600087803b158015612eb257600080fd5b505af1925050508015612ee357506040513d601f19601f82011682018060405250810190612ee09190613a95565b60015b612f66573d8060008114612f13576040519150601f19603f3d011682016040523d82523d6000602084013e612f18565b606091505b50600081511415612f5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f559061433f565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612fbb565b600190505b949350505050565b606060098054612fd2906146ef565b80601f0160208091040260200160405190810160405280929190818152602001828054612ffe906146ef565b801561304b5780601f106130205761010080835404028352916020019161304b565b820191906000526020600020905b81548152906001019060200180831161302e57829003601f168201915b5050505050905090565b6060600082141561309d576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506131b1565b600082905060005b600082146130cf5780806130b890614752565b915050600a826130c8919061457a565b91506130a5565b60008167ffffffffffffffff8111156130eb576130ea614888565b5b6040519080825280601f01601f19166020018201604052801561311d5781602001600182028036833780820191505090505b5090505b600085146131aa576001826131369190614605565b9150600a85613145919061479b565b60306131519190614524565b60f81b81838151811061316757613166614859565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856131a3919061457a565b9450613121565b8093505050505b919050565b50505050565b50505050565b6131cf83838360016131d4565b505050565b600080549050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561324a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132419061435f565b60405180910390fd5b600084141561328e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132859061437f565b60405180910390fd5b61329b60008683876131b6565b83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555083600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160108282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550846003600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426003600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550600081905060005b8581101561353557818773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a48315613520576134e06000888488612e2c565b61351f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135169061433f565b60405180910390fd5b5b81806001019250508080600101915050613469565b50806000819055505061354b60008683876131bc565b5050505050565b82805461355e906146ef565b90600052602060002090601f01602090048101928261358057600085556135c7565b82601f1061359957805160ff19168380011785556135c7565b828001600101855582156135c7579182015b828111156135c65782518255916020019190600101906135ab565b5b5090506135d49190613612565b5090565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681525090565b5b8082111561362b576000816000905550600101613613565b5090565b600061364261363d8461445f565b61443a565b90508281526020810184848401111561365e5761365d6148c6565b5b6136698482856146ad565b509392505050565b600061368461367f84614490565b61443a565b9050828152602081018484840111156136a05761369f6148c6565b5b6136ab8482856146ad565b509392505050565b6000813590506136c281614f96565b92915050565b60008083601f8401126136de576136dd6148bc565b5b8235905067ffffffffffffffff8111156136fb576136fa6148b7565b5b602083019150836020820283011115613717576137166148c1565b5b9250929050565b60008083601f840112613734576137336148bc565b5b8235905067ffffffffffffffff811115613751576137506148b7565b5b60208301915083602082028301111561376d5761376c6148c1565b5b9250929050565b60008135905061378381614fad565b92915050565b60008135905061379881614fc4565b92915050565b6000815190506137ad81614fc4565b92915050565b600082601f8301126137c8576137c76148bc565b5b81356137d884826020860161362f565b91505092915050565b600082601f8301126137f6576137f56148bc565b5b8135613806848260208601613671565b91505092915050565b60008135905061381e81614fdb565b92915050565b60006020828403121561383a576138396148d0565b5b6000613848848285016136b3565b91505092915050565b60008060408385031215613868576138676148d0565b5b6000613876858286016136b3565b9250506020613887858286016136b3565b9150509250929050565b6000806000606084860312156138aa576138a96148d0565b5b60006138b8868287016136b3565b93505060206138c9868287016136b3565b92505060406138da8682870161380f565b9150509250925092565b600080600080608085870312156138fe576138fd6148d0565b5b600061390c878288016136b3565b945050602061391d878288016136b3565b935050604061392e8782880161380f565b925050606085013567ffffffffffffffff81111561394f5761394e6148cb565b5b61395b878288016137b3565b91505092959194509250565b6000806040838503121561397e5761397d6148d0565b5b600061398c858286016136b3565b925050602061399d85828601613774565b9150509250929050565b600080604083850312156139be576139bd6148d0565b5b60006139cc858286016136b3565b92505060206139dd8582860161380f565b9150509250929050565b60008060008060408587031215613a0157613a006148d0565b5b600085013567ffffffffffffffff811115613a1f57613a1e6148cb565b5b613a2b8782880161371e565b9450945050602085013567ffffffffffffffff811115613a4e57613a4d6148cb565b5b613a5a878288016136c8565b925092505092959194509250565b600060208284031215613a7e57613a7d6148d0565b5b6000613a8c84828501613789565b91505092915050565b600060208284031215613aab57613aaa6148d0565b5b6000613ab98482850161379e565b91505092915050565b600060208284031215613ad857613ad76148d0565b5b600082013567ffffffffffffffff811115613af657613af56148cb565b5b613b02848285016137e1565b91505092915050565b600060208284031215613b2157613b206148d0565b5b6000613b2f8482850161380f565b91505092915050565b613b4181614639565b82525050565b613b508161464b565b82525050565b6000613b61826144d6565b613b6b81856144ec565b9350613b7b8185602086016146bc565b613b84816148d5565b840191505092915050565b6000613b9a826144e1565b613ba48185614508565b9350613bb48185602086016146bc565b613bbd816148d5565b840191505092915050565b6000613bd3826144e1565b613bdd8185614519565b9350613bed8185602086016146bc565b80840191505092915050565b60008154613c06816146ef565b613c108186614519565b94506001821660008114613c2b5760018114613c3c57613c6f565b60ff19831686528186019350613c6f565b613c45856144c1565b60005b83811015613c6757815481890152600182019150602081019050613c48565b838801955050505b50505092915050565b6000613c85602283614508565b9150613c90826148e6565b604082019050919050565b6000613ca8601483614508565b9150613cb382614935565b602082019050919050565b6000613ccb600783614508565b9150613cd68261495e565b602082019050919050565b6000613cee602683614508565b9150613cf982614987565b604082019050919050565b6000613d11602a83614508565b9150613d1c826149d6565b604082019050919050565b6000613d34602383614508565b9150613d3f82614a25565b604082019050919050565b6000613d57602583614508565b9150613d6282614a74565b604082019050919050565b6000613d7a602183614508565b9150613d8582614ac3565b604082019050919050565b6000613d9d603983614508565b9150613da882614b12565b604082019050919050565b6000613dc0602b83614508565b9150613dcb82614b61565b604082019050919050565b6000613de3602083614508565b9150613dee82614bb0565b602082019050919050565b6000613e06602683614508565b9150613e1182614bd9565b604082019050919050565b6000613e29600883614508565b9150613e3482614c28565b602082019050919050565b6000613e4c602083614508565b9150613e5782614c51565b602082019050919050565b6000613e6f602f83614508565b9150613e7a82614c7a565b604082019050919050565b6000613e92601a83614508565b9150613e9d82614cc9565b602082019050919050565b6000613eb5603283614508565b9150613ec082614cf2565b604082019050919050565b6000613ed8602283614508565b9150613ee382614d41565b604082019050919050565b6000613efb6000836144fd565b9150613f0682614d90565b600082019050919050565b6000613f1e603383614508565b9150613f2982614d93565b604082019050919050565b6000613f41602183614508565b9150613f4c82614de2565b604082019050919050565b6000613f64602883614508565b9150613f6f82614e31565b604082019050919050565b6000613f87601383614508565b9150613f9282614e80565b602082019050919050565b6000613faa602e83614508565b9150613fb582614ea9565b604082019050919050565b6000613fcd602f83614508565b9150613fd882614ef8565b604082019050919050565b6000613ff0602d83614508565b9150613ffb82614f47565b604082019050919050565b61400f816146a3565b82525050565b60006140218286613bc8565b915061402d8285613bc8565b91506140398284613bf9565b9150819050949350505050565b600061405182613eee565b9150819050919050565b60006020820190506140706000830184613b38565b92915050565b600060808201905061408b6000830187613b38565b6140986020830186613b38565b6140a56040830185614006565b81810360608301526140b78184613b56565b905095945050505050565b60006020820190506140d76000830184613b47565b92915050565b600060208201905081810360008301526140f78184613b8f565b905092915050565b6000602082019050818103600083015261411881613c78565b9050919050565b6000602082019050818103600083015261413881613c9b565b9050919050565b6000602082019050818103600083015261415881613cbe565b9050919050565b6000602082019050818103600083015261417881613ce1565b9050919050565b6000602082019050818103600083015261419881613d04565b9050919050565b600060208201905081810360008301526141b881613d27565b9050919050565b600060208201905081810360008301526141d881613d4a565b9050919050565b600060208201905081810360008301526141f881613d6d565b9050919050565b6000602082019050818103600083015261421881613d90565b9050919050565b6000602082019050818103600083015261423881613db3565b9050919050565b6000602082019050818103600083015261425881613dd6565b9050919050565b6000602082019050818103600083015261427881613df9565b9050919050565b6000602082019050818103600083015261429881613e1c565b9050919050565b600060208201905081810360008301526142b881613e3f565b9050919050565b600060208201905081810360008301526142d881613e62565b9050919050565b600060208201905081810360008301526142f881613e85565b9050919050565b6000602082019050818103600083015261431881613ea8565b9050919050565b6000602082019050818103600083015261433881613ecb565b9050919050565b6000602082019050818103600083015261435881613f11565b9050919050565b6000602082019050818103600083015261437881613f34565b9050919050565b6000602082019050818103600083015261439881613f57565b9050919050565b600060208201905081810360008301526143b881613f7a565b9050919050565b600060208201905081810360008301526143d881613f9d565b9050919050565b600060208201905081810360008301526143f881613fc0565b9050919050565b6000602082019050818103600083015261441881613fe3565b9050919050565b60006020820190506144346000830184614006565b92915050565b6000614444614455565b90506144508282614721565b919050565b6000604051905090565b600067ffffffffffffffff82111561447a57614479614888565b5b614483826148d5565b9050602081019050919050565b600067ffffffffffffffff8211156144ab576144aa614888565b5b6144b4826148d5565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061452f826146a3565b915061453a836146a3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561456f5761456e6147cc565b5b828201905092915050565b6000614585826146a3565b9150614590836146a3565b9250826145a05761459f6147fb565b5b828204905092915050565b60006145b6826146a3565b91506145c1836146a3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156145fa576145f96147cc565b5b828202905092915050565b6000614610826146a3565b915061461b836146a3565b92508282101561462e5761462d6147cc565b5b828203905092915050565b600061464482614683565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156146da5780820151818401526020810190506146bf565b838111156146e9576000848401525b50505050565b6000600282049050600182168061470757607f821691505b6020821081141561471b5761471a61482a565b5b50919050565b61472a826148d5565b810181811067ffffffffffffffff8211171561474957614748614888565b5b80604052505050565b600061475d826146a3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156147905761478f6147cc565b5b600182019050919050565b60006147a6826146a3565b91506147b1836146a3565b9250826147c1576147c06147fb565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f455243373231413a206f776e657220696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b7f4d696e74206973206e6f74206c69766520796574000000000000000000000000600082015250565b7f4e6f206d6f726500000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f455243373231413a206f776e657220717565727920666f72206e6f6e6578697360008201527f74656e7420746f6b656e00000000000000000000000000000000000000000000602082015250565b7f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f7560008201527f6e64730000000000000000000000000000000000000000000000000000000000602082015250565b7f455243373231413a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f50726f76696465207175616e74697469657320616e6420726563697069656e7460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f76656420666f7220616c6c00000000000000602082015250565b7f455243373231413a2062616c616e636520717565727920666f7220746865207a60008201527f65726f2061646472657373000000000000000000000000000000000000000000602082015250565b7f506c656173652073656e64207468652065786163742045544820616d6f756e74600082015250565b7f455243373231413a207472616e736665722066726f6d20696e636f727265637460008201527f206f776e65720000000000000000000000000000000000000000000000000000602082015250565b7f546f6f206d616e79000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f455243373231413a20617070726f766520746f2063616c6c6572000000000000600082015250565b7f455243373231413a207472616e736665722063616c6c6572206973206e6f742060008201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000602082015250565b7f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b50565b7f455243373231413a207472616e7366657220746f206e6f6e204552433732315260008201527f6563656976657220696d706c656d656e74657200000000000000000000000000602082015250565b7f455243373231413a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f455243373231413a207175616e74697479206d7573742062652067726561746560008201527f72207468616e2030000000000000000000000000000000000000000000000000602082015250565b7f4d61782070657220545820726561636865642e00000000000000000000000000600082015250565b7f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060008201527f6f776e657220627920696e646578000000000000000000000000000000000000602082015250565b7f455243373231413a20756e61626c6520746f2064657465726d696e652074686560008201527f206f776e6572206f6620746f6b656e0000000000000000000000000000000000602082015250565b7f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560008201527f78697374656e7420746f6b656e00000000000000000000000000000000000000602082015250565b614f9f81614639565b8114614faa57600080fd5b50565b614fb68161464b565b8114614fc157600080fd5b50565b614fcd81614657565b8114614fd857600080fd5b50565b614fe4816146a3565b8114614fef57600080fd5b5056fea2646970667358221220ff360d292f94ad024adeceeea4822008d2dae02bde10ab037b8500798543b56564736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
RarePepePunks.sol 1506 lines
/**
*Submitted for verification at Etherscan.io on 2022-07-08
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @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);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v4.5.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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// 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);
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// 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);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @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 be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: ERC721A.sol
// Creator: Chiru Labs
pragma solidity ^0.8.0;
/**
* @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..).
*
* Does not support burning tokens to address(0).
*
* Assumes that an owner cannot have more than the 2**128 - 1 (max value of uint128) of supply
*/
contract ERC721A 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 internal currentIndex;
// 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) internal _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;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @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(), 'ERC721A: global index out of bounds');
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(totalSupply). 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), 'ERC721A: owner index out of bounds');
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx;
address currOwnershipAddr;
// Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
unchecked {
for (uint256 i; 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('ERC721A: 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), 'ERC721A: balance query for the zero address');
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
require(owner != address(0), 'ERC721A: number minted query for the zero address');
return uint256(_addressData[owner].numberMinted);
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
require(_exists(tokenId), 'ERC721A: owner query for nonexistent token');
unchecked {
for (uint256 curr = tokenId; curr >= 0; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
}
revert('ERC721A: 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 = ERC721A.ownerOf(tokenId);
require(to != owner, 'ERC721A: approval to current owner');
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
'ERC721A: 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), 'ERC721A: approved query for nonexistent token');
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), 'ERC721A: 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),
'ERC721A: 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 Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
_mint(to, quantity, _data, true);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _mint(
address to,
uint256 quantity,
bytes memory _data,
bool safe
) internal {
uint256 startTokenId = currentIndex;
require(to != address(0), 'ERC721A: mint to the zero address');
require(quantity != 0, 'ERC721A: quantity must be greater than 0');
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
// updatedIndex overflows if currentIndex + quantity > 1.56e77 (2**256) - 1
unchecked {
_addressData[to].balance += uint128(quantity);
_addressData[to].numberMinted += uint128(quantity);
_ownerships[startTokenId].addr = to;
_ownerships[startTokenId].startTimestamp = uint64(block.timestamp);
uint256 updatedIndex = startTokenId;
for (uint256 i; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
if (safe) {
require(
_checkOnERC721Received(address(0), to, updatedIndex, _data),
'ERC721A: 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, 'ERC721A: transfer caller is not owner nor approved');
require(prevOwnership.addr == from, 'ERC721A: transfer from incorrect owner');
require(to != address(0), 'ERC721A: transfer to the zero address');
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
unchecked {
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId].addr = to;
_ownerships[tokenId].startTimestamp = 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].addr = prevOwnership.addr;
_ownerships[nextTokenId].startTimestamp = 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);
}
/**
* @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('ERC721A: 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 {}
}
// File: MutantAIYachtClub.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// Ownable.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
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 make 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;
}
}
//newerc.sol
pragma solidity ^0.8.0;
contract RarePepePunks is ERC721A, Ownable, Pausable, ReentrancyGuard {
using Strings for uint256;
string public baseURI;
string public baseExtension = "";
string public notRevealedUri;
bool public revealed = true;
uint public maxPerTx = 100;
uint public maxPerFree = 2;
uint public totalFree = 2000;
uint256 public price = 0.0055 ether;
uint256 public maxSupply = 10000;
uint256 public maxperAddressPublicMint = 100;
bool public mintEnabled = true;
uint public totalFreeMinted = 0;
mapping(address => uint256) public _mintedFreeAmount;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri
)
ERC721A(_name, _symbol) {
_safeMint(msg.sender, 100);
setBaseURI(_initBaseURI);
setNotRevealedURI(_initNotRevealedUri);
}
function mint(uint256 count) external payable {
uint256 cost = price;
bool isFree = ((totalFreeMinted + count < totalFree + 1) &&
(_mintedFreeAmount[msg.sender] < maxPerFree));
if (isFree) {
require(mintEnabled, "Mint is not live yet");
require(totalSupply() + count <= maxSupply, "No more");
require(count <= maxPerTx, "Max per TX reached.");
if(count >= (maxPerFree - _mintedFreeAmount[msg.sender]))
{
require(msg.value >= (count * cost) - ((maxPerFree - _mintedFreeAmount[msg.sender]) * cost), "Please send the exact ETH amount");
_mintedFreeAmount[msg.sender] = maxPerFree;
totalFreeMinted += maxPerFree;
}
else if(count < (maxPerFree - _mintedFreeAmount[msg.sender]))
{
require(msg.value >= 0, "Please send the exact ETH amount");
_mintedFreeAmount[msg.sender] += count;
totalFreeMinted += count;
}
}
else{
require(mintEnabled, "Mint is not live yet");
require(msg.value >= count * cost, "Please send the exact ETH amount");
require(totalSupply() + count <= maxSupply, "No more");
require(count <= maxPerTx, "Max per TX reached.");
}
_safeMint(msg.sender, count);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function setMaxTotalFree(uint256 MaxTotalFree_) external onlyOwner {
totalFree = MaxTotalFree_;
}
function maxFreePerWallet() public view returns (uint256) {
return maxPerFree;
}
function setMaxPerFree(uint256 MaxPerFree_) external onlyOwner {
maxPerFree = MaxPerFree_;
}
function gift(uint256[] calldata quantity, address[] calldata recipient)
external
onlyOwner
{
require(
quantity.length == recipient.length,
"Provide quantities and recipients"
);
uint256 totalQuantity = 0;
uint256 s = totalSupply();
for (uint256 i = 0; i < quantity.length; ++i) {
totalQuantity += quantity[i];
}
require(s + totalQuantity <= maxSupply, "Too many");
delete totalQuantity;
for (uint256 i = 0; i < recipient.length; ++i) {
_safeMint(recipient[i], quantity[i]);
}
delete s;
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
if(revealed == false) {
return notRevealedUri;
}
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
: "";
}
function reveal() public onlyOwner() {
revealed = true;
}
function setPrice(uint256 price_) external onlyOwner {
price = price_;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function withdraw() public payable onlyOwner {
(bool success, ) = payable(msg.sender).call{
value: address(this).balance
}("");
require(success);
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
baseExtension = _newBaseExtension;
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
notRevealedUri = _notRevealedURI;
}
}
Read Contract
_mintedFreeAmount 0xf4db2acb → uint256
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
baseURI 0x6c0360eb → string
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxFreePerWallet 0xa7027357 → uint256
maxPerFree 0xc7c39ffc → uint256
maxPerTx 0xf968adbe → uint256
maxSupply 0xd5abeb01 → uint256
maxperAddressPublicMint 0x34c8fd75 → uint256
mintEnabled 0xd1239730 → bool
name 0x06fdde03 → string
notRevealedUri 0x081c8c44 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
price 0xa035b1fe → uint256
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalFree 0x333e44e6 → uint256
totalFreeMinted 0xdad7b5c9 → uint256
totalSupply 0x18160ddd → uint256
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
gift 0x96ea3a47
uint256[] quantity
address[] recipient
mint 0xa0712d68
uint256 count
renounceOwnership 0x715018a6
No parameters
reveal 0xa475b5dd
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseExtension 0xda3ef23f
string _newBaseExtension
setBaseURI 0x55f804b3
string _newBaseURI
setMaxPerFree 0xe945971c
uint256 MaxPerFree_
setMaxTotalFree 0x5a963f1b
uint256 MaxTotalFree_
setNotRevealedURI 0xf2c4ce1e
string _notRevealedURI
setPrice 0x91b7f5ed
uint256 price_
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address