Address Contract Partially Verified
Address
0x9F1bF310F74C9674bb3cEb538FCdb7F8dfbA3f0d
Balance
0.080000 ETH ($169.73)
Nonce
1
Code Size
15152 bytes
Creator
0x68BAa5c0...E5f5 at tx 0xef2df145...5d87ec
Indexed Transactions
0 (1 on-chain, 0.8% indexed)
Contract Bytecode
15152 bytes
0x6080604052600436106101c25760003560e01c806370a08231116100f7578063a22cb46511610095578063d1cbf17d11610064578063d1cbf17d1461060d578063d5abeb0114610638578063e985e9c514610663578063f2fde38b146106a0576101c2565b8063a22cb46514610553578063a475b5dd1461057c578063b88d4fde146105a7578063c87b56dd146105d0576101c2565b8063819b25ba116100d1578063819b25ba146104b85780638da5cb5b146104e157806395d89b411461050c578063a0712d6814610537576101c2565b806370a0823114610439578063715018a61461047657806371adc02a1461048d576101c2565b80633a467e3d11610164578063518302271161013e578063518302271461037d57806355f804b3146103a85780636352211e146103d15780636817c76c1461040e576101c2565b80633a467e3d146103125780633ccfd60b1461033d57806342842e0e14610354576101c2565b8063095ea7b3116101a0578063095ea7b31461026c57806318160ddd1461029557806323b872dd146102c05780632d46d6ff146102e9576101c2565b806301ffc9a7146101c757806306fdde0314610204578063081812fc1461022f575b600080fd5b3480156101d357600080fd5b506101ee60048036038101906101e991906127ff565b6106c9565b6040516101fb9190612dc6565b60405180910390f35b34801561021057600080fd5b506102196107ab565b6040516102269190612de1565b60405180910390f35b34801561023b57600080fd5b50610256600480360381019061025191906128d3565b61083d565b6040516102639190612d5f565b60405180910390f35b34801561027857600080fd5b50610293600480360381019061028e91906127bf565b6108c2565b005b3480156102a157600080fd5b506102aa6109da565b6040516102b791906130a3565b60405180910390f35b3480156102cc57600080fd5b506102e760048036038101906102e291906126a9565b6109eb565b005b3480156102f557600080fd5b50610310600480360381019061030b91906128a6565b610a4b565b005b34801561031e57600080fd5b50610327610ad5565b60405161033491906130a3565b60405180910390f35b34801561034957600080fd5b50610352610adb565b005b34801561036057600080fd5b5061037b600480360381019061037691906126a9565b610bea565b005b34801561038957600080fd5b50610392610c0a565b60405161039f9190612dc6565b60405180910390f35b3480156103b457600080fd5b506103cf60048036038101906103ca9190612859565b610c1d565b005b3480156103dd57600080fd5b506103f860048036038101906103f391906128d3565b610caf565b6040516104059190612d5f565b60405180910390f35b34801561041a57600080fd5b50610423610d61565b60405161043091906130a3565b60405180910390f35b34801561044557600080fd5b50610460600480360381019061045b919061263c565b610d67565b60405161046d91906130a3565b60405180910390f35b34801561048257600080fd5b5061048b610e1f565b005b34801561049957600080fd5b506104a2610ea7565b6040516104af9190612dc6565b60405180910390f35b3480156104c457600080fd5b506104df60048036038101906104da91906128d3565b610eba565b005b3480156104ed57600080fd5b506104f6610f43565b6040516105039190612d5f565b60405180910390f35b34801561051857600080fd5b50610521610f6c565b60405161052e9190612de1565b60405180910390f35b610551600480360381019061054c91906128d3565b610ffe565b005b34801561055f57600080fd5b5061057a6004803603810190610575919061277f565b611157565b005b34801561058857600080fd5b506105916112d8565b60405161059e9190612dc6565b60405180910390f35b3480156105b357600080fd5b506105ce60048036038101906105c991906126fc565b611395565b005b3480156105dc57600080fd5b506105f760048036038101906105f291906128d3565b6113f7565b6040516106049190612de1565b60405180910390f35b34801561061957600080fd5b50610622611531565b60405161062f9190612dc6565b60405180910390f35b34801561064457600080fd5b5061064d6115ee565b60405161065a91906130a3565b60405180910390f35b34801561066f57600080fd5b5061068a60048036038101906106859190612669565b6115f4565b6040516106979190612dc6565b60405180910390f35b3480156106ac57600080fd5b506106c760048036038101906106c2919061263c565b611688565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061079457507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806107a457506107a382611780565b5b9050919050565b6060600180546107ba90613345565b80601f01602080910402602001604051908101604052809291908181526020018280546107e690613345565b80156108335780601f1061080857610100808354040283529160200191610833565b820191906000526020600020905b81548152906001019060200180831161081657829003601f168201915b5050505050905090565b6000610848826117ea565b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087e90612fc3565b60405180910390fd5b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006108cd82610caf565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561093e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093590613063565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661095d611856565b73ffffffffffffffffffffffffffffffffffffffff16148061098c575061098b81610986611856565b6115f4565b5b6109cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c290612f03565b60405180910390fd5b6109d5838361185e565b505050565b60006109e66007611917565b905090565b6109fc6109f6611856565b82611925565b610a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3290613083565b60405180910390fd5b610a46838383611a03565b505050565b610a53611856565b73ffffffffffffffffffffffffffffffffffffffff16610a71610f43565b73ffffffffffffffffffffffffffffffffffffffff1614610ac7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abe90612fe3565b60405180910390fd5b8061ffff16600a8190555050565b600a5481565b610ae3611856565b73ffffffffffffffffffffffffffffffffffffffff16610b01610f43565b73ffffffffffffffffffffffffffffffffffffffff1614610b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4e90612fe3565b60405180910390fd5b60004711610b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9190613043565b60405180910390fd5b610ba2610f43565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610be7573d6000803e3d6000fd5b50565b610c0583838360405180602001604052806000815250611395565b505050565b600d60019054906101000a900460ff1681565b610c25611856565b73ffffffffffffffffffffffffffffffffffffffff16610c43610f43565b73ffffffffffffffffffffffffffffffffffffffff1614610c99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9090612fe3565b60405180910390fd5b8181600c9190610caa929190612455565b505050565b6000806003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4f90612f43565b60405180910390fd5b80915050919050565b60085481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcf90612f23565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e27611856565b73ffffffffffffffffffffffffffffffffffffffff16610e45610f43565b73ffffffffffffffffffffffffffffffffffffffff1614610e9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9290612fe3565b60405180910390fd5b610ea56000611c5f565b565b600d60009054906101000a900460ff1681565b610ec2611856565b73ffffffffffffffffffffffffffffffffffffffff16610ee0610f43565b73ffffffffffffffffffffffffffffffffffffffff1614610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d90612fe3565b60405180910390fd5b610f403382611d23565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060028054610f7b90613345565b80601f0160208091040260200160405190810160405280929190818152602001828054610fa790613345565b8015610ff45780601f10610fc957610100808354040283529160200191610ff4565b820191906000526020600020905b815481529060010190602001808311610fd757829003601f168201915b5050505050905090565b600d60009054906101000a900460ff1661104d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104490612ec3565b60405180910390fd5b60095461105a6007611917565b111561109b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109290612f63565b60405180910390fd5b600b548111156110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d790612e03565b60405180910390fd5b600a546110ed6007611917565b1061114a5761110781600854611dce90919063ffffffff16565b341015611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612fa3565b60405180910390fd5b5b6111543382611d23565b50565b61115f611856565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c490612ea3565b60405180910390fd5b80600660006111da611856565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611287611856565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516112cc9190612dc6565b60405180910390a35050565b60006112e2611856565b73ffffffffffffffffffffffffffffffffffffffff16611300610f43565b73ffffffffffffffffffffffffffffffffffffffff1614611356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134d90612fe3565b60405180910390fd5b600d60019054906101000a900460ff1615600d60016101000a81548160ff021916908315150217905550600d60019054906101000a900460ff16905090565b6113a66113a0611856565b83611925565b6113e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dc90613083565b60405180910390fd5b6113f184848484611de4565b50505050565b6060611402826117ea565b611441576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143890613023565b60405180910390fd5b60001515600d60019054906101000a900460ff16151514156114ef57600f805461146a90613345565b80601f016020809104026020016040519081016040528092919081815260200182805461149690613345565b80156114e35780601f106114b8576101008083540402835291602001916114e3565b820191906000526020600020905b8154815290600101906020018083116114c657829003601f168201915b5050505050905061152c565b60006114f9611e40565b90508061150584611ed2565b600e60405160200161151993929190612d2e565b6040516020818303038152906040529150505b919050565b600061153b611856565b73ffffffffffffffffffffffffffffffffffffffff16611559610f43565b73ffffffffffffffffffffffffffffffffffffffff16146115af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a690612fe3565b60405180910390fd5b600d60009054906101000a900460ff1615600d60006101000a81548160ff021916908315150217905550600d60009054906101000a900460ff16905090565b60095481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611690611856565b73ffffffffffffffffffffffffffffffffffffffff166116ae610f43565b73ffffffffffffffffffffffffffffffffffffffff1614611704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fb90612fe3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176b90612e43565b60405180910390fd5b61177d81611c5f565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166118d183610caf565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081600001549050919050565b6000611930826117ea565b61196f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196690612ee3565b60405180910390fd5b600061197a83610caf565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806119e957508373ffffffffffffffffffffffffffffffffffffffff166119d18461083d565b73ffffffffffffffffffffffffffffffffffffffff16145b806119fa57506119f981856115f4565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611a2382610caf565b73ffffffffffffffffffffffffffffffffffffffff1614611a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7090613003565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae090612e83565b60405180910390fd5b611af4838383612033565b611aff60008261185e565b6001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611b4f919061324d565b925050819055506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ba6919061316c565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611d2f6007611917565b9050600954611d47838361203890919063ffffffff16565b1115611d88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7f90612f63565b60405180910390fd5b60005b82811015611dc8578180611d9e906133a8565b925050611dab848361204e565b611db5600761206c565b8080611dc0906133a8565b915050611d8b565b50505050565b60008183611ddc91906131f3565b905092915050565b611def848484611a03565b611dfb84848484612082565b611e3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3190612e23565b60405180910390fd5b50505050565b6060600c8054611e4f90613345565b80601f0160208091040260200160405190810160405280929190818152602001828054611e7b90613345565b8015611ec85780601f10611e9d57610100808354040283529160200191611ec8565b820191906000526020600020905b815481529060010190602001808311611eab57829003601f168201915b5050505050905090565b60606000821415611f1a576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061202e565b600082905060005b60008214611f4c578080611f35906133a8565b915050600a82611f4591906131c2565b9150611f22565b60008167ffffffffffffffff811115611f6857611f676134de565b5b6040519080825280601f01601f191660200182016040528015611f9a5781602001600182028036833780820191505090505b5090505b6000851461202757600182611fb3919061324d565b9150600a85611fc291906133f1565b6030611fce919061316c565b60f81b818381518110611fe457611fe36134af565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561202091906131c2565b9450611f9e565b8093505050505b919050565b505050565b60008183612046919061316c565b905092915050565b612068828260405180602001604052806000815250612219565b5050565b6001816000016000828254019250508190555050565b60006120a38473ffffffffffffffffffffffffffffffffffffffff16612274565b1561220c578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026120cc611856565b8786866040518563ffffffff1660e01b81526004016120ee9493929190612d7a565b602060405180830381600087803b15801561210857600080fd5b505af192505050801561213957506040513d601f19601f82011682018060405250810190612136919061282c565b60015b6121bc573d8060008114612169576040519150601f19603f3d011682016040523d82523d6000602084013e61216e565b606091505b506000815114156121b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ab90612e23565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612211565b600190505b949350505050565b6122238383612287565b6122306000848484612082565b61226f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226690612e23565b60405180910390fd5b505050565b600080823b905060008111915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156122f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ee90612f83565b60405180910390fd5b612300816117ea565b15612340576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161233790612e63565b60405180910390fd5b61234c60008383612033565b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461239c919061316c565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b82805461246190613345565b90600052602060002090601f01602090048101928261248357600085556124ca565b82601f1061249c57803560ff19168380011785556124ca565b828001600101855582156124ca579182015b828111156124c95782358255916020019190600101906124ae565b5b5090506124d791906124db565b5090565b5b808211156124f45760008160009055506001016124dc565b5090565b600061250b612506846130e3565b6130be565b9050828152602081018484840111156125275761252661351c565b5b612532848285613303565b509392505050565b60008135905061254981613a87565b92915050565b60008135905061255e81613a9e565b92915050565b60008135905061257381613ab5565b92915050565b60008151905061258881613ab5565b92915050565b600082601f8301126125a3576125a2613512565b5b81356125b38482602086016124f8565b91505092915050565b60008083601f8401126125d2576125d1613512565b5b8235905067ffffffffffffffff8111156125ef576125ee61350d565b5b60208301915083600182028301111561260b5761260a613517565b5b9250929050565b60008135905061262181613acc565b92915050565b60008135905061263681613ae3565b92915050565b60006020828403121561265257612651613526565b5b60006126608482850161253a565b91505092915050565b600080604083850312156126805761267f613526565b5b600061268e8582860161253a565b925050602061269f8582860161253a565b9150509250929050565b6000806000606084860312156126c2576126c1613526565b5b60006126d08682870161253a565b93505060206126e18682870161253a565b92505060406126f286828701612627565b9150509250925092565b6000806000806080858703121561271657612715613526565b5b60006127248782880161253a565b94505060206127358782880161253a565b935050604061274687828801612627565b925050606085013567ffffffffffffffff81111561276757612766613521565b5b6127738782880161258e565b91505092959194509250565b6000806040838503121561279657612795613526565b5b60006127a48582860161253a565b92505060206127b58582860161254f565b9150509250929050565b600080604083850312156127d6576127d5613526565b5b60006127e48582860161253a565b92505060206127f585828601612627565b9150509250929050565b60006020828403121561281557612814613526565b5b600061282384828501612564565b91505092915050565b60006020828403121561284257612841613526565b5b600061285084828501612579565b91505092915050565b600080602083850312156128705761286f613526565b5b600083013567ffffffffffffffff81111561288e5761288d613521565b5b61289a858286016125bc565b92509250509250929050565b6000602082840312156128bc576128bb613526565b5b60006128ca84828501612612565b91505092915050565b6000602082840312156128e9576128e8613526565b5b60006128f784828501612627565b91505092915050565b61290981613281565b82525050565b61291881613293565b82525050565b600061292982613129565b612933818561313f565b9350612943818560208601613312565b61294c8161352b565b840191505092915050565b600061296282613134565b61296c8185613150565b935061297c818560208601613312565b6129858161352b565b840191505092915050565b600061299b82613134565b6129a58185613161565b93506129b5818560208601613312565b80840191505092915050565b600081546129ce81613345565b6129d88186613161565b945060018216600081146129f35760018114612a0457612a37565b60ff19831686528186019350612a37565b612a0d85613114565b60005b83811015612a2f57815481890152600182019150602081019050612a10565b838801955050505b50505092915050565b6000612a4d602383613150565b9150612a588261353c565b604082019050919050565b6000612a70603283613150565b9150612a7b8261358b565b604082019050919050565b6000612a93602683613150565b9150612a9e826135da565b604082019050919050565b6000612ab6601c83613150565b9150612ac182613629565b602082019050919050565b6000612ad9602483613150565b9150612ae482613652565b604082019050919050565b6000612afc601983613150565b9150612b07826136a1565b602082019050919050565b6000612b1f601283613150565b9150612b2a826136ca565b602082019050919050565b6000612b42602c83613150565b9150612b4d826136f3565b604082019050919050565b6000612b65603883613150565b9150612b7082613742565b604082019050919050565b6000612b88602a83613150565b9150612b9382613791565b604082019050919050565b6000612bab602983613150565b9150612bb6826137e0565b604082019050919050565b6000612bce601683613150565b9150612bd98261382f565b602082019050919050565b6000612bf1602083613150565b9150612bfc82613858565b602082019050919050565b6000612c14601483613150565b9150612c1f82613881565b602082019050919050565b6000612c37602c83613150565b9150612c42826138aa565b604082019050919050565b6000612c5a602083613150565b9150612c65826138f9565b602082019050919050565b6000612c7d602983613150565b9150612c8882613922565b604082019050919050565b6000612ca0602f83613150565b9150612cab82613971565b604082019050919050565b6000612cc3601683613150565b9150612cce826139c0565b602082019050919050565b6000612ce6602183613150565b9150612cf1826139e9565b604082019050919050565b6000612d09603183613150565b9150612d1482613a38565b604082019050919050565b612d28816132f9565b82525050565b6000612d3a8286612990565b9150612d468285612990565b9150612d5282846129c1565b9150819050949350505050565b6000602082019050612d746000830184612900565b92915050565b6000608082019050612d8f6000830187612900565b612d9c6020830186612900565b612da96040830185612d1f565b8181036060830152612dbb818461291e565b905095945050505050565b6000602082019050612ddb600083018461290f565b92915050565b60006020820190508181036000830152612dfb8184612957565b905092915050565b60006020820190508181036000830152612e1c81612a40565b9050919050565b60006020820190508181036000830152612e3c81612a63565b9050919050565b60006020820190508181036000830152612e5c81612a86565b9050919050565b60006020820190508181036000830152612e7c81612aa9565b9050919050565b60006020820190508181036000830152612e9c81612acc565b9050919050565b60006020820190508181036000830152612ebc81612aef565b9050919050565b60006020820190508181036000830152612edc81612b12565b9050919050565b60006020820190508181036000830152612efc81612b35565b9050919050565b60006020820190508181036000830152612f1c81612b58565b9050919050565b60006020820190508181036000830152612f3c81612b7b565b9050919050565b60006020820190508181036000830152612f5c81612b9e565b9050919050565b60006020820190508181036000830152612f7c81612bc1565b9050919050565b60006020820190508181036000830152612f9c81612be4565b9050919050565b60006020820190508181036000830152612fbc81612c07565b9050919050565b60006020820190508181036000830152612fdc81612c2a565b9050919050565b60006020820190508181036000830152612ffc81612c4d565b9050919050565b6000602082019050818103600083015261301c81612c70565b9050919050565b6000602082019050818103600083015261303c81612c93565b9050919050565b6000602082019050818103600083015261305c81612cb6565b9050919050565b6000602082019050818103600083015261307c81612cd9565b9050919050565b6000602082019050818103600083015261309c81612cfc565b9050919050565b60006020820190506130b86000830184612d1f565b92915050565b60006130c86130d9565b90506130d48282613377565b919050565b6000604051905090565b600067ffffffffffffffff8211156130fe576130fd6134de565b5b6131078261352b565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000613177826132f9565b9150613182836132f9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131b7576131b6613422565b5b828201905092915050565b60006131cd826132f9565b91506131d8836132f9565b9250826131e8576131e7613451565b5b828204905092915050565b60006131fe826132f9565b9150613209836132f9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324257613241613422565b5b828202905092915050565b6000613258826132f9565b9150613263836132f9565b92508282101561327657613275613422565b5b828203905092915050565b600061328c826132d9565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015613330578082015181840152602081019050613315565b8381111561333f576000848401525b50505050565b6000600282049050600182168061335d57607f821691505b6020821081141561337157613370613480565b5b50919050565b6133808261352b565b810181811067ffffffffffffffff8211171561339f5761339e6134de565b5b80604052505050565b60006133b3826132f9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133e6576133e5613422565b5b600182019050919050565b60006133fc826132f9565b9150613407836132f9565b92508261341757613416613451565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f546f6f206d616e7920746f6b656e7320666f72206f6e65207472616e7361637460008201527f696f6e0000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f53616c65206973206e6f74206163746976650000000000000000000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4e6f7420656e6f75676820746f6b656e73206c65667400000000000000000000600082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f496e73756666696369656e74207061796d656e74000000000000000000000000600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4e6f2062616c616e636520746f20776974686472617700000000000000000000600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b613a9081613281565b8114613a9b57600080fd5b50565b613aa781613293565b8114613ab257600080fd5b50565b613abe8161329f565b8114613ac957600080fd5b50565b613ad5816132cb565b8114613ae057600080fd5b50565b613aec816132f9565b8114613af757600080fd5b5056fea26469706673582212208990326d053436849e7b1607bae8485baa3f53d2f6b5a4e7902a46d83c6ab5a164736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
LarvaDoodles.sol 1369 lines
/**
*Submitted for verification at Etherscan.io on 2022-01-03
*/
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/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`, 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 Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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 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);
/**
* @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;
}
// File: @openzeppelin/contracts/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/utils/Strings.sol
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/Address.sol
pragma solidity ^0.8.0;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 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/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: @openzeppelin/contracts/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 `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/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;
}
}
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// 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 Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @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 ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @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 virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: 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 virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @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.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: 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`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* 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
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), 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.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_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;
contract LarvaDoodles is Ownable, ERC721 {
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
uint256 public mintPrice = .016 ether;
uint256 public maxSupply = 3333;
uint256 public freeMintAmount =1000;
uint256 private mintLimit = 10;
string private baseURI = "ipfs://QmaR3mSaWu86pcZ1bbcFdanga5DhkL9JZaPLrPze1ouHCC/";
bool public publicSaleState = true;
bool public revealed = true;
string private base_URI_tail = ".json";
string private hiddenURI = "";
constructor() ERC721("Larva Doodles", "LDOODLE") {
}
function _hiddenURI() internal view returns (string memory) {
return hiddenURI;
}
function _baseURI() internal view override returns (string memory) {
return baseURI;
}
function setBaseURI(string calldata newBaseURI) external onlyOwner {
baseURI = newBaseURI;
}
function tokenURI(uint256 _tokenId) public view override returns (string memory) {
require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token");
if(revealed == false) {
return hiddenURI;
}
string memory currentBaseURI = _baseURI();
return string(abi.encodePacked(currentBaseURI, Strings.toString(_tokenId), base_URI_tail));
}
function reveal() public onlyOwner returns(bool) {
revealed = !revealed;
return revealed;
}
function changeStatePublicSale() public onlyOwner returns(bool) {
publicSaleState = !publicSaleState;
return publicSaleState;
}
function mint(uint numberOfTokens) external payable {
require(publicSaleState, "Sale is not active");
require(_tokenIdCounter.current() <= maxSupply, "Not enough tokens left");
require(numberOfTokens <= mintLimit, "Too many tokens for one transaction");
if(_tokenIdCounter.current() >= freeMintAmount){
require(msg.value >= mintPrice.mul(numberOfTokens), "Insufficient payment");
}
mintInternal(msg.sender, numberOfTokens);
}
function mintInternal(address wallet, uint amount) internal {
uint currentTokenSupply = _tokenIdCounter.current();
require(currentTokenSupply.add(amount) <= maxSupply, "Not enough tokens left");
for(uint i = 0; i< amount; i++){
currentTokenSupply++;
_safeMint(wallet, currentTokenSupply);
_tokenIdCounter.increment();
}
}
function reserve(uint256 numberOfTokens) external onlyOwner {
mintInternal(msg.sender, numberOfTokens);
}
function setfreeAmount(uint16 _newFreeMints) public onlyOwner() {
freeMintAmount = _newFreeMints;
}
function totalSupply() public view returns (uint){
return _tokenIdCounter.current();
}
function withdraw() public onlyOwner {
require(address(this).balance > 0, "No balance to withdraw");
payable(owner()).transfer(address(this).balance);
}
}
Read Contract
balanceOf 0x70a08231 → uint256
freeMintAmount 0x3a467e3d → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxSupply 0xd5abeb01 → uint256
mintPrice 0x6817c76c → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
publicSaleState 0x71adc02a → bool
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
changeStatePublicSale 0xd1cbf17d
No parameters
returns: bool
mint 0xa0712d68
uint256 numberOfTokens
renounceOwnership 0x715018a6
No parameters
reserve 0x819b25ba
uint256 numberOfTokens
reveal 0xa475b5dd
No parameters
returns: bool
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 newBaseURI
setfreeAmount 0x2d46d6ff
uint16 _newFreeMints
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
This address has 1 on-chain transactions, but only 0.8% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →