Address Contract Partially Verified
Address
0x37CAB9F09a2FfA8C8650DD3De3594e1Cf2F38A84
Balance
0 ETH
Nonce
1
Code Size
12301 bytes
Creator
0x4Ed06D19...Fa92 at tx 0xd0b164f3...b906ac
Indexed Transactions
0
Contract Bytecode
12301 bytes
0x60806040526004361061031a5760003560e01c80636b34a45a116101ab578063a475b5dd116100f7578063dd7c986111610095578063e985e9c51161006f578063e985e9c5146108e7578063f2c4ce1e14610930578063f2fde38b14610950578063fd2c58f21461097057600080fd5b8063dd7c986114610891578063ddcb30a9146108b1578063e38d93a4146108c757600080fd5b8063c6682862116100d1578063c668286214610827578063c87b56dd1461083c578063d111515d1461085c578063da3ef23f1461087157600080fd5b8063a475b5dd146107d8578063b88d4fde146107ed578063c2f318d31461080d57600080fd5b806395d89b41116101645780639bc643a81161013e5780639bc643a814610770578063a0712d6814610785578063a22cb46514610798578063a351f75a146107b857600080fd5b806395d89b411461072557806395fc4d831461073a5780639758d46f1461075a57600080fd5b80636b34a45a1461067d5780636b74a5981461069d5780636eedf952146106b257806370a08231146106d2578063715018a6146106f25780638da5cb5b1461070757600080fd5b80632b0dac0d1161026a57806344a0d68a1161022357806351830227116101fd57806351830227146105fb57806355f804b31461061c5780635c975abb1461063c5780636352211e1461065d57600080fd5b806344a0d68a1461059b5780634bce50ee146105bb5780634f6ccce7146105db57600080fd5b80632b0dac0d146104e35780632f745c591461050357806335cc70d4146105235780633ccfd60b1461053957806342842e0e1461054e578063438b63001461056e57600080fd5b8063095ea7b3116102d757806315a1f542116102b157806315a1f5421461048357806318160ddd14610499578063239c70ae146104ae57806323b872dd146104c357600080fd5b8063095ea7b31461040e57806310c333931461042e57806313faede61461045f57600080fd5b806301ffc9a71461031f57806302329a2914610354578063064412221461037657806306fdde031461039f578063081812fc146103c1578063081c8c44146103f9575b600080fd5b34801561032b57600080fd5b5061033f61033a36600461281a565b610985565b60405190151581526020015b60405180910390f35b34801561036057600080fd5b5061037461036f366004612845565b6109b0565b005b34801561038257600080fd5b5061038c6103e881565b60405161ffff909116815260200161034b565b3480156103ab57600080fd5b506103b4610a01565b60405161034b91906128ba565b3480156103cd57600080fd5b506103e16103dc3660046128cd565b610a93565b6040516001600160a01b03909116815260200161034b565b34801561040557600080fd5b506103b4610b28565b34801561041a57600080fd5b50610374610429366004612902565b610bb6565b34801561043a57600080fd5b50600e5461044d90610100900460ff1681565b60405160ff909116815260200161034b565b34801561046b57600080fd5b50610475600f5481565b60405190815260200161034b565b34801561048f57600080fd5b5061047560125481565b3480156104a557600080fd5b50600854610475565b3480156104ba57600080fd5b5061044d600a81565b3480156104cf57600080fd5b506103746104de36600461292c565b610ccc565b3480156104ef57600080fd5b506014546103e1906001600160a01b031681565b34801561050f57600080fd5b5061047561051e366004612902565b610cfd565b34801561052f57600080fd5b5061047560105481565b34801561054557600080fd5b50610374610d93565b34801561055a57600080fd5b5061037461056936600461292c565b610df9565b34801561057a57600080fd5b5061058e610589366004612968565b610e14565b60405161034b9190612983565b3480156105a757600080fd5b506103746105b63660046128cd565b610ec2565b3480156105c757600080fd5b506103746105d6366004612968565b610ef1565b3480156105e757600080fd5b506104756105f63660046128cd565b610f3d565b34801561060757600080fd5b5060155461033f90600160a81b900460ff1681565b34801561062857600080fd5b50610374610637366004612a53565b610fd0565b34801561064857600080fd5b5060155461033f90600160a01b900460ff1681565b34801561066957600080fd5b506103e16106783660046128cd565b611011565b34801561068957600080fd5b506015546103e1906001600160a01b031681565b3480156106a957600080fd5b50610374611088565b3480156106be57600080fd5b506103746106cd366004612968565b611215565b3480156106de57600080fd5b506104756106ed366004612968565b611261565b3480156106fe57600080fd5b506103746112e8565b34801561071357600080fd5b50600a546001600160a01b03166103e1565b34801561073157600080fd5b506103b461131e565b34801561074657600080fd5b50610374610755366004612a9c565b61132d565b34801561076657600080fd5b5061038c61271081565b34801561077c57600080fd5b5061044d606481565b6103746107933660046128cd565b611513565b3480156107a457600080fd5b506103746107b3366004612abf565b6116de565b3480156107c457600080fd5b506103746107d3366004612968565b6117a3565b3480156107e457600080fd5b506103746117ef565b3480156107f957600080fd5b50610374610808366004612af6565b61182e565b34801561081957600080fd5b50600e5461044d9060ff1681565b34801561083357600080fd5b506103b4611866565b34801561084857600080fd5b506103b46108573660046128cd565b611873565b34801561086857600080fd5b506103746119e7565b34801561087d57600080fd5b5061037461088c366004612a53565b611a81565b34801561089d57600080fd5b506013546103e1906001600160a01b031681565b3480156108bd57600080fd5b5061047560115481565b3480156108d357600080fd5b506103746108e23660046128cd565b611abe565b3480156108f357600080fd5b5061033f610902366004612b72565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561093c57600080fd5b5061037461094b366004612a53565b611aed565b34801561095c57600080fd5b5061037461096b366004612968565b611b2a565b34801561097c57600080fd5b50610374611bc2565b60006001600160e01b0319821663780e9d6360e01b14806109aa57506109aa82611d4d565b92915050565b600a546001600160a01b031633146109e35760405162461bcd60e51b81526004016109da90612ba5565b60405180910390fd5b60158054911515600160a01b0260ff60a01b19909216919091179055565b606060008054610a1090612bda565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3c90612bda565b8015610a895780601f10610a5e57610100808354040283529160200191610a89565b820191906000526020600020905b815481529060010190602001808311610a6c57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610b0c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109da565b506000908152600460205260409020546001600160a01b031690565b60168054610b3590612bda565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6190612bda565b8015610bae5780601f10610b8357610100808354040283529160200191610bae565b820191906000526020600020905b815481529060010190602001808311610b9157829003601f168201915b505050505081565b6000610bc182611011565b9050806001600160a01b0316836001600160a01b03161415610c2f5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016109da565b336001600160a01b0382161480610c4b5750610c4b8133610902565b610cbd5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109da565b610cc78383611d9d565b505050565b610cd63382611e0b565b610cf25760405162461bcd60e51b81526004016109da90612c15565b610cc7838383611f02565b6000610d0883611261565b8210610d6a5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016109da565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600a546001600160a01b03163314610dbd5760405162461bcd60e51b81526004016109da90612ba5565b6015546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610df6573d6000803e3d6000fd5b50565b610cc78383836040518060200160405280600081525061182e565b60606000610e2183611261565b905060008167ffffffffffffffff811115610e3e57610e3e6129c7565b604051908082528060200260200182016040528015610e67578160200160208202803683370190505b50905060005b828161ffff161015610eba57610e87858261ffff16610cfd565b828261ffff1681518110610e9d57610e9d612c66565b602090810291909101015280610eb281612c92565b915050610e6d565b509392505050565b600a546001600160a01b03163314610eec5760405162461bcd60e51b81526004016109da90612ba5565b600f55565b600a546001600160a01b03163314610f1b5760405162461bcd60e51b81526004016109da90612ba5565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6000610f4860085490565b8210610fab5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016109da565b60088281548110610fbe57610fbe612c66565b90600052602060002001549050919050565b600a546001600160a01b03163314610ffa5760405162461bcd60e51b81526004016109da90612ba5565b805161100d90600c90602084019061276b565b5050565b6000818152600260205260408120546001600160a01b0316806109aa5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016109da565b600a546001600160a01b031633146110b25760405162461bcd60e51b81526004016109da90612ba5565b6002600b5414156110d55760405162461bcd60e51b81526004016109da90612cb4565b6002600b5560155460408051808201909152601081526f26b4b73a34b733b9903830bab9b2b21760811b602082015290600160a01b900460ff161561112d5760405162461bcd60e51b81526004016109da91906128ba565b50600e54601154600091610100900460ff169061114c90606490612ceb565b6111569190612d02565b611161906001612d02565b60115490915061117390606490612ceb565b8111801561118357506011548111155b6040518060400160405280601481526020017321b0b73737ba1036b4b73a1039b79036b0b73c9760611b815250906111ce5760405162461bcd60e51b81526004016109da91906128ba565b506111d933826120ad565b600e8054610100900460ff169060016111f183612d1a565b91906101000a81548160ff021916908360ff16021790555050506001600b81905550565b600a546001600160a01b0316331461123f5760405162461bcd60e51b81526004016109da90612ba5565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b0382166112cc5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016109da565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b031633146113125760405162461bcd60e51b81526004016109da90612ba5565b61131c60006120c7565b565b606060018054610a1090612bda565b6002600b5414156113505760405162461bcd60e51b81526004016109da90612cb4565b6002600b5560155460408051808201909152601081526f26b4b73a34b733b9903830bab9b2b21760811b602082015290600160a01b900460ff16156113a85760405162461bcd60e51b81526004016109da91906128ba565b50601354604080516080810190915260488082526001600160a01b03909216151591612f6f6020830139906113f05760405162461bcd60e51b81526004016109da91906128ba565b5060408051808201909152601481527321b0b73737ba1036b4b73a1039b79036b0b73c9760611b6020820152600a60ff831611156114415760405162461bcd60e51b81526004016109da91906128ba565b5060008160ff1611611454576001611456565b805b6013546015546010549293506001600160a01b03918216926323b872dd92339216906114869060ff871690612d3a565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af11580156114da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fe9190612d59565b5061150b8160ff16612119565b506001600b55565b6002600b5414156115365760405162461bcd60e51b81526004016109da90612cb4565b6002600b5560155460408051808201909152601081526f26b4b73a34b733b9903830bab9b2b21760811b602082015290600160a01b900460ff161561158e5760405162461bcd60e51b81526004016109da91906128ba565b506014546001600160a01b031615806115b057506013546001600160a01b0316155b604051806080016040528060488152602001612f6f60489139906115e75760405162461bcd60e51b81526004016109da91906128ba565b5060408051808201909152601481527321b0b73737ba1036b4b73a1039b79036b0b73c9760611b6020820152600a8211156116355760405162461bcd60e51b81526004016109da91906128ba565b5060008111611645576001611647565b805b90506012548161165660085490565b6011546116639190612d02565b61166d9190612d02565b11156040518060400160405280601481526020017326b4b73a34b7339034b9903334b734b9b432b21760611b815250906116ba5760405162461bcd60e51b81526004016109da91906128ba565b5080600f546116c99190612d3a565b3410156116d557600080fd5b61150b81612119565b6001600160a01b0382163314156117375760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109da565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b031633146117cd5760405162461bcd60e51b81526004016109da90612ba5565b601580546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031633146118195760405162461bcd60e51b81526004016109da90612ba5565b6015805460ff60a81b1916600160a81b179055565b6118383383611e0b565b6118545760405162461bcd60e51b81526004016109da90612c15565b61186084848484612164565b50505050565b600d8054610b3590612bda565b6000818152600260205260409020546060906001600160a01b031615156040518060400160405280601981526020017f5468697320746f6b656e496420646f65736e7420657869737400000000000000815250906118e45760405162461bcd60e51b81526004016109da91906128ba565b50601554600160a81b900460ff16611988576016805461190390612bda565b80601f016020809104026020016040519081016040528092919081815260200182805461192f90612bda565b801561197c5780601f106119515761010080835404028352916020019161197c565b820191906000526020600020905b81548152906001019060200180831161195f57829003601f168201915b50505050509050919050565b6000611992612197565b905060008151116119b257604051806020016040528060008152506119e0565b806119bc846121a6565b600d6040516020016119d093929190612d76565b6040516020818303038152906040525b9392505050565b600a546001600160a01b03163314611a115760405162461bcd60e51b81526004016109da90612ba5565b601154600090611a2390606490612ceb565b90505b6012548111610df657807fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b55657207611a5a83611873565b604051611a6791906128ba565b60405180910390a280611a7981612e3a565b915050611a26565b600a546001600160a01b03163314611aab5760405162461bcd60e51b81526004016109da90612ba5565b805161100d90600d90602084019061276b565b600a546001600160a01b03163314611ae85760405162461bcd60e51b81526004016109da90612ba5565b601055565b600a546001600160a01b03163314611b175760405162461bcd60e51b81526004016109da90612ba5565b805161100d90601690602084019061276b565b600a546001600160a01b03163314611b545760405162461bcd60e51b81526004016109da90612ba5565b6001600160a01b038116611bb95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109da565b610df6816120c7565b6002600b541415611be55760405162461bcd60e51b81526004016109da90612cb4565b6002600b5560155460408051808201909152601081526f26b4b73a34b733b9903830bab9b2b21760811b602082015290600160a01b900460ff1615611c3d5760405162461bcd60e51b81526004016109da91906128ba565b50601454604080516080810190915260488082526001600160a01b03909216151591612f6f602083013990611c855760405162461bcd60e51b81526004016109da91906128ba565b506014546000906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d039190612e55565b11604051806060016040528060218152602001612fb76021913990611d3b5760405162461bcd60e51b81526004016109da91906128ba565b50611d466001612119565b6001600b55565b60006001600160e01b031982166380ac58cd60e01b1480611d7e57506001600160e01b03198216635b5e139f60e01b145b806109aa57506301ffc9a760e01b6001600160e01b03198316146109aa565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611dd282611011565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316611e845760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109da565b6000611e8f83611011565b9050806001600160a01b0316846001600160a01b03161480611eca5750836001600160a01b0316611ebf84610a93565b6001600160a01b0316145b80611efa57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611f1582611011565b6001600160a01b031614611f7d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016109da565b6001600160a01b038216611fdf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109da565b611fea8383836122a4565b611ff5600082611d9d565b6001600160a01b038316600090815260036020526040812080546001929061201e908490612ceb565b90915550506001600160a01b038216600090815260036020526040812080546001929061204c908490612d02565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61100d82826040518060200160405280600081525061235c565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061212460085490565b905060015b828111610cc7576121523382846011546121439190612d02565b61214d9190612d02565b6120ad565b8061215c81612e3a565b915050612129565b61216f848484611f02565b61217b8484848461238f565b6118605760405162461bcd60e51b81526004016109da90612e6e565b6060600c8054610a1090612bda565b6060816121ca5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156121f457806121de81612e3a565b91506121ed9050600a83612ed6565b91506121ce565b60008167ffffffffffffffff81111561220f5761220f6129c7565b6040519080825280601f01601f191660200182016040528015612239576020820181803683370190505b5090505b8415611efa5761224e600183612ceb565b915061225b600a86612eea565b612266906030612d02565b60f81b81838151811061227b5761227b612c66565b60200101906001600160f81b031916908160001a90535061229d600a86612ed6565b945061223d565b6001600160a01b0383166122ff576122fa81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612322565b816001600160a01b0316836001600160a01b03161461232257612322838261248d565b6001600160a01b03821661233957610cc78161252a565b826001600160a01b0316826001600160a01b031614610cc757610cc782826125d9565b612366838361261d565b612373600084848461238f565b610cc75760405162461bcd60e51b81526004016109da90612e6e565b60006001600160a01b0384163b1561248257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906123d3903390899088908890600401612efe565b6020604051808303816000875af192505050801561240e575060408051601f3d908101601f1916820190925261240b91810190612f3b565b60015b612468573d80801561243c576040519150601f19603f3d011682016040523d82523d6000602084013e612441565b606091505b5080516124605760405162461bcd60e51b81526004016109da90612e6e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611efa565b506001949350505050565b6000600161249a84611261565b6124a49190612ceb565b6000838152600760205260409020549091508082146124f7576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061253c90600190612ceb565b6000838152600960205260408120546008805493945090928490811061256457612564612c66565b90600052602060002001549050806008838154811061258557612585612c66565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806125bd576125bd612f58565b6001900381819060005260206000200160009055905550505050565b60006125e483611261565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b0382166126735760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109da565b6000818152600260205260409020546001600160a01b0316156126d85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109da565b6126e4600083836122a4565b6001600160a01b038216600090815260036020526040812080546001929061270d908490612d02565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461277790612bda565b90600052602060002090601f01602090048101928261279957600085556127df565b82601f106127b257805160ff19168380011785556127df565b828001600101855582156127df579182015b828111156127df5782518255916020019190600101906127c4565b506127eb9291506127ef565b5090565b5b808211156127eb57600081556001016127f0565b6001600160e01b031981168114610df657600080fd5b60006020828403121561282c57600080fd5b81356119e081612804565b8015158114610df657600080fd5b60006020828403121561285757600080fd5b81356119e081612837565b60005b8381101561287d578181015183820152602001612865565b838111156118605750506000910152565b600081518084526128a6816020860160208601612862565b601f01601f19169290920160200192915050565b6020815260006119e0602083018461288e565b6000602082840312156128df57600080fd5b5035919050565b80356001600160a01b03811681146128fd57600080fd5b919050565b6000806040838503121561291557600080fd5b61291e836128e6565b946020939093013593505050565b60008060006060848603121561294157600080fd5b61294a846128e6565b9250612958602085016128e6565b9150604084013590509250925092565b60006020828403121561297a57600080fd5b6119e0826128e6565b6020808252825182820181905260009190848201906040850190845b818110156129bb5783518352928401929184019160010161299f565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156129f8576129f86129c7565b604051601f8501601f19908116603f01168101908282118183101715612a2057612a206129c7565b81604052809350858152868686011115612a3957600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612a6557600080fd5b813567ffffffffffffffff811115612a7c57600080fd5b8201601f81018413612a8d57600080fd5b611efa848235602084016129dd565b600060208284031215612aae57600080fd5b813560ff811681146119e057600080fd5b60008060408385031215612ad257600080fd5b612adb836128e6565b91506020830135612aeb81612837565b809150509250929050565b60008060008060808587031215612b0c57600080fd5b612b15856128e6565b9350612b23602086016128e6565b925060408501359150606085013567ffffffffffffffff811115612b4657600080fd5b8501601f81018713612b5757600080fd5b612b66878235602084016129dd565b91505092959194509250565b60008060408385031215612b8557600080fd5b612b8e836128e6565b9150612b9c602084016128e6565b90509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680612bee57607f821691505b60208210811415612c0f57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600061ffff80831681811415612caa57612caa612c7c565b6001019392505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600082821015612cfd57612cfd612c7c565b500390565b60008219821115612d1557612d15612c7c565b500190565b600060ff821660ff811415612d3157612d31612c7c565b60010192915050565b6000816000190483118215151615612d5457612d54612c7c565b500290565b600060208284031215612d6b57600080fd5b81516119e081612837565b600084516020612d898285838a01612862565b855191840191612d9c8184848a01612862565b8554920191600090600181811c9080831680612db957607f831692505b858310811415612dd757634e487b7160e01b85526022600452602485fd5b808015612deb5760018114612dfc57612e29565b60ff19851688528388019550612e29565b60008b81526020902060005b85811015612e215781548a820152908401908801612e08565b505083880195505b50939b9a5050505050505050505050565b6000600019821415612e4e57612e4e612c7c565b5060010190565b600060208284031215612e6757600080fd5b5051919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b600082612ee557612ee5612ec0565b500490565b600082612ef957612ef9612ec0565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612f319083018461288e565b9695505050505050565b600060208284031215612f4d57600080fd5b81516119e081612804565b634e487b7160e01b600052603160045260246000fdfe54686973206d696e74696e67206d6574686f64206973206e6f7420617661696c61626c6520666f72207468697320636861696e2e2055736520416e6f74686572206d6574686f6421596f7520646f206e6f74206f776e20616e792054726176656c6572204c6f6f742ea264697066735822122004c0cc1b42c4f8d7bd1351f0e7258358c088209069ca4346459cc9b04c97f6fc64736f6c634300080b0033
Verified Source Code Partial Match
Compiler: v0.8.11+commit.d7f03943
EVM: london
Optimization: Yes (200 runs)
LittleTraveler.sol 1493 lines
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
pragma solidity ^0.8.11;
/**
* @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);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
pragma solidity ^0.8.11;
/**
* @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;
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
pragma solidity ^0.8.11;
/**
* @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);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
pragma solidity ^0.8.11;
/**
* @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;
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity ^0.8.11;
/**
* @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);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity ^0.8.11;
/**
* @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);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
pragma solidity ^0.8.11;
/**
* @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);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
pragma solidity ^0.8.11;
/**
* @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);
}
// File: @openzeppelin/contracts/utils/Context.sol
pragma solidity ^0.8.11;
/**
* @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;
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity ^0.8.11;
/**
* @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 {}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
pragma solidity ^0.8.11;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
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();
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.8.11;
/**
* @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 Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
pragma solidity ^0.8.11;
/// @title A 10,000 multi-chain PFP project for the travelers.
/// @author Project by TripsCommunity, coding by jacmos3
/// @notice The first multichain project for the Travel Industry. First derivative of Traveler Loot in Ethereum.
/// @custom:website www.littletraveler.org | www.travelerloot.com
contract LittleTraveler is ERC721Enumerable, Ownable, ReentrancyGuard {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint8 public chainNumber;
uint8 public counterOwner = 0;
uint8 public constant maxMintAmount = 10;
uint8 public constant maxPerOwner = 100;
uint16 public constant maxThisChain = 1000;
uint16 public constant maxSupplyAllChains = 10000;
uint256 public cost;
uint256 public costTrips;
uint256 public floorIndex;
uint256 public roofIndex;
address public tripsAddress;
address public travelerLootAddress;
address public treasurerAddress;
string private constant ERROR_PAUSED = "Mintings paused.";
string private constant ERROR_TOO_MUCH = "Cannot mint so many.";
string private constant ERROR_MINT_FINISHED = "Minting is finished.";
string private constant ERROR_DONT_OWN_TRAVELER_LOOT = "You do not own any Traveler Loot.";
string private constant ERROR_NOT_POSSIBLE_ON_THIS_CHAIN = "This minting method is not available for this chain. Use Another method!";
string private constant ERROR_TOKEN_ID_DOES_NOT_EXISTS = "This tokenId doesnt exist";
bool public paused = true;
bool public revealed = false;
string public notRevealedUri;
event PermanentURI(string _value, uint256 indexed _id);
constructor(string memory _name, string memory _symbol, string memory _initBaseURI, string memory _initNotRevealedUri, uint256 _cost, uint256 _costTrips, uint8 _chainNumber, address _tripsAddress, address _travelerLootAddress, address _treasurerAddress) ERC721(_name, _symbol) {
baseURI = _initBaseURI;
notRevealedUri = _initNotRevealedUri;
cost = _cost;
costTrips = _costTrips;
tripsAddress = _tripsAddress;
travelerLootAddress = _travelerLootAddress;
treasurerAddress = _treasurerAddress;
chainNumber = _chainNumber;
floorIndex = chainNumber * maxThisChain + maxPerOwner;
roofIndex = floorIndex + maxThisChain - maxPerOwner;
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function _processingMints(uint256 _mintAmount) internal {
uint256 baseSupply = totalSupply();
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, floorIndex + baseSupply + i);
}
}
/// @notice Mints Little Traveler by paying native coin.
/// @param _mintAmount the number of Little Traveler you want to mint
/// @dev check requirements: different chains have different configurations and not in every chains it is possible to mint using this function
function mint(uint256 _mintAmount) external payable nonReentrant{
require(!paused, ERROR_PAUSED);
require(travelerLootAddress == address(0) || tripsAddress == address(0), ERROR_NOT_POSSIBLE_ON_THIS_CHAIN);
require(_mintAmount <= maxMintAmount, ERROR_TOO_MUCH);
_mintAmount = _mintAmount > 0 ? _mintAmount : 1;
require((floorIndex + totalSupply()) + _mintAmount <= roofIndex, ERROR_MINT_FINISHED);
require(msg.value >= cost * _mintAmount);
_processingMints(_mintAmount);
}
/// @notice Mints Little Traveler by holding a Little Traveler.
/// @dev This is only thought for ethereum network and it is leaded by a configuration param
function mintByTravelerLoot() external nonReentrant{
require(!paused, ERROR_PAUSED);
require(travelerLootAddress != address(0), ERROR_NOT_POSSIBLE_ON_THIS_CHAIN);
require(IERC721(travelerLootAddress).balanceOf(_msgSender()) > 0, ERROR_DONT_OWN_TRAVELER_LOOT);
_processingMints(1);
}
/// @notice Mints Little Traveler by paying Trips coin.
/// @dev check requirements: different chains have different configurations and not in every chains it ...
// [truncated — 55222 bytes total]
Read Contract
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
chainNumber 0xc2f318d3 → uint8
cost 0x13faede6 → uint256
costTrips 0x35cc70d4 → uint256
counterOwner 0x10c33393 → uint8
floorIndex 0xddcb30a9 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxMintAmount 0x239c70ae → uint8
maxPerOwner 0x9bc643a8 → uint8
maxSupplyAllChains 0x9758d46f → uint16
maxThisChain 0x06441222 → uint16
name 0x06fdde03 → string
notRevealedUri 0x081c8c44 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
revealed 0x51830227 → bool
roofIndex 0x15a1f542 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
travelerLootAddress 0x2b0dac0d → address
treasurerAddress 0x6b34a45a → address
tripsAddress 0xdd7c9861 → address
walletOfOwner 0x438b6300 → uint256[]
Write Contract 23 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
freezeMetadata 0xd111515d
No parameters
mint 0xa0712d68
uint256 _mintAmount
mintByOwner 0x6b74a598
No parameters
mintByTravelerLoot 0xfd2c58f2
No parameters
mintWithTrips 0x95fc4d83
uint8 _mintAmount
pause 0x02329a29
bool _state
renounceOwnership 0x715018a6
No parameters
reveal 0xa475b5dd
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseExtension 0xda3ef23f
string _newBaseExtension
setBaseURI 0x55f804b3
string _newBaseURI
setCost 0x44a0d68a
uint256 _newCost
setCostTrips 0xe38d93a4
uint256 _newCostTrips
setNotRevealedURI 0xf2c4ce1e
string _notRevealedURI
setTravelerLootAddress 0x6eedf952
address _travelerLootAddress
setTreasurerAddress 0xa351f75a
address _treasurerAddress
setTripsAddress 0x4bce50ee
address _tripsAddress
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address