Address Contract Verified
Address
0x89ECfB3e8A8CE9DD7133FE719f79697c5c6D30BD
Balance
0 ETH
Nonce
1
Code Size
15221 bytes
Creator
0x3AA599FB...a29f at tx 0xb65ee47c...0edd5b
Indexed Transactions
0
Contract Bytecode
15221 bytes
0x6080604052600436106101085760003560e01c8063840a112811610095578063af0087b011610064578063af0087b014610355578063c16e76b214610396578063dbc938d8146103bf578063e985e9c5146103d6578063f242432a1461041357610108565b8063840a1128146102af5780638da5cb5b146102d8578063a22cb46514610303578063a2b40d191461032c57610108565b806334259b5c116100dc57806334259b5c146101ed5780634e1273f4146102165780634e6ec247146102535780637633b4ed1461026f578063782f08ae1461028657610108565b8062fdd58e1461010d57806301ffc9a71461014a5780630e89341c146101875780632eb2c2d6146101c4575b600080fd5b34801561011957600080fd5b50610134600480360381019061012f9190612756565b61043c565b6040516101419190612f97565b60405180910390f35b34801561015657600080fd5b50610171600480360381019061016c919061280e565b610506565b60405161017e9190612d7a565b60405180910390f35b34801561019357600080fd5b506101ae60048036038101906101a99190612868565b6105e8565b6040516101bb9190612d95565b60405180910390f35b3480156101d057600080fd5b506101eb60048036038101906101e691906125b0565b61068d565b005b3480156101f957600080fd5b50610214600480360381019061020f9190612868565b610720565b005b34801561022257600080fd5b5061023d60048036038101906102389190612796565b6107da565b60405161024a9190612d21565b60405180910390f35b61026d60048036038101906102689190612756565b6108f3565b005b34801561027b57600080fd5b50610284610d07565b005b34801561029257600080fd5b506102ad60048036038101906102a89190612895565b611127565b005b3480156102bb57600080fd5b506102d660048036038101906102d19190612543565b6111ff565b005b3480156102e457600080fd5b506102ed61129a565b6040516102fa9190612c44565b60405180910390f35b34801561030f57600080fd5b5061032a60048036038101906103259190612716565b6112c3565b005b34801561033857600080fd5b50610353600480360381019061034e9190612868565b61142f565b005b34801561036157600080fd5b5061037c60048036038101906103779190612516565b6114e9565b60405161038d95949392919061302d565b60405180910390f35b3480156103a257600080fd5b506103bd60048036038101906103b89190612543565b6115af565b005b3480156103cb57600080fd5b506103d461164d565b005b3480156103e257600080fd5b506103fd60048036038101906103f89190612570565b61172b565b60405161040a9190612d7a565b60405180910390f35b34801561041f57600080fd5b5061043a6004803603810190610435919061267f565b6117bf565b005b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156104ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a490612df7565b60405180910390fd5b6005600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806105d157507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806105e157506105e082611852565b5b9050919050565b6060600960008381526020019081526020016000208054610608906133a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610634906133a0565b80156106815780601f1061065657610100808354040283529160200191610681565b820191906000526020600020905b81548152906001019060200180831161066457829003601f168201915b50505050509050919050565b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806106cd57506106cc853361172b565b5b61070c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070390612e97565b60405180910390fd5b61071985858585856118bc565b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806107c75750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6107d057600080fd5b8060038190555050565b60608151835114610820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081790612f17565b60405180910390fd5b6000835167ffffffffffffffff81111561083d5761083c613508565b5b60405190808252806020026020018201604052801561086b5781602001602082028036833780820191505090505b50905060005b84518110156108e8576108b88582815181106108905761088f6134d9565b5b60200260200101518583815181106108ab576108aa6134d9565b5b602002602001015161043c565b8282815181106108cb576108ca6134d9565b5b602002602001018181525050806108e190613403565b9050610871565b508091505092915050565b6000600454905062093a8060086000838152602001908152602001600020544261091d9190613280565b1061095d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095490612e17565b60405180910390fd5b8160025461096b9190613226565b34146109ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390612e37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612f57565b60405180910390fd5b600354826007600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a7b919061319f565b1115610abc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab390612f77565b60405180910390fd5b816005600083815260200190815260200160002060003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610b4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4690612ed7565b60405180910390fd5b816007600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610baf919061319f565b92505081905550816005600083815260200190815260200160002060003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c169190613280565b92505081905550816005600083815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c7d919061319f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628486604051610cfa929190613004565b60405180910390a4505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610dae5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610db757600080fd5b600960045410610dc657600080fd5b6000600460008154610dd790613403565b919050819055905061013d6005600083815260200190815260200160002060003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060086005600083815260200190815260200160002060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610eb8919061319f565b925050819055506008600560008381526020019081526020016000206000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f42919061319f565b925050819055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628461013d604051610fc2929190612fb2565b60405180910390a460008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62846008604051611062929190612fdb565b60405180910390a4600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62846008604051611104929190612fdb565b60405180910390a442600860008381526020019081526020016000208190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806111ce5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111d757600080fd5b81816009600086815260200190815260200160002091906111f99291906121f3565b50505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461125757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132990612ef7565b60405180910390fd5b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516114239190612d7a565b60405180910390a35050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114d65750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6114df57600080fd5b8060028190555050565b6000806000806000600354945060045493506005600085815260200190815260200160002060003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205492506007600085815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600254905091939590929450565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461160957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc60024761169491906131f5565b9081150290604051600060405180830381858888f193505050501580156116bf573d6000803e3d6000fd5b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611728573d6000803e3d6000fd5b50565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806117ff57506117fe853361172b565b5b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612e57565b60405180910390fd5b61184b8585858585611bb8565b5050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b8151835114611900576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f790612f37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611970576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196790612e77565b60405180910390fd5b60005b8351811015611b24576000848281518110611991576119906134d9565b5b6020026020010151905060008483815181106119b0576119af6134d9565b5b6020026020010151905060006005600084815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4990612eb7565b60405180910390fd5b8181036005600085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816005600085815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611b09919061319f565b9250508190555050505080611b1d90613403565b9050611973565b508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611b9b929190612d43565b60405180910390a4611bb1338686868686611e12565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611c28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1f90612e77565b60405180910390fd5b60006005600085815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015611cc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb790612eb7565b60405180910390fd5b8281036005600086815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550826005600086815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611d77919061319f565b925050819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628787604051611df4929190613004565b60405180910390a4611e0a338787878787611ff9565b505050505050565b611e318473ffffffffffffffffffffffffffffffffffffffff166121e0565b15611ff1578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b8152600401611e77959493929190612c5f565b602060405180830381600087803b158015611e9157600080fd5b505af1925050508015611ec257506040513d601f19601f82011682018060405250810190611ebf919061283b565b60015b611f6857611ece613537565b806308c379a01415611f2b5750611ee3613a36565b80611eee5750611f2d565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f229190612d95565b60405180910390fd5b505b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5f90612db7565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611fef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fe690612dd7565b60405180910390fd5b505b505050505050565b6120188473ffffffffffffffffffffffffffffffffffffffff166121e0565b156121d8578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b815260040161205e959493929190612cc7565b602060405180830381600087803b15801561207857600080fd5b505af19250505080156120a957506040513d601f19601f820116820180604052508101906120a6919061283b565b60015b61214f576120b5613537565b806308c379a0141561211257506120ca613a36565b806120d55750612114565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121099190612d95565b60405180910390fd5b505b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214690612db7565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146121d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cd90612dd7565b60405180910390fd5b505b505050505050565b600080823b905060008111915050919050565b8280546121ff906133a0565b90600052602060002090601f0160209004810192826122215760008555612268565b82601f1061223a57803560ff1916838001178555612268565b82800160010185558215612268579182015b8281111561226757823582559160200191906001019061224c565b5b5090506122759190612279565b5090565b5b8082111561229257600081600090555060010161227a565b5090565b60006122a96122a4846130a5565b613080565b905080838252602082019050828560208602820111156122cc576122cb613563565b5b60005b858110156122fc57816122e288826123b8565b8452602084019350602083019250506001810190506122cf565b5050509392505050565b6000612319612314846130d1565b613080565b9050808382526020820190508285602086028201111561233c5761233b613563565b5b60005b8581101561236c57816123528882612501565b84526020840193506020830192505060018101905061233f565b5050509392505050565b6000612389612384846130fd565b613080565b9050828152602081018484840111156123a5576123a4613568565b5b6123b084828561335e565b509392505050565b6000813590506123c781613acc565b92915050565b6000813590506123dc81613ae3565b92915050565b600082601f8301126123f7576123f661355e565b5b8135612407848260208601612296565b91505092915050565b600082601f8301126124255761242461355e565b5b8135612435848260208601612306565b91505092915050565b60008135905061244d81613afa565b92915050565b60008135905061246281613b11565b92915050565b60008151905061247781613b11565b92915050565b600082601f8301126124925761249161355e565b5b81356124a2848260208601612376565b91505092915050565b60008083601f8401126124c1576124c061355e565b5b8235905067ffffffffffffffff8111156124de576124dd613559565b5b6020830191508360018202830111156124fa576124f9613563565b5b9250929050565b60008135905061251081613b28565b92915050565b60006020828403121561252c5761252b613572565b5b600061253a848285016123b8565b91505092915050565b60006020828403121561255957612558613572565b5b6000612567848285016123cd565b91505092915050565b6000806040838503121561258757612586613572565b5b6000612595858286016123b8565b92505060206125a6858286016123b8565b9150509250929050565b600080600080600060a086880312156125cc576125cb613572565b5b60006125da888289016123b8565b95505060206125eb888289016123b8565b945050604086013567ffffffffffffffff81111561260c5761260b61356d565b5b61261888828901612410565b935050606086013567ffffffffffffffff8111156126395761263861356d565b5b61264588828901612410565b925050608086013567ffffffffffffffff8111156126665761266561356d565b5b6126728882890161247d565b9150509295509295909350565b600080600080600060a0868803121561269b5761269a613572565b5b60006126a9888289016123b8565b95505060206126ba888289016123b8565b94505060406126cb88828901612501565b93505060606126dc88828901612501565b925050608086013567ffffffffffffffff8111156126fd576126fc61356d565b5b6127098882890161247d565b9150509295509295909350565b6000806040838503121561272d5761272c613572565b5b600061273b858286016123b8565b925050602061274c8582860161243e565b9150509250929050565b6000806040838503121561276d5761276c613572565b5b600061277b858286016123b8565b925050602061278c85828601612501565b9150509250929050565b600080604083850312156127ad576127ac613572565b5b600083013567ffffffffffffffff8111156127cb576127ca61356d565b5b6127d7858286016123e2565b925050602083013567ffffffffffffffff8111156127f8576127f761356d565b5b61280485828601612410565b9150509250929050565b60006020828403121561282457612823613572565b5b600061283284828501612453565b91505092915050565b60006020828403121561285157612850613572565b5b600061285f84828501612468565b91505092915050565b60006020828403121561287e5761287d613572565b5b600061288c84828501612501565b91505092915050565b6000806000604084860312156128ae576128ad613572565b5b60006128bc86828701612501565b935050602084013567ffffffffffffffff8111156128dd576128dc61356d565b5b6128e9868287016124ab565b92509250509250925092565b60006129018383612c26565b60208301905092915050565b612916816132b4565b82525050565b60006129278261313e565b612931818561316c565b935061293c8361312e565b8060005b8381101561296d57815161295488826128f5565b975061295f8361315f565b925050600181019050612940565b5085935050505092915050565b612983816132d8565b82525050565b600061299482613149565b61299e818561317d565b93506129ae81856020860161336d565b6129b781613577565b840191505092915050565b6129cb8161333a565b82525050565b6129da8161334c565b82525050565b60006129eb82613154565b6129f5818561318e565b9350612a0581856020860161336d565b612a0e81613577565b840191505092915050565b6000612a2660348361318e565b9150612a3182613595565b604082019050919050565b6000612a4960288361318e565b9150612a54826135e4565b604082019050919050565b6000612a6c602b8361318e565b9150612a7782613633565b604082019050919050565b6000612a8f603a8361318e565b9150612a9a82613682565b604082019050919050565b6000612ab260258361318e565b9150612abd826136d1565b604082019050919050565b6000612ad560298361318e565b9150612ae082613720565b604082019050919050565b6000612af860258361318e565b9150612b038261376f565b604082019050919050565b6000612b1b60328361318e565b9150612b26826137be565b604082019050919050565b6000612b3e602a8361318e565b9150612b498261380d565b604082019050919050565b6000612b61602e8361318e565b9150612b6c8261385c565b604082019050919050565b6000612b8460298361318e565b9150612b8f826138ab565b604082019050919050565b6000612ba760298361318e565b9150612bb2826138fa565b604082019050919050565b6000612bca60288361318e565b9150612bd582613949565b604082019050919050565b6000612bed60218361318e565b9150612bf882613998565b604082019050919050565b6000612c1060228361318e565b9150612c1b826139e7565b604082019050919050565b612c2f81613330565b82525050565b612c3e81613330565b82525050565b6000602082019050612c59600083018461290d565b92915050565b600060a082019050612c74600083018861290d565b612c81602083018761290d565b8181036040830152612c93818661291c565b90508181036060830152612ca7818561291c565b90508181036080830152612cbb8184612989565b90509695505050505050565b600060a082019050612cdc600083018861290d565b612ce9602083018761290d565b612cf66040830186612c35565b612d036060830185612c35565b8181036080830152612d158184612989565b90509695505050505050565b60006020820190508181036000830152612d3b818461291c565b905092915050565b60006040820190508181036000830152612d5d818561291c565b90508181036020830152612d71818461291c565b90509392505050565b6000602082019050612d8f600083018461297a565b92915050565b60006020820190508181036000830152612daf81846129e0565b905092915050565b60006020820190508181036000830152612dd081612a19565b9050919050565b60006020820190508181036000830152612df081612a3c565b9050919050565b60006020820190508181036000830152612e1081612a5f565b9050919050565b60006020820190508181036000830152612e3081612a82565b9050919050565b60006020820190508181036000830152612e5081612aa5565b9050919050565b60006020820190508181036000830152612e7081612ac8565b9050919050565b60006020820190508181036000830152612e9081612aeb565b9050919050565b60006020820190508181036000830152612eb081612b0e565b9050919050565b60006020820190508181036000830152612ed081612b31565b9050919050565b60006020820190508181036000830152612ef081612b54565b9050919050565b60006020820190508181036000830152612f1081612b77565b9050919050565b60006020820190508181036000830152612f3081612b9a565b9050919050565b60006020820190508181036000830152612f5081612bbd565b9050919050565b60006020820190508181036000830152612f7081612be0565b9050919050565b60006020820190508181036000830152612f9081612c03565b9050919050565b6000602082019050612fac6000830184612c35565b92915050565b6000604082019050612fc76000830185612c35565b612fd460208301846129c2565b9392505050565b6000604082019050612ff06000830185612c35565b612ffd60208301846129d1565b9392505050565b60006040820190506130196000830185612c35565b6130266020830184612c35565b9392505050565b600060a0820190506130426000830188612c35565b61304f6020830187612c35565b61305c6040830186612c35565b6130696060830185612c35565b6130766080830184612c35565b9695505050505050565b600061308a61309b565b905061309682826133d2565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf613508565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156130ec576130eb613508565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561311857613117613508565b5b61312182613577565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131aa82613330565b91506131b583613330565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131ea576131e961344c565b5b828201905092915050565b600061320082613330565b915061320b83613330565b92508261321b5761321a61347b565b5b828204905092915050565b600061323182613330565b915061323c83613330565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132755761327461344c565b5b828202905092915050565b600061328b82613330565b915061329683613330565b9250828210156132a9576132a861344c565b5b828203905092915050565b60006132bf82613310565b9050919050565b60006132d182613310565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061334582613330565b9050919050565b600061335782613330565b9050919050565b82818337600083830152505050565b60005b8381101561338b578082015181840152602081019050613370565b8381111561339a576000848401525b50505050565b600060028204905060018216806133b857607f821691505b602082108114156133cc576133cb6134aa565b5b50919050565b6133db82613577565b810181811067ffffffffffffffff821117156133fa576133f9613508565b5b80604052505050565b600061340e82613330565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134415761344061344c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060033d11156135565760046000803e613553600051613588565b90505b90565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160e01c9050919050565b7f455243313135353a207472616e7366657220746f206e6f6e204552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2062616c616e636520717565727920666f7220746865207a60008201527f65726f2061646472657373000000000000000000000000000000000000000000602082015250565b7f54686552656441706546616d696c793a204d696e74696e6720706572696f642060008201527f666f72207468697320657069736f64652068617320656e646564000000000000602082015250565b7f54686552656441706546616d696c793a20496e73756666696369656e7420626160008201527f6c616e6365000000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260008201527f20617070726f7665640000000000000000000000000000000000000000000000602082015250565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a207472616e736665722063616c6c6572206973206e6f742060008201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000602082015250565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b7f54686552656441706546616d696c793a20496e73756666696369656e74204e4660008201527f547320666f72206d696e74696e67000000000000000000000000000000000000602082015250565b7f455243313135353a2073657474696e6720617070726f76616c2073746174757360008201527f20666f722073656c660000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f54686552656441706546616d696c793a204d6178206d696e747320726561636860008201527f6564000000000000000000000000000000000000000000000000000000000000602082015250565b600060443d1015613a4657613ac9565b613a4e61309b565b60043d036004823e80513d602482011167ffffffffffffffff82111715613a76575050613ac9565b808201805167ffffffffffffffff811115613a945750505050613ac9565b80602083010160043d038501811115613ab1575050505050613ac9565b613ac0826020018501866133d2565b82955050505050505b90565b613ad5816132b4565b8114613ae057600080fd5b50565b613aec816132c6565b8114613af757600080fd5b50565b613b03816132d8565b8114613b0e57600080fd5b50565b613b1a816132e4565b8114613b2557600080fd5b50565b613b3181613330565b8114613b3c57600080fd5b5056fea26469706673582212205f05b543d5d8eb4423acc41d13013fc861caccb7dd48e30bef37e6cce928e9a664736f6c63430008070033
Verified Source Code Full Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
ERC1155.sol 719 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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);
}
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;
}
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);
}
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);
}
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
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);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private 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);
}
}
}
}
library Strings {
bytes16 private constant alphabet = "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] = alphabet[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
contract ERC1155 is ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
using Strings for uint256;
address payable _owner1;
address payable _owner2;
uint256 private _price = 0;
uint256 private _maxMints = 10;
uint256 private _episode = 0;
// 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;
mapping(uint256 => mapping(address => uint256)) private _mints;
mapping (uint256 => uint256) private _mintTimeStamp; //when mint of this episode started
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
mapping(uint256 => string) private _uri;
function owner() external view returns (address) {
return _owner1;
}
function webData(address user) external view returns(uint256 maxMint, uint256 episode, uint256 leftNFT, uint256 userMints, uint256 price) {
maxMint = _maxMints;
episode = _episode;
leftNFT = _balances[episode][address(this)];
userMints = _mints[episode][user];
price = _price;
}
function changeOwner1(address payable owner) external {
require(msg.sender == _owner1);
_owner1 = owner;
}
function changeOwner2(address payable owner) external {
require(msg.sender == _owner2);
_owner2 = owner;
}
function changePrice(uint256 newPrice) external {
require(msg.sender == _owner1 || msg.sender == _owner2);
_price = newPrice;
}
function changeMintLimit(uint256 newLimit) external {
require(msg.sender == _owner1 || msg.sender == _owner2);
_maxMints = newLimit;
}
constructor(address payable owner1, address payable owner2) {
_owner1 = owner1;
_owner2 = owner2;
_balances[0][address(this)] = 317;
_balances[0][owner1] += 8;
_balances[0][owner2] += 8;
emit TransferSingle(msg.sender, address(0), address(this), 0, 317);
emit TransferSingle(msg.sender, address(0), owner1, 0, 8);
emit TransferSingle(msg.sender, address(0), owner2, 0, 8);
_mintTimeStamp[0] = block.timestamp;
}
function concat(string memory _base, string memory _value) pure internal returns (string memory) {
bytes memory _baseBytes = bytes(_base);
bytes memory _valueBytes = bytes(_value);
string memory _tmpValue = new string(_baseBytes.length + _valueBytes.length);
bytes memory _newValue = bytes(_tmpValue);
uint i;
uint j;
for(i=0;i<_baseBytes.length;i++) {
_newValue[j++] = _baseBytes[i];
}
for(i=0;i<_valueBytes.length;i++) {
_newValue[j++] = _valueBytes[i];
}
return string(_newValue);
}
function uri(uint256 id) external view override returns (string memory) {
return _uri[id];
}
function setUri(uint256 id, string calldata uri) external {
require(msg.sender == _owner1 || msg.sender == _owner2);
_uri[id] = uri;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address account, uint256 id) public view override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
function balanceOfBatch(address[] memory accounts, uint256[] memory ids) external view 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;
}
function setApprovalForAll(address operator, bool approved) external override {
require(msg.sender != operator, "ERC1155: setting approval status for self");
_operatorApprovals[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function isApprovedForAll(address account, address operator) public view override returns (bool) {
return _operatorApprovals[account][operator];
}
function safeTransferFrom(address from,address to,uint256 id,uint256 amount,bytes memory data) external override {
require(
from == msg.sender || isApprovedForAll(from, msg.sender),
"ERC1155: caller is not owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
function safeBatchTransferFrom(address from,address to,uint256[] memory ids,uint256[] memory amounts,bytes memory data) public virtual override {
require(
from == msg.sender || isApprovedForAll(from, msg.sender),
"ERC1155: transfer caller is not owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
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");
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(msg.sender, from, to, id, amount);
_doSafeTransferAcceptanceCheck(msg.sender, from, to, id, amount, data);
}
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");
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(msg.sender, from, to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(msg.sender, from, to, ids, amounts, data);
}
function _mint(address account, uint256 amount) external payable {
uint256 id = _episode;
require(block.timestamp - _mintTimeStamp[id] < 604800, "TheRedApeFamily: Minting period for this episode has ended");
require(msg.value == _price * amount, "TheRedApeFamily: Insufficient balance");
require(account != address(0), "ERC1155: mint to the zero address");
require(_mints[id][msg.sender] + amount <= _maxMints, "TheRedApeFamily: Max mints reached");
require(_balances[id][address(this)] >= amount, "TheRedApeFamily: Insufficient NFTs for minting");
_mints[id][msg.sender] += amount;
_balances[id][address(this)] -= amount;
_balances[id][account] += amount;
emit TransferSingle(msg.sender, address(this), account, id, amount);
}
function distributeEth() external {
_owner1.transfer(address(this).balance / 2);
_owner2.transfer(address(this).balance);
}
function nextEpisode() external {
require(msg.sender == _owner1 || msg.sender == _owner2);
require(_episode < 9);
uint256 episode = ++_episode;
_balances[episode][address(this)] = 317;
_balances[episode][_owner1] += 8;
_balances[episode][_owner2] += 8;
emit TransferSingle(msg.sender, address(0), address(this), episode, 317);
emit TransferSingle(msg.sender, address(0), _owner1, episode, 8);
emit TransferSingle(msg.sender, address(0), _owner2, episode, 8);
_mintTimeStamp[episode] = block.timestamp;
}
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(to).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(to).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;
}
}
Read Contract
balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
isApprovedForAll 0xe985e9c5 → bool
owner 0x8da5cb5b → address
supportsInterface 0x01ffc9a7 → bool
uri 0x0e89341c → string
webData 0xaf0087b0 → uint256, uint256, uint256, uint256, uint256
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
_mint 0x4e6ec247
address account
uint256 amount
changeMintLimit 0x34259b5c
uint256 newLimit
changeOwner1 0x840a1128
address owner
changeOwner2 0xc16e76b2
address owner
changePrice 0xa2b40d19
uint256 newPrice
distributeEth 0xdbc938d8
No parameters
nextEpisode 0x7633b4ed
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
setUri 0x782f08ae
uint256 id
string uri
Recent Transactions
No transactions found for this address