Address Contract Partially Verified
Address
0xbBfb6E466F376e493da35B5665DbfC19f7204231
Balance
0 ETH
Nonce
1
Code Size
24149 bytes
Creator
0xf7D96d2D...484D at tx 0x8cf7ee6d...41b6f2
Indexed Transactions
0
Contract Bytecode
24149 bytes
0x6080604052600436106102045760003560e01c80635bdbdc3a11610118578063b155d57e116100a0578063c87b56dd1161006f578063c87b56dd1461077c578063d4e4d3dd146107b9578063e985e9c5146107fc578063f2fde38b14610839578063f48d11541461086257610204565b8063b155d57e146106c4578063b88d4fde146106ed578063c65be56214610716578063c86e7a191461075357610204565b80638c7a63ae116100e75780638c7a63ae146105dc5780638da5cb5b1461061c57806395d89b4114610647578063a1cf313814610672578063a22cb4651461069b57610204565b80635bdbdc3a1461051d5780636352211e1461054657806370a08231146105835780637e3ca9ea146105c057610204565b80632e1a7d4d1161019b57806342842e0e1161016a57806342842e0e1461043c57806342966c68146104655780634f6ccce71461048e57806355f804b3146104cb5780635845bfb1146104f457610204565b80632e1a7d4d146103705780632f745c59146103995780633efd9ae8146103d657806340398d67146103ff57610204565b80630f436129116101d75780630f436129146102d7578063156e29f61461030057806318160ddd1461031c57806323b872dd1461034757610204565b806301ffc9a71461020957806306fdde0314610246578063081812fc14610271578063095ea7b3146102ae575b600080fd5b34801561021557600080fd5b50610230600480360381019061022b9190614280565b61088b565b60405161023d9190614bac565b60405180910390f35b34801561025257600080fd5b5061025b6109d5565b6040516102689190614bc7565b60405180910390f35b34801561027d57600080fd5b5061029860048036038101906102939190614323565b610a67565b6040516102a59190614aa7565b60405180910390f35b3480156102ba57600080fd5b506102d560048036038101906102d0919061409b565b610aec565b005b3480156102e357600080fd5b506102fe60048036038101906102f99190614459565b610c04565b005b61031a600480360381019061031591906140db565b610cbb565b005b34801561032857600080fd5b50610331610cf2565b60405161033e9190614f89565b60405180910390f35b34801561035357600080fd5b5061036e60048036038101906103699190613f85565b610cff565b005b34801561037c57600080fd5b5061039760048036038101906103929190614323565b610d5f565b005b3480156103a557600080fd5b506103c060048036038101906103bb919061409b565b610e32565b6040516103cd9190614f89565b60405180910390f35b3480156103e257600080fd5b506103fd60048036038101906103f8919061412e565b610ed7565b005b34801561040b57600080fd5b5061042660048036038101906104219190613eeb565b6110a4565b6040516104339190614b8a565b60405180910390f35b34801561044857600080fd5b50610463600480360381019061045e9190613f85565b611152565b005b34801561047157600080fd5b5061048c60048036038101906104879190614323565b611172565b005b34801561049a57600080fd5b506104b560048036038101906104b09190614323565b61117e565b6040516104c29190614f89565b60405180910390f35b3480156104d757600080fd5b506104f260048036038101906104ed91906142da565b6111ef565b005b34801561050057600080fd5b5061051b600480360381019061051691906140db565b611285565b005b34801561052957600080fd5b50610544600480360381019061053f9190614195565b611453565b005b34801561055257600080fd5b5061056d60048036038101906105689190614323565b6115f8565b60405161057a9190614aa7565b60405180910390f35b34801561058f57600080fd5b506105aa60048036038101906105a59190613eeb565b6116aa565b6040516105b79190614f89565b60405180910390f35b6105da60048036038101906105d5919061412e565b611762565b005b3480156105e857600080fd5b5061060360048036038101906105fe9190614323565b61179a565b6040516106139493929190614fa4565b60405180910390f35b34801561062857600080fd5b506106316117fd565b60405161063e9190614aa7565b60405180910390f35b34801561065357600080fd5b5061065c611826565b6040516106699190614bc7565b60405180910390f35b34801561067e57600080fd5b5061069960048036038101906106949190613eeb565b6118b8565b005b3480156106a757600080fd5b506106c260048036038101906106bd919061405b565b611978565b005b3480156106d057600080fd5b506106eb60048036038101906106e691906143bd565b611af9565b005b3480156106f957600080fd5b50610714600480360381019061070f9190613fd8565b611ba4565b005b34801561072257600080fd5b5061073d60048036038101906107389190614419565b611c06565b60405161074a9190614f89565b60405180910390f35b34801561075f57600080fd5b5061077a6004803603810190610775919061437d565b611cef565b005b34801561078857600080fd5b506107a3600480360381019061079e9190614323565b611df5565b6040516107b09190614bc7565b60405180910390f35b3480156107c557600080fd5b506107e060048036038101906107db9190614323565b611e9c565b6040516107f39796959493929190614fe9565b60405180910390f35b34801561080857600080fd5b50610823600480360381019061081e9190613f45565b612066565b6040516108309190614bac565b60405180910390f35b34801561084557600080fd5b50610860600480360381019061085b9190613eeb565b6120fa565b005b34801561086e57600080fd5b5061088960048036038101906108849190614419565b6121f2565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061095657507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109be57507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109ce57506109cd826122a3565b5b9050919050565b6060600780546109e490615337565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1090615337565b8015610a5d5780601f10610a3257610100808354040283529160200191610a5d565b820191906000526020600020905b815481529060010190602001808311610a4057829003601f168201915b5050505050905090565b6000610a728261230d565b610ab1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa890614e09565b60405180910390fd5b600c600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610af7826115f8565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5f90614ec9565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610b87612379565b73ffffffffffffffffffffffffffffffffffffffff161480610bb65750610bb581610bb0612379565b612066565b5b610bf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bec90614d69565b60405180910390fd5b610bff8383612381565b505050565b610c0c612379565b73ffffffffffffffffffffffffffffffffffffffff16610c2a6117fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7790614e29565b60405180910390fd5b816001600085815260200190815260200160002060040181905550806001600085815260200190815260200160002060050181905550505050565b610cca3383833460018061243a565b610cd68282600161289c565b610ce083836128f9565b610ced3383600180612a07565b505050565b6000601080549050905090565b610d10610d0a612379565b82612c9b565b610d4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4690614f09565b60405180910390fd5b610d5a838383612d79565b505050565b610d67612379565b73ffffffffffffffffffffffffffffffffffffffff16610d856117fd565b73ffffffffffffffffffffffffffffffffffffffff1614610ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd290614e29565b60405180910390fd5b6000610de56117fd565b90508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610e2d573d6000803e3d6000fd5b505050565b6000610e3d836116aa565b8210610e7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7590614c09565b60405180910390fd5b600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636feaa9666040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4157600080fd5b505afa158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f799190614253565b905080610fbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb290614f29565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016110189190614aa7565b60206040518083038186803b15801561103057600080fd5b505afa158015611044573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110689190614350565b90506110793386868487600061243a565b61108485858561289c565b61108f868685612fd5565b61109c3386856000612a07565b505050505050565b606060006110b1836116aa565b905060008167ffffffffffffffff8111156110cf576110ce61552d565b5b6040519080825280602002602001820160405280156110fd5781602001602082028036833780820191505090505b50905060005b82811015611147576111158582610e32565b828281518110611128576111276154fe565b5b602002602001018181525050808061113f9061539a565b915050611103565b508092505050919050565b61116d83838360405180602001604052806000815250611ba4565b505050565b61117b81613003565b50565b6000611188610cf2565b82106111c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c090614f49565b60405180910390fd5b601082815481106111dd576111dc6154fe565b5b90600052602060002001549050919050565b6111f7612379565b73ffffffffffffffffffffffffffffffffffffffff166112156117fd565b73ffffffffffffffffffffffffffffffffffffffff161461126b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126290614e29565b60405180910390fd5b8060099080519060200190611281929190613cc0565b5050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636feaa9666040518163ffffffff1660e01b815260040160206040518083038186803b1580156112ef57600080fd5b505afa158015611303573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113279190614253565b905080611369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136090614f29565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016113c69190614aa7565b60206040518083038186803b1580156113de57600080fd5b505afa1580156113f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114169190614350565b9050611428338585846001600061243a565b6114348484600161289c565b61143e85856128f9565b61144c338560016000612a07565b5050505050565b61145b612379565b73ffffffffffffffffffffffffffffffffffffffff166114796117fd565b73ffffffffffffffffffffffffffffffffffffffff16146114cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c690614e29565b60405180910390fd5b60006114db6005613189565b9050604051806101000160405280848152602001600081526020018581526020018381526020018781526020018681526020018881526020018973ffffffffffffffffffffffffffffffffffffffff1681525060016000838152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301908051906020019061157b929190613cc0565b506080820151816004015560a0820151816005015560c0820151816006015560e08201518160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506115ee600561228d565b5050505050505050565b600080600a600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169890614da9565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561171b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171290614d89565b60405180910390fd5b600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6117713384843485600161243a565b61177c83838361289c565b611787848483612fd5565b6117943384836001612a07565b50505050565b6000806000806117a98561230d565b5060006003600087815260200190815260200160002054905060006004600088815260200190815260200160002054905060006117e5886115f8565b90508782828596509650965096505050509193509193565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606008805461183590615337565b80601f016020809104026020016040519081016040528092919081815260200182805461186190615337565b80156118ae5780601f10611883576101008083540402835291602001916118ae565b820191906000526020600020905b81548152906001019060200180831161189157829003601f168201915b5050505050905090565b6118c0612379565b73ffffffffffffffffffffffffffffffffffffffff166118de6117fd565b73ffffffffffffffffffffffffffffffffffffffff1614611934576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192b90614e29565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611980612379565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e590614cc9565b60405180910390fd5b80600d60006119fb612379565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611aa8612379565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611aed9190614bac565b60405180910390a35050565b611b01612379565b73ffffffffffffffffffffffffffffffffffffffff16611b1f6117fd565b73ffffffffffffffffffffffffffffffffffffffff1614611b75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6c90614e29565b60405180910390fd5b80600160008481526020019081526020016000206003019080519060200190611b9f929190613cc0565b505050565b611bb5611baf612379565b83612c9b565b611bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611beb90614f09565b60405180910390fd5b611c0084848484613197565b50505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f8c6c1c8846040518263ffffffff1660e01b8152600401611c649190614f89565b60206040518083038186803b158015611c7c57600080fd5b505afa158015611c90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb49190614350565b90506002600085815260200190815260200160002060008481526020019081526020016000205481611ce69190615243565b91505092915050565b81611cf8612379565b73ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9290614e89565b60405180910390fd5b816001600085815260200190815260200160002060070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b6060611e008261230d565b611e3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3690614e69565b60405180910390fd5b6000611e496131f3565b90506000815111611e695760405180602001604052806000815250611e94565b80611e7384613285565b604051602001611e84929190614a35565b6040516020818303038152906040525b915050919050565b60008060606000806000806000600160008a8152602001908152602001600020600001541415611f01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef890614c49565b60405180910390fd5b6001600089815260200190815260200160002060010154600160008a815260200190815260200160002060020154600160008b8152602001908152602001600020600301600160008c815260200190815260200160002060040154600160008d815260200190815260200160002060050154600160008e815260200190815260200160002060070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008f815260200190815260200160002060060154848054611fcd90615337565b80601f0160208091040260200160405190810160405280929190818152602001828054611ff990615337565b80156120465780601f1061201b57610100808354040283529160200191612046565b820191906000526020600020905b81548152906001019060200180831161202957829003601f168201915b505050505094509650965096509650965096509650919395979092949650565b6000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b612102612379565b73ffffffffffffffffffffffffffffffffffffffff166121206117fd565b73ffffffffffffffffffffffffffffffffffffffff1614612176576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216d90614e29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121dd90614c69565b60405180910390fd5b6121ef816133e6565b50565b6121fa612379565b73ffffffffffffffffffffffffffffffffffffffff166122186117fd565b73ffffffffffffffffffffffffffffffffffffffff161461226e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226590614e29565b60405180910390fd5b8060016000848152602001908152602001600020600201819055505050565b6001816000016000828254019250508190555050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16600a600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b81600c600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166123f4836115f8565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600060016000878152602001908152602001600020600001541415612494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248b90614f69565b60405180910390fd5b6001600086815260200190815260200160002060020154600160008781526020019081526020016000206001015410612502576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f990614ea9565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b815260040161255f9190614f89565b60206040518083038186803b15801561257757600080fd5b505afa15801561258b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125af9190613f18565b90508673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461261f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261690614d09565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f4ed4d15876040518263ffffffff1660e01b815260040161267c9190614f89565b60206040518083038186803b15801561269457600080fd5b505afa1580156126a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126cc9190614253565b90506000816126dc5760016126df565b60025b60ff1690506003600160008a815260200190815260200160002060000154148061271e575080600160008a815260200190815260200160002060000154145b61275d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275490614be9565b60405180910390fd5b60006127698989611c06565b9050858110156127ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a590614ee9565b60405180910390fd5b841561282457866127de87600160008d8152602001908152602001600020600401546134aa90919063ffffffff16565b111561281f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161281690614d49565b60405180910390fd5b612890565b8661284e87600160008d8152602001908152602001600020600501546134aa90919063ffffffff16565b111561288f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288690614de9565b60405180910390fd5b5b50505050505050505050565b80600260008581526020019081526020016000206000848152602001908152602001600020546128cc9190615162565b60026000858152602001908152602001600020600084815260200190815260200160002081905550505050565b600060018060008481526020019081526020016000206001015461291d9190615162565b9050600081620186a08461293191906151e9565b61293b9190615162565b90508160016000858152602001908152602001600020600101819055506000824344876040516020016129719493929190614a59565b6040516020818303038152906040528051906020012090508060036000848152602001908152602001600020819055508360046000848152602001908152602001600020819055506129c385836134c0565b7fcf6fbb9dcea7d07263ab4f5c3a92f53af33dffc421d9d121e1c74b307e68189d858584846040516129f89493929190614b45565b60405180910390a15050505050565b600081612a3c57612a378360016000878152602001908152602001600020600501546134aa90919063ffffffff16565b612a66565b612a658360016000878152602001908152602001600020600401546134aa90919063ffffffff16565b5b90506000612a726117fd565b905060006064600160008881526020019081526020016000206006015484612a9a91906151e9565b612aa491906151b8565b90508315612b2e576001600087815260200190815260200160002060070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612b28573d6000803e3d6000fd5b50612c92565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd88848487612b7a9190615243565b6040518463ffffffff1660e01b8152600401612b9893929190614ac2565b600060405180830381600087803b158015612bb257600080fd5b505af1158015612bc6573d6000803e3d6000fd5b50505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd88600160008a815260200190815260200160002060070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518463ffffffff1660e01b8152600401612c5f93929190614ac2565b600060405180830381600087803b158015612c7957600080fd5b505af1158015612c8d573d6000803e3d6000fd5b505050505b50505050505050565b6000612ca68261230d565b612ce5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cdc90614ce9565b60405180910390fd5b6000612cf0836115f8565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612d5f57508373ffffffffffffffffffffffffffffffffffffffff16612d4784610a67565b73ffffffffffffffffffffffffffffffffffffffff16145b80612d705750612d6f8185612066565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612d99826115f8565b73ffffffffffffffffffffffffffffffffffffffff1614612def576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612de690614e49565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612e5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e5690614ca9565b60405180910390fd5b612e6a8383836134de565b612e75600082612381565b6001600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612ec59190615243565b925050819055506001600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612f1c9190615162565b9250508190555081600a600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60005b81811015612ffd57612fea84846128f9565b8080612ff59061539a565b915050612fd8565b50505050565b600061300e826115f8565b90508073ffffffffffffffffffffffffffffffffffffffff1661302f612379565b73ffffffffffffffffffffffffffffffffffffffff1614613085576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161307c90614d29565b60405180910390fd5b613091816000846134de565b61309c600083612381565b6001600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546130ec9190615243565b92505081905550600a600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600081600001549050919050565b6131a2848484612d79565b6131ae848484846135e7565b6131ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131e490614c29565b60405180910390fd5b50505050565b60606009805461320290615337565b80601f016020809104026020016040519081016040528092919081815260200182805461322e90615337565b801561327b5780601f106132505761010080835404028352916020019161327b565b820191906000526020600020905b81548152906001019060200180831161325e57829003601f168201915b5050505050905090565b606060008214156132cd576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506133e1565b600082905060005b600082146132ff5780806132e89061539a565b915050600a826132f891906151b8565b91506132d5565b60008167ffffffffffffffff81111561331b5761331a61552d565b5b6040519080825280601f01601f19166020018201604052801561334d5781602001600182028036833780820191505090505b5090505b600085146133da576001826133669190615243565b9150600a856133759190615411565b60306133819190615162565b60f81b818381518110613397576133966154fe565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856133d391906151b8565b9450613351565b8093505050505b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081836134b891906151e9565b905092915050565b6134da82826040518060200160405280600081525061377e565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156135215761351c816137d9565b613560565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461355f5761355e8382613822565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156135a35761359e8161398f565b6135e2565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146135e1576135e08282613a60565b5b5b505050565b60006136088473ffffffffffffffffffffffffffffffffffffffff16613adf565b15613771578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02613631612379565b8786866040518563ffffffff1660e01b81526004016136539493929190614af9565b602060405180830381600087803b15801561366d57600080fd5b505af192505050801561369e57506040513d601f19601f8201168201806040525081019061369b91906142ad565b60015b613721573d80600081146136ce576040519150601f19603f3d011682016040523d82523d6000602084013e6136d3565b606091505b50600081511415613719576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161371090614c29565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613776565b600190505b949350505050565b6137888383613af2565b61379560008484846135e7565b6137d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137cb90614c29565b60405180910390fd5b505050565b6010805490506011600083815260200190815260200160002081905550601081908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161382f846116aa565b6138399190615243565b90506000600f600084815260200190815260200160002054905081811461391e576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000208190555081600f600083815260200190815260200160002081905550505b600f600084815260200190815260200160002060009055600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016010805490506139a39190615243565b90506000601160008481526020019081526020016000205490506000601083815481106139d3576139d26154fe565b5b9060005260206000200154905080601083815481106139f5576139f46154fe565b5b906000526020600020018190555081601160008381526020019081526020016000208190555060116000858152602001908152602001600020600090556010805480613a4457613a436154cf565b5b6001900381819060005260206000200160009055905550505050565b6000613a6b836116aa565b905081600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000208190555080600f600084815260200190815260200160002081905550505050565b600080823b905060008111915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b5990614dc9565b60405180910390fd5b613b6b8161230d565b15613bab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ba290614c89565b60405180910390fd5b613bb7600083836134de565b6001600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613c079190615162565b9250508190555081600a600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b828054613ccc90615337565b90600052602060002090601f016020900481019282613cee5760008555613d35565b82601f10613d0757805160ff1916838001178555613d35565b82800160010185558215613d35579182015b82811115613d34578251825591602001919060010190613d19565b5b509050613d429190613d46565b5090565b5b80821115613d5f576000816000905550600101613d47565b5090565b6000613d76613d7184615084565b61505f565b905082815260208101848484011115613d9257613d91615561565b5b613d9d8482856152f5565b509392505050565b6000613db8613db3846150b5565b61505f565b905082815260208101848484011115613dd457613dd3615561565b5b613ddf8482856152f5565b509392505050565b600081359050613df681615dc3565b92915050565b600081519050613e0b81615dc3565b92915050565b600081359050613e2081615dda565b92915050565b600081519050613e3581615dda565b92915050565b600081359050613e4a81615df1565b92915050565b600081519050613e5f81615df1565b92915050565b600082601f830112613e7a57613e7961555c565b5b8135613e8a848260208601613d63565b91505092915050565b600082601f830112613ea857613ea761555c565b5b8135613eb8848260208601613da5565b91505092915050565b600081359050613ed081615e08565b92915050565b600081519050613ee581615e08565b92915050565b600060208284031215613f0157613f0061556b565b5b6000613f0f84828501613de7565b91505092915050565b600060208284031215613f2e57613f2d61556b565b5b6000613f3c84828501613dfc565b91505092915050565b60008060408385031215613f5c57613f5b61556b565b5b6000613f6a85828601613de7565b9250506020613f7b85828601613de7565b9150509250929050565b600080600060608486031215613f9e57613f9d61556b565b5b6000613fac86828701613de7565b9350506020613fbd86828701613de7565b9250506040613fce86828701613ec1565b9150509250925092565b60008060008060808587031215613ff257613ff161556b565b5b600061400087828801613de7565b945050602061401187828801613de7565b935050604061402287828801613ec1565b925050606085013567ffffffffffffffff81111561404357614042615566565b5b61404f87828801613e65565b91505092959194509250565b600080604083850312156140725761407161556b565b5b600061408085828601613de7565b925050602061409185828601613e11565b9150509250929050565b600080604083850312156140b2576140b161556b565b5b60006140c085828601613de7565b92505060206140d185828601613ec1565b9150509250929050565b6000806000606084860312156140f4576140f361556b565b5b600061410286828701613de7565b935050602061411386828701613ec1565b925050604061412486828701613ec1565b9150509250925092565b600080600080608085870312156141485761414761556b565b5b600061415687828801613de7565b945050602061416787828801613ec1565b935050604061417887828801613ec1565b925050606061418987828801613ec1565b91505092959194509250565b600080600080600080600060e0888a0312156141b4576141b361556b565b5b60006141c28a828b01613de7565b97505060206141d38a828b01613ec1565b96505060406141e48a828b01613ec1565b95505060606141f58a828b01613ec1565b94505060806142068a828b01613ec1565b93505060a06142178a828b01613ec1565b92505060c088013567ffffffffffffffff81111561423857614237615566565b5b6142448a828b01613e93565b91505092959891949750929550565b6000602082840312156142695761426861556b565b5b600061427784828501613e26565b91505092915050565b6000602082840312156142965761429561556b565b5b60006142a484828501613e3b565b91505092915050565b6000602082840312156142c3576142c261556b565b5b60006142d184828501613e50565b91505092915050565b6000602082840312156142f0576142ef61556b565b5b600082013567ffffffffffffffff81111561430e5761430d615566565b5b61431a84828501613e93565b91505092915050565b6000602082840312156143395761433861556b565b5b600061434784828501613ec1565b91505092915050565b6000602082840312156143665761436561556b565b5b600061437484828501613ed6565b91505092915050565b600080604083850312156143945761439361556b565b5b60006143a285828601613ec1565b92505060206143b385828601613de7565b9150509250929050565b600080604083850312156143d4576143d361556b565b5b60006143e285828601613ec1565b925050602083013567ffffffffffffffff81111561440357614402615566565b5b61440f85828601613e93565b9150509250929050565b600080604083850312156144305761442f61556b565b5b600061443e85828601613ec1565b925050602061444f85828601613ec1565b9150509250929050565b6000806000606084860312156144725761447161556b565b5b600061448086828701613ec1565b935050602061449186828701613ec1565b92505060406144a286828701613ec1565b9150509250925092565b60006144b88383614a00565b60208301905092915050565b6144cd81615277565b82525050565b6144e46144df82615277565b6153e3565b82525050565b60006144f5826150f6565b6144ff8185615124565b935061450a836150e6565b8060005b8381101561453b57815161452288826144ac565b975061452d83615117565b92505060018101905061450e565b5085935050505092915050565b61455181615289565b82525050565b61456081615295565b82525050565b600061457182615101565b61457b8185615135565b935061458b818560208601615304565b61459481615570565b840191505092915050565b60006145aa8261510c565b6145b48185615146565b93506145c4818560208601615304565b6145cd81615570565b840191505092915050565b60006145e38261510c565b6145ed8185615157565b93506145fd818560208601615304565b80840191505092915050565b6000614616602583615146565b91506146218261558e565b604082019050919050565b6000614639602b83615146565b9150614644826155dd565b604082019050919050565b600061465c603283615146565b91506146678261562c565b604082019050919050565b600061467f602783615146565b915061468a8261567b565b604082019050919050565b60006146a2602683615146565b91506146ad826156ca565b604082019050919050565b60006146c5601c83615146565b91506146d082615719565b602082019050919050565b60006146e8602483615146565b91506146f382615742565b604082019050919050565b600061470b601983615146565b915061471682615791565b602082019050919050565b600061472e602c83615146565b9150614739826157ba565b604082019050919050565b6000614751603183615146565b915061475c82615809565b604082019050919050565b6000614774602b83615146565b915061477f82615858565b604082019050919050565b6000614797602783615146565b91506147a2826158a7565b604082019050919050565b60006147ba603883615146565b91506147c5826158f6565b604082019050919050565b60006147dd602a83615146565b91506147e882615945565b604082019050919050565b6000614800602983615146565b915061480b82615994565b604082019050919050565b6000614823602083615146565b915061482e826159e3565b602082019050919050565b6000614846602b83615146565b915061485182615a0c565b604082019050919050565b6000614869602c83615146565b915061487482615a5b565b604082019050919050565b600061488c602083615146565b915061489782615aaa565b602082019050919050565b60006148af602983615146565b91506148ba82615ad3565b604082019050919050565b60006148d2602f83615146565b91506148dd82615b22565b604082019050919050565b60006148f5603483615146565b915061490082615b71565b604082019050919050565b6000614918602d83615146565b915061492382615bc0565b604082019050919050565b600061493b602183615146565b915061494682615c0f565b604082019050919050565b600061495e602483615146565b915061496982615c5e565b604082019050919050565b6000614981603183615146565b915061498c82615cad565b604082019050919050565b60006149a4601d83615146565b91506149af82615cfc565b602082019050919050565b60006149c7602c83615146565b91506149d282615d25565b604082019050919050565b60006149ea602983615146565b91506149f582615d74565b604082019050919050565b614a09816152eb565b82525050565b614a18816152eb565b82525050565b614a2f614a2a826152eb565b615407565b82525050565b6000614a4182856145d8565b9150614a4d82846145d8565b91508190509392505050565b6000614a658287614a1e565b602082019150614a758286614a1e565b602082019150614a858285614a1e565b602082019150614a9582846144d3565b60148201915081905095945050505050565b6000602082019050614abc60008301846144c4565b92915050565b6000606082019050614ad760008301866144c4565b614ae460208301856144c4565b614af16040830184614a0f565b949350505050565b6000608082019050614b0e60008301876144c4565b614b1b60208301866144c4565b614b286040830185614a0f565b8181036060830152614b3a8184614566565b905095945050505050565b6000608082019050614b5a60008301876144c4565b614b676020830186614a0f565b614b746040830185614a0f565b614b816060830184614557565b95945050505050565b60006020820190508181036000830152614ba481846144ea565b905092915050565b6000602082019050614bc16000830184614548565b92915050565b60006020820190508181036000830152614be1818461459f565b905092915050565b60006020820190508181036000830152614c0281614609565b9050919050565b60006020820190508181036000830152614c228161462c565b9050919050565b60006020820190508181036000830152614c428161464f565b9050919050565b60006020820190508181036000830152614c6281614672565b9050919050565b60006020820190508181036000830152614c8281614695565b9050919050565b60006020820190508181036000830152614ca2816146b8565b9050919050565b60006020820190508181036000830152614cc2816146db565b9050919050565b60006020820190508181036000830152614ce2816146fe565b9050919050565b60006020820190508181036000830152614d0281614721565b9050919050565b60006020820190508181036000830152614d2281614744565b9050919050565b60006020820190508181036000830152614d4281614767565b9050919050565b60006020820190508181036000830152614d628161478a565b9050919050565b60006020820190508181036000830152614d82816147ad565b9050919050565b60006020820190508181036000830152614da2816147d0565b9050919050565b60006020820190508181036000830152614dc2816147f3565b9050919050565b60006020820190508181036000830152614de281614816565b9050919050565b60006020820190508181036000830152614e0281614839565b9050919050565b60006020820190508181036000830152614e228161485c565b9050919050565b60006020820190508181036000830152614e428161487f565b9050919050565b60006020820190508181036000830152614e62816148a2565b9050919050565b60006020820190508181036000830152614e82816148c5565b9050919050565b60006020820190508181036000830152614ea2816148e8565b9050919050565b60006020820190508181036000830152614ec28161490b565b9050919050565b60006020820190508181036000830152614ee28161492e565b9050919050565b60006020820190508181036000830152614f0281614951565b9050919050565b60006020820190508181036000830152614f2281614974565b9050919050565b60006020820190508181036000830152614f4281614997565b9050919050565b60006020820190508181036000830152614f62816149ba565b9050919050565b60006020820190508181036000830152614f82816149dd565b9050919050565b6000602082019050614f9e6000830184614a0f565b92915050565b6000608082019050614fb96000830187614a0f565b614fc66020830186614a0f565b614fd360408301856144c4565b614fe06060830184614557565b95945050505050565b600060e082019050614ffe600083018a614a0f565b61500b6020830189614a0f565b818103604083015261501d818861459f565b905061502c6060830187614a0f565b6150396080830186614a0f565b61504660a08301856144c4565b61505360c0830184614a0f565b98975050505050505050565b600061506961507a565b90506150758282615369565b919050565b6000604051905090565b600067ffffffffffffffff82111561509f5761509e61552d565b5b6150a882615570565b9050602081019050919050565b600067ffffffffffffffff8211156150d0576150cf61552d565b5b6150d982615570565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600061516d826152eb565b9150615178836152eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156151ad576151ac615442565b5b828201905092915050565b60006151c3826152eb565b91506151ce836152eb565b9250826151de576151dd615471565b5b828204905092915050565b60006151f4826152eb565b91506151ff836152eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561523857615237615442565b5b828202905092915050565b600061524e826152eb565b9150615259836152eb565b92508282101561526c5761526b615442565b5b828203905092915050565b6000615282826152cb565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015615322578082015181840152602081019050615307565b83811115615331576000848401525b50505050565b6000600282049050600182168061534f57607f821691505b60208210811415615363576153626154a0565b5b50919050565b61537282615570565b810181811067ffffffffffffffff821117156153915761539061552d565b5b80604052505050565b60006153a5826152eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156153d8576153d7615442565b5b600182019050919050565b60006153ee826153f5565b9050919050565b600061540082615581565b9050919050565b6000819050919050565b600061541c826152eb565b9150615427836152eb565b92508261543757615436615471565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f47656e417274436f6c6c656374696f6e3a206e6f2076616c6964206d656d626560008201527f7273686970000000000000000000000000000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a20696e76616c696420636f6c6c656360008201527f74696f6e20696400000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a2073656e646572206d75737420626560008201527f206d656d62657273686970206f776e6572000000000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a206f6e6c7920746f6b656e206f776e60008201527f65722063616e206275726e000000000000000000000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a20696e636f727265637420616d6f7560008201527f6e742073656e7400000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f47656e417274436f6c6c656374696f6e3a20696e73756666696369656e74202460008201527f47454e2062616c616e6365000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a206f6e6c792061727469737420636160008201527f6e2063616c6c20746869732066756e6374696f6e000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a206d617820696e766f636174696f6e60008201527f7320776173207265616368656400000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a206e6f206d696e7473206176616c6960008201527f61626c6500000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f4d696e742077697468202447454e415254206e6f7420616c6c6f776564000000600082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f47656e417274436f6c6c656374696f6e3a20696e636f727265637420636f6c6c60008201527f656374696f6e2069640000000000000000000000000000000000000000000000602082015250565b615dcc81615277565b8114615dd757600080fd5b50565b615de381615289565b8114615dee57600080fd5b50565b615dfa8161529f565b8114615e0557600080fd5b50565b615e11816152eb565b8114615e1c57600080fd5b5056fea2646970667358221220c484d9e6c1ddef593c360c41d665db1ba9c060ae46b4082fb6ed1cb8cdf7cd3364736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
GenArtCollection.sol 1850 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* GEN.ART Collection Contract
*/
interface IGenArt {
function getTokensByOwner(address owner)
external
view
returns (uint256[] memory);
function ownerOf(uint256 tokenId) external view returns (address);
function isGoldToken(uint256 _tokenId) external view returns (bool);
}
interface IGenArtInterface {
function getMaxMintForMembership(uint256 _membershipId)
external
view
returns (uint256);
function getMaxMintForOwner(address owner) external view returns (uint256);
function upgradeGenArtTokenContract(address _genArtTokenAddress) external;
function setAllowGen(bool allow) external;
function genAllowed() external view returns (bool);
function isGoldToken(uint256 _membershipId) external view returns (bool);
function transferFrom(
address _from,
address _to,
uint256 _amount
) external;
function balanceOf(address _owner) external view returns (uint256);
function ownerOf(uint256 _membershipId) external view returns (address);
}
/**
* @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;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @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;
}
}
/**
* @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 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;
}
}
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount)
external
returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender)
external
view
returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @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);
}
/**
* @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;
}
}
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId)
external
view
returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract GenArtCollection is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable,
Ownable
{
using Address for address;
using Strings for uint256;
using Counters for Counters.Counter;
using SafeMath for uint256;
struct Collection {
uint256 tier;
uint256 invocations;
uint256 maxInvocations;
string script;
uint256 price;
uint256 priceGen;
uint256 artistPercentage;
address artist;
}
event Mint(address to, uint256 collectionId, uint256 tokenId, bytes32 hash);
// IGenArtMintState _genArtMintState;
mapping(uint256 => Collection) private _collectionsMap;
// Mapping collectionId to membershipId and total mints
mapping(uint256 => mapping(uint256 => uint256)) private _collectionsMintMap;
mapping(uint256 => bytes32) private _tokenIdToHashMap;
mapping(uint256 => uint256) private _tokenIdToCollectionIdMap;
Counters.Counter private _collectionIdCounter;
IGenArtInterface private _genArtInterface;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Base URI
string private _baseURI;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(
string memory name_,
string memory symbol_,
string memory uri_,
address genArtInterfaceAddress_
) {
_name = name_;
_symbol = symbol_;
_baseURI = uri_;
_genArtInterface = IGenArtInterface(genArtInterfaceAddress_);
_collectionIdCounter.increment();
}
modifier onlyArtist(uint256 _collectionId) {
require(
_collectionsMap[_collectionId].artist == _msgSender(),
"GenArtCollection: only artist can call this function"
);
_;
}
function withdraw(uint256 value) public onlyOwner {
address _owner = owner();
payable(_owner).transfer(value);
}
function createGenCollection(
address _artist,
uint256 _artistPercentage,
uint256 _price,
uint256 _priceGen,
uint256 _maxInvocations,
uint256 _tier,
string memory _script
) public onlyOwner {
uint256 _collectionId = _collectionIdCounter.current();
_collectionsMap[_collectionId] = Collection({
tier: _tier,
invocations: 0,
maxInvocations: _maxInvocations,
script: _script,
price: _price,
priceGen: _priceGen,
artistPercentage: _artistPercentage,
artist: _artist
});
_collectionIdCounter.increment();
}
function checkMint(
address _sender,
uint256 _collectionId,
uint256 _membershipId,
uint256 _value,
uint256 _amount,
bool _isEthPayment
) internal virtual {
require(
_collectionsMap[_collectionId].tier != 0,
"GenArtCollection: incorrect collection id"
);
require(
_collectionsMap[_collectionId].invocations <
_collectionsMap[_collectionId].maxInvocations,
"GenArtCollection: max invocations was reached"
);
address _membershipOwner = _genArtInterface.ownerOf(_membershipId);
require(
_membershipOwner == _sender,
"GenArtCollection: sender must be membership owner"
);
bool _isGoldMember = _genArtInterface.isGoldToken(_membershipId);
uint256 _tier = _isGoldMember ? 2 : 1;
require(
_collectionsMap[_collectionId].tier == 3 ||
_collectionsMap[_collectionId].tier == _tier,
"GenArtCollection: no valid membership"
);
uint256 maxMint = getAllowedMintForMembership(
_collectionId,
_membershipId
);
require(
maxMint >= _amount,
"GenArtCollection: no mints avaliable"
);
if (_isEthPayment) {
require(
_collectionsMap[_collectionId].price.mul(_amount) <= _value,
"GenArtCollection: incorrect amount sent"
);
} else {
require(
_collectionsMap[_collectionId].priceGen.mul(_amount) <= _value,
"GenArtCollection: insufficient $GEN balance"
);
}
}
function mint(
address _to,
uint256 _collectionId,
uint256 _membershipId
) public payable {
checkMint(msg.sender, _collectionId, _membershipId, msg.value, 1, true);
updateMintState(_collectionId, _membershipId, 1);
_mintOne(_to, _collectionId);
splitFunds(msg.sender, _collectionId, 1, true);
}
function mintGen(
address _to,
uint256 _collectionId,
uint256 _membershipId
) public {
bool _genAllowed = _genArtInterface.genAllowed();
require(_genAllowed, "Mint with $GENART not allowed");
uint256 balance = _genArtInterface.balanceOf(msg.sender);
checkMint(msg.sender, _collectionId, _membershipId, balance, 1, false);
updateMintState(_collectionId, _membershipId, 1);
_mintOne(_to, _collectionId);
splitFunds(msg.sender, _collectionId, 1, false);
}
function mintMany(
address _to,
uint256 _collectionId,
uint256 _membershipId,
uint256 _amount
) public payable {
checkMint(
msg.sender,
_collectionId,
_membershipId,
msg.value,
_amount,
true
);
updateMintState(_collectionId, _membershipId, _amount);
_mintMany(_to, _collectionId, _amount);
splitFunds(msg.sender, _collectionId, _amount, true);
}
function mintManyGen(
address _to,
uint256 _collectionId,
uint256 _membershipId,
uint256 _amount
) public {
bool _genAllowed = _genArtInterface.genAllowed();
require(_genAllowed, "Mint with $GENART not allowed");
uint256 balance = _genArtInterface.balanceOf(msg.sender);
checkMint(
msg.sender,
_collectionId,
_membershipId,
balance,
_amount,
false
);
updateMintState(_collectionId, _membershipId, _amount);
_mintMany(_to, _collectionId, _amount);
splitFunds(msg.sender, _collectionId, _amount, false);
}
function _mintMany(
address _to,
uint256 _collectionId,
uint256 _amount
) internal virtual {
for (uint256 i = 0; i < _amount; i++) {
_mintOne(_to, _collectionId);
}
}
function _mintOne(address _to, uint256 _collectionId) internal virtual {
uint256 invocation = _collectionsMap[_collectionId].invocations + 1;
uint256 _tokenId = _collectionId * 100000 + invocation;
_collectionsMap[_collectionId].invocations = invocation;
bytes32 hash = keccak256(
abi.encodePacked(invocation, block.number, block.difficulty, _to)
);
_tokenIdToHashMap[_tokenId] = hash;
_tokenIdToCollectionIdMap[_tokenId] = _collectionId;
_safeMint(_to, _tokenId);
emit Mint(_to, _collectionId, _tokenId, hash);
}
function splitFunds(
address _sender,
uint256 _collectionId,
uint256 _amount,
bool _isEthPayment
) internal virtual {
uint256 value = _isEthPayment
? _collectionsMap[_collectionId].price.mul(_amount)
: _collectionsMap[_collectionId].priceGen.mul(_amount);
address _owner = owner();
uint256 artistReward = (value *
_collectionsMap[_collectionId].artistPercentage) / 100;
if (_isEthPayment) {
payable(_collectionsMap[_collectionId].artist).transfer(
artistReward
);
} else {
_genArtInterface.transferFrom(
_sender,
_owner,
value - artistReward
);
_genArtInterface.transferFrom(
_sender,
_collectionsMap[_collectionId].artist,
artistReward
);
}
}
function burn(uint256 _tokenId) public {
_burn(_tokenId);
}
function getAllowedMintForMembership(
uint256 _collectionId,
uint256 _membershipId
) public view returns (uint256) {
uint256 maxMint = _genArtInterface.getMaxMintForMembership(
_membershipId
);
return maxMint - _collectionsMintMap[_collectionId][_membershipId];
}
function updateMintState(
uint256 _collectionId,
uint256 _membershipId,
uint256 _amount
) internal virtual {
_collectionsMintMap[_collectionId][_membershipId] =
_collectionsMintMap[_collectionId][_membershipId] +
_amount;
}
function updateArtistAddress(uint256 _collectionId, address _artist)
public
onlyArtist(_collectionId)
{
_collectionsMap[_collectionId].artist = _artist;
}
function updateMaxInvocations(
uint256 _collectionId,
uint256 _maxInvocations
) public onlyOwner {
_collectionsMap[_collectionId].maxInvocations = _maxInvocations;
}
function updateScript(uint256 _collectionId, string memory _script)
public
onlyOwner
{
_collectionsMap[_collectionId].script = _script;
}
function upgradeGenArtInterfaceContract(address _genArtInterfaceAddress)
public
onlyOwner
{
_genArtInterface = IGenArtInterface(_genArtInterfaceAddress);
}
function updatePrice(
uint256 _collectionId,
uint256 _price,
uint256 _priceGen
) public onlyOwner {
_collectionsMap[_collectionId].price = _price;
_collectionsMap[_collectionId].priceGen = _priceGen;
}
function getCollectionInfo(uint256 _collectionId)
public
view
returns (
uint256 invocations,
uint256 maxInvocations,
string memory script,
uint256 price,
uint256 priceGen,
address artist,
uint256 artistPercentage
)
{
require(
_collectionsMap[_collectionId].tier != 0,
"GenArtCollection: invalid collection id"
);
return (
_collectionsMap[_collectionId].invocations,
_collectionsMap[_collectionId].maxInvocations,
_collectionsMap[_collectionId].script,
_collectionsMap[_collectionId].price,
_collectionsMap[_collectionId].priceGen,
_collectionsMap[_collectionId].artist,
_collectionsMap[_collectionId].artistPercentage
);
}
function getTokenInfo(uint256 _tokenId)
public
view
returns (
uint256,
uint256,
address,
bytes32
)
{
_exists(_tokenId);
bytes32 hash = _tokenIdToHashMap[_tokenId];
uint256 _collectionId = _tokenIdToCollectionIdMap[_tokenId];
address owner = GenArtCollection.ownerOf(_tokenId);
return (_tokenId, _collectionId, owner, hash);
}
function getTokensByOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokenIds = new uint256[](tokenCount);
for (uint256 i; i < tokenCount; i++) {
tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokenIds;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner)
public
view
virtual
override
returns (uint256)
{
require(
owner != address(0),
"ERC721: balance query for the zero address"
);
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
address owner = _owners[tokenId];
require(
owner != address(0),
"ERC721: owner query for nonexistent token"
);
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory baseURI_ = baseURI();
return
bytes(baseURI_).length > 0
? string(abi.encodePacked(baseURI_, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function baseURI() internal view virtual returns (string memory) {
return _baseURI;
}
/**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI},
* or to the token ID if {tokenURI} is empty.
*/
function setBaseURI(string memory baseURI_) public onlyOwner {
_baseURI = baseURI_;
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = GenArtCollection.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(
_exists(tokenId),
"ERC721: operator query for nonexistent token"
);
address owner = GenArtCollection.ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = GenArtCollection.ownerOf(tokenId);
require(
_msgSender() == owner,
"GenArtCollection: only token owner can burn"
);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
GenArtCollection.ownerOf(tokenId) == from,
"ERC721: transfer of token that is not o...
// [truncated — 58301 bytes total]
Read Contract
balanceOf 0x70a08231 → uint256
getAllowedMintForMembership 0xc65be562 → uint256
getApproved 0x081812fc → address
getCollectionInfo 0xd4e4d3dd → uint256, uint256, string, uint256, uint256, address, uint256
getTokenInfo 0x8c7a63ae → uint256, uint256, address, bytes32
getTokensByOwner 0x40398d67 → uint256[]
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
burn 0x42966c68
uint256 _tokenId
createGenCollection 0x5bdbdc3a
address _artist
uint256 _artistPercentage
uint256 _price
uint256 _priceGen
uint256 _maxInvocations
uint256 _tier
string _script
mint 0x156e29f6
address _to
uint256 _collectionId
uint256 _membershipId
mintGen 0x5845bfb1
address _to
uint256 _collectionId
uint256 _membershipId
mintMany 0x7e3ca9ea
address _to
uint256 _collectionId
uint256 _membershipId
uint256 _amount
mintManyGen 0x3efd9ae8
address _to
uint256 _collectionId
uint256 _membershipId
uint256 _amount
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURI_
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
updateArtistAddress 0xc86e7a19
uint256 _collectionId
address _artist
updateMaxInvocations 0xf48d1154
uint256 _collectionId
uint256 _maxInvocations
updatePrice 0x0f436129
uint256 _collectionId
uint256 _price
uint256 _priceGen
updateScript 0xb155d57e
uint256 _collectionId
string _script
upgradeGenArtInterfaceContract 0xa1cf3138
address _genArtInterfaceAddress
withdraw 0x2e1a7d4d
uint256 value
Recent Transactions
No transactions found for this address