Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x6F784f596d62fD092A8d4e9F389c2dB29De6c95e
Balance 0 ETH
Nonce 1
Code Size 15177 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

15177 bytes
0x608060405234801561001057600080fd5b50600436106102535760003560e01c80638da5cb5b11610146578063c87b56dd116100c3578063e985e9c511610087578063e985e9c5146105d9578063ee95821d14610615578063ef5b42e714610628578063f14fcbc81461063b578063f386ff711461064e578063fbcf855f1461065657600080fd5b8063c87b56dd1461056c578063c90e5ba51461057f578063cc33c87514610592578063df7e0856146105b3578063e053faed146105c657600080fd5b80639af51f6e1161010a5780639af51f6e1461050d578063a22cb46514610520578063afde435c14610533578063b88d4fde14610546578063be985ac91461055957600080fd5b80638da5cb5b146104ae5780638e23cb3f146104c457806392d7c52b146104d757806395d89b41146104fa5780639ae248941461050257600080fd5b8063438b6300116101d45780636ee6005b116101985780636ee6005b1461041c57806370a08231146104265780637b43a8e61461043957806381e679f6146104755780638696b8871461047d57600080fd5b8063438b63001461032c5780634f64b2be1461034c578063547b87d0146103d35780636352211e146103f6578063671ff7861461040957600080fd5b8063095ea7b31161021b578063095ea7b3146102e157806318160ddd146102f657806323b872dd146102fe5780633fb27b851461031157806342842e0e1461031957600080fd5b806301ffc9a7146102585780630450e10014610280578063053affac1461029857806306fdde03146102a1578063081812fc146102b6575b600080fd5b61026b610266366004612f53565b610669565b60405190151581526020015b60405180910390f35b61028a6202a30081565b604051908152602001610277565b61028a60095481565b6102a96106bb565b60405161027791906137fc565b6102c96102c4366004612f3a565b61074d565b6040516001600160a01b039091168152602001610277565b6102f46102ef366004612d11565b610774565b005b606e5461028a565b6102f461030c366004612c44565b61088f565b6102f46108c0565b6102f4610327366004612c44565b610930565b61033f61033a366004612bf6565b61094b565b60405161027791906137b8565b61039a61035a366004612f3a565b606f6020526000908152604090208054600182015460688301546069840154606a9094015460ff808516956101009095046001600160a01b031694911686565b6040805196151587526001600160a01b0390951660208701529385019290925260608401526080830152151560a082015260c001610277565b61026b6103e1366004612bf6565b60716020526000908152604090205460ff1681565b6102c9610404366004612f3a565b610a46565b6102a9610417366004612f8d565b610aa6565b61028a62ed4e0081565b61028a610434366004612bf6565b610c69565b610460610447366004612bf6565b6070602052600090815260409020805460019091015482565b60408051928352602083019190915201610277565b61028a600b81565b61046061048b366004612bf6565b6001600160a01b0316600090815260706020526040902080546001909101549091565b60085461010090046001600160a01b03166102c9565b6102f46104d2366004612d3b565b610cef565b61026b6104e5366004612f3a565b60726020526000908152604090205460ff1681565b6102a9610dbc565b61028a6301e1338081565b6102f461051b36600461309d565b610dcb565b6102f461052e366004612ce7565b611244565b6102f461054136600461307b565b611253565b6102f4610554366004612c80565b61156b565b6102a9610567366004612f3a565b61159d565b6102a961057a366004612f3a565b611852565b6102a961058d366004613037565b6119c3565b6105a56105a0366004612f3a565b611a37565b604051610277929190613741565b61033f6105c1366004612bf6565b611b7c565b6102f46105d4366004612eb3565b611cd2565b61026b6105e7366004612c11565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6102f4610623366004612dae565b611dad565b6102f4610636366004612df2565b611e3f565b6102f4610649366004612f3a565b611ee5565b61028a60c081565b61028a610664366004612f3a565b611f93565b60006001600160e01b031982166380ac58cd60e01b148061069a57506001600160e01b03198216635b5e139f60e01b145b806106b557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546106ca906139fb565b80601f01602080910402602001604051908101604052809291908181526020018280546106f6906139fb565b80156107435780601f1061071857610100808354040283529160200191610743565b820191906000526020600020905b81548152906001019060200180831161072657829003601f168201915b5050505050905090565b6000610758826120b5565b506000908152600660205260409020546001600160a01b031690565b600061077f82610a46565b9050806001600160a01b0316836001600160a01b031614156107f25760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061080e575061080e81336105e7565b6108805760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016107e9565b61088a8383612117565b505050565b6108993382612185565b6108b55760405162461bcd60e51b81526004016107e99061380f565b61088a838383612204565b60085461010090046001600160a01b031633146108dc57600080fd5b60085460ff16156109215760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9039b2b0b632b21760891b60448201526064016107e9565b6008805460ff19166001179055565b61088a8383836040518060200160405280600081525061156b565b6060600061095883610c69565b90506000816001600160401b0381111561097457610974613aa7565b60405190808252806020026020018201604052801561099d578160200160208202803683370190505b5090506000805b83811080156109b35750606482105b15610a3c576000828152600460205260409020546001600160a01b031615610a2a5760006109e083610a46565b9050866001600160a01b0316816001600160a01b03161415610a285782848381518110610a0f57610a0f613a91565b602090810291909101015281610a2481613a36565b9250505b505b81610a3481613a36565b9250506109a4565b5090949350505050565b6000818152600460205260408120546001600160a01b0316806106b55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107e9565b6060600082516002610ab89190613999565b6001600160401b03811115610acf57610acf613aa7565b6040519080825280601f01601f191660200182016040528015610af9576020820181803683370190505b5060408051808201909152601081526f181899199a1a9b1b9c1cb0b131b232b360811b602082015290915060005b8451811015610c3f57818251868381518110610b4557610b45613a91565b0160200151610b57919060f81c613985565b81518110610b6757610b67613a91565b01602001516001600160f81b03191683610b82836002613999565b81518110610b9257610b92613a91565b60200101906001600160f81b031916908160001a905350818251868381518110610bbe57610bbe613a91565b0160200151610bd0919060f81c613a51565b81518110610be057610be0613a91565b01602001516001600160f81b03191683610bfb836002613999565b610c0690600161396d565b81518110610c1657610c16613a91565b60200101906001600160f81b031916908160001a90535080610c3781613a36565b915050610b27565b5081604051602001610c5191906134d5565b60405160208183030381529060405292505050919050565b60006001600160a01b038216610cd35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016107e9565b506001600160a01b031660009081526005602052604090205490565b60085461010090046001600160a01b031633148015610d11575060085460ff16155b610d1a57600080fd5b60005b8251811015610db6578160726000868481518110610d3d57610d3d613a91565b6020026020010151868581518110610d5757610d57613a91565b6020026020010151604051602001610d70929190613131565b60408051808303601f19018152918152815160209283012083529082019290925201600020805460ff191691151591909117905580610dae81613a36565b915050610d1d565b50505050565b6060600180546106ca906139fb565b60648360ff1610610e165760405162461bcd60e51b8152602060048201526015602482015274746f6b656e204944206f7574206f662072616e676560581b60448201526064016107e9565b60ff8084166000908152606f60205260409020541615610e785760405162461bcd60e51b815260206004820152601860248201527f746f6b656e20494420616c726561647920636c61696d6564000000000000000060448201526064016107e9565b60726000338560ff16604051602001610e92929190613131565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1680610ed5575062ed4e00600954610ed2919061396d565b42115b610f475760405162461bcd60e51b815260206004820152603d60248201527f5361666567756172643a2028616464726573732c746f6b656e6964292070616960448201527f72206e6f74206f6e2074656d706f7261727920616c6c6f77206c69737400000060648201526084016107e9565b33600081815260706020526040902060010154610fb75760405162461bcd60e51b815260206004820152602860248201527f4e6f20636f6d6d697420686173206265656e206d61646520666f722074686973604482015267206164647265737360c01b60648201526084016107e9565b6001600160a01b0381166000908152607060205260409020600101546202a30090610fe290426139b8565b1161103b5760405162461bcd60e51b815260206004820152602360248201527f6e6565642034386872206265747765656e20636f6d6d697420616e642072657660448201526219585b60ea1b60648201526084016107e9565b60008460f81b3385856040516020016110579493929190613153565b60408051601f1981840301815291815281516020928301206001600160a01b0385166000908152607090935291205490915081146110d75760405162461bcd60e51b815260206004820152601960248201527f436f6d6d6974206861736820646f65736e2774206d617463680000000000000060448201526064016107e9565b60ff85166000908152606f60205260408120600201015460408051602081018790520160405160208183030381529060405280519060200120146111505760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b21039b7b63aba34b7b760811b60448201526064016107e9565b60ff85166000908152606f602052604081204260688201556301e133806069820155805460ff1916600190811782550180549161118c83613a36565b909155505060ff85166000908152606f602052604090206001810154859160020190606481106111be576111be613a91565b01556111cd3360ff8716612368565b60ff85166000908152606f602052604081208054610100600160a81b0319163361010002179055606e80549161120283613a36565b909155505060405160ff861681527fca7dabad069fb827f92fe8b4b03d5952fe36cca0793ec55d57ad5534502be9ab9060200160405180910390a15050505050565b61124f3383836124f3565b5050565b606482106112965760405162461bcd60e51b815260206004820152601060248201526f746964206f7574206f662072616e676560801b60448201526064016107e9565b6000828152606f602052604090205460ff166112ec5760405162461bcd60e51b8152602060048201526015602482015274151bdad95b881b9bdd081e595d0818db185a5b5959605a1b60448201526064016107e9565b6000828152606f60205260409020606a015460ff161561134e5760405162461bcd60e51b815260206004820152601a60248201527f6d6178696d756d2072656672657368657320657863656564656400000000000060448201526064016107e9565b6000828152606f602052604090206069810154606890910154611371919061396d565b42116113d05760405162461bcd60e51b815260206004820152602860248201527f4d75737420776169742074696c6c20706572696f64206578706972657320746f604482015267040e4cacce4cae6d60c31b60648201526084016107e9565b6000828152606f602052604090206001810154600290910190606481106113f9576113f9613a91565b0154604080516020810184905201604051602081830303815290604052805190602001201461145b5760405162461bcd60e51b815260206004820152600e60248201526d092dcc6dee4e4cac6e840d0c2e6d60931b60448201526064016107e9565b6000828152606f6020526040812060010180549161147883613a36565b90915550506000828152606f602052604090204260688201556001810154829160020190606481106114ac576114ac613a91565b01556000828152606f6020908152604091829020600101548251858152918201527fb12fff57dc63f5e10acb127d82321dedd2cd7cb6eb9add789dcf32fc1a2317a3910160405180910390a16000828152606f6020526040902060010154600b1161124f576000828152606f602052604090819020606a01805460ff19166001179055517fb87a29b1ae4534ad46ae76a7818de1a83135bd2f7791a5cd6d5cc77d1d5f743e9061155f9084815260200190565b60405180910390a15050565b6115753383612185565b6115915760405162461bcd60e51b81526004016107e99061380f565b610db6848484846125c2565b6060606482106115e75760405162461bcd60e51b8152602060048201526015602482015274546f6b656e204944206f7574206f662072616e676560581b60448201526064016107e9565b60006115f283611f93565b905060ff6116018260c0613999565b61160c8360646139b8565b6116169083613999565b611620919061396d565b905061162d606482613985565b9050600061163a826125f5565b90506000818283604051602001611653939291906133a3565b60408051601f198184030181528282018252600a8352691e17b39f1e17b9bb339f60b11b602084810191909152825180840190935260aa83526055908301529250600290606060005b8381101561181e5760008b8152606f6020526040812060660182600281106116c6576116c6613a91565b0160009054906101000a90046001600160a01b03166001600160a01b03166373d4a13a6040518163ffffffff1660e01b815260040160006040518083038186803b15801561171357600080fd5b505afa158015611727573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261174f9190810190612fc1565b60008d8152606f60205260409020600301549091506060908061177457829150611781565b61177e83826119c3565b91505b85846002811061179357611793613a91565b60200201519a506117a58c60c0613999565b6117b08d60646139b8565b6117ba908d613999565b6117c4919061396d565b9a506117d160648c613985565b9a506117dc8b6125f5565b995084828b8c8d6040516020016117f79594939291906131e2565b6040516020818303038152906040529450505050808061181690613a36565b91505061169c565b508481856040516020016118349392919061319f565b60408051601f198184030181529190529a9950505050505050505050565b606061185d826120b5565b60006118688361159d565b6000848152606f60205260408120600190810154929350909161188b91906139b8565b9050600061189885611f93565b905060006118a583612729565b6040516020016118b591906134ff565b60408051601f198184030181529181526000888152606f60205220606a015490915060ff161561190257806040516020016118f09190613348565b60405160208183030381529060405290505b8115611935578061191283612729565b6040516020016119239291906132d4565b60405160208183030381529060405290505b8060405160200161194691906132af565b6040516020818303038152906040529050600061199561196588612729565b8361196f88612826565b604051602001611981939291906135bb565b604051602081830303815290604052612826565b9050806040516020016119a89190613576565b60405160208183030381529060405295505050505050919050565b6060600083815b602086516119d89190613985565b811015611a2d5760408051602081018790529081018290526060016040516020818303038152906040528051906020012094506020820191508151925084831882528080611a2590613a36565b9150506119ca565b5093949350505050565b604080516002808252606082810190935282916000918160200160208202803683375050506000858152606f602052604081206066015482519293506001600160a01b031691839190611a8c57611a8c613a91565b6001600160a01b039283166020918202929092018101919091526000868152606f9091526040902060670154825191169082906001908110611ad057611ad0613a91565b6001600160a01b039290921660209283029190910182015260408051600b8082526101808201909252929450849260009290919082016101608036833701905050905060005b600b811015611b72576000868152606f602052604090206002018160648110611b4157611b41613a91565b0154828281518110611b5557611b55613a91565b602090810291909101015280611b6a81613a36565b915050611b16565b5092949293505050565b60606000805b6064811015611bf057607260008583604051602001611ba2929190613131565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1615611bde5781611bda81613a36565b9250505b80611be881613a36565b915050611b82565b506000816001600160401b03811115611c0b57611c0b613aa7565b604051908082528060200260200182016040528015611c34578160200160208202803683370190505b5090506000915060005b6064811015611cca57607260008683604051602001611c5e929190613131565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1615611cb85780828481518110611c9f57611c9f613a91565b602090810291909101015282611cb481613a36565b9350505b80611cc281613a36565b915050611c3e565b509392505050565b60085461010090046001600160a01b031633148015611cf4575060085460ff16155b611cfd57600080fd5b60005b8351811015610db657818181518110611d1b57611d1b613a91565b6020026020010151606f6000868481518110611d3957611d39613a91565b60200260200101518152602001908152602001600020606601848381518110611d6457611d64613a91565b602002602001015160028110611d7c57611d7c613a91565b0180546001600160a01b0319166001600160a01b039290921691909117905580611da581613a36565b915050611d00565b60085461010090046001600160a01b031633148015611dcf575060085460ff16155b611dd857600080fd5b60005b825181101561088a578160716000858481518110611dfb57611dfb613a91565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611e3781613a36565b915050611ddb565b60085461010090046001600160a01b031633148015611e61575060085460ff16155b611e6a57600080fd5b60005b825181101561088a57818181518110611e8857611e88613a91565b6020026020010151606f6000858481518110611ea657611ea6613a91565b60200260200101518152602001908152602001600020600201600060648110611ed157611ed1613a91565b015580611edd81613a36565b915050611e6d565b3360009081526071602052604090205460ff1680611f12575062ed4e00600954611f0f919061396d565b42115b611f785760405162461bcd60e51b815260206004820152603160248201527f5361666567756172643a206d73672e73656e646572206e6f74206f6e2074656d6044820152701c1bdc985c9e48185b1b1bddc81b1a5cdd607a1b60648201526084016107e9565b33600090815260706020526040902090815542600190910155565b600080600a8360648110611fa957611fa9613a91565b01541115611fcc57600a8260648110611fc457611fc4613a91565b015492915050565b6000828152606f602052604081206069810154606890910154611fef919061396d565b6000848152606f60205260408120606a01549192509060ff1615612012576120ae565b814211158061203057506000848152606f602052604090205460ff16155b1561203a576120ae565b6000848152606f602052604090206069015461205683426139b8565b612061906064613999565b61206b9190613985565b9050606481111561207a575060645b60006120878260646139b8565b905060646120958280613999565b61209f9190613985565b6120aa9060646139b8565b9150505b9392505050565b6000818152600460205260409020546001600160a01b03166121145760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107e9565b50565b600081815260066020526040902080546001600160a01b0319166001600160a01b038416908117909155819061214c82610a46565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061219183610a46565b9050806001600160a01b0316846001600160a01b031614806121d857506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b806121fc5750836001600160a01b03166121f18461074d565b6001600160a01b0316145b949350505050565b826001600160a01b031661221782610a46565b6001600160a01b03161461223d5760405162461bcd60e51b81526004016107e9906138ae565b6001600160a01b03821661229f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107e9565b826001600160a01b03166122b282610a46565b6001600160a01b0316146122d85760405162461bcd60e51b81526004016107e9906138ae565b600081815260066020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260058552838620805460001901905590871680865283862080546001019055868652600490945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0382166123be5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107e9565b6000818152600460205260409020546001600160a01b0316156124235760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107e9565b6000818152600460205260409020546001600160a01b0316156124885760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107e9565b6001600160a01b038216600081815260056020908152604080832080546001019055848352600490915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b816001600160a01b0316836001600160a01b031614156125555760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107e9565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6125cd848484612204565b6125d98484848461298b565b610db65760405162461bcd60e51b81526004016107e99061385c565b60608161261a575050604080518082019091526002815261030360f41b602082015290565b6040805160028082528183019092526000916020820181803683370190505090506040518060400160405280601081526020016f181899199a1a9b1b9c1ca0a121a222a360811b81525083600f168151811061267857612678613a91565b602001015160f81c60f81b8160018151811061269657612696613a91565b60200101906001600160f81b031916908160001a9053506040518060400160405280601081526020016f181899199a1a9b1b9c1ca0a121a222a360811b815250600484901c600f16815181106126ee576126ee613a91565b602001015160f81c60f81b8160008151811061270c5761270c613a91565b60200101906001600160f81b031916908160001a90535092915050565b60608161274d5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612777578061276181613a36565b91506127709050600a83613985565b9150612751565b6000816001600160401b0381111561279157612791613aa7565b6040519080825280601f01601f1916602001820160405280156127bb576020820181803683370190505b5090505b84156121fc576127d06001836139b8565b91506127dd600a86613a51565b6127e890603061396d565b60f81b8183815181106127fd576127fd613a91565b60200101906001600160f81b031916908160001a90535061281f600a86613985565b94506127bf565b805160609080612846575050604080516020810190915260008152919050565b6000600361285583600261396d565b61285f9190613985565b61286a906004613999565b9050600061287982602061396d565b6001600160401b0381111561289057612890613aa7565b6040519080825280601f01601f1916602001820160405280156128ba576020820181803683370190505b5090506000604051806060016040528060408152602001613ad4604091399050600181016020830160005b86811015612946576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016128e5565b50600386066001811461296057600281146129715761297d565b613d3d60f01b60011983015261297d565b603d60f81b6000198301525b505050918152949350505050565b60006001600160a01b0384163b15612a8d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906129cf903390899088908890600401613704565b602060405180830381600087803b1580156129e957600080fd5b505af1925050508015612a19575060408051601f3d908101601f19168201909252612a1691810190612f70565b60015b612a73573d808015612a47576040519150601f19603f3d011682016040523d82523d6000602084013e612a4c565b606091505b508051612a6b5760405162461bcd60e51b81526004016107e99061385c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506121fc565b506001949350505050565b6000612aab612aa684613946565b6138f3565b9050828152838383011115612abf57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114612aed57600080fd5b919050565b600082601f830112612b0357600080fd5b81356020612b13612aa683613923565b80838252828201915082860187848660051b8901011115612b3357600080fd5b60005b85811015612b5957612b4782612ad6565b84529284019290840190600101612b36565b5090979650505050505050565b600082601f830112612b7757600080fd5b81356020612b87612aa683613923565b80838252828201915082860187848660051b8901011115612ba757600080fd5b60005b85811015612b5957813584529284019290840190600101612baa565b80358015158114612aed57600080fd5b600082601f830112612be757600080fd5b6120ae83833560208501612a98565b600060208284031215612c0857600080fd5b6120ae82612ad6565b60008060408385031215612c2457600080fd5b612c2d83612ad6565b9150612c3b60208401612ad6565b90509250929050565b600080600060608486031215612c5957600080fd5b612c6284612ad6565b9250612c7060208501612ad6565b9150604084013590509250925092565b60008060008060808587031215612c9657600080fd5b612c9f85612ad6565b9350612cad60208601612ad6565b92506040850135915060608501356001600160401b03811115612ccf57600080fd5b612cdb87828801612bd6565b91505092959194509250565b60008060408385031215612cfa57600080fd5b612d0383612ad6565b9150612c3b60208401612bc6565b60008060408385031215612d2457600080fd5b612d2d83612ad6565b946020939093013593505050565b600080600060608486031215612d5057600080fd5b83356001600160401b0380821115612d6757600080fd5b612d7387838801612af2565b94506020860135915080821115612d8957600080fd5b50612d9686828701612b66565b925050612da560408501612bc6565b90509250925092565b60008060408385031215612dc157600080fd5b82356001600160401b03811115612dd757600080fd5b612de385828601612af2565b925050612c3b60208401612bc6565b60008060408385031215612e0557600080fd5b82356001600160401b0380821115612e1c57600080fd5b612e2886838701612b66565b9350602091508185013581811115612e3f57600080fd5b85019050601f81018613612e5257600080fd5b8035612e60612aa682613923565b80828252848201915084840189868560051b8701011115612e8057600080fd5b600094505b83851015612ea3578035835260019490940193918501918501612e85565b5080955050505050509250929050565b600080600060608486031215612ec857600080fd5b83356001600160401b0380821115612edf57600080fd5b612eeb87838801612b66565b94506020860135915080821115612f0157600080fd5b612f0d87838801612b66565b93506040860135915080821115612f2357600080fd5b50612f3086828701612af2565b9150509250925092565b600060208284031215612f4c57600080fd5b5035919050565b600060208284031215612f6557600080fd5b81356120ae81613abd565b600060208284031215612f8257600080fd5b81516120ae81613abd565b600060208284031215612f9f57600080fd5b81356001600160401b03811115612fb557600080fd5b6121fc84828501612bd6565b600060208284031215612fd357600080fd5b81516001600160401b03811115612fe957600080fd5b8201601f81018413612ffa57600080fd5b8051613008612aa682613946565b81815285602083850101111561301d57600080fd5b61302e8260208301602086016139cf565b95945050505050565b6000806040838503121561304a57600080fd5b82356001600160401b0381111561306057600080fd5b61306c85828601612bd6565b95602094909401359450505050565b6000806040838503121561308e57600080fd5b50508035926020909101359150565b6000806000606084860312156130b257600080fd5b833560ff811681146130c357600080fd5b92506020840135915060408401356001600160401b038111156130e557600080fd5b8401601f810186136130f657600080fd5b612f3086823560208401612a98565b6000815180845261311d8160208601602086016139cf565b601f01601f19169290920160200192915050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b60ff60f81b851681526bffffffffffffffffffffffff198460601b1660018201528260158201526000825161318f8160358501602087016139cf565b9190910160350195945050505050565b600084516131b18184602089016139cf565b8451908301906131c58183602089016139cf565b84519101906131d88183602088016139cf565b0195945050505050565b600086516131f4818460208b016139cf565b681e3830ba3410321e9160b91b908301908152865161321a816009840160208b016139cf565b6e22207374796c653d2266696c6c3a2360881b60099290910191820152855161324a816018840160208a016139cf565b85519101906132608160188401602089016139cf565b84519101906132768160188401602088016139cf565b7f3b7374726f6b652d77696474683a302e333222202f3e0a00000000000000000060189290910191820152602f01979650505050505050565b600082516132c18184602087016139cf565b605d60f81b920191825250600101919050565b600083516132e68184602088016139cf565b80830190507f2c207b2274726169745f74797065223a202246616465222c202276616c7565228152621d101160e91b6020820152835161332d8160238401602088016139cf565b61227d60f01b60239290910191820152602501949350505050565b6000825161335a8184602087016139cf565b7f2c207b2274726169745f74797065223a2022496d6d6f7274616c222c20227661920191825250706c7565223a2022496d6d6f7274616c227d60781b6020820152603101919050565b7f3c737667207072657365727665417370656374526174696f3d22784d696e594d81527f696e206d656574222076657273696f6e3d22312e31222076696577426f783d2260208201527f3020302039362039362220786d6c6e733d22687474703a2f2f7777772e77332e60408201527f6f72672f323030302f737667223e203c67207374726f6b652d77696474683d2260608201527f2e3332223e203c726563742077696474683d223130302522206865696768743d60808201526d2231303025222066696c6c3d222360901b60a08201526000845161348a8160ae8501602089016139cf565b8451908301906134a18160ae8401602089016139cf565b84519101906134b78160ae8401602088016139cf565b631110179f60e11b60ae929091019182015260b20195945050505050565b61060f60f31b8152600082516134f28160028501602087016139cf565b9190910160020192915050565b7f2c202261747472696275746573223a205b207b2274726169745f74797065223a81527f2022526566726573686573222c202276616c7565223a2022000000000000000060208201526000825161355d8160388501602087016139cf565b61227d60f01b6038939091019283015250603a01919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516135ae81601d8501602087016139cf565b91909101601d0192915050565b747b226e616d65223a2022484153484d41524b53202360581b815283516000906135ec8160158501602089016139cf565b7f222c20226465736372697074696f6e223a2022484153484d41524b53206279206015918401918201527f307844454146424545463a2031303020756e697175652068616e6420666f726760358201527f65642069726f6e207363756c70747572657320616e642063727970746f67726160558201527f70686963616c6c79206c696e6b6564206469676974616c20746f6b656e732e226075820152845161369b8160958401602089016139cf565b7f2c2022696d616765223a2022646174613a696d6167652f7376672b786d6c3b626095929091019182015265185cd94d8d0b60d21b60b582015283516136e88160bb8401602088016139cf565b61227d60f01b60bb929091019182015260bd0195945050505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061373790830184613105565b9695505050505050565b604080825283519082018190526000906020906060840190828701845b828110156137835781516001600160a01b03168452928401929084019060010161375e565b5050508381038285015284518082528583019183019060005b81811015612b595783518352928401929184019160010161379c565b6020808252825182820181905260009190848201906040850190845b818110156137f0578351835292840192918401916001016137d4565b50909695505050505050565b6020815260006120ae6020830184613105565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b604051601f8201601f191681016001600160401b038111828210171561391b5761391b613aa7565b604052919050565b60006001600160401b0382111561393c5761393c613aa7565b5060051b60200190565b60006001600160401b0382111561395f5761395f613aa7565b50601f01601f191660200190565b6000821982111561398057613980613a65565b500190565b60008261399457613994613a7b565b500490565b60008160001904831182151516156139b3576139b3613a65565b500290565b6000828210156139ca576139ca613a65565b500390565b60005b838110156139ea5781810151838201526020016139d2565b83811115610db65750506000910152565b600181811c90821680613a0f57607f821691505b60208210811415613a3057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613a4a57613a4a613a65565b5060010190565b600082613a6057613a60613a7b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461211457600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122098574c711238e555fa5bfa7584f0fb09110aad33941bae2bd814d44041c3ac3664736f6c63430008070033

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: Yes (200 runs)
Hashmarks.sol 1507 lines
//
// █████████████████████████████████████████████████████████████████████████████████████████████████
// █████████████████████████████████████████████████████████████████████████████████████████████████
// ██████░  ▒████████████░    ▒███░      ▒████░▒████░      ▒█░     ▒██░      ▒█░      ▒█░      ▒████
// █████░ ▒░ ▒████████████░ ▒░ ▒███░ ▒█░ ▒███░  ▒████░ ▒█░ ▒██░ ▒█░ ▒██░ ▒█░ ▒██░ ▒█░ ▒██░ ▒█░ ▒████
// ████░ ▒██░ ▒███████████░ ▒█░ ▒██░ ▒██░▒██░ ▒░ ▒███░ ▒██░▒██░ ▒█░ ▒██░ ▒██░▒██░ ▒██░▒██░ ▒██░▒████
// ████░ ▒██░ ▒█░ ▒██░ ▒██░ ▒█░ ▒██░ ▒░▒███░ ▒██░ ▒██░ ▒░▒████░ ▒█░ ▒██░ ▒░▒████░ ▒░▒████░ ▒░▒██████
// ████░ ▒░▒░ ▒██░ ▒░ ▒███░ ▒█░ ▒██░   ▒███░ ▒██░ ▒██░   ▒████░    ▒███░   ▒████░   ▒████░   ▒██████
// ████░ ▒██░ ▒███░  ▒████░ ▒█░ ▒██░ ▒░▒███░      ▒██░ ▒░▒████░ ▒█░ ▒██░ ▒░▒████░ ▒░▒████░ ▒░▒██████
// ████░ ▒██░ ▒███░  ▒████░ ▒█░ ▒██░ ▒██░▒█░ ▒██░ ▒██░ ▒██████░ ▒█░ ▒██░ ▒██░▒██░ ▒██░▒██░ ▒████████
// █████░ ▒░ ▒███░ ▒░ ▒███░ ▒░ ▒███░ ▒░  ▒█░ ▒██░ ▒██░ ▒██████░ ▒█░ ▒██░ ▒░  ▒██░ ▒░  ▒██░ ▒████████
// ██████░  ▒███░ ▒██░ ▒█░    ▒███░      ▒█░ ▒██░ ▒█░   ▒████░     ▒██░      ▒█░      ▒█░   ▒███████
// █████████████████████████████████████████████████████████████████████████████████████████████████
// █████████████████████████████████████████████████████████████████████████████████████████████████
//
// HASHMARKS by 0xDEAFBEEF
// Oct 2023
//
// SPDX-License-Identifier: MIT

abstract contract DataContract {
  function data() external virtual view returns (bytes memory);
}

pragma solidity ^0.8.0;

// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

/**
 * @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);
}


// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.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;
    }
}

// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)


/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)



/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}



// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)



/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)




/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}


// OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol)

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    //    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;
    string internal _baseURI;

    mapping(uint256 => string) internal _tokenURIs;
    
    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }


    // On-chain metadata per token can optionally be stored in _tokenURIs[]
    // If it exists, use it. Otherwise use _baseURI concatenated with tokenId
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);
        if (bytes(_tokenURIs[tokenId]).length > 0) {
            return _tokenURIs[tokenId];
        }

        return bytes(_baseURI).length > 0 ? string(abi.encodePacked(_baseURI, ToString.toString(tokenId))) : "";
    }

    

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _ownerOf(tokenId) != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId, 1);

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @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, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}



// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)


/**
 * @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
     * ====
     *
     * [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://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 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);
        }
    }
}


pragma solidity ^0.8.4;

library ToString {
  function toString(uint256 value) internal pure returns (string memory) {
    // Inspired by OraclizeAPI's implementation - MIT license
    // 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);
  }
  
  bytes internal constant TABLE = "0123456789ABCDEF";    
  //returns hex byte value like 00 - ff
  function toHex(uint256 val) internal pure returns (string memory) {
    if (val==0) return "00";
      
    bytes memory buf = new bytes(2);
    buf[1] = TABLE[val & 0xf];
    buf[0] = TABLE[val >> 4 & 0xf];
    return string(buf);
  }
}

library Base64 {
    bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /// @notice Encodes some bytes to the base64 representation
    function encode(bytes memory data) internal pure returns (string memory) {
//      return string(data);
      
        uint256 len = data.length;
        if (len == 0) return "";

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((len + 2) / 3);

        // Add some extra buffer at the end
        bytes memory result = new bytes(encodedLen + 32);

        bytes memory table = TABLE;

        assembly {
            let tablePtr := add(table, 1)
            let resultPtr := add(result, 32)

            for {
                let i := 0
            } lt(i, len) {

            } {
                i := add(i, 3)
                let input := and(mload(add(data, i)), 0xffffff)

                let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))
                out := shl(224, out)

                mstore(resultPtr, out)

                resultPtr := add(resultPtr, 4)
            }

            switch mod(len, 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }

            mstore(result, encodedLen)
        }

        return string(result);
    }
}

contract Hashmarks is ERC721 {
  bool isSealed;
  address _owner;

  // H^11(secret) to claim, H^10.. H^1 for refreshes
  uint256 public constant max_hashes = 11;
  uint256 public constant fade_period = (86400*365); // 1 year

  /* image fades to this color; */
  uint256 public constant grey_fade = 0xc0;  
  
  uint256 public constant reveal_window = (86400*2); //48 hr

  /* safeguard allowlists for commit/reveal expire after 180 days,
     after which any address can perform commit/reveals */
  uint256 public constant safeguard_expire = 86400*180;
  
  uint256 public deployed_ts;
  uint256[100] fadeamounts;

  uint256 numTokens;

  struct TokenStruct {
    bool claimed;
    address claimer;
    
    uint256 hindex; //index into hashchain[]
    bytes32[100] hashchain;
    
    DataContract[2] paths; //svg paths
    uint256 last_refresh;
    uint256 period;    
    bool immortal;
  }

  struct CommitStruct {
    bytes32 hash;
    uint256 ts;
  }

  event eRefresh(uint256 tid,uint256 hindex);
  event eAscension(uint256 tid);
  event eClaim(uint256 tid);
  
  mapping(uint256 => TokenStruct) public tokens;
  mapping(address => CommitStruct) public commits;

  mapping(address => bool) public allow_commit; //safeguard allow list for address allowed to perform commits
  mapping(bytes32 => bool) public allow_reveal; //safeguard allow list for (address,token_id) eligible to be revealed


  //only performed by contract owner, before seal() is called
  modifier onlyInit() {
    require(msg.sender==_owner && isSealed == false);
    _;
  }

  //only performed by contract owner
  modifier onlyOwner() {
    require(msg.sender==_owner);
    _;
  }  

  constructor() ERC721("HASHMARKS", "HASHMARKS") {    
    deployed_ts = block.timestamp;
    _owner = msg.sender;
  }

  function owner() public view virtual returns (address) {
    return _owner;
  }
  
  function totalSupply() public view returns (uint256) {
    return numTokens;
  }
  
  function walletOfOwner(address a) public view returns (uint256[] memory) {
    uint256 ownerTokenCount = balanceOf(a);
    uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount);
    uint256 currentTokenId = 0;
    uint256 ownedTokenIndex = 0;

    while (ownedTokenIndex < ownerTokenCount && currentTokenId < 100) {
      if (_exists(currentTokenId)) {
	address currentTokenOwner = ownerOf(currentTokenId);
	if (currentTokenOwner == a) {
	  ownedTokenIds[ownedTokenIndex] = currentTokenId;
	  ownedTokenIndex++;
	}
      }
      currentTokenId++;
    }
    return ownedTokenIds;
  }

    
  // Prevents any further admin updates to initHashes, initData, safeguard_addresses or safeguard_tokenids
  function seal() public onlyOwner {
    require(isSealed == false, "Already sealed.");
    isSealed = true;
  }
  
  function initHashes(uint256[] memory tid, bytes32[] memory a) public onlyInit {
    for (uint256 i = 0;i<tid.length;i++) {
      tokens[tid[i]].hashchain[0] = a[i];
    }
  }

  // Admin maintained safeguard list of addresses allowed to perform commits
  // Safeguard expires automatically after 180 days
  function safeguard_commit(address[] memory a, bool v) public onlyInit {
    for (uint256 i = 0;i<a.length;i++)
      allow_commit[a[i]] = v;
  }
  
  // Admin maintained safeguard list of (address,token id) pairs allowed to be revealed
  // Safeguard expires automatically after 180 days
  function safeguard_reveal(address[] memory a, uint256[] memory tid, bool v) public onlyInit {
    for (uint256 i = 0;i<tid.length;i++)
      allow_reveal[keccak256(abi.encodePacked(a[i],tid[i]))] = v;
  }

  // public read function for additional TokenStruct array fields 
  function tokenInfo(uint256 tid) public view returns(address[] memory paths, bytes32[] memory hashchain) {

    address[] memory plist = new address[](2);
    plist[0] = address(tokens[tid].paths[0]);
    plist[1] = address(tokens[tid].paths[1]);

    paths = plist;
    
    bytes32[] memory rlist = new bytes32[](11);
    
    for (uint256 k=0;k<11;k++) {
      rlist[k]=tokens[tid].hashchain[k];
    }

    hashchain = rlist;
  }
  
  // (address,token id) pairs that can perform reveals
  function is_allow_reveal(address a) public view returns (uint256[] memory) {
    uint k=0;
    for (uint256 tid=0;tid<100;tid++)
      if (allow_reveal[keccak256(abi.encodePacked(a,tid))]) k++;
    
    uint256[] memory rlist = new uint256[](k);

    k=0;
    for (uint256 tid=0;tid<100;tid++)  {
      if (allow_reveal[keccak256(abi.encodePacked(a,tid))]) {
	rlist[k]=tid;
	k++;
      }
    }
    return rlist;
  }
  
  function iToHex(bytes memory buffer) public pure returns (string memory) {
    // Fixed buffer size for hexadecimal convertion
    bytes memory converted = new bytes(buffer.length * 2);

    bytes memory _base = "0123456789abcdef";

    for (uint256 i = 0; i < buffer.length; i++) {
      converted[i * 2] = _base[uint8(buffer[i]) / _base.length];
      converted[i * 2 + 1] = _base[uint8(buffer[i]) % _base.length];
    }

    return string(abi.encodePacked("0x", converted));
  }

  //specify on-chain locations of encrypted SVG data for each token
  function initData(uint256[] memory tid, uint256[] memory ind, address[] memory a) public onlyInit {
    for (uint256 i = 0;i<tid.length;i++) {
      tokens[tid[i]].paths[ind[i]] = DataContract(a[i]);
    }
  }

  // claim is a commit-reveal to prevent front running
  // What you should submit is a 32-byte hash calculated by the following:
  // keccak256(token ID, address, H^11(secret), salt);
  // - token ID is between 0 and 99, indicated on back of physical hashmark
  // - address is the address you want the token minted to
  // - H^11(secret) is the 11th hash of the 32 byte secret engraved on back of physical hashmark
  // - salt is a password of your choice; will be used again during the reveal stage
  
  function commit(bytes32 a) public {
    /* safeguard: an expiring allowlist of addresses that can perform commits */
    require(allow_commit[msg.sender] || block.timestamp > deployed_ts + safeguard_expire, "Safeguard: msg.sender not on temporary allow list");
    
    commits[msg.sender].hash = a;
    commits[msg.sender].ts = block.timestamp;    //enforce 48hr between commit and reveal
  }
  
  function getCommit(address a) public view returns (bytes32 hash, uint256 ts) {
    return (commits[a].hash, commits[a].ts);    
  }
  
  function reveal(uint8 tid, bytes32 solution, string memory salt) public {
    require(tid < 100,"token ID out of range");
    require(!tokens[tid].claimed,"token ID already claimed");
    /* safeguard: an expiring allowlist of (address,token id) pairs that are elligible to be claimed (tokens get enabled for claiming once 
     I verify the physical has arrived with its owner). Safeguard expires after 180 days, at which point any
     remaining tokens are elligible for commit/reveal */
    
    require(allow_reveal[keccak256(abi.encodePacked(msg.sender,uint256(tid)))] || block.timestamp > deployed_ts + safeguard_expire, "Safeguard: (address,tokenid) pair not on temporary allow list");
    
    address i = msg.sender;
    require(commits[i].ts > 0, "No commit has been made for this address");
    require(block.timestamp - commits[i]...

// [truncated — 56400 bytes total]

Read Contract

allow_commit 0x547b87d0 → bool
allow_reveal 0x92d7c52b → bool
balanceOf 0x70a08231 → uint256
commits 0x7b43a8e6 → bytes32, uint256
decrypt 0xc90e5ba5 → string
deployed_ts 0x053affac → uint256
fade_amount 0xfbcf855f → uint256
fade_period 0x9ae24894 → uint256
getApproved 0x081812fc → address
getCommit 0x8696b887 → bytes32, uint256
getSVG 0xbe985ac9 → string
grey_fade 0xf386ff71 → uint256
iToHex 0x671ff786 → string
isApprovedForAll 0xe985e9c5 → bool
is_allow_reveal 0xdf7e0856 → uint256[]
max_hashes 0x81e679f6 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
reveal_window 0x0450e100 → uint256
safeguard_expire 0x6ee6005b → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenInfo 0xcc33c875 → address[], bytes32[]
tokenURI 0xc87b56dd → string
tokens 0x4f64b2be → bool, address, uint256, uint256, uint256, bool
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]

Write Contract 13 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address to
uint256 tokenId
commit 0xf14fcbc8
bytes32 a
initData 0xe053faed
uint256[] tid
uint256[] ind
address[] a
initHashes 0xef5b42e7
uint256[] tid
bytes32[] a
refresh 0xafde435c
uint256 tid
bytes32 solution
reveal 0x9af51f6e
uint8 tid
bytes32 solution
string salt
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes data
safeguard_commit 0xee95821d
address[] a
bool v
safeguard_reveal 0x8e23cb3f
address[] a
uint256[] tid
bool v
seal 0x3fb27b85
No parameters
setApprovalForAll 0xa22cb465
address operator
bool approved
transferFrom 0x23b872dd
address from
address to
uint256 tokenId

Recent Transactions

No transactions found for this address