Address Contract Verified
Address
0xB49698F5eA127BeE52d5bA0B9F50a65E39228921
Balance
0.014506 ETH
Nonce
1
Code Size
20895 bytes
Creator
0xAa52AC3D...12b1 at tx 0xc859796b...3287d6
Indexed Transactions
0
Contract Bytecode
20895 bytes
0x60806040526004361061022f5760003560e01c806379830cc81161012e578063c0220347116100ab578063e39ffeef1161006f578063e39ffeef14610842578063e5187f431461086d578063e985e9c514610896578063f242432a146108d3578063f2fde38b146108fc5761022f565b8063c02203471461076a578063c1493a3114610795578063c83c0590146107c0578063d720ad8a146107dc578063e1a93466146108195761022f565b80639e86554a116100f25780639e86554a1461069d578063a1470e1a146106c6578063a22cb465146106ef578063ab9fb4e914610718578063b0700eb5146107415761022f565b806379830cc8146105c85780638317a505146105f35780638da5cb5b1461061c578063900cf0cf1461064757806395d89b41146106725761022f565b806327827ae8116101bc5780634e1273f4116101805780634e1273f4146104e35780635a08fa79146105205780635dce15a91461054b5780636da4e8ab14610574578063715018a6146105b15761022f565b806327827ae8146103fe578063282f1f94146104295780632eb2c2d6146104665780633205511a1461048f5780634b423d02146104cc5761022f565b80630e89341c116102035780630e89341c146103045780631584d8d8146103415780631b76a1f41461037f5780632685fd14146103aa57806326cf4479146103d55761022f565b8062fdd58e1461023457806301ffc9a714610271578063060bd1d4146102ae57806306fdde03146102d9575b600080fd5b34801561024057600080fd5b5061025b60048036038101906102569190613479565b610925565b60405161026891906134c8565b60405180910390f35b34801561027d57600080fd5b506102986004803603810190610293919061353b565b6109ed565b6040516102a59190613583565b60405180910390f35b3480156102ba57600080fd5b506102c3610acf565b6040516102d091906135ad565b60405180910390f35b3480156102e557600080fd5b506102ee610af5565b6040516102fb9190613658565b60405180910390f35b34801561031057600080fd5b5061032b6004803603810190610326919061367a565b610b83565b6040516103389190613658565b60405180910390f35b34801561034d57600080fd5b506103686004803603810190610363919061367a565b610c7c565b6040516103769291906136a7565b60405180910390f35b34801561038b57600080fd5b50610394610d28565b6040516103a191906134c8565b60405180910390f35b3480156103b657600080fd5b506103bf610d2e565b6040516103cc91906134c8565b60405180910390f35b3480156103e157600080fd5b506103fc60048036038101906103f79190613703565b610d34565b005b34801561040a57600080fd5b50610413610f17565b60405161042091906134c8565b60405180910390f35b34801561043557600080fd5b50610450600480360381019061044b9190613756565b610f1d565b60405161045d9190613583565b60405180910390f35b34801561047257600080fd5b5061048d600480360381019061048891906139a6565b610fe7565b005b34801561049b57600080fd5b506104b660048036038101906104b19190613a75565b611088565b6040516104c39190613583565b60405180910390f35b3480156104d857600080fd5b506104e16110d1565b005b3480156104ef57600080fd5b5061050a60048036038101906105059190613b9f565b61126d565b6040516105179190613cd5565b60405180910390f35b34801561052c57600080fd5b50610535611386565b60405161054291906134c8565b60405180910390f35b34801561055757600080fd5b50610572600480360381019061056d9190613cf7565b61138c565b005b34801561058057600080fd5b5061059b6004803603810190610596919061367a565b611457565b6040516105a891906134c8565b60405180910390f35b3480156105bd57600080fd5b506105c661146f565b005b3480156105d457600080fd5b506105dd611483565b6040516105ea91906134c8565b60405180910390f35b3480156105ff57600080fd5b5061061a60048036038101906106159190613dc5565b611489565b005b34801561062857600080fd5b506106316115da565b60405161063e91906135ad565b60405180910390f35b34801561065357600080fd5b5061065c611604565b60405161066991906134c8565b60405180910390f35b34801561067e57600080fd5b5061068761160a565b6040516106949190613658565b60405180910390f35b3480156106a957600080fd5b506106c460048036038101906106bf9190613e21565b611698565b005b3480156106d257600080fd5b506106ed60048036038101906106e89190613cf7565b611897565b005b3480156106fb57600080fd5b5061071660048036038101906107119190613e90565b611962565b005b34801561072457600080fd5b5061073f600480360381019061073a9190613ed0565b611978565b005b34801561074d57600080fd5b5061076860048036038101906107639190613ed0565b611b4d565b005b34801561077657600080fd5b5061077f611d88565b60405161078c91906135ad565b60405180910390f35b3480156107a157600080fd5b506107aa611dae565b6040516107b791906134c8565b60405180910390f35b6107da60048036038101906107d59190613f10565b611db4565b005b3480156107e857600080fd5b5061080360048036038101906107fe9190613f6c565b6120d9565b6040516108109190613583565b60405180910390f35b34801561082557600080fd5b50610840600480360381019061083b9190613fb5565b61210f565b005b34801561084e57600080fd5b506108576121b0565b60405161086491906134c8565b60405180910390f35b34801561087957600080fd5b50610894600480360381019061088f9190613cf7565b6121b6565b005b3480156108a257600080fd5b506108bd60048036038101906108b89190614011565b612202565b6040516108ca9190613583565b60405180910390f35b3480156108df57600080fd5b506108fa60048036038101906108f59190614051565b612296565b005b34801561090857600080fd5b50610923600480360381019061091e9190613cf7565b612337565b005b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610995576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098c9061415a565b60405180910390fd5b60008083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610ab857507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610ac85750610ac7826123ba565b5b9050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054610b02906141a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2e906141a9565b8015610b7b5780601f10610b5057610100808354040283529160200191610b7b565b820191906000526020600020905b815481529060010190602001808311610b5e57829003601f168201915b505050505081565b6060600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166358d932718360126000868152602001908152602001600020600101601260008781526020019081526020016000206000016000600b54815260200190815260200160002060009054906101000a900460ff166040518463ffffffff1660e01b8152600401610c2f93929190614273565b600060405180830381865afa158015610c4c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c759190614321565b9050919050565b6012602052806000526040600020600091509050806001018054610c9f906141a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ccb906141a9565b8015610d185780601f10610ced57610100808354040283529160200191610d18565b820191906000526020600020905b815481529060010190602001808311610cfb57829003601f168201915b5050505050908060020154905082565b600e5481565b60075481565b8181600080610d438385610925565b11610d4f576000610d52565b60015b905080610d8b576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d96338385612424565b610dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcc906143b6565b60405180910390fd5b6000600b5403610e11576040517fd2ade55600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000851480610e20575060fa85115b15610e57576040517f618fae5d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85601260008781526020019081526020016000206000016000600b54815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff1685600b547fe23fcb7fb524c88dc2d6c2925e44751bd642a28b13e18ec882dd5c16e497ee08438a604051610ee49291906143d6565b60405180910390a46001600b5410158015610f015750600c544310155b15610f0f57610f0e612524565b5b505050505050565b60085481565b6000601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060006013600086815260200190815260200160002054815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1690509392505050565b610fef612552565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148061103557506110348561102f612552565b612202565b5b611074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106b90614471565b60405180910390fd5b611081858585858561255a565b5050505050565b601460205283600052604060002060205282600052604060002060205281600052604060002060205280600052604060002060009350935050509054906101000a900460ff1681565b6110d961287b565b600047905060006040518060400160405280600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152509050600060405180604001604052806064856007546111b091906144c0565b6111ba9190614531565b81526020016064856008546111cf91906144c0565b6111d99190614531565b815250905060005b6002816111ed90614562565b915081101561126757828160028110611209576112086145aa565b5b602002015173ffffffffffffffffffffffffffffffffffffffff166108fc83836002811061123a576112396145aa565b5b60200201519081150290604051600060405180830381858888f1935050505061126257600080fd5b6111e1565b50505050565b606081518351146112b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112aa9061464b565b60405180910390fd5b6000835167ffffffffffffffff8111156112d0576112cf6137ae565b5b6040519080825280602002602001820160405280156112fe5781602001602082028036833780820191505090505b50905060005b845181101561137b5761134b858281518110611323576113226145aa565b5b602002602001015185838151811061133e5761133d6145aa565b5b6020026020010151610925565b82828151811061135e5761135d6145aa565b5b6020026020010181815250508061137490614562565b9050611304565b508091505092915050565b600d5481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611413576040517fd2ade55600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60136020528060005260406000206000915090505481565b61147761287b565b61148160006128f9565b565b60105481565b61149161287b565b60008251036114cc576040517f7cea490200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6011826040516114dc91906146a7565b908152602001604051809103902060009054906101000a900460ff161561152f576040517f9e4b268500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006011601260008481526020019081526020016000206001016040516115569190614741565b908152602001604051809103902060006101000a81548160ff0219169083151502179055508160126000838152602001908152602001600020600101908161159e91906148ef565b5060016011836040516115b191906146a7565b908152602001604051809103902060006101000a81548160ff0219169083151502179055505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600b5481565b60048054611617906141a9565b80601f0160208091040260200160405190810160405280929190818152602001828054611643906141a9565b80156116905780601f1061166557610100808354040283529160200191611690565b820191906000526020600020905b81548152906001019060200180831161167357829003601f168201915b505050505081565b81816000806116a78385610925565b116116b35760006116b6565b60015b9050806116ef576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116fa338385612424565b611739576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611730906143b6565b60405180910390fd5b6000865103611774576040517f7cea490200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000601260008781526020019081526020016000206001018054611797906141a9565b905011156117d1576040517fbcde494100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6011866040516117e191906146a7565b908152602001604051809103902060009054906101000a900460ff1615611834576040517f9e4b268500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8560126000878152602001908152602001600020600101908161185791906148ef565b50600160118760405161186a91906146a7565b908152602001604051809103902060006101000a81548160ff021916908315150217905550505050505050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461191e576040517fd2ade55600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61197461196d612552565b83836129bf565b5050565b81336000806119878385610925565b11611993576000611996565b60015b9050806119cf576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6119da338385612424565b611a19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a10906143b6565b60405180910390fd5b6000601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087815260200190815260200160002060006013600089815260200190815260200160002054815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060136000868152602001908152602001600020543373ffffffffffffffffffffffffffffffffffffffff16867faa355409a6e3946a8bc4a22f500bafdabdf30c51bad48806a1c67e823e6742e187604051611b3e91906135ad565b60405180910390a45050505050565b8133600080611b5c8385610925565b11611b68576000611b6b565b60015b905080611ba4576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611baf338385612424565b611bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be5906143b6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611c54576040517fd2ade55600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087815260200190815260200160002060006013600089815260200190815260200160002054815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060136000868152602001908152602001600020543373ffffffffffffffffffffffffffffffffffffffff16867f01529e3d50a9c4bc4ec15fbbf7948d5822be104571eebd1ace510b9040f77e2687604051611d7991906135ad565b60405180910390a45050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b6000815103611def576040517fcb192f2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006004825110611e1b578151601054611e0991906144c0565b81611e1491906149c1565b9050611e38565b8151600f54611e2a91906144c0565b81611e3591906149c1565b90505b803414611e71576040517fd2ade55600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82518110156120c0576000838281518110611e9257611e916145aa565b5b60200260200101511480611ec0575060fa838281518110611eb657611eb56145aa565b5b6020026020010151115b15611ef7576040517fd2ade55600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060126000858481518110611f1057611f0f6145aa565b5b60200260200101518152602001908152602001600020600201541115611f62576040517fcfa5127400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60126000848381518110611f7957611f786145aa565b5b6020026020010151815260200190815260200160002060020160008154809291906001019190505550600160126000858481518110611fbb57611fba6145aa565b5b602002602001015181526020019081526020016000206000016000600b54815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff16838281518110612028576120276145aa565b5b6020026020010151600b547fe23fcb7fb524c88dc2d6c2925e44751bd642a28b13e18ec882dd5c16e497ee084360016040516120659291906143d6565b60405180910390a46120a98484838060010194508151811061208a576120896145aa565b5b6020026020010151600160405180602001604052806000815250612b2b565b600e60008154809291906001019190505550611e74565b5060fa600e54036120d4576120d3612524565b5b505050565b6011818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900460ff1681565b61211761287b565b6000821480612127575060fa8211155b1561215e576040517fd2ade55600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81518110156121ab576121a6828280600101935081518110612186576121856145aa565b5b602002602001015184600160405180602001604052806000815250612b2b565b612161565b505050565b600f5481565b6121be61287b565b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61229e612552565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806122e457506122e3856122de612552565b612202565b5b612323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231a90614471565b60405180910390fd5b6123308585858585612cdb565b5050505050565b61233f61287b565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036123ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a590614a67565b60405180910390fd5b6123b7816128f9565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061251b5750601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060006013600085815260200190815260200160002054815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b90509392505050565b600d544361253291906149c1565b600c81905550600b600081548092919061254b90614562565b9190505550565b600033905090565b815183511461259e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259590614af9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361260d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260490614b8b565b60405180910390fd5b6000612617612552565b9050612627818787878787612f76565b60005b84518110156127d8576000858281518110612648576126476145aa565b5b602002602001015190506000858381518110612667576126666145aa565b5b60200260200101519050600080600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015612708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ff90614c1d565b60405180910390fd5b81810360008085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160008085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546127bd91906149c1565b92505081905550505050806127d190614562565b905061262a565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161284f929190614c3d565b60405180910390a4612865818787878787612f7e565b612873818787878787612f86565b505050505050565b612883612552565b73ffffffffffffffffffffffffffffffffffffffff166128a16115da565b73ffffffffffffffffffffffffffffffffffffffff16146128f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ee90614cc0565b60405180910390fd5b565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2490614d52565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612b1e9190613583565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603612b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b9190614de4565b60405180910390fd5b6000612ba4612552565b90506000612bb18561315d565b90506000612bbe8561315d565b9050612bcf83600089858589612f76565b8460008088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612c2e91906149c1565b925050819055508673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628989604051612cac929190614e04565b60405180910390a4612cc383600089858589612f7e565b612cd2836000898989896131d7565b50505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603612d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4190614b8b565b60405180910390fd5b6000612d54612552565b90506000612d618561315d565b90506000612d6e8561315d565b9050612d7e838989858589612f76565b600080600088815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905085811015612e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0c90614c1d565b60405180910390fd5b85810360008089815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560008089815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612eca91906149c1565b925050819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628a8a604051612f47929190614e04565b60405180910390a4612f5d848a8a86868a612f7e565b612f6b848a8a8a8a8a6131d7565b505050505050505050565b505050505050565b505050505050565b612fa58473ffffffffffffffffffffffffffffffffffffffff166133ae565b15613155578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b8152600401612feb959493929190614e82565b6020604051808303816000875af192505050801561302757506040513d601f19601f820116820180604052508101906130249190614eff565b60015b6130cc57613033614f39565b806308c379a00361308f5750613047614f5b565b806130525750613091565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130869190613658565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130c39061505d565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614613153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161314a906150ef565b60405180910390fd5b505b505050505050565b60606000600167ffffffffffffffff81111561317c5761317b6137ae565b5b6040519080825280602002602001820160405280156131aa5781602001602082028036833780820191505090505b50905082816000815181106131c2576131c16145aa565b5b60200260200101818152505080915050919050565b6131f68473ffffffffffffffffffffffffffffffffffffffff166133ae565b156133a6578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b815260040161323c95949392919061510f565b6020604051808303816000875af192505050801561327857506040513d601f19601f820116820180604052508101906132759190614eff565b60015b61331d57613284614f39565b806308c379a0036132e05750613298614f5b565b806132a357506132e2565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132d79190613658565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133149061505d565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146133a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161339b906150ef565b60405180910390fd5b505b505050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613410826133e5565b9050919050565b61342081613405565b811461342b57600080fd5b50565b60008135905061343d81613417565b92915050565b6000819050919050565b61345681613443565b811461346157600080fd5b50565b6000813590506134738161344d565b92915050565b600080604083850312156134905761348f6133db565b5b600061349e8582860161342e565b92505060206134af85828601613464565b9150509250929050565b6134c281613443565b82525050565b60006020820190506134dd60008301846134b9565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613518816134e3565b811461352357600080fd5b50565b6000813590506135358161350f565b92915050565b600060208284031215613551576135506133db565b5b600061355f84828501613526565b91505092915050565b60008115159050919050565b61357d81613568565b82525050565b60006020820190506135986000830184613574565b92915050565b6135a781613405565b82525050565b60006020820190506135c2600083018461359e565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156136025780820151818401526020810190506135e7565b60008484015250505050565b6000601f19601f8301169050919050565b600061362a826135c8565b61363481856135d3565b93506136448185602086016135e4565b61364d8161360e565b840191505092915050565b60006020820190508181036000830152613672818461361f565b905092915050565b6000602082840312156136905761368f6133db565b5b600061369e84828501613464565b91505092915050565b600060408201905081810360008301526136c1818561361f565b90506136d060208301846134b9565b9392505050565b6136e081613568565b81146136eb57600080fd5b50565b6000813590506136fd816136d7565b92915050565b60008060006060848603121561371c5761371b6133db565b5b600061372a868287016136ee565b935050602061373b86828701613464565b925050604061374c8682870161342e565b9150509250925092565b60008060006060848603121561376f5761376e6133db565b5b600061377d8682870161342e565b935050602061378e86828701613464565b925050604061379f8682870161342e565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6137e68261360e565b810181811067ffffffffffffffff82111715613805576138046137ae565b5b80604052505050565b60006138186133d1565b905061382482826137dd565b919050565b600067ffffffffffffffff821115613844576138436137ae565b5b602082029050602081019050919050565b600080fd5b600061386d61386884613829565b61380e565b905080838252602082019050602084028301858111156138905761388f613855565b5b835b818110156138b957806138a58882613464565b845260208401935050602081019050613892565b5050509392505050565b600082601f8301126138d8576138d76137a9565b5b81356138e884826020860161385a565b91505092915050565b600080fd5b600067ffffffffffffffff821115613911576139106137ae565b5b61391a8261360e565b9050602081019050919050565b82818337600083830152505050565b6000613949613944846138f6565b61380e565b905082815260208101848484011115613965576139646138f1565b5b613970848285613927565b509392505050565b600082601f83011261398d5761398c6137a9565b5b813561399d848260208601613936565b91505092915050565b600080600080600060a086880312156139c2576139c16133db565b5b60006139d08882890161342e565b95505060206139e18882890161342e565b945050604086013567ffffffffffffffff811115613a0257613a016133e0565b5b613a0e888289016138c3565b935050606086013567ffffffffffffffff811115613a2f57613a2e6133e0565b5b613a3b888289016138c3565b925050608086013567ffffffffffffffff811115613a5c57613a5b6133e0565b5b613a6888828901613978565b9150509295509295909350565b60008060008060808587031215613a8f57613a8e6133db565b5b6000613a9d8782880161342e565b9450506020613aae87828801613464565b9350506040613abf87828801613464565b9250506060613ad08782880161342e565b91505092959194509250565b600067ffffffffffffffff821115613af757613af66137ae565b5b602082029050602081019050919050565b6000613b1b613b1684613adc565b61380e565b90508083825260208201905060208402830185811115613b3e57613b3d613855565b5b835b81811015613b675780613b53888261342e565b845260208401935050602081019050613b40565b5050509392505050565b600082601f830112613b8657613b856137a9565b5b8135613b96848260208601613b08565b91505092915050565b60008060408385031215613bb657613bb56133db565b5b600083013567ffffffffffffffff811115613bd457613bd36133e0565b5b613be085828601613b71565b925050602083013567ffffffffffffffff811115613c0157613c006133e0565b5b613c0d858286016138c3565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c4c81613443565b82525050565b6000613c5e8383613c43565b60208301905092915050565b6000602082019050919050565b6000613c8282613c17565b613c8c8185613c22565b9350613c9783613c33565b8060005b83811015613cc8578151613caf8882613c52565b9750613cba83613c6a565b925050600181019050613c9b565b5085935050505092915050565b60006020820190508181036000830152613cef8184613c77565b905092915050565b600060208284031215613d0d57613d0c6133db565b5b6000613d1b8482850161342e565b91505092915050565b600067ffffffffffffffff821115613d3f57613d3e6137ae565b5b613d488261360e565b9050602081019050919050565b6000613d68613d6384613d24565b61380e565b905082815260208101848484011115613d8457613d836138f1565b5b613d8f848285613927565b509392505050565b600082601f830112613dac57613dab6137a9565b5b8135613dbc848260208601613d55565b91505092915050565b60008060408385031215613ddc57613ddb6133db565b5b600083013567ffffffffffffffff811115613dfa57613df96133e0565b5b613e0685828601613d97565b9250506020613e1785828601613464565b9150509250929050565b600080600060608486031215613e3a57613e396133db565b5b600084013567ffffffffffffffff811115613e5857613e576133e0565b5b613e6486828701613d97565b9350506020613e7586828701613464565b9250506040613e868682870161342e565b9150509250925092565b60008060408385031215613ea757613ea66133db565b5b6000613eb58582860161342e565b9250506020613ec6858286016136ee565b9150509250929050565b60008060408385031215613ee757613ee66133db565b5b6000613ef585828601613464565b9250506020613f068582860161342e565b9150509250929050565b60008060408385031215613f2757613f266133db565b5b6000613f358582860161342e565b925050602083013567ffffffffffffffff811115613f5657613f556133e0565b5b613f62858286016138c3565b9150509250929050565b600060208284031215613f8257613f816133db565b5b600082013567ffffffffffffffff811115613fa057613f9f6133e0565b5b613fac84828501613d97565b91505092915050565b60008060408385031215613fcc57613fcb6133db565b5b6000613fda85828601613464565b925050602083013567ffffffffffffffff811115613ffb57613ffa6133e0565b5b61400785828601613b71565b9150509250929050565b60008060408385031215614028576140276133db565b5b60006140368582860161342e565b92505060206140478582860161342e565b9150509250929050565b600080600080600060a0868803121561406d5761406c6133db565b5b600061407b8882890161342e565b955050602061408c8882890161342e565b945050604061409d88828901613464565b93505060606140ae88828901613464565b925050608086013567ffffffffffffffff8111156140cf576140ce6133e0565b5b6140db88828901613978565b9150509295509295909350565b7f455243313135353a2061646472657373207a65726f206973206e6f742061207660008201527f616c6964206f776e657200000000000000000000000000000000000000000000602082015250565b6000614144602a836135d3565b915061414f826140e8565b604082019050919050565b6000602082019050818103600083015261417381614137565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806141c157607f821691505b6020821081036141d4576141d361417a565b5b50919050565b60008190508160005260206000209050919050565b600081546141fc816141a9565b61420681866135d3565b9450600182166000811461422157600181146142375761426a565b60ff19831686528115156020028601935061426a565b614240856141da565b60005b8381101561426257815481890152600182019150602081019050614243565b808801955050505b50505092915050565b600060608201905061428860008301866134b9565b818103602083015261429a81856141ef565b90506142a96040830184613574565b949350505050565b60006142c46142bf84613d24565b61380e565b9050828152602081018484840111156142e0576142df6138f1565b5b6142eb8482856135e4565b509392505050565b600082601f830112614308576143076137a9565b5b81516143188482602086016142b1565b91505092915050565b600060208284031215614337576143366133db565b5b600082015167ffffffffffffffff811115614355576143546133e0565b5b614361848285016142f3565b91505092915050565b7f4e6f74206f776e6572206f722064656c656761746f7200000000000000000000600082015250565b60006143a06016836135d3565b91506143ab8261436a565b602082019050919050565b600060208201905081810360008301526143cf81614393565b9050919050565b60006040820190506143eb60008301856134b9565b6143f86020830184613574565b9392505050565b7f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60008201527f6572206f7220617070726f766564000000000000000000000000000000000000602082015250565b600061445b602e836135d3565b9150614466826143ff565b604082019050919050565b6000602082019050818103600083015261448a8161444e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006144cb82613443565b91506144d683613443565b92508282026144e481613443565b915082820484148315176144fb576144fa614491565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061453c82613443565b915061454783613443565b92508261455757614556614502565b5b828204905092915050565b600061456d82613443565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361459f5761459e614491565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b60006146356029836135d3565b9150614640826145d9565b604082019050919050565b6000602082019050818103600083015261466481614628565b9050919050565b600081905092915050565b6000614681826135c8565b61468b818561466b565b935061469b8185602086016135e4565b80840191505092915050565b60006146b38284614676565b915081905092915050565b600081546146cb816141a9565b6146d5818661466b565b945060018216600081146146f0576001811461470557614738565b60ff1983168652811515820286019350614738565b61470e856141da565b60005b8381101561473057815481890152600182019150602081019050614711565b838801955050505b50505092915050565b600061474d82846146be565b915081905092915050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026147a57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82614768565b6147af8683614768565b95508019841693508086168417925050509392505050565b6000819050919050565b60006147ec6147e76147e284613443565b6147c7565b613443565b9050919050565b6000819050919050565b614806836147d1565b61481a614812826147f3565b848454614775565b825550505050565b600090565b61482f614822565b61483a8184846147fd565b505050565b5b8181101561485e57614853600082614827565b600181019050614840565b5050565b601f8211156148a357614874816141da565b61487d84614758565b8101602085101561488c578190505b6148a061489885614758565b83018261483f565b50505b505050565b600082821c905092915050565b60006148c6600019846008026148a8565b1980831691505092915050565b60006148df83836148b5565b9150826002028217905092915050565b6148f8826135c8565b67ffffffffffffffff811115614911576149106137ae565b5b61491b82546141a9565b614926828285614862565b600060209050601f8311600181146149595760008415614947578287015190505b61495185826148d3565b8655506149b9565b601f198416614967866141da565b60005b8281101561498f5784890151825560018201915060208501945060208101905061496a565b868310156149ac57848901516149a8601f8916826148b5565b8355505b6001600288020188555050505b505050505050565b60006149cc82613443565b91506149d783613443565b92508282019050808211156149ef576149ee614491565b5b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614a516026836135d3565b9150614a5c826149f5565b604082019050919050565b60006020820190508181036000830152614a8081614a44565b9050919050565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b6000614ae36028836135d3565b9150614aee82614a87565b604082019050919050565b60006020820190508181036000830152614b1281614ad6565b9050919050565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000614b756025836135d3565b9150614b8082614b19565b604082019050919050565b60006020820190508181036000830152614ba481614b68565b9050919050565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b6000614c07602a836135d3565b9150614c1282614bab565b604082019050919050565b60006020820190508181036000830152614c3681614bfa565b9050919050565b60006040820190508181036000830152614c578185613c77565b90508181036020830152614c6b8184613c77565b90509392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614caa6020836135d3565b9150614cb582614c74565b602082019050919050565b60006020820190508181036000830152614cd981614c9d565b9050919050565b7f455243313135353a2073657474696e6720617070726f76616c2073746174757360008201527f20666f722073656c660000000000000000000000000000000000000000000000602082015250565b6000614d3c6029836135d3565b9150614d4782614ce0565b604082019050919050565b60006020820190508181036000830152614d6b81614d2f565b9050919050565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000614dce6021836135d3565b9150614dd982614d72565b604082019050919050565b60006020820190508181036000830152614dfd81614dc1565b9050919050565b6000604082019050614e1960008301856134b9565b614e2660208301846134b9565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000614e5482614e2d565b614e5e8185614e38565b9350614e6e8185602086016135e4565b614e778161360e565b840191505092915050565b600060a082019050614e97600083018861359e565b614ea4602083018761359e565b8181036040830152614eb68186613c77565b90508181036060830152614eca8185613c77565b90508181036080830152614ede8184614e49565b90509695505050505050565b600081519050614ef98161350f565b92915050565b600060208284031215614f1557614f146133db565b5b6000614f2384828501614eea565b91505092915050565b60008160e01c9050919050565b600060033d1115614f585760046000803e614f55600051614f2c565b90505b90565b600060443d10614fe857614f6d6133d1565b60043d036004823e80513d602482011167ffffffffffffffff82111715614f95575050614fe8565b808201805167ffffffffffffffff811115614fb35750505050614fe8565b80602083010160043d038501811115614fd0575050505050614fe8565b614fdf826020018501866137dd565b82955050505050505b90565b7f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b60006150476034836135d3565b915061505282614feb565b604082019050919050565b600060208201905081810360008301526150768161503a565b9050919050565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b60006150d96028836135d3565b91506150e48261507d565b604082019050919050565b60006020820190508181036000830152615108816150cc565b9050919050565b600060a082019050615124600083018861359e565b615131602083018761359e565b61513e60408301866134b9565b61514b60608301856134b9565b818103608083015261515d8184614e49565b9050969550505050505056fea2646970667358221220aa63504b5d7e6ba09204d0e3fa963670c1a5f611a800d3b9ad7ef7bdad0afd6a64736f6c63430008120033
Verified Source Code Full Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: No
Venus.sol 292 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// :...:!?Y7~~!?J77!~!!5BP5~~P&&&G&&&&&&&&&&#@@@@&@@@@&&@@@@@@@@@&@@@@@@@@@@&@@@@@@@@@@&@@@@@@@@@@
// ::.:5BGJ!~?PP?:.:^7?#&GP~.^?B@#@@@@@@@@@@#@@@@@@@@@&&@@@@@@@@@&&@@@@@@@@@#@@@@@@@@@@B@@@@@@@@@@
// ^^^YPJ?J?YP?:....~Y5##BG?:..:7Y&@@@@@@@@@#@@@@@@@@@&#@@&&##BGPJ?J??7777??75PGGG&@@@@B@@@@@@@@@@
// 7!!77777!!!:...^7G&GBBBG?:^^:::7GBPPGBB##P#BGP555YJ??YJ?7!!~^^::.......::^^!7?JYG#&@B@@@@@@@@@@
// ???????7!!77?YPB&&&P##BJ:..:::^^:~7?J????!J??77!~~~^^^^^::...............:::^^~!7?5GP@@@@@@@@@@
// ~!!7?J5PYP##&&&&##BYY?~^~~~^^~^^^~!!77!77!???777!~^::....................:::::^~!7?Y?G#&@@@@@@&
// ^::::^~!~7JY55PPPY?~~~~!7???77~7777??????!777!7777!~^^:......................:^~~!?J?G#&@@@@@@@
// ~~:...........::^^~^~~~~~~~~~!~!77????JJJ7YYY?7!!~~~^^::....................::^~~7?J?G#&&@@@@@@
// ::^^:......................:::::::^^~~~!7!?JYYYJ?!^::^:::...................:^~!?JYPJ#&&&@@@@@@
// ..::::..............................:::^^^7??JY55Y?~:....................::^!7JJY5PG5&&&&@@@@@@
// ....:::::............................:::^^~!77JYYYY?~^:............::::^^^~~!!!7777?7PB#&@@@@@&
// ......:::..............^^!77!^:.........::^~!7?JY5PY??!^:.........:::::::::^~~!!!77?!5G#&@@@@@@
// .........::...........:^!?7Y5J!~:........:^^!!7?JYYJ?Y?77~::........:::::::^^^^~~~!!~?5B##&@@@@
// .........::.......... .:^~~!!~^^........:::^~!!77777!777??77~^:........::::::.....:::^!J5GBB&@@
// ..........::........... ................:::^^~!!!!!~^^^^^~!777^:.......................:~J5PPB#
// ..........:^:........................:::::^^^~~!!~^^::::::^!77~~^:.....................::~??555
// ...........:~^:........... ........:::::^^~~!!~^:::.:::^^~~!~!7!^.....................:^!7JYJ
// :...........:~^:.......... .......:::^^^^~~!~^:.........^~^~~!777~:..................::::^^~!
// ~::..........:!~^:::..............::^~~~~~!7!^.............:^~!!!!77!^:...............:::::::::
// #G5?~::.......:~!!~^^:::::::::::^^~!!77??7?7^...............:^~~~^~!~~~^:...............::^^^::
// B###BP57^.......:!7!7!~~~~~^^~~!!!7??JYJ?~~:................:^^~^:::::^^^^::::..........::::^^^
// ###BBBBB5YJ!^:....:^!77?????77!?JJJJ?7!^^:..................:^:::....:::::^::::::..........:::^
// ##&&####PPBBGPJ!:..:.:::^~~!!!~7!~~^^:::....................:::.........::::::^^:::...........:
// ##&&&&&#PB#GPG##GJ~:........::::::::::::..::::::...........::::.............::::^^::::.........
// author: jolan.eth
interface iMetadata {
function generateMetadata(
uint256,
string memory,
bool
) external view returns (string memory);
}
contract CensoredVenus is ERC1155, Ownable {
string public symbol = "VENUS";
string public name = "The Censored Venus";
struct Mozaic {
mapping(uint256 => bool) historicalViewable;
string name;
uint256 supply;
}
iMetadata Metadata;
uint256 public SHARE_PBOY = 87;
uint256 public SHARE_JOLAN = 13;
address public ADDRESS_PBOY = 0x1Af70e564847bE46e4bA286c0b0066Da8372F902;
address public ADDRESS_JOLAN = 0xe7C161519b315AE58f42f3B1709F42aE9A34A9E0;
uint256 public epoch = 0;
uint256 public epochBlock = 0;
uint256 public maxBlockPerEpoch = 7200 * 90;
uint256 public mozaicSupply = 0;
uint256 public mozaicPrice = 0.33 ether;
uint256 public reducedMozaicPrice = 0.25 ether;
mapping(string => bool) public NameRegistry;
mapping(uint256 => Mozaic) public MozaicRegistry;
mapping(uint256 => uint256) public _delegatorsIndexationMap;
mapping(address => mapping(uint256 => mapping(uint256 => mapping(address => bool))))
public _delegators;
event MozaicEntry(
uint256 indexed epoch,
uint256 indexed id,
address indexed sender,
uint256 blockNumber,
bool viewable
);
event DelegatorAdded(
uint256 indexed tokenId,
address indexed owner,
address delegator,
uint256 indexed mapIndexer
);
event DelegatorRemoved(
uint256 indexed tokenId,
address indexed owner,
address delegator,
uint256 indexed mapIndexer
);
constructor() ERC1155("") {}
function setMetadataContract(address ctr) public onlyOwner {
Metadata = iMetadata(ctr);
}
function setPboy(address PBOY) public {
if (msg.sender != ADDRESS_PBOY) revert IncorrectValue();
ADDRESS_PBOY = PBOY;
}
function setJolan(address JOLAN) public {
if (msg.sender != ADDRESS_JOLAN) revert IncorrectValue();
ADDRESS_JOLAN = JOLAN;
}
function withdrawEquity() public onlyOwner {
uint256 balance = address(this).balance;
address[2] memory shareholders = [ADDRESS_PBOY, ADDRESS_JOLAN];
uint256[2] memory _shares = [
(SHARE_PBOY * balance) / 100,
(SHARE_JOLAN * balance) / 100
];
uint256 i = 0;
while (++i < shareholders.length)
require(payable(shareholders[i]).send(_shares[i]));
}
function airdropToken(uint256 id, address[] memory addresses)
public
onlyOwner
{
if (id == 0 || id <= 250) revert IncorrectValue();
unchecked {
uint256 i = 0;
while (i < addresses.length) _mint(addresses[i++], id, 1, "");
}
}
function emitViewableForEpoch(
bool viewable,
uint256 id,
address owner
) public onlyOwnerOrDelegator(id, owner) {
if (epoch == 0) revert IncorrectValue();
if (id == 0 || id > 250) revert DoNotExist();
MozaicRegistry[id].historicalViewable[epoch] = viewable;
emit MozaicEntry(epoch, id, msg.sender, block.number, viewable);
if (epoch >= 1 && block.number >= epochBlock) _increaseEpoch();
}
function mintMozaic(address receiver, uint256[] memory ids) public payable {
if (ids.length == 0) revert ExceedMaxToBatch();
uint256 totalPrice;
if (ids.length >= 4) totalPrice += reducedMozaicPrice * ids.length;
else totalPrice += mozaicPrice * ids.length;
if (msg.value != totalPrice) revert IncorrectValue();
unchecked {
uint256 i = 0;
while (i < ids.length) {
if (ids[i] == 0 || ids[i] > 250) revert IncorrectValue();
if (MozaicRegistry[ids[i]].supply > 0) revert AlreadyExist();
MozaicRegistry[ids[i]].supply++;
MozaicRegistry[ids[i]].historicalViewable[epoch] = true;
emit MozaicEntry(epoch, ids[i], receiver, block.number, true);
_mint(receiver, ids[i++], 1, "");
mozaicSupply++;
}
}
if (mozaicSupply == 250) _increaseEpoch();
}
function nameMozaic(
string memory _name,
uint256 id,
address owner
) public onlyOwnerOrDelegator(id, owner) {
if (bytes(_name).length == 0) revert NameLengthIncorrect();
if (bytes(MozaicRegistry[id].name).length > 0) revert NameAlreadySet();
if (NameRegistry[_name]) revert NameTaken();
MozaicRegistry[id].name = _name;
NameRegistry[_name] = true;
}
function renameMozaic(string memory _name, uint256 id) public onlyOwner {
if (bytes(_name).length == 0) revert NameLengthIncorrect();
if (NameRegistry[_name]) revert NameTaken();
NameRegistry[MozaicRegistry[id].name] = false;
MozaicRegistry[id].name = _name;
NameRegistry[_name] = true;
}
function uri(uint256 id)
public
view
virtual
override
returns (string memory)
{
return
Metadata.generateMetadata(
id,
MozaicRegistry[id].name,
MozaicRegistry[id].historicalViewable[epoch]
);
}
function addDelegator(uint256 tokenId, address delegator)
public
onlyOwnerOrDelegator(tokenId, msg.sender)
{
if (delegator == address(0)) revert IncorrectValue();
_delegators[msg.sender][tokenId][_delegatorsIndexationMap[tokenId]][
delegator
] = true;
emit DelegatorAdded(
tokenId,
msg.sender,
delegator,
_delegatorsIndexationMap[tokenId]
);
}
function removeDelegator(uint256 tokenId, address delegator)
public
onlyOwnerOrDelegator(tokenId, msg.sender)
{
_delegators[msg.sender][tokenId][_delegatorsIndexationMap[tokenId]][
delegator
] = false;
emit DelegatorRemoved(
tokenId,
msg.sender,
delegator,
_delegatorsIndexationMap[tokenId]
);
}
function isDelegator(
address owner,
uint256 tokenId,
address delegator
) public view returns (bool) {
return
_delegators[owner][tokenId][_delegatorsIndexationMap[tokenId]][
delegator
];
}
function _isOwnerOrDelegator(
address account,
address owner,
uint256 tokenId
) internal view returns (bool) {
return
owner == account ||
_delegators[owner][tokenId][_delegatorsIndexationMap[tokenId]][
account
];
}
function _increaseEpoch() internal {
epochBlock = block.number + maxBlockPerEpoch;
epoch++;
}
modifier onlyOwnerOrDelegator(uint256 tokenId, address owner) {
bool ownership = balanceOf(owner, tokenId) > 0 ? true : false;
if (!ownership) revert NotOwner();
require(
_isOwnerOrDelegator(msg.sender, owner, tokenId),
"Not owner or delegator"
);
_;
}
error NameTaken();
error NameAlreadySet();
error NameLengthIncorrect();
error ExceedMaxToBatch();
error IncorrectValue();
error AlreadyTaken();
error AlreadyExist();
error IncorrectId();
error DoNotExist();
error NotOwner();
}
Address.sol 244 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
ERC1155.sol 497 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] memory accounts,
uint256[] memory ids
) public view virtual override returns (uint256[] memory) {
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* 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 _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(address from, uint256 id, uint256 amount) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}
IERC1155.sol 119 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must 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;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC1155Receiver.sol 58 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: 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.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
IERC1155MetadataURI.sol 22 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}
Read Contract
ADDRESS_JOLAN 0xc0220347 → address
ADDRESS_PBOY 0x060bd1d4 → address
MozaicRegistry 0x1584d8d8 → string, uint256
NameRegistry 0xd720ad8a → bool
SHARE_JOLAN 0x27827ae8 → uint256
SHARE_PBOY 0x2685fd14 → uint256
_delegators 0x3205511a → bool
_delegatorsIndexationMap 0x6da4e8ab → uint256
balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
epoch 0x900cf0cf → uint256
epochBlock 0xc1493a31 → uint256
isApprovedForAll 0xe985e9c5 → bool
isDelegator 0x282f1f94 → bool
maxBlockPerEpoch 0x5a08fa79 → uint256
mozaicPrice 0xe39ffeef → uint256
mozaicSupply 0x1b76a1f4 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
reducedMozaicPrice 0x79830cc8 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
uri 0x0e89341c → string
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
addDelegator 0xb0700eb5
uint256 tokenId
address delegator
airdropToken 0xe1a93466
uint256 id
address[] addresses
emitViewableForEpoch 0x26cf4479
bool viewable
uint256 id
address owner
mintMozaic 0xc83c0590
address receiver
uint256[] ids
nameMozaic 0x9e86554a
string _name
uint256 id
address owner
removeDelegator 0xab9fb4e9
uint256 tokenId
address delegator
renameMozaic 0x8317a505
string _name
uint256 id
renounceOwnership 0x715018a6
No parameters
safeBatchTransferFrom 0x2eb2c2d6
address from
address to
uint256[] ids
uint256[] amounts
bytes data
safeTransferFrom 0xf242432a
address from
address to
uint256 id
uint256 amount
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setJolan 0x5dce15a9
address JOLAN
setMetadataContract 0xe5187f43
address ctr
setPboy 0xa1470e1a
address PBOY
transferOwnership 0xf2fde38b
address newOwner
withdrawEquity 0x4b423d02
No parameters
Recent Transactions
No transactions found for this address