Address Contract Verified
Address
0xda7Ceef88Ca02ACC98e34d9150C52E4F3086F188
Balance
0 ETH
Nonce
1
Code Size
21326 bytes
Creator
0xbd9c204D...3d5E at tx 0x6bc6277c...c3bb56
Indexed Transactions
0 (1 on-chain, 1.1% indexed)
Contract Bytecode
21326 bytes
0x6080604052600436106102885760003560e01c8063715018a61161015a578063b88d4fde116100c1578063e448db671161007a578063e448db671461096e578063e985e9c514610999578063eb8835ab146109d6578063edf4de7214610a13578063f2fde38b14610a3e578063f759867a14610a6757610288565b8063b88d4fde1461085e578063c87b56dd14610887578063c889004b146108c4578063d5abeb01146108ef578063d897833e1461091a578063d9f645451461094357610288565b806395d89b411161011357806395d89b411461075d57806396ea3a4714610788578063a0712d68146107b1578063a10fe536146107cd578063a22cb4651461080a578063b61a429d1461083357610288565b8063715018a614610680578063732e71ef146106975780637501f741146106c05780637b6b4c0e146106eb5780638462151c146106f55780638da5cb5b1461073257610288565b8063259015b1116101fe5780634f6ccce7116101b75780634f6ccce71461056b57806355f804b3146105a85780635da5c7e3146105d15780636352211e146105db5780636c0360eb1461061857806370a082311461064357610288565b8063259015b1146104805780632f745c59146104a95780633ccfd60b146104e657806342842e0e146104f057806342966c681461051957806344a0d68a1461054257610288565b806313faede61161025057806313faede61461038457806318160ddd146103af57806319dab25c146103da578063200d2ed214610403578063228025e81461042e57806323b872dd1461045757610288565b806301ffc9a71461028d57806306fdde03146102ca578063081812fc146102f5578063088a4ed014610332578063095ea7b31461035b575b600080fd5b34801561029957600080fd5b506102b460048036038101906102af9190613672565b610a83565b6040516102c191906136ba565b60405180910390f35b3480156102d657600080fd5b506102df610a95565b6040516102ec919061376e565b60405180910390f35b34801561030157600080fd5b5061031c600480360381019061031791906137c6565b610b27565b6040516103299190613834565b60405180910390f35b34801561033e57600080fd5b50610359600480360381019061035491906137c6565b610bac565b005b34801561036757600080fd5b50610382600480360381019061037d919061387b565b610c32565b005b34801561039057600080fd5b50610399610d4a565b6040516103a691906138ca565b60405180910390f35b3480156103bb57600080fd5b506103c4610d50565b6040516103d191906138ca565b60405180910390f35b3480156103e657600080fd5b5061040160048036038101906103fc91906137c6565b610d5d565b005b34801561040f57600080fd5b50610418610de3565b60405161042591906136ba565b60405180910390f35b34801561043a57600080fd5b50610455600480360381019061045091906137c6565b610df6565b005b34801561046357600080fd5b5061047e600480360381019061047991906138e5565b610e7c565b005b34801561048c57600080fd5b506104a760048036038101906104a291906137c6565b610edc565b005b3480156104b557600080fd5b506104d060048036038101906104cb919061387b565b610f62565b6040516104dd91906138ca565b60405180910390f35b6104ee6110ab565b005b3480156104fc57600080fd5b50610517600480360381019061051291906138e5565b6111a0565b005b34801561052557600080fd5b50610540600480360381019061053b91906137c6565b6111c0565b005b34801561054e57600080fd5b50610569600480360381019061056491906137c6565b61121c565b005b34801561057757600080fd5b50610592600480360381019061058d91906137c6565b6112a2565b60405161059f91906138ca565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613a6d565b6112f5565b005b6105d961138b565b005b3480156105e757600080fd5b5061060260048036038101906105fd91906137c6565b6114e1565b60405161060f9190613834565b60405180910390f35b34801561062457600080fd5b5061062d61159e565b60405161063a919061376e565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190613ab6565b61162c565b60405161067791906138ca565b60405180910390f35b34801561068c57600080fd5b50610695611752565b005b3480156106a357600080fd5b506106be60048036038101906106b99190613b99565b6117da565b005b3480156106cc57600080fd5b506106d5611902565b6040516106e291906138ca565b60405180910390f35b6106f3611908565b005b34801561070157600080fd5b5061071c60048036038101906107179190613ab6565b611a5e565b6040516107299190613cd8565b60405180910390f35b34801561073e57600080fd5b50610747611b57565b6040516107549190613834565b60405180910390f35b34801561076957600080fd5b50610772611b81565b60405161077f919061376e565b60405180910390f35b34801561079457600080fd5b506107af60048036038101906107aa9190613cfa565b611c13565b005b6107cb60048036038101906107c691906137c6565b611e46565b005b3480156107d957600080fd5b506107f460048036038101906107ef91906137c6565b61204b565b60405161080191906138ca565b60405180910390f35b34801561081657600080fd5b50610831600480360381019061082c9190613da7565b61206f565b005b34801561083f57600080fd5b506108486121f0565b6040516108559190613e46565b60405180910390f35b34801561086a57600080fd5b5061088560048036038101906108809190613f02565b612216565b005b34801561089357600080fd5b506108ae60048036038101906108a991906137c6565b612278565b6040516108bb919061376e565b60405180910390f35b3480156108d057600080fd5b506108d961231f565b6040516108e691906138ca565b60405180910390f35b3480156108fb57600080fd5b50610904612325565b60405161091191906138ca565b60405180910390f35b34801561092657600080fd5b50610941600480360381019061093c9190613f85565b61232b565b005b34801561094f57600080fd5b506109586123c4565b60405161096591906138ca565b60405180910390f35b34801561097a57600080fd5b506109836123ca565b60405161099091906138ca565b60405180910390f35b3480156109a557600080fd5b506109c060048036038101906109bb9190613fb2565b6123d7565b6040516109cd91906136ba565b60405180910390f35b3480156109e257600080fd5b506109fd60048036038101906109f89190613ab6565b61246b565b604051610a0a91906138ca565b60405180910390f35b348015610a1f57600080fd5b50610a28612483565b604051610a3591906138ca565b60405180910390f35b348015610a4a57600080fd5b50610a656004803603810190610a609190613ab6565b612489565b005b610a816004803603810190610a7c91906137c6565b612581565b005b6000610a8e82612843565b9050919050565b606060008054610aa490614021565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad090614021565b8015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b5050505050905090565b6000610b32826128bd565b610b71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b68906140c5565b60405180910390fd5b6003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b610bb4612945565b73ffffffffffffffffffffffffffffffffffffffff16610bd2611b57565b73ffffffffffffffffffffffffffffffffffffffff1614610c28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1f90614131565b60405180910390fd5b80600b8190555050565b6000610c3d826114e1565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca5906141c3565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610ccd612945565b73ffffffffffffffffffffffffffffffffffffffff161480610cfc5750610cfb81610cf6612945565b6123d7565b5b610d3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3290614255565b60405180910390fd5b610d45838361294d565b505050565b60085481565b6000600280549050905090565b610d65612945565b73ffffffffffffffffffffffffffffffffffffffff16610d83611b57565b73ffffffffffffffffffffffffffffffffffffffff1614610dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd090614131565b60405180910390fd5b80600a8190555050565b600d60009054906101000a900460ff1681565b610dfe612945565b73ffffffffffffffffffffffffffffffffffffffff16610e1c611b57565b73ffffffffffffffffffffffffffffffffffffffff1614610e72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6990614131565b60405180910390fd5b8060098190555050565b610e8d610e87612945565b82612a06565b610ecc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec3906142e7565b60405180910390fd5b610ed7838383612ae4565b505050565b610ee4612945565b73ffffffffffffffffffffffffffffffffffffffff16610f02611b57565b73ffffffffffffffffffffffffffffffffffffffff1614610f58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4f90614131565b60405180910390fd5b80600c8190555050565b6000610f6d8361162c565b8210610fae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa590614353565b60405180910390fd5b6000805b6002805490508110156110615760028181548110610fd357610fd2614373565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561105057838214156110435780925050506110a5565b8161104d906143d1565b91505b8061105a906143d1565b9050610fb2565b5060006110a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109a90614353565b60405180910390fd5b505b92915050565b6110b3612945565b73ffffffffffffffffffffffffffffffffffffffff166110d1611b57565b73ffffffffffffffffffffffffffffffffffffffff1614611127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111e90614131565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff164760405161114d9061444b565b60006040518083038185875af1925050503d806000811461118a576040519150601f19603f3d011682016040523d82523d6000602084013e61118f565b606091505b505090508061119d57600080fd5b50565b6111bb83838360405180602001604052806000815250612216565b505050565b6111d16111cb612945565b82612a06565b611210576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611207906144d2565b60405180910390fd5b61121981612c9d565b50565b611224612945565b73ffffffffffffffffffffffffffffffffffffffff16611242611b57565b73ffffffffffffffffffffffffffffffffffffffff1614611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90614131565b60405180910390fd5b8060088190555050565b60006112ac610d50565b82106112ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e49061453e565b60405180910390fd5b819050919050565b6112fd612945565b73ffffffffffffffffffffffffffffffffffffffff1661131b611b57565b73ffffffffffffffffffffffffffffffffffffffff1614611371576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136890614131565b60405180910390fd5b8060079080519060200190611387929190613563565b5050565b6000611395610d50565b905060006113a16123ca565b9050600a546001826113b3919061455e565b11156113f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113eb90614600565b60405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632eb18d74343360016040518463ffffffff1660e01b815260040161145392919061465b565b6000604051808303818588803b15801561146c57600080fd5b505af1158015611480573d6000803e3d6000fd5b50505050506114ab33600184611496919061455e565b60405180602001604052806000815250612d7f565b60106001908060018154018082558091505060019003906000526020600020016000909190919091505560009150600090505050565b600080600283815481106114f8576114f7614373565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158c906146f6565b60405180910390fd5b80915050919050565b600780546115ab90614021565b80601f01602080910402602001604051908101604052809291908181526020018280546115d790614021565b80156116245780601f106115f957610100808354040283529160200191611624565b820191906000526020600020905b81548152906001019060200180831161160757829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561169d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169490614788565b60405180910390fd5b600080600280549050905060005b8181101561174357600281815481106116c7576116c6614373565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611732578261172f906143d1565b92505b8061173c906143d1565b90506116ab565b50600090508192505050919050565b61175a612945565b73ffffffffffffffffffffffffffffffffffffffff16611778611b57565b73ffffffffffffffffffffffffffffffffffffffff16146117ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c590614131565b60405180910390fd5b6117d86000612dda565b565b6117e2612945565b73ffffffffffffffffffffffffffffffffffffffff16611800611b57565b73ffffffffffffffffffffffffffffffffffffffff1614611856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184d90614131565b60405180910390fd5b60005b848490508110156118fb5782828281811061187757611876614373565b5b90506020020135600f600087878581811061189557611894614373565b5b90506020020160208101906118aa9190613ab6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806118f3906143d1565b915050611859565b5050505050565b600b5481565b6000611912610d50565b9050600061191e6123ca565b9050600a54600182611930919061455e565b1115611971576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196890614600565b60405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ea7acac343360016040518463ffffffff1660e01b81526004016119d092919061465b565b6000604051808303818588803b1580156119e957600080fd5b505af11580156119fd573d6000803e3d6000fd5b5050505050611a2833600184611a13919061455e565b60405180602001604052806000815250612d7f565b60106001908060018154018082558091505060019003906000526020600020016000909190919091505560009150600090505050565b6060611a698261162c565b600010611aab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa290614353565b60405180910390fd5b6000611ab68361162c565b905060008167ffffffffffffffff811115611ad457611ad3613942565b5b604051908082528060200260200182016040528015611b025781602001602082028036833780820191505090505b50905060005b82811015611b4c57611b1a8582610f62565b828281518110611b2d57611b2c614373565b5b6020026020010181815250508080611b44906143d1565b915050611b08565b508092505050919050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054611b9090614021565b80601f0160208091040260200160405190810160405280929190818152602001828054611bbc90614021565b8015611c095780601f10611bde57610100808354040283529160200191611c09565b820191906000526020600020905b815481529060010190602001808311611bec57829003601f168201915b5050505050905090565b611c1b612945565b73ffffffffffffffffffffffffffffffffffffffff16611c39611b57565b73ffffffffffffffffffffffffffffffffffffffff1614611c8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8690614131565b60405180910390fd5b818190508484905014611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce9061481a565b60405180910390fd5b600080611ce2610d50565b90506000611cee6123ca565b905060005b87879050811015611d3657878782818110611d1157611d10614373565b5b9050602002013584611d23919061455e565b935080611d2f906143d1565b9050611cf3565b50600954818484611d47919061455e565b611d51919061483a565b1115611d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d89906148ba565b60405180910390fd5b6000925060005b85859050811015611e385760005b888883818110611dba57611db9614373565b5b90506020020135811015611e2657611e15878784818110611dde57611ddd614373565b5b9050602002016020810190611df39190613ab6565b8580611dfe906143d1565b965060405180602001604052806000815250612d7f565b80611e1f906143d1565b9050611da7565b5080611e31906143d1565b9050611d99565b506000915050505050505050565b60026006541415611e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8390614926565b60405180910390fd5b60026006819055506000611e9e610d50565b90506000611eaa6123ca565b9050600d60009054906101000a900460ff16611efb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef290614992565b60405180910390fd5b60008311611f3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f35906149fe565b60405180910390fd5b600b54831115611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7a906148ba565b60405180910390fd5b600954818484611f93919061455e565b611f9d919061483a565b1115611fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd590614600565b60405180910390fd5b82600854611fec9190614a1e565b341015611ff857600080fd5b60005b8381101561203957612028338285612013919061455e565b60405180602001604052806000815250612d7f565b80612032906143d1565b9050611ffb565b50600091505050600160068190555050565b6010818154811061205b57600080fd5b906000526020600020016000915090505481565b612077612945565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dc90614ac4565b60405180910390fd5b80600460006120f2612945565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff1661219f612945565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516121e491906136ba565b60405180910390a35050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612227612221612945565b83612a06565b612266576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225d906142e7565b60405180910390fd5b61227284848484612ea0565b50505050565b6060612283826128bd565b6122c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b990614b56565b60405180910390fd5b60006122cc612efc565b905060008151116122ec5760405180602001604052806000815250612317565b806122f684612f8e565b604051602001612307929190614bb2565b6040516020818303038152906040525b915050919050565b600e5481565b60095481565b612333612945565b73ffffffffffffffffffffffffffffffffffffffff16612351611b57565b73ffffffffffffffffffffffffffffffffffffffff16146123a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239e90614131565b60405180910390fd5b80600d60006101000a81548160ff02191690831515021790555050565b600c5481565b6000601080549050905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600f6020528060005260406000206000915090505481565b600a5481565b612491612945565b73ffffffffffffffffffffffffffffffffffffffff166124af611b57565b73ffffffffffffffffffffffffffffffffffffffff1614612505576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fc90614131565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256c90614c48565b60405180910390fd5b61257e81612dda565b50565b42600e5411156125c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bd90614cb4565b60405180910390fd5b60006125d0610d50565b905060006125dc6123ca565b90506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600d60009054906101000a900460ff1615612672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266990614992565b60405180910390fd5b600081116126b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ac90614d20565b60405180910390fd5b808411156126f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ef90614d8c565b60405180910390fd5b600954828585612708919061455e565b612712919061483a565b1115612753576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274a90614df8565b60405180910390fd5b34846008546127629190614a1e565b146127a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279990614e64565b60405180910390fd5b83816127ae919061483a565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000905060005b8481101561283857612825338286612810919061455e565b60405180602001604052806000815250612d7f565b8080612830906143d1565b9150506127f8565b506000925050505050565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806128b657506128b5826130ef565b5b9050919050565b60006002805490508210801561293e5750600073ffffffffffffffffffffffffffffffffffffffff16600283815481106128fa576128f9614373565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b600033905090565b816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166129c0836114e1565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612a11826128bd565b612a50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4790614ef6565b60405180910390fd5b6000612a5b836114e1565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612aca57508373ffffffffffffffffffffffffffffffffffffffff16612ab284610b27565b73ffffffffffffffffffffffffffffffffffffffff16145b80612adb5750612ada81856123d7565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612b04826114e1565b73ffffffffffffffffffffffffffffffffffffffff1614612b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5190614f88565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612bca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bc19061501a565b60405180910390fd5b612bd58383836131d1565b612be060008261294d565b8160028281548110612bf557612bf4614373565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000612ca8826114e1565b9050612cb6816000846131d1565b612cc160008361294d565b600060028381548110612cd757612cd6614373565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b612d8983836131d6565b612d96600084848461335e565b612dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dcc906150ac565b60405180910390fd5b505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612eab848484612ae4565b612eb78484848461335e565b612ef6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eed906150ac565b60405180910390fd5b50505050565b606060078054612f0b90614021565b80601f0160208091040260200160405190810160405280929190818152602001828054612f3790614021565b8015612f845780601f10612f5957610100808354040283529160200191612f84565b820191906000526020600020905b815481529060010190602001808311612f6757829003601f168201915b5050505050905090565b60606000821415612fd6576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506130ea565b600082905060005b60008214613008578080612ff1906143d1565b915050600a8261300191906150fb565b9150612fde565b60008167ffffffffffffffff81111561302457613023613942565b5b6040519080825280601f01601f1916602001820160405280156130565781602001600182028036833780820191505090505b5090505b600085146130e35760018261306f919061483a565b9150600a8561307e919061512c565b603061308a919061455e565b60f81b8183815181106130a05761309f614373565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856130dc91906150fb565b945061305a565b8093505050505b919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806131ba57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806131ca57506131c9826134e6565b5b9050919050565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323d906151a9565b60405180910390fd5b61324f816128bd565b1561328f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161328690615215565b60405180910390fd5b61329b600083836131d1565b6002829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600061337f8473ffffffffffffffffffffffffffffffffffffffff16613550565b156134d9578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026133a8612945565b8786866040518563ffffffff1660e01b81526004016133ca949392919061528a565b6020604051808303816000875af192505050801561340657506040513d601f19601f8201168201806040525081019061340391906152eb565b60015b613489573d8060008114613436576040519150601f19603f3d011682016040523d82523d6000602084013e61343b565b606091505b50600081511415613481576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613478906150ac565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506134de565b600190505b949350505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600080823b905060008111915050919050565b82805461356f90614021565b90600052602060002090601f01602090048101928261359157600085556135d8565b82601f106135aa57805160ff19168380011785556135d8565b828001600101855582156135d8579182015b828111156135d75782518255916020019190600101906135bc565b5b5090506135e591906135e9565b5090565b5b808211156136025760008160009055506001016135ea565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61364f8161361a565b811461365a57600080fd5b50565b60008135905061366c81613646565b92915050565b60006020828403121561368857613687613610565b5b60006136968482850161365d565b91505092915050565b60008115159050919050565b6136b48161369f565b82525050565b60006020820190506136cf60008301846136ab565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561370f5780820151818401526020810190506136f4565b8381111561371e576000848401525b50505050565b6000601f19601f8301169050919050565b6000613740826136d5565b61374a81856136e0565b935061375a8185602086016136f1565b61376381613724565b840191505092915050565b600060208201905081810360008301526137888184613735565b905092915050565b6000819050919050565b6137a381613790565b81146137ae57600080fd5b50565b6000813590506137c08161379a565b92915050565b6000602082840312156137dc576137db613610565b5b60006137ea848285016137b1565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061381e826137f3565b9050919050565b61382e81613813565b82525050565b60006020820190506138496000830184613825565b92915050565b61385881613813565b811461386357600080fd5b50565b6000813590506138758161384f565b92915050565b6000806040838503121561389257613891613610565b5b60006138a085828601613866565b92505060206138b1858286016137b1565b9150509250929050565b6138c481613790565b82525050565b60006020820190506138df60008301846138bb565b92915050565b6000806000606084860312156138fe576138fd613610565b5b600061390c86828701613866565b935050602061391d86828701613866565b925050604061392e868287016137b1565b9150509250925092565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61397a82613724565b810181811067ffffffffffffffff8211171561399957613998613942565b5b80604052505050565b60006139ac613606565b90506139b88282613971565b919050565b600067ffffffffffffffff8211156139d8576139d7613942565b5b6139e182613724565b9050602081019050919050565b82818337600083830152505050565b6000613a10613a0b846139bd565b6139a2565b905082815260208101848484011115613a2c57613a2b61393d565b5b613a378482856139ee565b509392505050565b600082601f830112613a5457613a53613938565b5b8135613a648482602086016139fd565b91505092915050565b600060208284031215613a8357613a82613610565b5b600082013567ffffffffffffffff811115613aa157613aa0613615565b5b613aad84828501613a3f565b91505092915050565b600060208284031215613acc57613acb613610565b5b6000613ada84828501613866565b91505092915050565b600080fd5b600080fd5b60008083601f840112613b0357613b02613938565b5b8235905067ffffffffffffffff811115613b2057613b1f613ae3565b5b602083019150836020820283011115613b3c57613b3b613ae8565b5b9250929050565b60008083601f840112613b5957613b58613938565b5b8235905067ffffffffffffffff811115613b7657613b75613ae3565b5b602083019150836020820283011115613b9257613b91613ae8565b5b9250929050565b60008060008060408587031215613bb357613bb2613610565b5b600085013567ffffffffffffffff811115613bd157613bd0613615565b5b613bdd87828801613aed565b9450945050602085013567ffffffffffffffff811115613c0057613bff613615565b5b613c0c87828801613b43565b925092505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c4f81613790565b82525050565b6000613c618383613c46565b60208301905092915050565b6000602082019050919050565b6000613c8582613c1a565b613c8f8185613c25565b9350613c9a83613c36565b8060005b83811015613ccb578151613cb28882613c55565b9750613cbd83613c6d565b925050600181019050613c9e565b5085935050505092915050565b60006020820190508181036000830152613cf28184613c7a565b905092915050565b60008060008060408587031215613d1457613d13613610565b5b600085013567ffffffffffffffff811115613d3257613d31613615565b5b613d3e87828801613b43565b9450945050602085013567ffffffffffffffff811115613d6157613d60613615565b5b613d6d87828801613aed565b925092505092959194509250565b613d848161369f565b8114613d8f57600080fd5b50565b600081359050613da181613d7b565b92915050565b60008060408385031215613dbe57613dbd613610565b5b6000613dcc85828601613866565b9250506020613ddd85828601613d92565b9150509250929050565b6000819050919050565b6000613e0c613e07613e02846137f3565b613de7565b6137f3565b9050919050565b6000613e1e82613df1565b9050919050565b6000613e3082613e13565b9050919050565b613e4081613e25565b82525050565b6000602082019050613e5b6000830184613e37565b92915050565b600067ffffffffffffffff821115613e7c57613e7b613942565b5b613e8582613724565b9050602081019050919050565b6000613ea5613ea084613e61565b6139a2565b905082815260208101848484011115613ec157613ec061393d565b5b613ecc8482856139ee565b509392505050565b600082601f830112613ee957613ee8613938565b5b8135613ef9848260208601613e92565b91505092915050565b60008060008060808587031215613f1c57613f1b613610565b5b6000613f2a87828801613866565b9450506020613f3b87828801613866565b9350506040613f4c878288016137b1565b925050606085013567ffffffffffffffff811115613f6d57613f6c613615565b5b613f7987828801613ed4565b91505092959194509250565b600060208284031215613f9b57613f9a613610565b5b6000613fa984828501613d92565b91505092915050565b60008060408385031215613fc957613fc8613610565b5b6000613fd785828601613866565b9250506020613fe885828601613866565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061403957607f821691505b6020821081141561404d5761404c613ff2565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b60006140af602c836136e0565b91506140ba82614053565b604082019050919050565b600060208201905081810360008301526140de816140a2565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061411b6020836136e0565b9150614126826140e5565b602082019050919050565b6000602082019050818103600083015261414a8161410e565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006141ad6021836136e0565b91506141b882614151565b604082019050919050565b600060208201905081810360008301526141dc816141a0565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b600061423f6038836136e0565b915061424a826141e3565b604082019050919050565b6000602082019050818103600083015261426e81614232565b9050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b60006142d16031836136e0565b91506142dc82614275565b604082019050919050565b60006020820190508181036000830152614300816142c4565b9050919050565b7f455243373231456e756d3a206f776e657220696f6f6200000000000000000000600082015250565b600061433d6016836136e0565b915061434882614307565b602082019050919050565b6000602082019050818103600083015261436c81614330565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006143dc82613790565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561440f5761440e6143a2565b5b600182019050919050565b600081905092915050565b50565b600061443560008361441a565b915061444082614425565b600082019050919050565b600061445682614428565b9150819050919050565b7f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656400000000000000000000000000000000602082015250565b60006144bc6030836136e0565b91506144c782614460565b604082019050919050565b600060208201905081810360008301526144eb816144af565b9050919050565b7f455243373231456e756d3a20676c6f62616c20696f6f62000000000000000000600082015250565b60006145286017836136e0565b9150614533826144f2565b602082019050919050565b600060208201905081810360008301526145578161451b565b9050919050565b600061456982613790565b915061457483613790565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156145a9576145a86143a2565b5b828201905092915050565b7f536f727279000000000000000000000000000000000000000000000000000000600082015250565b60006145ea6005836136e0565b91506145f5826145b4565b602082019050919050565b60006020820190508181036000830152614619816145dd565b9050919050565b6000819050919050565b600061464561464061463b84614620565b613de7565b613790565b9050919050565b6146558161462a565b82525050565b60006040820190506146706000830185613825565b61467d602083018461464c565b9392505050565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b60006146e06029836136e0565b91506146eb82614684565b604082019050919050565b6000602082019050818103600083015261470f816146d3565b9050919050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000614772602a836136e0565b915061477d82614716565b604082019050919050565b600060208201905081810360008301526147a181614765565b9050919050565b7f50726f76696465207175616e74697469657320616e6420726563697069656e7460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006148046021836136e0565b915061480f826147a8565b604082019050919050565b60006020820190508181036000830152614833816147f7565b9050919050565b600061484582613790565b915061485083613790565b925082821015614863576148626143a2565b5b828203905092915050565b7f546f6f206d616e79000000000000000000000000000000000000000000000000600082015250565b60006148a46008836136e0565b91506148af8261486e565b602082019050919050565b600060208201905081810360008301526148d381614897565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614910601f836136e0565b915061491b826148da565b602082019050919050565b6000602082019050818103600083015261493f81614903565b9050919050565b7f4f66660000000000000000000000000000000000000000000000000000000000600082015250565b600061497c6003836136e0565b915061498782614946565b602082019050919050565b600060208201905081810360008301526149ab8161496f565b9050919050565b7f4475680000000000000000000000000000000000000000000000000000000000600082015250565b60006149e86003836136e0565b91506149f3826149b2565b602082019050919050565b60006020820190508181036000830152614a17816149db565b9050919050565b6000614a2982613790565b9150614a3483613790565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614a6d57614a6c6143a2565b5b828202905092915050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614aae6019836136e0565b9150614ab982614a78565b602082019050919050565b60006020820190508181036000830152614add81614aa1565b9050919050565b7f4552433732314d657461646174613a204e6f6e6578697374656e7420746f6b6560008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000614b406021836136e0565b9150614b4b82614ae4565b604082019050919050565b60006020820190508181036000830152614b6f81614b33565b9050919050565b600081905092915050565b6000614b8c826136d5565b614b968185614b76565b9350614ba68185602086016136f1565b80840191505092915050565b6000614bbe8285614b81565b9150614bca8284614b81565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614c326026836136e0565b9150614c3d82614bd6565b604082019050919050565b60006020820190508181036000830152614c6181614c25565b9050919050565b7f4e6f742079657400000000000000000000000000000000000000000000000000600082015250565b6000614c9e6007836136e0565b9150614ca982614c68565b602082019050919050565b60006020820190508181036000830152614ccd81614c91565b9050919050565b7f4c6f772072657365727665000000000000000000000000000000000000000000600082015250565b6000614d0a600b836136e0565b9150614d1582614cd4565b602082019050919050565b60006020820190508181036000830152614d3981614cfd565b9050919050565b7f547279206c657373000000000000000000000000000000000000000000000000600082015250565b6000614d766008836136e0565b9150614d8182614d40565b602082019050919050565b60006020820190508181036000830152614da581614d69565b9050919050565b7f4d6f7265207468616e206d617800000000000000000000000000000000000000600082015250565b6000614de2600d836136e0565b9150614ded82614dac565b602082019050919050565b60006020820190508181036000830152614e1181614dd5565b9050919050565b7f57726f6e6720616d6f756e740000000000000000000000000000000000000000600082015250565b6000614e4e600c836136e0565b9150614e5982614e18565b602082019050919050565b60006020820190508181036000830152614e7d81614e41565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000614ee0602c836136e0565b9150614eeb82614e84565b604082019050919050565b60006020820190508181036000830152614f0f81614ed3565b9050919050565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b6000614f726029836136e0565b9150614f7d82614f16565b604082019050919050565b60006020820190508181036000830152614fa181614f65565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006150046024836136e0565b915061500f82614fa8565b604082019050919050565b6000602082019050818103600083015261503381614ff7565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b60006150966032836136e0565b91506150a18261503a565b604082019050919050565b600060208201905081810360008301526150c581615089565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061510682613790565b915061511183613790565b925082615121576151206150cc565b5b828204905092915050565b600061513782613790565b915061514283613790565b925082615152576151516150cc565b5b828206905092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006151936020836136e0565b915061519e8261515d565b602082019050919050565b600060208201905081810360008301526151c281615186565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b60006151ff601c836136e0565b915061520a826151c9565b602082019050919050565b6000602082019050818103600083015261522e816151f2565b9050919050565b600081519050919050565b600082825260208201905092915050565b600061525c82615235565b6152668185615240565b93506152768185602086016136f1565b61527f81613724565b840191505092915050565b600060808201905061529f6000830187613825565b6152ac6020830186613825565b6152b960408301856138bb565b81810360608301526152cb8184615251565b905095945050505050565b6000815190506152e581613646565b92915050565b60006020828403121561530157615300613610565b5b600061530f848285016152d6565b9150509291505056fea2646970667358221220ae1b7f60cd8b50a0e9986924fe819afc2c52687194d09c788fc2f91cbe29bf3664736f6c634300080a0033
Verified Source Code Full Match
Compiler: v0.8.10+commit.fc410830
EVM: london
Optimization: No
Koala.sol 203 lines
// SPDX-License-Identifier: GPL-3.0
// Modified from: Pagzi Tech Inc. 2021
pragma solidity ^0.8.10;
import "./ERC721Enum.sol";
import "./ERC721Burn.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./Traveler.sol";
contract Koala is ERC721Enum, ERC721Burn, Ownable, ReentrancyGuard{
using Strings for uint256;
string public baseURI;
//sale settings
uint256 public cost = 0.05 ether;
uint256 public maxSupply = 4715;
uint256 public maxTravelerReserve = 285;
uint256 public maxMint = 5;
uint256 public maxTravelerReservePerMint = 1;
bool public status = false;
//presale settings
uint256 public presaleDate = 1642042800;
mapping(address => uint256) public presaleWhitelist;
uint256[] public koalaMet;
Traveler public Travelers;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
Traveler _Traveler
)
ERC721P(_name, _symbol)
{
setBaseURI(_initBaseURI);
Travelers = _Traveler;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enum, ERC721P) returns (bool) {
return super.supportsInterface(interfaceId);
}
// internal
function _baseURI() internal view virtual returns (string memory) {
return baseURI;
}
// public minting
function mint(uint256 _mintAmount) external payable nonReentrant {
uint256 s = totalSupply();
uint256 t = totalTravelerReserve();
require(status, "Off");
require(_mintAmount > 0, "Duh");
require(_mintAmount <= maxMint, "Too many");
require(s + _mintAmount - t <= maxSupply, "Sorry");
require(msg.value >= cost * _mintAmount);
for (uint256 i = 0; i < _mintAmount; ++i) {
_safeMint(msg.sender, s + i, "");
}
delete s;
}
function mintPresale(uint256 _mintAmount) external payable {
require(presaleDate <= block.timestamp, "Not yet");
uint256 s = totalSupply();
uint256 t = totalTravelerReserve();
uint256 reserve = presaleWhitelist[msg.sender];
require(!status, "Off");
require(reserve > 0, "Low reserve");
require(_mintAmount <= reserve, "Try less");
require(s + _mintAmount - t <= maxSupply, "More than max");
require(cost * _mintAmount == msg.value, "Wrong amount");
presaleWhitelist[msg.sender] = reserve - _mintAmount;
delete reserve;
for (uint256 i = 0; i < _mintAmount; i++) {
_safeMint(msg.sender, s + i, "");
}
delete s;
}
// admin minting
function gift(uint256[] calldata quantity, address[] calldata recipient)
external
onlyOwner
{
require(
quantity.length == recipient.length,
"Provide quantities and recipients"
);
uint256 totalQuantity = 0;
uint256 s = totalSupply();
uint256 t = totalTravelerReserve();
for (uint256 i = 0; i < quantity.length; ++i) {
totalQuantity += quantity[i];
}
require(s + totalQuantity - t <= maxSupply, "Too many");
delete totalQuantity;
for (uint256 i = 0; i < recipient.length; ++i) {
for (uint256 j = 0; j < quantity[i]; ++j) {
_safeMint(recipient[i], s++, "");
}
}
delete s;
}
function travelerReserve() external payable{
uint256 s = totalSupply();
uint256 t = totalTravelerReserve();
require(t + 1 <= maxTravelerReserve, "Sorry");
Travelers.koalaMint{value: msg.value}(msg.sender,1);
_safeMint(msg.sender, s + 1, "");
koalaMet.push(1);
delete s;
delete t;
}
function travelerReservePresale() external payable{
uint256 s = totalSupply();
uint256 t = totalTravelerReserve();
require(t + 1 <= maxTravelerReserve, "Sorry");
Travelers.koalaPresaleMint{value: msg.value}(msg.sender,1);
_safeMint(msg.sender, s + 1, "");
koalaMet.push(1);
delete s;
delete t;
}
// admin functionality
function presaleSet(
address[] calldata _addresses,
uint256[] calldata _amounts
) external onlyOwner {
for (uint256 i; i < _addresses.length; i++) {
presaleWhitelist[_addresses[i]] = _amounts[i];
}
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(_exists(tokenId), "ERC721Metadata: Nonexistent token");
string memory currentBaseURI = _baseURI();
return
bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString()))
: "";
}
function setCost(uint256 _newCost) public onlyOwner {
cost = _newCost;
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
maxMint = _newMaxMintAmount;
}
function setMaxTravelerReservePerMintAmount(uint256 _newMaxMintAmount)
public
onlyOwner
{
maxTravelerReservePerMint = _newMaxMintAmount;
}
function setmaxSupply(uint256 _newMaxSupply) public onlyOwner {
maxSupply = _newMaxSupply;
}
function setmaxTravelerReserve(uint256 _newMaxTravelerReserve)
public
onlyOwner
{
maxTravelerReserve = _newMaxTravelerReserve;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function setSaleStatus(bool _status) public onlyOwner {
status = _status;
}
function totalTravelerReserve() public view returns (uint256) {
return koalaMet.length;
}
function withdraw() public payable onlyOwner {
(bool success, ) = payable(msg.sender).call{
value: address(this).balance
}("");
require(success);
}
}
ERC721P.sol 200 lines
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
abstract contract ERC721P is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
string private _name;
string private _symbol;
address[] internal _owners;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
uint count = 0;
uint length = _owners.length;
for( uint i = 0; i < length; ++i ){
if( owner == _owners[i] ){
++count;
}
}
delete length;
return count;
}
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;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721P.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);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
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);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
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);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
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);
}
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");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return tokenId < _owners.length && _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721P.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
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"
);
}
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);
_owners.push(to);
emit Transfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721P.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_owners[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721P.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);
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721P.ownerOf(tokenId), to, tokenId);
}
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;
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
Traveler.sol 176 lines
// SPDX-License-Identifier: GPL-3.0
// Modified from: Pagzi Tech Inc. 2021
pragma solidity ^0.8.10;
import "./ERC721Enum.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract Traveler is ERC721Enum, Ownable, ReentrancyGuard {
using Strings for uint256;
string public baseURI;
//sale settings
uint256 public cost = 0.15 ether;
uint256 public maxSupply = 300;
uint256 public maxMint = 1;
bool public status = false;
//presale settings
uint256 public presaleDate = 1642042800;
mapping(address => uint256) public presaleWhitelist;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
)
ERC721P(_name, _symbol)
{
setBaseURI(_initBaseURI);
}
// internal
function _baseURI() internal view virtual returns (string memory) {
return baseURI;
}
// public minting
function koalaMint(address _sender,uint256 _mintAmount) external payable nonReentrant {
uint256 s = totalSupply();
require(status, "Off");
require(_mintAmount > 0, "Duh");
require(_mintAmount <= maxMint, "Too many");
require(s + _mintAmount <= maxSupply, "Sorry");
require(msg.value >= cost * _mintAmount);
for (uint256 i = 0; i < _mintAmount; ++i) {
_safeMint(_sender, s + i, "");
}
delete s;
}
function koalaPresaleMint(address _sender,uint256 _mintAmount) external payable nonReentrant {
require(presaleDate <= block.timestamp, "Not yet");
uint256 s = totalSupply();
uint256 reserve = presaleWhitelist[_sender];
require(!status, "Off");
require(reserve > 0, "Low reserve");
require(_mintAmount <= reserve, "Try less");
require(s + _mintAmount <= maxSupply, "More than max");
require(cost * _mintAmount == msg.value, "Wrong amount");
presaleWhitelist[_sender] = reserve - _mintAmount;
delete reserve;
for (uint256 i = 0; i < _mintAmount; i++) {
_safeMint(_sender, s + i, "");
}
delete s;
}
function mint(uint256 _mintAmount) external payable nonReentrant {
uint256 s = totalSupply();
require(status, "Off");
require(_mintAmount > 0, "Duh");
require(_mintAmount <= maxMint, "Too many");
require(s + _mintAmount <= maxSupply, "Sorry");
require(msg.value >= cost * _mintAmount);
for (uint256 i = 0; i < _mintAmount; ++i) {
_safeMint(msg.sender, s + i, "");
}
delete s;
}
function mintPresale(uint256 _mintAmount) external payable {
require(presaleDate <= block.timestamp, "Not yet");
uint256 s = totalSupply();
uint256 reserve = presaleWhitelist[msg.sender];
require(!status, "Off");
require(reserve > 0, "Low reserve");
require(_mintAmount <= reserve, "Try less");
require(s + _mintAmount <= maxSupply, "More than max");
require(cost * _mintAmount == msg.value, "Wrong amount");
presaleWhitelist[msg.sender] = reserve - _mintAmount;
delete reserve;
for (uint256 i = 0; i < _mintAmount; i++) {
_safeMint(msg.sender, s + i, "");
}
delete s;
}
// admin minting
function gift(uint256[] calldata quantity, address[] calldata recipient)
external
onlyOwner
{
require(
quantity.length == recipient.length,
"Provide quantities and recipients"
);
uint256 totalQuantity = 0;
uint256 s = totalSupply();
for (uint256 i = 0; i < quantity.length; ++i) {
totalQuantity += quantity[i];
}
require(s + totalQuantity <= maxSupply, "Too many");
delete totalQuantity;
for (uint256 i = 0; i < recipient.length; ++i) {
for (uint256 j = 0; j < quantity[i]; ++j) {
_safeMint(recipient[i], s++, "");
}
}
delete s;
}
// admin functionality
function presaleSet(
address[] calldata _addresses,
uint256[] calldata _amounts
) external onlyOwner {
for (uint256 i; i < _addresses.length; i++) {
presaleWhitelist[_addresses[i]] = _amounts[i];
}
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(_exists(tokenId), "ERC721Metadata: Nonexistent token");
string memory currentBaseURI = _baseURI();
return
bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString()))
: "";
}
function setCost(uint256 _newCost) public onlyOwner {
cost = _newCost;
}
function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
maxMint = _newMaxMintAmount;
}
function setmaxSupply(uint256 _newMaxSupply) public onlyOwner {
maxSupply = _newMaxSupply;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function setSaleStatus(bool _status) public onlyOwner {
status = _status;
}
function withdraw() public payable onlyOwner {
(bool success, ) = payable(msg.sender).call{
value: address(this).balance
}("");
require(success);
}
}
ERC721Burn.sol 26 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/ERC721Burnable.sol)
pragma solidity ^0.8.10;
import "./ERC721P.sol";
import "@openzeppelin/contracts/utils/Context.sol";
/**
* @title ERC721 Burnable Token
* @dev ERC721 Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721Burn is Context, ERC721P {
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
_burn(tokenId);
}
}
ERC721Enum.sol 64 lines
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;
import "./ERC721P.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
abstract contract ERC721Enum is ERC721P, IERC721Enumerable {
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, ERC721P)
returns (bool)
{
return
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
override
returns (uint256 tokenId)
{
require(index < ERC721P.balanceOf(owner), "ERC721Enum: owner ioob");
uint256 count;
for (uint256 i; i < _owners.length; ++i) {
if (owner == _owners[i]) {
if (count == index) return i;
else ++count;
}
}
require(false, "ERC721Enum: owner ioob");
}
function tokensOfOwner(address owner)
public
view
returns (uint256[] memory)
{
require(0 < ERC721P.balanceOf(owner), "ERC721Enum: owner ioob");
uint256 tokenCount = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokenIds[i] = tokenOfOwnerByIndex(owner, i);
}
return tokenIds;
}
function totalSupply() public view virtual override returns (uint256) {
return _owners.length;
}
function tokenByIndex(uint256 index)
public
view
virtual
override
returns (uint256)
{
require(index < ERC721Enum.totalSupply(), "ERC721Enum: global ioob");
return index;
}
}
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev 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 {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, 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;
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @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 making 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;
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @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);
}
Read Contract
Travelers 0xb61a429d → address
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
cost 0x13faede6 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
koalaMet 0xa10fe536 → uint256
maxMint 0x7501f741 → uint256
maxSupply 0xd5abeb01 → uint256
maxTravelerReserve 0xedf4de72 → uint256
maxTravelerReservePerMint 0xd9f64545 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
presaleDate 0xc889004b → uint256
presaleWhitelist 0xeb8835ab → uint256
status 0x200d2ed2 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
totalSupply 0x18160ddd → uint256
totalTravelerReserve 0xe448db67 → uint256
Write Contract 22 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
burn 0x42966c68
uint256 tokenId
gift 0x96ea3a47
uint256[] quantity
address[] recipient
mint 0xa0712d68
uint256 _mintAmount
mintPresale 0xf759867a
uint256 _mintAmount
presaleSet 0x732e71ef
address[] _addresses
uint256[] _amounts
renounceOwnership 0x715018a6
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
setBaseURI 0x55f804b3
string _newBaseURI
setCost 0x44a0d68a
uint256 _newCost
setMaxMintAmount 0x088a4ed0
uint256 _newMaxMintAmount
setMaxTravelerReservePerMintAmount 0x259015b1
uint256 _newMaxMintAmount
setSaleStatus 0xd897833e
bool _status
setmaxSupply 0x228025e8
uint256 _newMaxSupply
setmaxTravelerReserve 0x19dab25c
uint256 _newMaxTravelerReserve
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
travelerReserve 0x5da5c7e3
No parameters
travelerReservePresale 0x7b6b4c0e
No parameters
withdraw 0x3ccfd60b
No parameters
Recent Transactions
This address has 1 on-chain transactions, but only 1.1% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →