Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x8510b7b968F6664136F557b079CE79F72D5b4AAB
Balance 0 ETH
Nonce 1
Code Size 14532 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

14532 bytes
0x60806040526004361061034e5760003560e01c80636c02a931116101c6578063b88d4fde116100f7578063e1829d2d11610095578063e985e9c51161006f578063e985e9c514610963578063ebf98abf146109ac578063ee0b4c35146109c2578063f2fde38b146109e257600080fd5b8063e1829d2d1461090d578063e4c79e451461092d578063e83157421461094d57600080fd5b8063c7af751a116100d1578063c7af751a146108a1578063c87b56dd146108b7578063da084fd0146108d7578063dc30158b146108f757600080fd5b8063b88d4fde1461084e578063bc11a4d61461086e578063c2e90b6a1461088e57600080fd5b806395d89b41116101645780639fd6db121161013e5780639fd6db12146107d5578063a22cb465146107ef578063a4f29aad1461080f578063b118060e1461082f57600080fd5b806395d89b411461078a57806397dbfcfb1461079f5780639b898477146107bf57600080fd5b80637420aa36116101a05780637420aa361461070c57806375535fb71461072c578063871cd69a1461074c5780638da5cb5b1461076c57600080fd5b80636c02a931146106c257806370a08231146106d7578063715018a6146106f757600080fd5b806325e6f516116102a05780635648051c1161023e5780636128e136116102185780636128e136146106415780636285abf4146106615780636352211e1461068157806369ab4315146106a157600080fd5b80635648051c146105f75780635895e44a1461060c57806358964dc21461062157600080fd5b806342842e0e1161027a57806342842e0e1461058157806348076aae146105a15780634f6ccce7146105b757806352332c18146105d757600080fd5b806325e6f5161461052c5780632f745c5914610541578063394d88d41461056157600080fd5b8063081812fc1161030d578063174da4a2116102e7578063174da4a21461049f57806318160ddd146104bf5780631db5b77b146104de57806323b872dd1461050c57600080fd5b8063081812fc1461041a578063095ea7b31461045257806314de39191461047257600080fd5b8062bad0d314610353578062d5da021461037e57806301ffc9a7146103a0578063031d5d01146103d057806304dd44dd146103e557806306fdde0314610405575b600080fd5b34801561035f57600080fd5b50610368610a02565b60405161037591906135b9565b60405180910390f35b34801561038a57600080fd5b5061039e610399366004612e31565b610a90565b005b3480156103ac57600080fd5b506103c06103bb366004612df7565b610ada565b6040519015158152602001610375565b3480156103dc57600080fd5b50610368610b05565b3480156103f157600080fd5b5061039e610400366004612c47565b610b97565b34801561041157600080fd5b50610368610be3565b34801561042657600080fd5b5061043a610435366004612edd565b610bf2565b6040516001600160a01b039091168152602001610375565b34801561045e57600080fd5b5061039e61046d366004612db0565b610c87565b34801561047e57600080fd5b5061049261048d366004612c47565b610d9d565b6040516103759190613575565b3480156104ab57600080fd5b5061039e6104ba366004612edd565b610e3f565b3480156104cb57600080fd5b506008545b604051908152602001610375565b3480156104ea57600080fd5b506103c06104f9366004612edd565b6000908152601760205260409020541590565b34801561051857600080fd5b5061039e610527366004612cba565b610e6e565b34801561053857600080fd5b50610368610e9f565b34801561054d57600080fd5b506104d061055c366004612db0565b610eac565b34801561056d57600080fd5b5060135461043a906001600160a01b031681565b34801561058d57600080fd5b5061039e61059c366004612cba565b610f42565b3480156105ad57600080fd5b506104d060145481565b3480156105c357600080fd5b506104d06105d2366004612edd565b610f5d565b3480156105e357600080fd5b5061039e6105f2366004612edd565b610ff0565b34801561060357600080fd5b5061036861101f565b34801561061857600080fd5b5061039e61102c565b34801561062d57600080fd5b5060105461043a906001600160a01b031681565b34801561064d57600080fd5b5061039e61065c366004612c47565b611085565b34801561066d57600080fd5b5061039e61067c366004612ddc565b6110d1565b34801561068d57600080fd5b5061043a61069c366004612edd565b611119565b3480156106ad57600080fd5b506013546103c090600160a01b900460ff1681565b3480156106ce57600080fd5b50610368611190565b3480156106e357600080fd5b506104d06106f2366004612c47565b61119d565b34801561070357600080fd5b5061039e611224565b34801561071857600080fd5b5061039e610727366004612ddc565b61125a565b34801561073857600080fd5b50610368610747366004612edd565b611297565b34801561075857600080fd5b5061039e610767366004612edd565b611339565b34801561077857600080fd5b50600a546001600160a01b031661043a565b34801561079657600080fd5b5061036861153b565b3480156107ab57600080fd5b50600f5461043a906001600160a01b031681565b3480156107cb57600080fd5b506104d060125481565b3480156107e157600080fd5b50600d546103c09060ff1681565b3480156107fb57600080fd5b5061039e61080a366004612d7b565b61154a565b34801561081b57600080fd5b5061039e61082a366004612e31565b61160f565b34801561083b57600080fd5b506104d061084a366004612e31565b5190565b34801561085a57600080fd5b5061039e610869366004612cfb565b61164c565b34801561087a57600080fd5b5061039e610889366004612e31565b611684565b61039e61089c366004612edd565b6116c1565b3480156108ad57600080fd5b506104d060155481565b3480156108c357600080fd5b506103686108d2366004612edd565b611985565b3480156108e357600080fd5b5061039e6108f2366004612ef6565b611b48565b34801561090357600080fd5b506104d0600e5481565b34801561091957600080fd5b506103c0610928366004612e31565b611eb5565b34801561093957600080fd5b5061039e610948366004612c47565b611fcf565b34801561095957600080fd5b506104d0600b5481565b34801561096f57600080fd5b506103c061097e366004612c81565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156109b857600080fd5b506104d0600c5481565b3480156109ce57600080fd5b5061039e6109dd366004612edd565b61201b565b3480156109ee57600080fd5b5061039e6109fd366004612c47565b61204a565b60118054610a0f9061378b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3b9061378b565b8015610a885780601f10610a5d57610100808354040283529160200191610a88565b820191906000526020600020905b815481529060010190602001808311610a6b57829003601f168201915b505050505081565b600a546001600160a01b03163314610ac35760405162461bcd60e51b8152600401610aba9061361e565b60405180910390fd5b8051610ad6906019906020840190612b34565b5050565b60006001600160e01b0319821663780e9d6360e01b1480610aff5750610aff826120e2565b92915050565b606060118054610b149061378b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b409061378b565b8015610b8d5780601f10610b6257610100808354040283529160200191610b8d565b820191906000526020600020905b815481529060010190602001808311610b7057829003601f168201915b5050505050905090565b600a546001600160a01b03163314610bc15760405162461bcd60e51b8152600401610aba9061361e565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b606060008054610b149061378b565b6000818152600260205260408120546001600160a01b0316610c6b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610aba565b506000908152600460205260409020546001600160a01b031690565b6000610c9282611119565b9050806001600160a01b0316836001600160a01b03161415610d005760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610aba565b336001600160a01b0382161480610d1c5750610d1c813361097e565b610d8e5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610aba565b610d988383612132565b505050565b60606000610daa8361119d565b905060008167ffffffffffffffff811115610dc757610dc761384d565b604051908082528060200260200182016040528015610df0578160200160208202803683370190505b50905060005b82811015610e3757610e088582610eac565b828281518110610e1a57610e1a613837565b602090810291909101015280610e2f816137c6565b915050610df6565b509392505050565b600a546001600160a01b03163314610e695760405162461bcd60e51b8152600401610aba9061361e565b600e55565b610e7833826121a0565b610e945760405162461bcd60e51b8152600401610aba90613653565b610d98838383612297565b60198054610a0f9061378b565b6000610eb78361119d565b8210610f195760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610aba565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610d988383836040518060200160405280600081525061164c565b6000610f6860085490565b8210610fcb5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610aba565b60088281548110610fde57610fde613837565b90600052602060002001549050919050565b600a546001600160a01b0316331461101a5760405162461bcd60e51b8152600401610aba9061361e565b601255565b601a8054610a0f9061378b565b600a546001600160a01b031633146110565760405162461bcd60e51b8152600401610aba9061361e565b60405133904780156108fc02916000818181858888f19350505050158015611082573d6000803e3d6000fd5b50565b600a546001600160a01b031633146110af5760405162461bcd60e51b8152600401610aba9061361e565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031633146110fb5760405162461bcd60e51b8152600401610aba9061361e565b60138054911515600160a01b0260ff60a01b19909216919091179055565b6000818152600260205260408120546001600160a01b031680610aff5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610aba565b60188054610a0f9061378b565b60006001600160a01b0382166112085760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610aba565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b0316331461124e5760405162461bcd60e51b8152600401610aba9061361e565b6112586000612442565b565b600a546001600160a01b031633146112845760405162461bcd60e51b8152600401610aba9061361e565b600d805460ff1916911515919091179055565b60008181526016602052604090208054606091906112b49061378b565b80601f01602080910402602001604051908101604052809291908181526020018280546112e09061378b565b801561132d5780601f106113025761010080835404028352916020019161132d565b820191906000526020600020905b81548152906001019060200180831161131057829003601f168201915b50505050509050919050565b600a546001600160a01b031633146113635760405162461bcd60e51b8152600401610aba9061361e565b6014548160155461137491906136fd565b11156113b95760405162461bcd60e51b81526020600482015260146024820152732737ba1032b737bab3b41039bab8383634b2b99760611b6044820152606401610aba565b600e548111156114045760405162461bcd60e51b815260206004820152601660248201527527bb32b91026b0bc1026b4b73a39903832b9102a2c1760511b6044820152606401610aba565b60005b81811015610ad657601580549081906000611421836137c6565b909155505060105460405163276d855f60e11b8152336004820152602481018390526001600160a01b0390911690634edb0abe90604401600060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b5050600f5460405163503d47bb60e11b8152336004820152602481018590526001600160a01b03909116925063a07a8f769150604401600060405180830381600087803b1580156114d657600080fd5b505af11580156114ea573d6000803e3d6000fd5b505060408051338152602081018590527f58c56899438364ac5ae60466110ad7032b2c0184d6d5e86814984bfefd6a1406935001905060405180910390a15080611533816137c6565b915050611407565b606060018054610b149061378b565b6001600160a01b0382163314156115a35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610aba565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b031633146116395760405162461bcd60e51b8152600401610aba9061361e565b8051610ad6906018906020840190612b34565b61165633836121a0565b6116725760405162461bcd60e51b8152600401610aba90613653565b61167e84848484612494565b50505050565b600a546001600160a01b031633146116ae5760405162461bcd60e51b8152600401610aba9061361e565b8051610ad690601a906020840190612b34565b3332146117095760405162461bcd60e51b815260206004820152601660248201527553656e646572206d757374206265206f726967696e2160501b6044820152606401610aba565b600d5460ff1615156001146117605760405162461bcd60e51b815260206004820181905260248201527f5075626c6963204d696e74696e67206973206e6f7420617661696c61626c65216044820152606401610aba565b6014548160155461177191906136fd565b11156117b65760405162461bcd60e51b81526020600482015260146024820152732737ba1032b737bab3b41039bab8383634b2b99760611b6044820152606401610aba565b600e548111156118015760405162461bcd60e51b815260206004820152601660248201527527bb32b91026b0bc1026b4b73a39903832b9102a2c1760511b6044820152606401610aba565b80600c5461180f9190613729565b341461184e5760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103b30b63ab29760911b6044820152606401610aba565b60005b81811015610ad65760158054908190600061186b836137c6565b909155505060105460405163276d855f60e11b8152336004820152602481018390526001600160a01b0390911690634edb0abe90604401600060405180830381600087803b1580156118bc57600080fd5b505af11580156118d0573d6000803e3d6000fd5b5050600f5460405163503d47bb60e11b8152336004820152602481018590526001600160a01b03909116925063a07a8f769150604401600060405180830381600087803b15801561192057600080fd5b505af1158015611934573d6000803e3d6000fd5b505060408051338152602081018590527f58c56899438364ac5ae60466110ad7032b2c0184d6d5e86814984bfefd6a1406935001905060405180910390a1508061197d816137c6565b915050611851565b6060600061199283611297565b60408051808201825260048152631ddbdc9960e21b6020808301919091528351925193945090928492916000916119ed91017f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c20000000008152601c0190565b604051602081830303815290604052905060006018611a0b896124c7565b604051602001611a1c9291906134e3565b60405160208183030381529060405290506000611a376125c5565b85604051602001611a499291906131c1565b60405160208183030381529060405290506000601a604051602001611a6e9190613486565b604051602081830303815290604052905060006019604051602001611a9391906134be565b604051602081830303815290604052905060008888604051602001611ab99291906133cc565b604051602081830303815290604052905080611ad4886124c7565b611ae7611ae28f60016136fd565b6124c7565b604051602001611af9939291906130f2565b60405160208183030381529060405290506000868686868686604051602001611b279695949392919061304e565b60408051601f198184030181529190529d9c50505050505050505050505050565b333214611b905760405162461bcd60e51b815260206004820152601660248201527553656e646572206d757374206265206f726967696e2160501b6044820152606401610aba565b6010546040516331a9108f60e11b81526004810184905233916001600160a01b031690636352211e9060240160206040518083038186803b158015611bd457600080fd5b505afa158015611be8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0c9190612c64565b6001600160a01b031614611c625760405162461bcd60e51b815260206004820152601f60248201527f596f7520646f6e2774206f776e2074686973207472616e73706f6e6465722e006044820152606401610aba565b60008281526017602052604090205415611cc95760405162461bcd60e51b815260206004820152602260248201527f5472616e73706f6e64657220616c7265616479207573656420746f2077726974604482015261329760f11b6064820152608401610aba565b60125481511115611d125760405162461bcd60e51b815260206004820152601360248201527250687261736520697320746f6f206c6f6e672160681b6044820152606401610aba565b611d1b81611eb5565b611d755760405162461bcd60e51b815260206004820152602560248201527f50687261736520636f6e7461696e7320756e616c6c6f77656420636861726163604482015264746572732160d81b6064820152608401610aba565b6000828152601760205260408120805491611d8f836137c6565b9190505550611e2860118054611da49061378b565b80601f0160208091040260200160405190810160405280929190818152602001828054611dd09061378b565b8015611e1d5780601f10611df257610100808354040283529160200191611e1d565b820191906000526020600020905b815481529060010190602001808311611e0057829003601f168201915b50505050508261264b565b8051611e3c91601191602090910190612b34565b506000611e4860085490565b60008181526016602090815260409091208451929350611e6c929091850190612b34565b50611e77338261269c565b60408051338152602081018390527f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885910160405180910390a1505050565b80516000908290825b81811015611fc4576000838281518110611eda57611eda613837565b01602001516013546001600160f81b0319909116915060009060ff600160a01b9091041615611f0e5750600160fd1b611f15565b50602160f81b5b6001600160f81b03198082169083161080611f3d5750603d60f91b6001600160f81b03198316115b80611f555750601360f91b6001600160f81b03198316145b80611f6d5750601160f91b6001600160f81b03198316145b80611f855750600f60fa1b6001600160f81b03198316145b80611f9d5750601f60f91b6001600160f81b03198316145b15611faf575060009695505050505050565b50508080611fbc906137c6565b915050611ebe565b506001949350505050565b600a546001600160a01b03163314611ff95760405162461bcd60e51b8152600401610aba9061361e565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031633146120455760405162461bcd60e51b8152600401610aba9061361e565b600c55565b600a546001600160a01b031633146120745760405162461bcd60e51b8152600401610aba9061361e565b6001600160a01b0381166120d95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610aba565b61108281612442565b60006001600160e01b031982166380ac58cd60e01b148061211357506001600160e01b03198216635b5e139f60e01b145b80610aff57506301ffc9a760e01b6001600160e01b0319831614610aff565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061216782611119565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166122195760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610aba565b600061222483611119565b9050806001600160a01b0316846001600160a01b0316148061225f5750836001600160a01b031661225484610bf2565b6001600160a01b0316145b8061228f57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166122aa82611119565b6001600160a01b0316146123125760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610aba565b6001600160a01b0382166123745760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610aba565b61237f8383836127ea565b61238a600082612132565b6001600160a01b03831660009081526003602052604081208054600192906123b3908490613748565b90915550506001600160a01b03821660009081526003602052604081208054600192906123e19084906136fd565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61249f848484612297565b6124ab848484846128a2565b61167e5760405162461bcd60e51b8152600401610aba906135cc565b6060816124eb5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561251557806124ff816137c6565b915061250e9050600a83613715565b91506124ef565b60008167ffffffffffffffff8111156125305761253061384d565b6040519080825280601f01601f19166020018201604052801561255a576020820181803683370190505b5090505b841561228f5761256f600183613748565b915061257c600a866137e1565b6125879060306136fd565b60f81b81838151811061259c5761259c613837565b60200101906001600160f81b031916908160001a9053506125be600a86613715565b945061255e565b60135460408051631d2a763560e21b815290516060926001600160a01b0316916374a9d8d4916004808301926000929190829003018186803b15801561260a57600080fd5b505afa15801561261e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126469190810190612e66565b905090565b606060008260405160200161266091906130cd565b6040516020818303038152906040529050838160405160200161268492919061301f565b60405160208183030381529060405291505092915050565b6001600160a01b0382166126f25760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610aba565b6000818152600260205260409020546001600160a01b0316156127575760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610aba565b612763600083836127ea565b6001600160a01b038216600090815260036020526040812080546001929061278c9084906136fd565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b0383166128455761284081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612868565b816001600160a01b0316836001600160a01b0316146128685761286883826129a4565b6001600160a01b03821661287f57610d9881612a41565b826001600160a01b0316826001600160a01b031614610d9857610d988282612af0565b60006001600160a01b0384163b15611fc457604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906128e6903390899088908890600401613538565b602060405180830381600087803b15801561290057600080fd5b505af1925050508015612930575060408051601f3d908101601f1916820190925261292d91810190612e14565b60015b61298a573d80801561295e576040519150601f19603f3d011682016040523d82523d6000602084013e612963565b606091505b5080516129825760405162461bcd60e51b8152600401610aba906135cc565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061228f565b600060016129b18461119d565b6129bb9190613748565b600083815260076020526040902054909150808214612a0e576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612a5390600190613748565b60008381526009602052604081205460088054939450909284908110612a7b57612a7b613837565b906000526020600020015490508060088381548110612a9c57612a9c613837565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ad457612ad4613821565b6001900381819060005260206000200160009055905550505050565b6000612afb8361119d565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b828054612b409061378b565b90600052602060002090601f016020900481019282612b625760008555612ba8565b82601f10612b7b57805160ff1916838001178555612ba8565b82800160010185558215612ba8579182015b82811115612ba8578251825591602001919060010190612b8d565b50612bb4929150612bb8565b5090565b5b80821115612bb45760008155600101612bb9565b6000612be0612bdb846136d5565b6136a4565b9050828152838383011115612bf457600080fd5b828260208301376000602084830101529392505050565b80358015158114612c1b57600080fd5b919050565b600082601f830112612c3157600080fd5b612c4083833560208501612bcd565b9392505050565b600060208284031215612c5957600080fd5b8135612c4081613863565b600060208284031215612c7657600080fd5b8151612c4081613863565b60008060408385031215612c9457600080fd5b8235612c9f81613863565b91506020830135612caf81613863565b809150509250929050565b600080600060608486031215612ccf57600080fd5b8335612cda81613863565b92506020840135612cea81613863565b929592945050506040919091013590565b60008060008060808587031215612d1157600080fd5b8435612d1c81613863565b93506020850135612d2c81613863565b925060408501359150606085013567ffffffffffffffff811115612d4f57600080fd5b8501601f81018713612d6057600080fd5b612d6f87823560208401612bcd565b91505092959194509250565b60008060408385031215612d8e57600080fd5b8235612d9981613863565b9150612da760208401612c0b565b90509250929050565b60008060408385031215612dc357600080fd5b8235612dce81613863565b946020939093013593505050565b600060208284031215612dee57600080fd5b612c4082612c0b565b600060208284031215612e0957600080fd5b8135612c4081613878565b600060208284031215612e2657600080fd5b8151612c4081613878565b600060208284031215612e4357600080fd5b813567ffffffffffffffff811115612e5a57600080fd5b61228f84828501612c20565b600060208284031215612e7857600080fd5b815167ffffffffffffffff811115612e8f57600080fd5b8201601f81018413612ea057600080fd5b8051612eae612bdb826136d5565b818152856020838501011115612ec357600080fd5b612ed482602083016020860161375f565b95945050505050565b600060208284031215612eef57600080fd5b5035919050565b60008060408385031215612f0957600080fd5b82359150602083013567ffffffffffffffff811115612f2757600080fd5b612f3385828601612c20565b9150509250929050565b60008151808452612f5581602086016020860161375f565b601f01601f19169290920160200192915050565b60008151612f7b81856020860161375f565b9290920192915050565b8054600090600181811c9080831680612f9f57607f831692505b6020808410821415612fc157634e487b7160e01b600052602260045260246000fd5b818015612fd55760018114612fe657613013565b60ff19861689528489019650613013565b60008881526020902060005b8681101561300b5781548b820152908501908301612ff2565b505084890196505b50505050505092915050565b6000835161303181846020880161375f565b83519083019061304581836020880161375f565b01949350505050565b6000875160206130618285838d0161375f565b8851918401916130748184848d0161375f565b88519201916130868184848c0161375f565b87519201916130988184848b0161375f565b86519201916130aa8184848a0161375f565b85519201916130bc818484890161375f565b919091019998505050505050505050565b600082516130df81846020870161375f565b600160fd1b920191825250600101919050565b6000845161310481846020890161375f565b80830190507f7b2274726169745f74797065223a20226c656e677468222c202276616c7565228152621d101160e91b6020820152845161314b81602384016020890161375f565b7f227d2c207b2274726169745f74797065223a20226d65737361676520706f736960239290910191820152703a34b7b7111610113b30b63ab2911d101160791b604382015283516131a381605484016020880161375f565b63227d5d7d60e01b6054929091019182015260580195945050505050565b671134b6b0b3b2911d60c11b81527f22646174613a696d6167652f7376672b786d6c3b757466382c2000000000000060088201527f3c73766720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323060228201527f30302f737667272077696474683d2735303027206865696768743d273530302760428201527f207374796c653d276261636b67726f756e642d636f6c6f723a2330303030303060628201527f273e3c7374796c653e40666f6e742d666163657b666f6e742d66616d696c793a60828201527f274d696e656372616674273b207372633a75726c2827646174613a6170706c6960a28201527f636174696f6e2f6f637465742d73747265616d3b6261736536342c000000000060c282015282516000906132ef8160dd85016020880161375f565b7f27293b3c2f7374796c653e3c746578742066696c6c3d2723303066666632272060dd918401918201527f666f6e742d66616d696c793d274d696e6563726166742720783d27353025272060fd8201527f793d273530252720646f6d696e616e742d626173656c696e653d276d6964646c61011d8201527f652720746578742d616e63686f723d276d6964646c652720666f6e742d73697a61013d82015268329e939999383c139f60b91b61015d820152612ed46133b1610166830186612f69565b6e0f0bdd195e1d0f8f0bdcdd99cf888b608a1b8152600f0190565b7f2261747472696275746573223a5b7b2274726169745f74797065223a2022747981526e3832911610113b30b63ab2911d101160891b60208201526000835161341c81602f85016020880161375f565b7f227d2c207b2274726169745f74797065223a2022706872617365222c20227661602f9184019182015266363ab2911d101160c91b604f820152835161346981605684016020880161375f565b630113e96160e51b60569290910191820152605a01949350505050565b701132bc3a32b93730b62fbab936111d101160791b815260006134ac6011830184612f85565b61088b60f21b81526002019392505050565b6f113232b9b1b934b83a34b7b7111d101160811b815260006134ac6010830184612f85565b693d913730b6b2911d101160b11b81526000613502600a830185612f85565b61202360f01b8152835161351d81600284016020880161375f565b61088b60f21b60029290910191820152600401949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061356b90830184612f3d565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156135ad57835183529284019291840191600101613591565b50909695505050505050565b602081526000612c406020830184612f3d565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff811182821017156136cd576136cd61384d565b604052919050565b600067ffffffffffffffff8211156136ef576136ef61384d565b50601f01601f191660200190565b60008219821115613710576137106137f5565b500190565b6000826137245761372461380b565b500490565b6000816000190483118215151615613743576137436137f5565b500290565b60008282101561375a5761375a6137f5565b500390565b60005b8381101561377a578181015183820152602001613762565b8381111561167e5750506000910152565b600181811c9082168061379f57607f821691505b602082108114156137c057634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156137da576137da6137f5565b5060010190565b6000826137f0576137f061380b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461108257600080fd5b6001600160e01b03198116811461108257600080fdfea2646970667358221220da2d35714edf9cc9f0a096197ffee246f30a06a17a41730dd8d1cf9aba7a0f3964736f6c63430008070033

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: Yes (200 runs)
MessageToMartians.sol 1419 lines
//SPDX-License-Identifier: MIT
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;
    }
}


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}


/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}




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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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


/**
 * @title ERC-721 Non-Fungible Token Standard, optional 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);
}


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


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

    // 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: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

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

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @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 owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

        _balances[to] += 1;
        _owners[tokenId] = to;

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

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

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @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 {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

interface iFont {
    function fontBase64() external view returns (string memory);
}

interface iMoonbags {
    function getMoonBag(address to_, uint tokenId_) external;
}

interface iTransponders {
    function mintTransponder(address to_, uint tokenId) external;
}

contract MessageToMartians is ERC721Enumerable, Ownable {
    
    uint public maxTokens = 8888;
    uint public mintingCost = 0.1 ether;
    bool public mintingEnabled = false;
    uint public maxMintsPerTx = 20;

    address public moonBagsAddress;
    address public transpondersAddress;
    
    string public messageToMartians;
    uint public maxStringLength = 20;
    address public fontAddress;
    
    bool public allowSpaces = false;

    uint public maxSupplies = 8888;
    uint public suppliesMinted = 0;
    
    mapping(uint => string) words;
    mapping(uint => uint) transpondersUsed;
    
    event MintSupplies(address to, uint tokenId);
    event Mint(address to, uint tokenId);

    constructor() ERC721("Message to Martians", "MARTIAN") {}

    function fontBase64() internal view returns (string memory) {
        return iFont(fontAddress).fontBase64();
    }
    
    // modifiers
    modifier onlySender() {
        require(msg.sender == tx.origin, "Sender must be origin!");
        _;
    }
    modifier publicMinting() {
        require(mintingEnabled == true, "Public Minting is not available!");
        _;
    }
    
    // owner tools
    function ownerWithdrawEther() external onlyOwner {
        payable(msg.sender).transfer(address(this).balance);
    }
    function setMintingCost(uint mintingCost_) external onlyOwner {
        mintingCost = mintingCost_;
    }
    function setMintingStatus(bool bool_) external onlyOwner {
        mintingEnabled = bool_;
    }
    function setMaxStringLength(uint maxLength_) external onlyOwner {
        maxStringLength = maxLength_;
    }
    function setAllowSpaces(bool bool_) external onlyOwner {
        allowSpaces = bool_;
    }
    function setMoonBagsAddress(address address_) external onlyOwner { 
        moonBagsAddress = address_;
    }
    function setTranspondersAddress(address address_) external onlyOwner {
        transpondersAddress = address_;
    }
    function setFontAddress(address address_) external onlyOwner {
        fontAddress = address_;
    }
    function setMaxMintsPerTx(uint uint_) external onlyOwner {
        maxMintsPerTx = uint_;
    }
    
    // internal workers
    function stringLength(string memory string_) public pure returns (uint) {
        return bytes(string_).length;
    }
    function onlyAllowedCharacters(string memory string_) public view returns (bool) {
        bytes memory _strBytes = bytes(string_);
        uint _strLen = _strBytes.length;
        for (uint i = 0; i < _strLen; i++) {
            bytes1 _letterBytes1 = _strBytes[i];
            bytes1 _bottomBytes;
            
            if (allowSpaces) {
                _bottomBytes = 0x20;
            } else {
                _bottomBytes = 0x21;
            }
            
            if (_letterBytes1 < _bottomBytes || _letterBytes1 > 0x7A || _letterBytes1 == 0x26 || _letterBytes1 == 0x22 || _letterBytes1 == 0x3C || _letterBytes1 == 0x3E) {
                    return false;
            }     
        }
        return true;
    }
    function addToString(string memory string_, string memory add_) internal pure returns (string memory) {
        string memory _add = string(abi.encodePacked(add_, " "));
        return string(abi.encodePacked(string_, _add));
    }

    function getTransponderStatus(uint tokenId_) public view returns (bool) {
        return (transpondersUsed[tokenId_] == 0);
    }

    function ownerMintSupplies(uint amount_) external onlyOwner {
        require(suppliesMinted + amount_ <= maxSupplies, "Not enough supplies.");
        require(amount_ <= maxMintsPerTx, "Over Max Mints per TX.");
        for (uint i = 0; i < amount_; i++) {
            uint _tokenId = suppliesMinted;
            suppliesMinted++; // add supplies minted count
            iTransponders(transpondersAddress).mintTransponder(msg.sender, _tokenId); 
            iMoonbags(moonBagsAddress).getMoonBag(msg.sender, _tokenId); // mint capsule
            emit MintSupplies(msg.sender, _tokenId);
        }
    }

    function mintSupplies(uint amount_) payable external onlySender publicMinting {
        require(suppliesMinted + amount_ <= maxSupplies, "Not enough supplies.");
        require(amount_ <= maxMintsPerTx, "Over Max Mints per TX.");
        require(msg.value == (mintingCost * amount_), "Invalid value.");
        for (uint i = 0; i < amount_; i++) {
            uint _tokenId = suppliesMinted;
            suppliesMinted++; // add supplies minted count
            iTransponders(transpondersAddress).mintTransponder(msg.sender, _tokenId); 
            iMoonbags(moonBagsAddress).getMoonBag(msg.sender, _tokenId); // mint capsule
            emit MintSupplies(msg.sender, _tokenId);
        }
    }

    function writeMessage(uint transponderId_, string memory word_) external onlySender {
        // require(totalSupply() + 1 <= maxTokens, "No more broadcasts remaining.");
        require(IERC721(transpondersAddress).ownerOf(transponderId_) == msg.sender, "You don't own this transponder.");
        require(transpondersUsed[transponderId_] == 0, "Transponder already used to write.");
        require(stringLength(word_) <= maxStringLength, "Phrase is too long!");
        require(onlyAllowedCharacters(word_), "Phrase contains unallowed characters!");
        transpondersUsed[transponderId_]++;
        messageToMartians = addToString(messageToMartians, word_);
        uint _tokenId = totalSupply();
        words[_tokenId] = word_;
        _mint(msg.sender, _tokenId);
        emit Mint(msg.sender, _tokenId);
    }

    function getTokensOfAddress(address address_) public view returns (uint[] memory) {
        uint _tokenBalance = balanceOf(address_);
        uint[] memory _tokenIds = new uint[](_tokenBalance);
        for (uint i = 0; i < _tokenBalance; i++) {
            _tokenIds[i] = tokenOfOwnerByIndex(address_, i);
        }
        return _tokenIds;
    }

    // function testMint(uint amount_) external {
    //     require(suppliesMinted + amount_ <= maxSupplies, "Not enough supplies.");
    //     for (uint i = 0; i < amount_; i ++) {
    //         uint _tokenId = suppliesMinted;
    //         suppliesMinted++;
    //         iTransponders(transpondersAddress).mintTransponder(msg.sender, _tokenId); 
    //         iMoonbags(moonBagsAddress).getMoonBag(msg.sender, _tokenId); // mint capsule
    //         emit MintSupplies(msg.sender, _tokenId);
    //     }
    // }
    
    // function testMint(string memory word_) external {
    //     require(totalSupply() + 1 <= maxTokens, "No phrases remaining!"); 
    //     require(stringLength(word_) <= maxStringLength, "Phrase is too long!");
    //     require(onlyAllowedCharacters(word_), "Phrase contains unallowed characters!");
    //     messageToMartians = addToString(messageToMartians, word_);
    //     words[totalSupply()] = word_;
    //     emit Mint(msg.sender, totalSupply());
    //     _mint(msg.sender, totalSupply());
    // }
    
    // // owner functions
    // function ownerWriteWord(address to_, string memory word_) external onlyOwner {
    //     require(totalSupply() + 1 <= maxTokens, "No phrases remaining!"); 
    //     require(stringLength(word_) <= maxStringLength, "Phrase is too long!");
    //     require(onlyAllowedCharacters(word_), "Phrase contains unallowed characters!");
    //     messageToMartians = addToString(messageToMartians, word_);
    //     words[totalSupply()] = word_;
    //     emit Mint(to_, totalSupply());
    //     iMoonbags(moonBagsAddress).getMoonBag(to_, totalSupply());
    //     _mint(to_, totalSupply());
    // }
    
    // // external functions
    // function writeWord(string memory word_) payable external onlySender publicMinting {
    //     require(t...

// [truncated — 53464 bytes total]

Read Contract

allowSpaces 0x69ab4315 → bool
balanceOf 0x70a08231 → uint256
fontAddress 0x394d88d4 → address
getApproved 0x081812fc → address
getTokensOfAddress 0x14de3919 → uint256[]
getTransponderStatus 0x1db5b77b → bool
isApprovedForAll 0xe985e9c5 → bool
maxMintsPerTx 0xdc30158b → uint256
maxStringLength 0x9b898477 → uint256
maxSupplies 0x48076aae → uint256
maxTokens 0xe8315742 → uint256
messageToMartians 0x00bad0d3 → string
mintingCost 0xebf98abf → uint256
mintingEnabled 0x9fd6db12 → bool
moonBagsAddress 0x97dbfcfb → address
name 0x06fdde03 → string
onlyAllowedCharacters 0xe1829d2d → bool
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
readMessage 0x031d5d01 → string
readWord 0x75535fb7 → string
stringLength 0xb118060e → uint256
suppliesMinted 0xc7af751a → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenDescription 0x25e6f516 → string
tokenExternalUrl 0x5648051c → string
tokenName 0x6c02a931 → string
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
transpondersAddress 0x58964dc2 → address

Write Contract 22 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
mintSupplies 0xc2e90b6a
uint256 amount_
ownerMintSupplies 0x871cd69a
uint256 amount_
ownerWithdrawEther 0x5895e44a
No parameters
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setAllowSpaces 0x6285abf4
bool bool_
setApprovalForAll 0xa22cb465
address operator
bool approved
setFontAddress 0x6128e136
address address_
setMaxMintsPerTx 0x174da4a2
uint256 uint_
setMaxStringLength 0x52332c18
uint256 maxLength_
setMintingCost 0xee0b4c35
uint256 mintingCost_
setMintingStatus 0x7420aa36
bool bool_
setMoonBagsAddress 0xe4c79e45
address address_
setTokenDescription 0x00d5da02
string tokenDescription_
setTokenExternalUrl 0xbc11a4d6
string tokenExternalUrl_
setTokenName 0xa4f29aad
string tokenName_
setTranspondersAddress 0x04dd44dd
address address_
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
writeMessage 0xda084fd0
uint256 transponderId_
string word_

Recent Transactions

No transactions found for this address