Address Contract Verified
Address
0x7E0b5148048Ff5af376F29d3FD1011a7Ff72e4d6
Balance
0.222200 ETH
Nonce
1
Code Size
23421 bytes
Creator
0x420fDa2C...55dA at tx 0x07d18f38...7abd7e
Indexed Transactions
0
Contract Bytecode
23421 bytes
0x6080604052600436106101f85760003560e01c80638da5cb5b1161010d578063b84c8246116100a0578063e8a3d4851161006f578063e8a3d485146106b7578063e985e9c5146106e2578063f242432a1461071f578063f2fde38b14610748578063fe9d4dcb14610771576101f8565b8063b84c824614610613578063c47f00271461063c578063c66ab9e114610665578063e7559b1e1461068e576101f8565b806395d89b41116100dc57806395d89b4114610578578063a035b1fe146105a3578063a22cb465146105ce578063af3830c3146105f7576101f8565b80638da5cb5b146104d0578063905cc216146104fb57806391b7f5ed1461052657806393a35def1461054f576101f8565b80633ccfd60b116101905780635c975abb1161015f5780635c975abb146104215780635d51de081461044c57806368794cb014610477578063715018a6146104a25780638456cb59146104b9576101f8565b80633ccfd60b1461038d5780633f4ba83a146103a457806342966c68146103bb5780634e1273f4146103e4576101f8565b806318160ddd116101cc57806318160ddd146102df5780632a55205a1461030a5780632db11544146103485780632eb2c2d614610364576101f8565b8062fdd58e146101fd57806301ffc9a71461023a57806306fdde03146102775780630e89341c146102a2575b600080fd5b34801561020957600080fd5b50610224600480360381019061021f9190613668565b61079c565b60405161023191906136b7565b60405180910390f35b34801561024657600080fd5b50610261600480360381019061025c919061372a565b610865565b60405161026e9190613772565b60405180910390f35b34801561028357600080fd5b5061028c610877565b6040516102999190613826565b60405180910390f35b3480156102ae57600080fd5b506102c960048036038101906102c49190613848565b610905565b6040516102d69190613826565b60405180910390f35b3480156102eb57600080fd5b506102f4610999565b60405161030191906136b7565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190613875565b61099f565b60405161033f9291906138c4565b60405180910390f35b610362600480360381019061035d9190613848565b610a5f565b005b34801561037057600080fd5b5061038b60048036038101906103869190613aea565b610c30565b005b34801561039957600080fd5b506103a2610cd1565b005b3480156103b057600080fd5b506103b9610d96565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190613848565b610e1c565b005b3480156103f057600080fd5b5061040b60048036038101906104069190613c7c565b610e73565b6040516104189190613db2565b60405180910390f35b34801561042d57600080fd5b50610436610f8c565b6040516104439190613772565b60405180910390f35b34801561045857600080fd5b50610461610fa3565b60405161046e91906136b7565b60405180910390f35b34801561048357600080fd5b5061048c610fa9565b60405161049991906136b7565b60405180910390f35b3480156104ae57600080fd5b506104b7610fc7565b005b3480156104c557600080fd5b506104ce61104f565b005b3480156104dc57600080fd5b506104e56110d5565b6040516104f29190613dd4565b60405180910390f35b34801561050757600080fd5b506105106110ff565b60405161051d91906136b7565b60405180910390f35b34801561053257600080fd5b5061054d60048036038101906105489190613848565b61111c565b005b34801561055b57600080fd5b5061057660048036038101906105719190613848565b6111a2565b005b34801561058457600080fd5b5061058d611228565b60405161059a9190613826565b60405180910390f35b3480156105af57600080fd5b506105b86112b6565b6040516105c591906136b7565b60405180910390f35b3480156105da57600080fd5b506105f560048036038101906105f09190613e1b565b6112bc565b005b610611600480360381019061060c9190613e5b565b6112d2565b005b34801561061f57600080fd5b5061063a60048036038101906106359190613f58565b6114ec565b005b34801561064857600080fd5b50610663600480360381019061065e9190613f58565b611582565b005b34801561067157600080fd5b5061068c60048036038101906106879190613fa1565b611618565b005b34801561069a57600080fd5b506106b560048036038101906106b09190614019565b611845565b005b3480156106c357600080fd5b506106cc6119b7565b6040516106d99190613826565b60405180910390f35b3480156106ee57600080fd5b5061070960048036038101906107049190614059565b6119d7565b6040516107169190613772565b60405180910390f35b34801561072b57600080fd5b5061074660048036038101906107419190614099565b611a6b565b005b34801561075457600080fd5b5061076f600480360381019061076a9190614130565b611b0c565b005b34801561077d57600080fd5b50610786611c04565b60405161079391906136b7565b60405180910390f35b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561080d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610804906141cf565b60405180910390fd5b60008083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600061087082611c21565b9050919050565b600680546108849061421e565b80601f01602080910402602001604051908101604052809291908181526020018280546108b09061421e565b80156108fd5780601f106108d2576101008083540402835291602001916108fd565b820191906000526020600020905b8154815290600101906020018083116108e057829003601f168201915b505050505081565b6060600280546109149061421e565b80601f01602080910402602001604051908101604052809291908181526020018280546109409061421e565b801561098d5780601f106109625761010080835404028352916020019161098d565b820191906000526020600020905b81548152906001019060200180831161097057829003601f168201915b50505050509050919050565b61045781565b600080600060046040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900462ffffff1662ffffff1662ffffff1681525050905080600001519250612710816020015162ffffff1685610a4b919061427f565b610a559190614308565b9150509250929050565b610a67610f8c565b15610aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9e90614385565b60405180910390fd5b6000610ab1610fa9565b11610af1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae890614417565b60405180910390fd5b600081610afc610fa9565b610b069190614437565b1015610b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3e906144dd565b60405180910390fd5b600954811115610b8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b83906145bb565b60405180910390fd5b80600854610b9a919061427f565b3414610bdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd290614699565b60405180910390fd5b60005b81811015610c2c576000610bf0611c9b565b9050610bfc600c611cb9565b610c183382600160405180602001604052806000815250611ccf565b508080610c24906146b9565b915050610bde565b5050565b610c38611e65565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610c7e5750610c7d85610c78611e65565b6119d7565b5b610cbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb490614774565b60405180910390fd5b610cca8585858585611e6d565b5050505050565b610cd9611e65565b73ffffffffffffffffffffffffffffffffffffffff16610cf76110d5565b73ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d44906147e0565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610d93573d6000803e3d6000fd5b50565b610d9e611e65565b73ffffffffffffffffffffffffffffffffffffffff16610dbc6110d5565b73ffffffffffffffffffffffffffffffffffffffff1614610e12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e09906147e0565b60405180910390fd5b610e1a612181565b565b610e24610f8c565b15610e64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5b90614385565b60405180910390fd5b610e7033826001612223565b50565b60608151835114610eb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb090614872565b60405180910390fd5b6000835167ffffffffffffffff811115610ed657610ed56138f2565b5b604051908082528060200260200182016040528015610f045781602001602082028036833780820191505090505b50905060005b8451811015610f8157610f51858281518110610f2957610f28614892565b5b6020026020010151858381518110610f4457610f43614892565b5b602002602001015161079c565b828281518110610f6457610f63614892565b5b60200260200101818152505080610f7a906146b9565b9050610f0a565b508091505092915050565b6000600560009054906101000a900460ff16905090565b60095481565b6000610fb5600c612440565b61029b610fc29190614437565b905090565b610fcf611e65565b73ffffffffffffffffffffffffffffffffffffffff16610fed6110d5565b73ffffffffffffffffffffffffffffffffffffffff1614611043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103a906147e0565b60405180910390fd5b61104d600061244e565b565b611057611e65565b73ffffffffffffffffffffffffffffffffffffffff166110756110d5565b73ffffffffffffffffffffffffffffffffffffffff16146110cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c2906147e0565b60405180910390fd5b6110d3612514565b565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061110b600a612440565b606f6111179190614437565b905090565b611124611e65565b73ffffffffffffffffffffffffffffffffffffffff166111426110d5565b73ffffffffffffffffffffffffffffffffffffffff1614611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f906147e0565b60405180910390fd5b8060088190555050565b6111aa611e65565b73ffffffffffffffffffffffffffffffffffffffff166111c86110d5565b73ffffffffffffffffffffffffffffffffffffffff161461121e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611215906147e0565b60405180910390fd5b8060098190555050565b600780546112359061421e565b80601f01602080910402602001604051908101604052809291908181526020018280546112619061421e565b80156112ae5780601f10611283576101008083540402835291602001916112ae565b820191906000526020600020905b81548152906001019060200180831161129157829003601f168201915b505050505081565b60085481565b6112ce6112c7611e65565b83836125b7565b5050565b6112da610f8c565b1561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190614385565b60405180910390fd5b61132381612724565b611362576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135990614959565b60405180910390fd5b600061136c611c04565b116113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a3906149eb565b60405180910390fd5b6000826113b7611c04565b6113c19190614437565b1015611402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f990614a7d565b60405180910390fd5b600954821115611447576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143e906145bb565b60405180910390fd5b81600854611455919061427f565b3414611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614699565b60405180910390fd5b60005b828110156114e75760006114ab6127b4565b90506114b7600b611cb9565b6114d33382600160405180602001604052806000815250611ccf565b5080806114df906146b9565b915050611499565b505050565b6114f4611e65565b73ffffffffffffffffffffffffffffffffffffffff166115126110d5565b73ffffffffffffffffffffffffffffffffffffffff1614611568576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155f906147e0565b60405180910390fd5b806007908051906020019061157e92919061351d565b5050565b61158a611e65565b73ffffffffffffffffffffffffffffffffffffffff166115a86110d5565b73ffffffffffffffffffffffffffffffffffffffff16146115fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f5906147e0565b60405180910390fd5b806006908051906020019061161492919061351d565b5050565b611620610f8c565b15611660576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165790614385565b60405180910390fd5b61166a82826127d1565b6116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a090614b0f565b60405180910390fd5b60005b82518110156118405760008382815181106116ca576116c9614892565b5b602002602001015190506116dd81612872565b61171c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171390614ba1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600d600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b590614c33565b60405180910390fd5b33600d600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061182c3382600160405180602001604052806000815250611ccf565b508080611838906146b9565b9150506116ac565b505050565b61184d611e65565b73ffffffffffffffffffffffffffffffffffffffff1661186b6110d5565b73ffffffffffffffffffffffffffffffffffffffff16146118c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b8906147e0565b60405180910390fd5b60006118cb6110ff565b1161190b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190290614cc5565b60405180910390fd5b6000826119166110ff565b6119209190614437565b1015611961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195890614d57565b60405180910390fd5b60005b828110156119b257600061197661288c565b9050611982600a611cb9565b61199e8382600160405180602001604052806000815250611ccf565b5080806119aa906146b9565b915050611964565b505050565b6060604051806060016040528060358152602001615b1360359139905090565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611a73611e65565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480611ab95750611ab885611ab3611e65565b6119d7565b5b611af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aef90614de9565b60405180910390fd5b611b0585858585856128a9565b5050505050565b611b14611e65565b73ffffffffffffffffffffffffffffffffffffffff16611b326110d5565b73ffffffffffffffffffffffffffffffffffffffff1614611b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7f906147e0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611bf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bef90614e7b565b60405180910390fd5b611c018161244e565b50565b6000611c10600b612440565b60de611c1c9190614437565b905090565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611c945750611c9382612b2b565b5b9050919050565b6000611ca7600c612440565b6101bd611cb49190614e9b565b905090565b6001816000016000828254019250508190555050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3690614f63565b60405180910390fd5b6000611d49611e65565b9050611d6a81600087611d5b88612c0d565b611d6488612c0d565b87612c87565b8260008086815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611dc99190614e9b565b925050819055508473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628787604051611e47929190614f83565b60405180910390a4611e5e81600087878787612c8f565b5050505050565b600033905090565b8151835114611eb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea89061501e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611f21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f18906150b0565b60405180910390fd5b6000611f2b611e65565b9050611f3b818787878787612c87565b60005b84518110156120ec576000858281518110611f5c57611f5b614892565b5b602002602001015190506000858381518110611f7b57611f7a614892565b5b60200260200101519050600080600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561201c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201390615142565b60405180910390fd5b81810360008085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160008085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546120d19190614e9b565b92505081905550505050806120e5906146b9565b9050611f3e565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612163929190615162565b60405180910390a4612179818787878787612e67565b505050505050565b612189610f8c565b6121c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bf906151e5565b60405180910390fd5b6000600560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61220c611e65565b6040516122199190613dd4565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612293576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228a90615277565b60405180910390fd5b600061229d611e65565b90506122cd818560006122af87612c0d565b6122b887612c0d565b60405180602001604052806000815250612c87565b600080600085815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015612364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235b90615309565b60405180910390fd5b82810360008086815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628787604051612431929190614f83565b60405180910390a45050505050565b600081600001549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61251c610f8c565b1561255c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255390614385565b60405180910390fd5b6001600560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125a0611e65565b6040516125ad9190613dd4565b60405180910390a1565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612626576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261d9061539b565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127179190613772565b60405180910390a3505050565b600080612758333060405160200161273d929190615403565b6040516020818303038152906040528051906020012061303f565b90506000612766828561306f565b905073348c2ffb9ba0431bc40118bbbeb968a6d112221273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161492505050919050565b60006127c0600b612440565b60df6127cc9190614e9b565b905090565b6000806127dd84613096565b905060006128148233306040516020016127f993929190615450565b6040516020818303038152906040528051906020012061303f565b90506000612822828661306f565b905073348c2ffb9ba0431bc40118bbbeb968a6d112221273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614935050505092915050565b600060708210158015612885575060df82105b9050919050565b6000612898600a612440565b60016128a49190614e9b565b905090565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612910906150b0565b60405180910390fd5b6000612923611e65565b905061294381878761293488612c0d565b61293d88612c0d565b87612c87565b600080600086815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050838110156129da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129d190615142565b60405180910390fd5b83810360008087815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508360008087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612a8f9190614e9b565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628888604051612b0c929190614f83565b60405180910390a4612b22828888888888612c8f565b50505050505050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612bf657507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612c065750612c05826130ed565b5b9050919050565b60606000600167ffffffffffffffff811115612c2c57612c2b6138f2565b5b604051908082528060200260200182016040528015612c5a5781602001602082028036833780820191505090505b5090508281600081518110612c7257612c71614892565b5b60200260200101818152505080915050919050565b505050505050565b612cae8473ffffffffffffffffffffffffffffffffffffffff16613157565b15612e5f578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b8152600401612cf49594939291906154e2565b6020604051808303816000875af1925050508015612d3057506040513d601f19601f82011682018060405250810190612d2d9190615551565b60015b612dd657612d3c61558b565b806308c379a01415612d995750612d516155ad565b80612d5c5750612d9b565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d909190613826565b60405180910390fd5b505b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dcd906156b5565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612e5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e5490615747565b60405180910390fd5b505b505050505050565b612e868473ffffffffffffffffffffffffffffffffffffffff16613157565b15613037578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b8152600401612ecc959493929190615767565b6020604051808303816000875af1925050508015612f0857506040513d601f19601f82011682018060405250810190612f059190615551565b60015b612fae57612f1461558b565b806308c379a01415612f715750612f296155ad565b80612f345750612f73565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f689190613826565b60405180910390fd5b505b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fa5906156b5565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614613035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161302c90615747565b60405180910390fd5b505b505050505050565b6000816040516020016130529190615851565b604051602081830303815290604052805190602001209050919050565b600080600061307e858561316a565b9150915061308b816131ed565b819250505092915050565b60008060008091505b83518210156130e3578382815181106130bb576130ba614892565b5b6020026020010151816130ce9190614e9b565b905081806130db906146b9565b92505061309f565b8092505050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600080823b905060008111915050919050565b6000806041835114156131ac5760008060006020860151925060408601519150606086015160001a90506131a0878285856133c2565b945094505050506131e6565b6040835114156131dd5760008060208501519150604085015190506131d28683836134cf565b9350935050506131e6565b60006002915091505b9250929050565b6000600481111561320157613200615877565b5b81600481111561321457613213615877565b5b141561321f576133bf565b6001600481111561323357613232615877565b5b81600481111561324657613245615877565b5b1415613287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161327e906158f2565b60405180910390fd5b6002600481111561329b5761329a615877565b5b8160048111156132ae576132ad615877565b5b14156132ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132e69061595e565b60405180910390fd5b6003600481111561330357613302615877565b5b81600481111561331657613315615877565b5b1415613357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161334e906159f0565b60405180910390fd5b60048081111561336a57613369615877565b5b81600481111561337d5761337c615877565b5b14156133be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133b590615a82565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c11156133fd5760006003915091506134c6565b601b8560ff16141580156134155750601c8560ff1614155b156134275760006004915091506134c6565b60006001878787876040516000815260200160405260405161344c9493929190615acd565b6020604051602081039080840390855afa15801561346e573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156134bd576000600192509250506134c6565b80600092509250505b94509492505050565b6000806000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85169150601b8560ff1c01905061350f878288856133c2565b935093505050935093915050565b8280546135299061421e565b90600052602060002090601f01602090048101928261354b5760008555613592565b82601f1061356457805160ff1916838001178555613592565b82800160010185558215613592579182015b82811115613591578251825591602001919060010190613576565b5b50905061359f91906135a3565b5090565b5b808211156135bc5760008160009055506001016135a4565b5090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006135ff826135d4565b9050919050565b61360f816135f4565b811461361a57600080fd5b50565b60008135905061362c81613606565b92915050565b6000819050919050565b61364581613632565b811461365057600080fd5b50565b6000813590506136628161363c565b92915050565b6000806040838503121561367f5761367e6135ca565b5b600061368d8582860161361d565b925050602061369e85828601613653565b9150509250929050565b6136b181613632565b82525050565b60006020820190506136cc60008301846136a8565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613707816136d2565b811461371257600080fd5b50565b600081359050613724816136fe565b92915050565b6000602082840312156137405761373f6135ca565b5b600061374e84828501613715565b91505092915050565b60008115159050919050565b61376c81613757565b82525050565b60006020820190506137876000830184613763565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156137c75780820151818401526020810190506137ac565b838111156137d6576000848401525b50505050565b6000601f19601f8301169050919050565b60006137f88261378d565b6138028185613798565b93506138128185602086016137a9565b61381b816137dc565b840191505092915050565b6000602082019050818103600083015261384081846137ed565b905092915050565b60006020828403121561385e5761385d6135ca565b5b600061386c84828501613653565b91505092915050565b6000806040838503121561388c5761388b6135ca565b5b600061389a85828601613653565b92505060206138ab85828601613653565b9150509250929050565b6138be816135f4565b82525050565b60006040820190506138d960008301856138b5565b6138e660208301846136a8565b9392505050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61392a826137dc565b810181811067ffffffffffffffff82111715613949576139486138f2565b5b80604052505050565b600061395c6135c0565b90506139688282613921565b919050565b600067ffffffffffffffff821115613988576139876138f2565b5b602082029050602081019050919050565b600080fd5b60006139b16139ac8461396d565b613952565b905080838252602082019050602084028301858111156139d4576139d3613999565b5b835b818110156139fd57806139e98882613653565b8452602084019350506020810190506139d6565b5050509392505050565b600082601f830112613a1c57613a1b6138ed565b5b8135613a2c84826020860161399e565b91505092915050565b600080fd5b600067ffffffffffffffff821115613a5557613a546138f2565b5b613a5e826137dc565b9050602081019050919050565b82818337600083830152505050565b6000613a8d613a8884613a3a565b613952565b905082815260208101848484011115613aa957613aa8613a35565b5b613ab4848285613a6b565b509392505050565b600082601f830112613ad157613ad06138ed565b5b8135613ae1848260208601613a7a565b91505092915050565b600080600080600060a08688031215613b0657613b056135ca565b5b6000613b148882890161361d565b9550506020613b258882890161361d565b945050604086013567ffffffffffffffff811115613b4657613b456135cf565b5b613b5288828901613a07565b935050606086013567ffffffffffffffff811115613b7357613b726135cf565b5b613b7f88828901613a07565b925050608086013567ffffffffffffffff811115613ba057613b9f6135cf565b5b613bac88828901613abc565b9150509295509295909350565b600067ffffffffffffffff821115613bd457613bd36138f2565b5b602082029050602081019050919050565b6000613bf8613bf384613bb9565b613952565b90508083825260208201905060208402830185811115613c1b57613c1a613999565b5b835b81811015613c445780613c30888261361d565b845260208401935050602081019050613c1d565b5050509392505050565b600082601f830112613c6357613c626138ed565b5b8135613c73848260208601613be5565b91505092915050565b60008060408385031215613c9357613c926135ca565b5b600083013567ffffffffffffffff811115613cb157613cb06135cf565b5b613cbd85828601613c4e565b925050602083013567ffffffffffffffff811115613cde57613cdd6135cf565b5b613cea85828601613a07565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613d2981613632565b82525050565b6000613d3b8383613d20565b60208301905092915050565b6000602082019050919050565b6000613d5f82613cf4565b613d698185613cff565b9350613d7483613d10565b8060005b83811015613da5578151613d8c8882613d2f565b9750613d9783613d47565b925050600181019050613d78565b5085935050505092915050565b60006020820190508181036000830152613dcc8184613d54565b905092915050565b6000602082019050613de960008301846138b5565b92915050565b613df881613757565b8114613e0357600080fd5b50565b600081359050613e1581613def565b92915050565b60008060408385031215613e3257613e316135ca565b5b6000613e408582860161361d565b9250506020613e5185828601613e06565b9150509250929050565b60008060408385031215613e7257613e716135ca565b5b6000613e8085828601613653565b925050602083013567ffffffffffffffff811115613ea157613ea06135cf565b5b613ead85828601613abc565b9150509250929050565b600067ffffffffffffffff821115613ed257613ed16138f2565b5b613edb826137dc565b9050602081019050919050565b6000613efb613ef684613eb7565b613952565b905082815260208101848484011115613f1757613f16613a35565b5b613f22848285613a6b565b509392505050565b600082601f830112613f3f57613f3e6138ed565b5b8135613f4f848260208601613ee8565b91505092915050565b600060208284031215613f6e57613f6d6135ca565b5b600082013567ffffffffffffffff811115613f8c57613f8b6135cf565b5b613f9884828501613f2a565b91505092915050565b60008060408385031215613fb857613fb76135ca565b5b600083013567ffffffffffffffff811115613fd657613fd56135cf565b5b613fe285828601613a07565b925050602083013567ffffffffffffffff811115614003576140026135cf565b5b61400f85828601613abc565b9150509250929050565b600080604083850312156140305761402f6135ca565b5b600061403e85828601613653565b925050602061404f8582860161361d565b9150509250929050565b600080604083850312156140705761406f6135ca565b5b600061407e8582860161361d565b925050602061408f8582860161361d565b9150509250929050565b600080600080600060a086880312156140b5576140b46135ca565b5b60006140c38882890161361d565b95505060206140d48882890161361d565b94505060406140e588828901613653565b93505060606140f688828901613653565b925050608086013567ffffffffffffffff811115614117576141166135cf565b5b61412388828901613abc565b9150509295509295909350565b600060208284031215614146576141456135ca565b5b60006141548482850161361d565b91505092915050565b7f455243313135353a2062616c616e636520717565727920666f7220746865207a60008201527f65726f2061646472657373000000000000000000000000000000000000000000602082015250565b60006141b9602b83613798565b91506141c48261415d565b604082019050919050565b600060208201905081810360008301526141e8816141ac565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061423657607f821691505b6020821081141561424a576142496141ef565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061428a82613632565b915061429583613632565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156142ce576142cd614250565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061431382613632565b915061431e83613632565b92508261432e5761432d6142d9565b5b828204905092915050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b600061436f601083613798565b915061437a82614339565b602082019050919050565b6000602082019050818103600083015261439e81614362565b9050919050565b7f5055424c49435f53414c455f544f4b454e5f534f4c445f4f55543a206e6f206d60008201527f6f726520746f6b656e20617661696c61626c652c20736f7272792e0000000000602082015250565b6000614401603b83613798565b915061440c826143a5565b604082019050919050565b60006020820190508181036000830152614430816143f4565b9050919050565b600061444282613632565b915061444d83613632565b9250828210156144605761445f614250565b5b828203905092915050565b7f494e53554646494349454e545f5055424c49435f53414c455f544f4b454e5f4c60008201527f4546543a206e6f7420656e6f75676820746f6b656e206c656674000000000000602082015250565b60006144c7603a83613798565b91506144d28261446b565b604082019050919050565b600060208201905081810360008301526144f6816144ba565b9050919050565b7f544f4b454e5f5045525f5452414e53414354494f4e5f4c494d49545f4558434560008201527f454445443a20616d6f756e74206f6620746f6b656e206578636565647320746860208201527f65206d617820616d6f756e74206f6620746f6b656e7320706572207472616e7360408201527f616374696f6e206c696d69740000000000000000000000000000000000000000606082015250565b60006145a5606c83613798565b91506145b0826144fd565b608082019050919050565b600060208201905081810360008301526145d481614598565b9050919050565b7f494e434f52524543545f5041594d454e545f414d4f554e543a204f6f6f70732160008201527f20416e20696e636f7272656374207175616e74697479206f662045544820776160208201527f732073656e742120506c6561736520636865636b20746865207072696365206f60408201527f662074686973204e46542e203a29000000000000000000000000000000000000606082015250565b6000614683606e83613798565b915061468e826145db565b608082019050919050565b600060208201905081810360008301526146b281614676565b9050919050565b60006146c482613632565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156146f7576146f6614250565b5b600182019050919050565b7f455243313135353a207472616e736665722063616c6c6572206973206e6f742060008201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000602082015250565b600061475e603283613798565b915061476982614702565b604082019050919050565b6000602082019050818103600083015261478d81614751565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006147ca602083613798565b91506147d582614794565b602082019050919050565b600060208201905081810360008301526147f9816147bd565b9050919050565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b600061485c602983613798565b915061486782614800565b604082019050919050565b6000602082019050818103600083015261488b8161484f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f494e56414c49445f475245454e4c4953545f5349474e41545552453a2061726560008201527f20796f75207375726520796f7572206164647265737320697320677265656e6c60208201527f69737465643f0000000000000000000000000000000000000000000000000000604082015250565b6000614943604683613798565b915061494e826148c1565b606082019050919050565b6000602082019050818103600083015261497281614936565b9050919050565b7f475245454e4c4953545f544f4b454e5f534f4c445f4f55543a206e6f206d6f7260008201527f6520677265656e6c69737420746f6b656e206c6566742e000000000000000000602082015250565b60006149d5603783613798565b91506149e082614979565b604082019050919050565b60006020820190508181036000830152614a04816149c8565b9050919050565b7f494e53554646494349454e545f475245454e4c4953545f544f4b454e5f4c454660008201527f543a206e6f7420656e6f75676820746f6b656e206c6566740000000000000000602082015250565b6000614a67603883613798565b9150614a7282614a0b565b604082019050919050565b60006020820190508181036000830152614a9681614a5a565b9050919050565b7f494e56414c49445f504859474954414c5f5349474e41545552453a20706c656160008201527f736520636865636b206164647265737320616e6420746f6b656e496473000000602082015250565b6000614af9603d83613798565b9150614b0482614a9d565b604082019050919050565b60006020820190508181036000830152614b2881614aec565b9050919050565b7f494e56414c49445f544f4b454e5f49443a20696e76616c69642070687967697460008201527f616c20746f6b656e204944000000000000000000000000000000000000000000602082015250565b6000614b8b602b83613798565b9150614b9682614b2f565b604082019050919050565b60006020820190508181036000830152614bba81614b7e565b9050919050565b7f554e415641494c41424c455f544f4b454e3a2074686973204e4654206973206160008201527f6c7265616479206d696e7465642e000000000000000000000000000000000000602082015250565b6000614c1d602e83613798565b9150614c2882614bc1565b604082019050919050565b60006020820190508181036000830152614c4c81614c10565b9050919050565b7f464f554e4445525f544f4b454e5f534f4c445f4f55543a20546865726520697360008201527f206e6f206d6f726520666f756e64657220746f6b656e206c6566742e00000000602082015250565b6000614caf603c83613798565b9150614cba82614c53565b604082019050919050565b60006020820190508181036000830152614cde81614ca2565b9050919050565b7f494e53554646494349454e545f464f554e4445525f544f4b454e5f4c4546543a60008201527f204e6f7420656e6f75676820666f756e64657220746f6b656e206c6566740000602082015250565b6000614d41603e83613798565b9150614d4c82614ce5565b604082019050919050565b60006020820190508181036000830152614d7081614d34565b9050919050565b7f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260008201527f20617070726f7665640000000000000000000000000000000000000000000000602082015250565b6000614dd3602983613798565b9150614dde82614d77565b604082019050919050565b60006020820190508181036000830152614e0281614dc6565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614e65602683613798565b9150614e7082614e09565b604082019050919050565b60006020820190508181036000830152614e9481614e58565b9050919050565b6000614ea682613632565b9150614eb183613632565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614ee657614ee5614250565b5b828201905092915050565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000614f4d602183613798565b9150614f5882614ef1565b604082019050919050565b60006020820190508181036000830152614f7c81614f40565b9050919050565b6000604082019050614f9860008301856136a8565b614fa560208301846136a8565b9392505050565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b6000615008602883613798565b915061501382614fac565b604082019050919050565b6000602082019050818103600083015261503781614ffb565b9050919050565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061509a602583613798565b91506150a58261503e565b604082019050919050565b600060208201905081810360008301526150c98161508d565b9050919050565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b600061512c602a83613798565b9150615137826150d0565b604082019050919050565b6000602082019050818103600083015261515b8161511f565b9050919050565b6000604082019050818103600083015261517c8185613d54565b905081810360208301526151908184613d54565b90509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006151cf601483613798565b91506151da82615199565b602082019050919050565b600060208201905081810360008301526151fe816151c2565b9050919050565b7f455243313135353a206275726e2066726f6d20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000615261602383613798565b915061526c82615205565b604082019050919050565b6000602082019050818103600083015261529081615254565b9050919050565b7f455243313135353a206275726e20616d6f756e7420657863656564732062616c60008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b60006152f3602483613798565b91506152fe82615297565b604082019050919050565b60006020820190508181036000830152615322816152e6565b9050919050565b7f455243313135353a2073657474696e6720617070726f76616c2073746174757360008201527f20666f722073656c660000000000000000000000000000000000000000000000602082015250565b6000615385602983613798565b915061539082615329565b604082019050919050565b600060208201905081810360008301526153b481615378565b9050919050565b60008160601b9050919050565b60006153d3826153bb565b9050919050565b60006153e5826153c8565b9050919050565b6153fd6153f8826135f4565b6153da565b82525050565b600061540f82856153ec565b60148201915061541f82846153ec565b6014820191508190509392505050565b6000819050919050565b61544a61544582613632565b61542f565b82525050565b600061545c8286615439565b60208201915061546c82856153ec565b60148201915061547c82846153ec565b601482019150819050949350505050565b600081519050919050565b600082825260208201905092915050565b60006154b48261548d565b6154be8185615498565b93506154ce8185602086016137a9565b6154d7816137dc565b840191505092915050565b600060a0820190506154f760008301886138b5565b61550460208301876138b5565b61551160408301866136a8565b61551e60608301856136a8565b818103608083015261553081846154a9565b90509695505050505050565b60008151905061554b816136fe565b92915050565b600060208284031215615567576155666135ca565b5b60006155758482850161553c565b91505092915050565b60008160e01c9050919050565b600060033d11156155aa5760046000803e6155a760005161557e565b90505b90565b600060443d10156155bd57615640565b6155c56135c0565b60043d036004823e80513d602482011167ffffffffffffffff821117156155ed575050615640565b808201805167ffffffffffffffff81111561560b5750505050615640565b80602083010160043d038501811115615628575050505050615640565b61563782602001850186613921565b82955050505050505b90565b7f455243313135353a207472616e7366657220746f206e6f6e204552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b600061569f603483613798565b91506156aa82615643565b604082019050919050565b600060208201905081810360008301526156ce81615692565b9050919050565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b6000615731602883613798565b915061573c826156d5565b604082019050919050565b6000602082019050818103600083015261576081615724565b9050919050565b600060a08201905061577c60008301886138b5565b61578960208301876138b5565b818103604083015261579b8186613d54565b905081810360608301526157af8185613d54565b905081810360808301526157c381846154a9565b90509695505050505050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000615810601c836157cf565b915061581b826157da565b601c82019050919050565b6000819050919050565b6000819050919050565b61584b61584682615826565b615830565b82525050565b600061585c82615803565b9150615868828461583a565b60208201915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b60006158dc601883613798565b91506158e7826158a6565b602082019050919050565b6000602082019050818103600083015261590b816158cf565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b6000615948601f83613798565b915061595382615912565b602082019050919050565b600060208201905081810360008301526159778161593b565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006159da602283613798565b91506159e58261597e565b604082019050919050565b60006020820190508181036000830152615a09816159cd565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b6000615a6c602283613798565b9150615a7782615a10565b604082019050919050565b60006020820190508181036000830152615a9b81615a5f565b9050919050565b615aab81615826565b82525050565b600060ff82169050919050565b615ac781615ab1565b82525050565b6000608082019050615ae26000830187615aa2565b615aef6020830186615abe565b615afc6040830185615aa2565b615b096060830184615aa2565b9594505050505056fe697066733a2f2f516d57336d41435664476f6570525150346374744b594e5a52755037553863656d48707951773548753638375837a2646970667358221220c496248986e5f85a4095ee9f83d8787158df3a73aa8451ce8b6ced63f282ff6364736f6c634300080b0033
Verified Source Code Full Match
Compiler: v0.8.11+commit.d7f03943
EVM: london
Optimization: No
parallel.sol 299 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./ERC2981ContractWideRoyalties.sol";
/// @title ELYX Genesis Parallel collection smart contract
/// @author Dev by Arenzel (@arenzel_eth)
/// @notice Parallel collection, 1 111 declinations of Elyx (digital ambassador for the United Nations, see https://unric.org/en/elyx/)
contract Parallel is ERC1155, Ownable, ERC2981ContractWideRoyalties, Pausable {
/*** ----------------------- CONFIGS ----------------------- ***/
/// @notice Name + symbol + total supply, Token data to be displayed on etherscan
string public name = "ELYX | Genesis | Para11e1";
string public symbol = "LLLL";
/// @notice Max amount of token to be ever minted
/// @dev In lower case to be compliant with Etherscan...
uint public constant totalSupply = 1111;
/// @notice Token price for public sale
uint public price = 0.1111 ether;
/// @notice Max amount of tokens/transaction
uint public maxAmountPerTransaction = 5;
// @notice Artist wallet (ELYXyak.eth)
address private constant ELYXYAK_WALLET = 0xD31a8fbcA285eAa3B5BcD2f5973FC05296382640;
/// @notice Royalties: 10% for ELYXyak.eth (artist)
/// @dev Using 2 decimals notation: 10000 = 100, 0 = 0
uint private constant ELYXYAK_ROYALTIES = 1000;
/*** ----------------------- SUPPLY - GENERAL ----------------------- ***/
/// @notice Token supply for founders and pre-sales.
uint private constant FOUNDER_SUPPLY = 111; /// @notice For artists + devs + core team
uint private constant PRESALE_PHYGITAL_SUPPLY = 111; /// @notice For phygital collectors who bought the printed painting
uint private constant GREENLIST_SUPPLY = 222; /// @notice Registration through offline signatures
uint private constant PUBLIC_SALE_SUPPLY = 667; /// @notice For everyone at drop
/// @notice To calculate remaining supplies we need to know the first ID of each subset
uint private constant FIRST_FOUNDER_ID = 1;
uint private constant FIRST_PRESALE_PHYGITAL_ID = 112;
uint private constant FIRST_GREENLIST_ID = 223;
uint private constant FIRST_PUBLIC_SALE_ID = 445;
/// @notice Keeping track of subset of the total token supply
using Counters for Counters.Counter;
Counters.Counter private founderTokenCounter;
Counters.Counter private greenlistTokenCounter;
Counters.Counter private publicSaleTokenCounter;
/// @notice Remaining supplies functions
function founderTokenLeft() public view returns (uint) {
return FOUNDER_SUPPLY - founderTokenCounter.current();
}
function greenlistTokenLeft() public view returns (uint) {
return GREENLIST_SUPPLY - greenlistTokenCounter.current();
}
function publicSaleTokenLeft() public view returns (uint) {
return PUBLIC_SALE_SUPPLY - publicSaleTokenCounter.current();
}
/// @notice Next IDs functions
function nextFounderTokenId() private view returns (uint) {
return FIRST_FOUNDER_ID + founderTokenCounter.current();
}
function nextGreenlistTokenId() private view returns (uint) {
return FIRST_GREENLIST_ID + greenlistTokenCounter.current();
}
function nextPublicSaleTokenId() private view returns (uint) {
return FIRST_PUBLIC_SALE_ID + publicSaleTokenCounter.current();
}
/*** ----------------------- SUPPLY - PHYGITAL ----------------------- ***/
/// @dev Because the phygital collector tokens won't be minted in order,
/// we need to keep track of the already minted ones
mapping (uint => address) private phygitalTokenIds;
/// @notice Never trust user input: we ensure the user sends a tokenId that is inside the range of phygical tokens
/// @dev Return true if the tokenId is in range
function validPhygitalTokenId(uint _tokenId) private pure returns (bool) {
return _tokenId >= FIRST_PRESALE_PHYGITAL_ID && _tokenId < FIRST_GREENLIST_ID;
}
/*** ----------------------- CONSTRUCTOR ----------------------- ***/
constructor() ERC1155("ipfs://QmbMcxBEsVgwP3yZDijj7wUwiLJHbGbCXmFe8DotMnup4T/{id}.json") {
_setRoyalties(ELYXYAK_WALLET, ELYXYAK_ROYALTIES);
}
/*** ----------------------- MINT FUNCTIONS ----------------------- ***/
/// @notice This smart contract has 4 mint functions based on the 4 token subsets of the supply
/// @notice Mint function for founders.
function founderMint(uint _amount, address _to) external onlyOwner {
require(founderTokenLeft() > 0, "FOUNDER_TOKEN_SOLD_OUT: There is no more founder token left.");
require(founderTokenLeft() - _amount >= 0, "INSUFFICIENT_FOUNDER_TOKEN_LEFT: Not enough founder token left");
for (uint256 index = 0; index < _amount; index++) {
uint _tokenId = nextFounderTokenId();
founderTokenCounter.increment();
_mint(_to, _tokenId, 1, "");
}
}
/// @notice Mint function for phygital collector (physical painting + nft) during the initial exhibition. The NFT must match the painting.
/// @param _tokenIds list of Token ID converted from 4 digits string to uint by frontend
function phygitalMint(uint[] memory _tokenIds, bytes memory _signature) external whenNotPaused {
require(signatureIsValid(_tokenIds, _signature), "INVALID_PHYGITAL_SIGNATURE: please check address and tokenIds");
for (uint index = 0; index < _tokenIds.length; index++) {
uint tokenId = _tokenIds[index];
require(validPhygitalTokenId(tokenId), "INVALID_TOKEN_ID: invalid phygital token ID");
require(phygitalTokenIds[tokenId] == address(0), "UNAVAILABLE_TOKEN: this NFT is already minted.");
phygitalTokenIds[tokenId] = msg.sender;
_mint(msg.sender, tokenId, 1, "");
}
}
/// @notice Mint function for green listed collectors.
function greenlistMint(uint _amount, bytes memory _signature) external payable whenNotPaused {
require(signatureIsValid(_signature), "INVALID_GREENLIST_SIGNATURE: are you sure your address is greenlisted?");
require(greenlistTokenLeft() > 0, "GREENLIST_TOKEN_SOLD_OUT: no more greenlist token left.");
require(greenlistTokenLeft() - _amount >= 0, "INSUFFICIENT_GREENLIST_TOKEN_LEFT: not enough token left");
require(_amount <= maxAmountPerTransaction, "TOKEN_PER_TRANSACTION_LIMIT_EXCEEDED: amount of token exceeds the max amount of tokens per transaction limit");
require(msg.value == price * _amount, "INCORRECT_PAYMENT_AMOUNT: Ooops! An incorrect quantity of ETH was sent! Please check the price of this NFT. :)");
for (uint256 index = 0; index < _amount; index++) {
uint _tokenId = nextGreenlistTokenId();
greenlistTokenCounter.increment();
_mint(msg.sender, _tokenId, 1, "");
}
}
/// @notice Mint function for the public sale.
function publicMint(uint _amount) external payable whenNotPaused {
require(publicSaleTokenLeft() > 0, "PUBLIC_SALE_TOKEN_SOLD_OUT: no more token available, sorry.");
require(publicSaleTokenLeft() - _amount >= 0, "INSUFFICIENT_PUBLIC_SALE_TOKEN_LEFT: not enough token left");
require(_amount <= maxAmountPerTransaction, "TOKEN_PER_TRANSACTION_LIMIT_EXCEEDED: amount of token exceeds the max amount of tokens per transaction limit");
require(msg.value == price * _amount, "INCORRECT_PAYMENT_AMOUNT: Ooops! An incorrect quantity of ETH was sent! Please check the price of this NFT. :)");
for (uint256 index = 0; index < _amount; index++) {
uint _tokenId = nextPublicSaleTokenId();
publicSaleTokenCounter.increment();
_mint(msg.sender, _tokenId, 1, "");
}
}
/*** ----------------------- BURN FUNCTION ----------------------- ***/
/// @notice Giving the ability for a owner to destroy its token(s).
/// @dev We use this method as an API to ERC-1155 _burn
function burn(uint _tokenId) external whenNotPaused {
_burn(msg.sender, _tokenId, 1);
}
/*** ----------------------- CONFIG FUNCTIONS ----------------------- ***/
function setName(string memory _name) external onlyOwner {
name = _name;
}
function setSymbol(string memory _symbol) external onlyOwner {
symbol = _symbol;
}
function setPrice(uint _price) external onlyOwner {
price = _price;
}
function setMaxAmountPerTransaction(uint _amount) external onlyOwner {
maxAmountPerTransaction = _amount;
}
/*** ----------------------- UTILITY FUNCTIONS ----------------------- ***/
/// @notice To display contract-level metadata on OpenSea
function contractURI() public pure returns (string memory) {
return "ipfs://QmW3mACVdGoepRQP4cttKYNZRuP7U8cemHpyQw5Hu687X7";
}
/// @notice Withdraw eth from the contract to the owner's wallet
function withdraw() external onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
/*** ----------------------- SIGNATURE FUNCTIONS ----------------------- ***/
/// @notice We use offchain signature for our greenlists
/// @dev Public key of the wallet used to generate signatures
address private constant ELYX_SIGNER_WALLET = 0x348c2FfB9Ba0431BC40118BbbeB968a6d1122212;
/// @notice Phygital list signature validation
function signatureIsValid(
uint[] memory _tokenIds,
bytes memory _signature
) private view returns (bool) {
uint tokenIdsSum = getSumFor(_tokenIds);
bytes32 _signedMessageHash = ECDSA.toEthSignedMessageHash(
keccak256(abi.encodePacked(
tokenIdsSum,
msg.sender,
address(this)
))
);
address recoveredAddress = ECDSA.recover(_signedMessageHash, _signature);
return recoveredAddress == ELYX_SIGNER_WALLET;
}
/// @notice Greenlist signature validation
function signatureIsValid(
bytes memory _signature
) private view returns (bool) {
bytes32 _signedMessageHash = ECDSA.toEthSignedMessageHash(
keccak256(abi.encodePacked(
msg.sender,
address(this)
))
);
address recoveredAddress = ECDSA.recover(_signedMessageHash, _signature);
return recoveredAddress == ELYX_SIGNER_WALLET;
}
/*** ----------------------- EMERGENCY FUNCTIONS ----------------------- ***/
/// @notice Block execution of public mint/burn function
function pause() external onlyOwner {
_pause();
}
/// @notice Resuming activity: back to mint business!
function unpause() external onlyOwner {
_unpause();
}
/*** ----------------------- TECHNICAL FUNCTIONS ----------------------- ***/
/// @dev As both ERC1155 and ERC2981Base include supportsInterface we need to override both.
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC2981Base) returns (bool) {
return super.supportsInterface(interfaceId);
}
/// @dev Function to return sum of elements of dynamic array, used for signature computation
function getSumFor(uint[] memory _array) private pure returns (uint) {
uint i;
uint sum = 0;
for (i = 0; i < _array.length; i++) {
sum = sum + _array[i];
}
return sum;
}
}
ERC2981Base.sol 28 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import './IERC2981Royalties.sol';
/// @dev This is a contract used to add ERC2981 support to ERC721 and 1155
/// @author https://github.com/dievardump/EIP2981-implementation
abstract contract ERC2981Base is ERC165, IERC2981Royalties {
struct RoyaltyInfo {
address recipient;
uint24 amount;
}
/// @inheritdoc ERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IERC2981Royalties).interfaceId ||
super.supportsInterface(interfaceId);
}
}
IERC2981Royalties.sol 18 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title IERC2981Royalties
/// @dev Interface for the ERC2981 - Token Royalty standard
/// @author https://github.com/dievardump/EIP2981-implementation
interface IERC2981Royalties {
/// @notice Called with the sale price to determine how much royalty
// is owed and to whom.
/// @param _tokenId - the NFT asset queried for royalty information
/// @param _value - the sale price of the NFT asset specified by _tokenId
/// @return _receiver - address of who should be sent the royalty payment
/// @return _royaltyAmount - the royalty payment amount for value sale price
function royaltyInfo(uint256 _tokenId, uint256 _value)
external
view
returns (address _receiver, uint256 _royaltyAmount);
}
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
ERC2981ContractWideRoyalties.sol 33 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import './ERC2981Base.sol';
/// @dev This is a contract used to add ERC2981 support to ERC721 and 1155
/// @dev This implementation has the same royalties for each and every tokens
/// @author https://github.com/dievardump/EIP2981-implementation
abstract contract ERC2981ContractWideRoyalties is ERC2981Base {
RoyaltyInfo private _royalties;
/// @dev Sets token royalties
/// @param recipient recipient of the royalties
/// @param value percentage (using 2 decimals - 10000 = 100, 0 = 0)
function _setRoyalties(address recipient, uint256 value) internal {
require(value <= 10000, 'ERC2981Royalties: Too high');
_royalties = RoyaltyInfo(recipient, uint24(value));
}
/// @inheritdoc IERC2981Royalties
function royaltyInfo(uint256, uint256 value)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
RoyaltyInfo memory royalties = _royalties;
receiver = royalties.recipient;
royaltyAmount = (value * royalties.amount) / 10000;
}
}
Pausable.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @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());
}
}
ERC1155.sol 464 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: transfer caller is not owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}
IERC1155.sol 125 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
ECDSA.sol 234 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s;
uint8 v;
assembly {
s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
v := add(shr(255, vs), 27)
}
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC1155Receiver.sol 53 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
@dev Handles the receipt of a single ERC1155 token type. This function is
called at the end of a `safeTransferFrom` after the balance has been updated.
To accept the transfer, this must return
`bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
(i.e. 0xf23a6e61, or its own function selector).
@param operator The address which initiated the transfer (i.e. msg.sender)
@param from The address which previously owned the token
@param id The ID of the token being transferred
@param value The amount of tokens being transferred
@param data Additional data with no specified format
@return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
@dev Handles the receipt of a multiple ERC1155 token types. This function
is called at the end of a `safeBatchTransferFrom` after the balances have
been updated. To accept the transfer(s), this must return
`bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
(i.e. 0xbc197c81, or its own function selector).
@param operator The address which initiated the batch transfer (i.e. msg.sender)
@param from The address which previously owned the token
@param ids An array containing ids of each token being transferred (order and length must match values array)
@param values An array containing amounts of each token being transferred (order and length must match ids array)
@param data Additional data with no specified format
@return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
IERC1155MetadataURI.sol 22 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}
Read Contract
balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
contractURI 0xe8a3d485 → string
founderTokenLeft 0x905cc216 → uint256
greenlistTokenLeft 0xfe9d4dcb → uint256
isApprovedForAll 0xe985e9c5 → bool
maxAmountPerTransaction 0x5d51de08 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
price 0xa035b1fe → uint256
publicSaleTokenLeft 0x68794cb0 → uint256
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
uri 0x0e89341c → string
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
burn 0x42966c68
uint256 _tokenId
founderMint 0xe7559b1e
uint256 _amount
address _to
greenlistMint 0xaf3830c3
uint256 _amount
bytes _signature
pause 0x8456cb59
No parameters
phygitalMint 0xc66ab9e1
uint256[] _tokenIds
bytes _signature
publicMint 0x2db11544
uint256 _amount
renounceOwnership 0x715018a6
No parameters
safeBatchTransferFrom 0x2eb2c2d6
address from
address to
uint256[] ids
uint256[] amounts
bytes data
safeTransferFrom 0xf242432a
address from
address to
uint256 id
uint256 amount
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setMaxAmountPerTransaction 0x93a35def
uint256 _amount
setName 0xc47f0027
string _name
setPrice 0x91b7f5ed
uint256 _price
setSymbol 0xb84c8246
string _symbol
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address