Address Contract Verified
Address
0x99682aEca0E823215E3F0a9335FC0cA3c30DfB38
Balance
0 ETH
Nonce
1
Code Size
19667 bytes
Creator
0xa8C36E1C...56c4 at tx 0x5a7b1488...e16ebf
Indexed Transactions
0
Contract Bytecode
19667 bytes
0x6080604052600436106102885760003560e01c806362b99ad41161015a578063a22cb465116100c1578063e0a808531161007a578063e0a80853146109d3578063e985e9c5146109fc578063ebf0c71714610a39578063efbd73f414610a64578063f2fde38b14610a8d578063f58e196414610ab657610288565b8063a22cb465146108d2578063a45ba8e7146108fb578063b88d4fde14610926578063ba41b0c61461094f578063c87b56dd1461096b578063d5abeb01146109a857610288565b80637ec4a659116101135780637ec4a659146107d45780637f00c7a6146107fd5780638583ff24146108265780638da5cb5b1461085157806395d89b411461087c5780639c70b512146108a757610288565b806362b99ad4146106c2578063631f9b5c146106ed5780636352211e1461071857806370a0823114610755578063715018a61461079257806374b1ceaf146107a957610288565b806323b872dd116101fe57806349912e8d116101b757806349912e8d146105b25780634fdd43cb146105ef578063518302271461061857806351cff8d9146106435780635503a0e81461066c5780635c975abb1461069757610288565b806323b872dd1461049457806342842e0e146104bd578063438b6300146104e657806344a0d68a1461052357806346e8cdd91461054c57806346f265fd1461057557610288565b806313faede61161025057806313faede61461038457806316ba10e0146103af57806316c38b3c146103d857806318160ddd1461040157806318cae2691461042c578063239c70ae1461046957610288565b806301ffc9a71461028d57806306fdde03146102ca578063081812fc146102f5578063095ea7b3146103325780630c2c7c641461035b575b600080fd5b34801561029957600080fd5b506102b460048036038101906102af91906136b1565b610adf565b6040516102c19190613e5e565b60405180910390f35b3480156102d657600080fd5b506102df610bc1565b6040516102ec9190613e94565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190613744565b610c53565b6040516103299190613dd5565b60405180910390f35b34801561033e57600080fd5b50610359600480360381019061035491906135cf565b610cd8565b005b34801561036757600080fd5b50610382600480360381019061037d919061360b565b610df0565b005b34801561039057600080fd5b50610399610e89565b6040516103a69190614196565b60405180910390f35b3480156103bb57600080fd5b506103d660048036038101906103d19190613703565b610e8f565b005b3480156103e457600080fd5b506103ff60048036038101906103fa919061360b565b610f25565b005b34801561040d57600080fd5b50610416610fbe565b6040516104239190614196565b60405180910390f35b34801561043857600080fd5b50610453600480360381019061044e9190613464565b610fcf565b6040516104609190614196565b60405180910390f35b34801561047557600080fd5b5061047e610fe7565b60405161048b9190614196565b60405180910390f35b3480156104a057600080fd5b506104bb60048036038101906104b691906134c9565b610fed565b005b3480156104c957600080fd5b506104e460048036038101906104df91906134c9565b61104d565b005b3480156104f257600080fd5b5061050d60048036038101906105089190613464565b61106d565b60405161051a9190613e3c565b60405180910390f35b34801561052f57600080fd5b5061054a60048036038101906105459190613744565b6111c4565b005b34801561055857600080fd5b50610573600480360381019061056e9190613634565b61124a565b005b34801561058157600080fd5b5061059c6004803603810190610597919061365d565b6112d0565b6040516105a99190613e5e565b60405180910390f35b3480156105be57600080fd5b506105d960048036038101906105d49190613464565b6112e7565b6040516105e69190613e79565b60405180910390f35b3480156105fb57600080fd5b5061061660048036038101906106119190613703565b611317565b005b34801561062457600080fd5b5061062d6113ad565b60405161063a9190613e5e565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190613464565b6113c0565b005b34801561067857600080fd5b506106816114b6565b60405161068e9190613e94565b60405180910390f35b3480156106a357600080fd5b506106ac611544565b6040516106b99190613e5e565b60405180910390f35b3480156106ce57600080fd5b506106d7611557565b6040516106e49190613e94565b60405180910390f35b3480156106f957600080fd5b506107026115e5565b60405161070f9190614196565b60405180910390f35b34801561072457600080fd5b5061073f600480360381019061073a9190613744565b6115f4565b60405161074c9190613dd5565b60405180910390f35b34801561076157600080fd5b5061077c60048036038101906107779190613464565b6116a6565b6040516107899190614196565b60405180910390f35b34801561079e57600080fd5b506107a761175e565b005b3480156107b557600080fd5b506107be6117e6565b6040516107cb9190614196565b60405180910390f35b3480156107e057600080fd5b506107fb60048036038101906107f69190613703565b6117ec565b005b34801561080957600080fd5b50610824600480360381019061081f9190613744565b611882565b005b34801561083257600080fd5b5061083b611908565b6040516108489190614196565b60405180910390f35b34801561085d57600080fd5b50610866611912565b6040516108739190613dd5565b60405180910390f35b34801561088857600080fd5b5061089161193c565b60405161089e9190613e94565b60405180910390f35b3480156108b357600080fd5b506108bc6119ce565b6040516108c99190613e5e565b60405180910390f35b3480156108de57600080fd5b506108f960048036038101906108f49190613593565b6119e1565b005b34801561090757600080fd5b506109106119f7565b60405161091d9190613e94565b60405180910390f35b34801561093257600080fd5b5061094d60048036038101906109489190613518565b611a85565b005b610969600480360381019061096491906137a9565b611ae7565b005b34801561097757600080fd5b50610992600480360381019061098d9190613744565b611de7565b60405161099f9190613e94565b60405180910390f35b3480156109b457600080fd5b506109bd611f0f565b6040516109ca9190614196565b60405180910390f35b3480156109df57600080fd5b506109fa60048036038101906109f5919061360b565b611f15565b005b348015610a0857600080fd5b50610a236004803603810190610a1e919061348d565b611fae565b604051610a309190613e5e565b60405180910390f35b348015610a4557600080fd5b50610a4e612042565b604051610a5b9190613e79565b60405180910390f35b348015610a7057600080fd5b50610a8b6004803603810190610a86919061376d565b612048565b005b348015610a9957600080fd5b50610ab46004803603810190610aaf9190613464565b6120d2565b005b348015610ac257600080fd5b50610add6004803603810190610ad89190613744565b6121ca565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610baa57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610bba5750610bb982612250565b5b9050919050565b606060008054610bd0906144d5565b80601f0160208091040260200160405190810160405280929190818152602001828054610bfc906144d5565b8015610c495780601f10610c1e57610100808354040283529160200191610c49565b820191906000526020600020905b815481529060010190602001808311610c2c57829003601f168201915b5050505050905090565b6000610c5e826122ba565b610c9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9490614056565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610ce3826115f4565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4b906140f6565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610d73612326565b73ffffffffffffffffffffffffffffffffffffffff161480610da25750610da181610d9c612326565b611fae565b5b610de1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd890613fd6565b60405180910390fd5b610deb838361232e565b505050565b610df8612326565b73ffffffffffffffffffffffffffffffffffffffff16610e16611912565b73ffffffffffffffffffffffffffffffffffffffff1614610e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6390614076565b60405180910390fd5b80600f60026101000a81548160ff02191690831515021790555050565b600b5481565b610e97612326565b73ffffffffffffffffffffffffffffffffffffffff16610eb5611912565b73ffffffffffffffffffffffffffffffffffffffff1614610f0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0290614076565b60405180910390fd5b8060099080519060200190610f21929190613193565b5050565b610f2d612326565b73ffffffffffffffffffffffffffffffffffffffff16610f4b611912565b73ffffffffffffffffffffffffffffffffffffffff1614610fa1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9890614076565b60405180910390fd5b80600f60006101000a81548160ff02191690831515021790555050565b6000610fca60076123e7565b905090565b60116020528060005260406000206000915090505481565b600d5481565b610ffe610ff8612326565b826123f5565b61103d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103490614136565b60405180910390fd5b6110488383836124d3565b505050565b61106883838360405180602001604052806000815250611a85565b505050565b6060600061107a836116a6565b905060008167ffffffffffffffff8111156110be577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156110ec5781602001602082028036833780820191505090505b50905060006001905060005b83811080156111095750600c548211155b156111b8576000611119836115f4565b90508673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111a45782848381518110611189577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101818152505081806111a090614538565b9250505b82806111af90614538565b935050506110f8565b82945050505050919050565b6111cc612326565b73ffffffffffffffffffffffffffffffffffffffff166111ea611912565b73ffffffffffffffffffffffffffffffffffffffff1614611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123790614076565b60405180910390fd5b80600b8190555050565b611252612326565b73ffffffffffffffffffffffffffffffffffffffff16611270611912565b73ffffffffffffffffffffffffffffffffffffffff16146112c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112bd90614076565b60405180910390fd5b8060108190555050565b60006112df826010548561273a565b905092915050565b6000816040516020016112fa9190613d43565b604051602081830303815290604052805190602001209050919050565b61131f612326565b73ffffffffffffffffffffffffffffffffffffffff1661133d611912565b73ffffffffffffffffffffffffffffffffffffffff1614611393576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138a90614076565b60405180910390fd5b80600a90805190602001906113a9929190613193565b5050565b600f60019054906101000a900460ff1681565b6113c8612326565b73ffffffffffffffffffffffffffffffffffffffff166113e6611912565b73ffffffffffffffffffffffffffffffffffffffff161461143c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143390614076565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff164760405161146290613dc0565b60006040518083038185875af1925050503d806000811461149f576040519150601f19603f3d011682016040523d82523d6000602084013e6114a4565b606091505b50509050806114b257600080fd5b5050565b600980546114c3906144d5565b80601f01602080910402602001604051908101604052809291908181526020018280546114ef906144d5565b801561153c5780601f106115115761010080835404028352916020019161153c565b820191906000526020600020905b81548152906001019060200180831161151f57829003601f168201915b505050505081565b600f60009054906101000a900460ff1681565b60088054611564906144d5565b80601f0160208091040260200160405190810160405280929190818152602001828054611590906144d5565b80156115dd5780601f106115b2576101008083540402835291602001916115dd565b820191906000526020600020905b8154815290600101906020018083116115c057829003601f168201915b505050505081565b60006115ef610fbe565b905090565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561169d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169490614016565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170e90613ff6565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611766612326565b73ffffffffffffffffffffffffffffffffffffffff16611784611912565b73ffffffffffffffffffffffffffffffffffffffff16146117da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d190614076565b60405180910390fd5b6117e46000612751565b565b600e5481565b6117f4612326565b73ffffffffffffffffffffffffffffffffffffffff16611812611912565b73ffffffffffffffffffffffffffffffffffffffff1614611868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185f90614076565b60405180910390fd5b806008908051906020019061187e929190613193565b5050565b61188a612326565b73ffffffffffffffffffffffffffffffffffffffff166118a8611912565b73ffffffffffffffffffffffffffffffffffffffff16146118fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f590614076565b60405180910390fd5b80600d8190555050565b6000600b54905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606001805461194b906144d5565b80601f0160208091040260200160405190810160405280929190818152602001828054611977906144d5565b80156119c45780601f10611999576101008083540402835291602001916119c4565b820191906000526020600020905b8154815290600101906020018083116119a757829003601f168201915b5050505050905090565b600f60029054906101000a900460ff1681565b6119f36119ec612326565b8383612817565b5050565b600a8054611a04906144d5565b80601f0160208091040260200160405190810160405280929190818152602001828054611a30906144d5565b8015611a7d5780601f10611a5257610100808354040283529160200191611a7d565b820191906000526020600020905b815481529060010190602001808311611a6057829003601f168201915b505050505081565b611a96611a90612326565b836123f5565b611ad5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611acc90614136565b60405180910390fd5b611ae184848484612984565b50505050565b82600081118015611afa5750600d548111155b611b39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3090613f36565b60405180910390fd5b600c5481611b4760076123e7565b611b519190614300565b1115611b92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8990614116565b60405180910390fd5b600f60009054906101000a900460ff1615611be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd9906140b6565b60405180910390fd5b83600b54611bf09190614387565b341015611c32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2990614176565b60405180910390fd5b60011515600f60029054906101000a900460ff1615151415611d425760001515611ca5611c5e336112e7565b858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050506112d0565b15151415611ce8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdf90614096565b60405180910390fd5b600e5484611cf660076123e7565b611d009190614300565b1115611d41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3890614156565b60405180910390fd5b5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600d548582611d959190614300565b1115611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90613f56565b60405180910390fd5b611de033866129e0565b5050505050565b6060611df2826122ba565b611e31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e28906140d6565b60405180910390fd5b60001515600f60019054906101000a900460ff1615151415611eae576000600a8054611e5c906144d5565b905011611e785760405180602001604052806000815250611ea7565b600a611e8383612a75565b6009604051602001611e9793929190613d8f565b6040516020818303038152906040525b9050611f0a565b6000611eb8612c22565b90506000815111611ed85760405180602001604052806000815250611f06565b80611ee284612a75565b6009604051602001611ef693929190613d5e565b6040516020818303038152906040525b9150505b919050565b600c5481565b611f1d612326565b73ffffffffffffffffffffffffffffffffffffffff16611f3b611912565b73ffffffffffffffffffffffffffffffffffffffff1614611f91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8890614076565b60405180910390fd5b80600f60016101000a81548160ff02191690831515021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60105481565b612050612326565b73ffffffffffffffffffffffffffffffffffffffff1661206e611912565b73ffffffffffffffffffffffffffffffffffffffff16146120c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120bb90614076565b60405180910390fd5b6120ce81836129e0565b5050565b6120da612326565b73ffffffffffffffffffffffffffffffffffffffff166120f8611912565b73ffffffffffffffffffffffffffffffffffffffff161461214e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214590614076565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b590613ed6565b60405180910390fd5b6121c781612751565b50565b6121d2612326565b73ffffffffffffffffffffffffffffffffffffffff166121f0611912565b73ffffffffffffffffffffffffffffffffffffffff1614612246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223d90614076565b60405180910390fd5b80600e8190555050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166123a1836115f4565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081600001549050919050565b6000612400826122ba565b61243f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243690613fb6565b60405180910390fd5b600061244a836115f4565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806124b957508373ffffffffffffffffffffffffffffffffffffffff166124a184610c53565b73ffffffffffffffffffffffffffffffffffffffff16145b806124ca57506124c98185611fae565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166124f3826115f4565b73ffffffffffffffffffffffffffffffffffffffff1614612549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254090613ef6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156125b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b090613f76565b60405180910390fd5b6125c4838383612cb4565b6125cf60008261232e565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461261f91906143e1565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126769190614300565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612735838383612cb9565b505050565b6000826127478584612cbe565b1490509392505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612886576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161287d90613f96565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516129779190613e5e565b60405180910390a3505050565b61298f8484846124d3565b61299b84848484612d59565b6129da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129d190613eb6565b60405180910390fd5b50505050565b60005b81811015612a7057601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190612a3b90614538565b9190505550612a4a6007612ef0565b612a5d83612a5860076123e7565b612f06565b8080612a6890614538565b9150506129e3565b505050565b60606000821415612abd576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612c1d565b600082905060005b60008214612aef578080612ad890614538565b915050600a82612ae89190614356565b9150612ac5565b60008167ffffffffffffffff811115612b31577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612b635781602001600182028036833780820191505090505b5090505b60008514612c1657600182612b7c91906143e1565b9150600a85612b8b91906145a5565b6030612b979190614300565b60f81b818381518110612bd3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612c0f9190614356565b9450612b67565b8093505050505b919050565b606060088054612c31906144d5565b80601f0160208091040260200160405190810160405280929190818152602001828054612c5d906144d5565b8015612caa5780601f10612c7f57610100808354040283529160200191612caa565b820191906000526020600020905b815481529060010190602001808311612c8d57829003601f168201915b5050505050905090565b505050565b505050565b60008082905060005b8451811015612d4e576000858281518110612d0b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519050808311612d2d57612d268382612f24565b9250612d3a565b612d378184612f24565b92505b508080612d4690614538565b915050612cc7565b508091505092915050565b6000612d7a8473ffffffffffffffffffffffffffffffffffffffff16612f3b565b15612ee3578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612da3612326565b8786866040518563ffffffff1660e01b8152600401612dc59493929190613df0565b602060405180830381600087803b158015612ddf57600080fd5b505af1925050508015612e1057506040513d601f19601f82011682018060405250810190612e0d91906136da565b60015b612e93573d8060008114612e40576040519150601f19603f3d011682016040523d82523d6000602084013e612e45565b606091505b50600081511415612e8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8290613eb6565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612ee8565b600190505b949350505050565b6001816000016000828254019250508190555050565b612f20828260405180602001604052806000815250612f5e565b5050565b600082600052816020526040600020905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b612f688383612fb9565b612f756000848484612d59565b612fb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fab90613eb6565b60405180910390fd5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613029576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161302090614036565b60405180910390fd5b613032816122ba565b15613072576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161306990613f16565b60405180910390fd5b61307e60008383612cb4565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546130ce9190614300565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461318f60008383612cb9565b5050565b82805461319f906144d5565b90600052602060002090601f0160209004810192826131c15760008555613208565b82601f106131da57805160ff1916838001178555613208565b82800160010185558215613208579182015b828111156132075782518255916020019190600101906131ec565b5b5090506132159190613219565b5090565b5b8082111561323257600081600090555060010161321a565b5090565b6000613249613244846141d6565b6141b1565b9050808382526020820190508285602086028201111561326857600080fd5b60005b85811015613298578161327e88826133bc565b84526020840193506020830192505060018101905061326b565b5050509392505050565b60006132b56132b084614202565b6141b1565b9050828152602081018484840111156132cd57600080fd5b6132d8848285614493565b509392505050565b60006132f36132ee84614233565b6141b1565b90508281526020810184848401111561330b57600080fd5b613316848285614493565b509392505050565b60008135905061332d81614c2a565b92915050565b60008083601f84011261334557600080fd5b8235905067ffffffffffffffff81111561335e57600080fd5b60208301915083602082028301111561337657600080fd5b9250929050565b600082601f83011261338e57600080fd5b813561339e848260208601613236565b91505092915050565b6000813590506133b681614c41565b92915050565b6000813590506133cb81614c58565b92915050565b6000813590506133e081614c6f565b92915050565b6000815190506133f581614c6f565b92915050565b600082601f83011261340c57600080fd5b813561341c8482602086016132a2565b91505092915050565b600082601f83011261343657600080fd5b81356134468482602086016132e0565b91505092915050565b60008135905061345e81614c86565b92915050565b60006020828403121561347657600080fd5b60006134848482850161331e565b91505092915050565b600080604083850312156134a057600080fd5b60006134ae8582860161331e565b92505060206134bf8582860161331e565b9150509250929050565b6000806000606084860312156134de57600080fd5b60006134ec8682870161331e565b93505060206134fd8682870161331e565b925050604061350e8682870161344f565b9150509250925092565b6000806000806080858703121561352e57600080fd5b600061353c8782880161331e565b945050602061354d8782880161331e565b935050604061355e8782880161344f565b925050606085013567ffffffffffffffff81111561357b57600080fd5b613587878288016133fb565b91505092959194509250565b600080604083850312156135a657600080fd5b60006135b48582860161331e565b92505060206135c5858286016133a7565b9150509250929050565b600080604083850312156135e257600080fd5b60006135f08582860161331e565b92505060206136018582860161344f565b9150509250929050565b60006020828403121561361d57600080fd5b600061362b848285016133a7565b91505092915050565b60006020828403121561364657600080fd5b6000613654848285016133bc565b91505092915050565b6000806040838503121561367057600080fd5b600061367e858286016133bc565b925050602083013567ffffffffffffffff81111561369b57600080fd5b6136a78582860161337d565b9150509250929050565b6000602082840312156136c357600080fd5b60006136d1848285016133d1565b91505092915050565b6000602082840312156136ec57600080fd5b60006136fa848285016133e6565b91505092915050565b60006020828403121561371557600080fd5b600082013567ffffffffffffffff81111561372f57600080fd5b61373b84828501613425565b91505092915050565b60006020828403121561375657600080fd5b60006137648482850161344f565b91505092915050565b6000806040838503121561378057600080fd5b600061378e8582860161344f565b925050602061379f8582860161331e565b9150509250929050565b6000806000604084860312156137be57600080fd5b60006137cc8682870161344f565b935050602084013567ffffffffffffffff8111156137e957600080fd5b6137f586828701613333565b92509250509250925092565b600061380d8383613d25565b60208301905092915050565b61382281614415565b82525050565b61383961383482614415565b614581565b82525050565b600061384a82614289565b61385481856142b7565b935061385f83614264565b8060005b838110156138905781516138778882613801565b9750613882836142aa565b925050600181019050613863565b5085935050505092915050565b6138a681614427565b82525050565b6138b581614433565b82525050565b60006138c682614294565b6138d081856142c8565b93506138e08185602086016144a2565b6138e981614692565b840191505092915050565b60006138ff8261429f565b61390981856142e4565b93506139198185602086016144a2565b61392281614692565b840191505092915050565b60006139388261429f565b61394281856142f5565b93506139528185602086016144a2565b80840191505092915050565b6000815461396b816144d5565b61397581866142f5565b9450600182166000811461399057600181146139a1576139d4565b60ff198316865281860193506139d4565b6139aa85614274565b60005b838110156139cc578154818901526001820191506020810190506139ad565b838801955050505b50505092915050565b60006139ea6032836142e4565b91506139f5826146b0565b604082019050919050565b6000613a0d6026836142e4565b9150613a18826146ff565b604082019050919050565b6000613a306025836142e4565b9150613a3b8261474e565b604082019050919050565b6000613a53601c836142e4565b9150613a5e8261479d565b602082019050919050565b6000613a766014836142e4565b9150613a81826147c6565b602082019050919050565b6000613a99601c836142e4565b9150613aa4826147ef565b602082019050919050565b6000613abc6024836142e4565b9150613ac782614818565b604082019050919050565b6000613adf6019836142e4565b9150613aea82614867565b602082019050919050565b6000613b02602c836142e4565b9150613b0d82614890565b604082019050919050565b6000613b256038836142e4565b9150613b30826148df565b604082019050919050565b6000613b48602a836142e4565b9150613b538261492e565b604082019050919050565b6000613b6b6029836142e4565b9150613b768261497d565b604082019050919050565b6000613b8e6020836142e4565b9150613b99826149cc565b602082019050919050565b6000613bb1602c836142e4565b9150613bbc826149f5565b604082019050919050565b6000613bd46020836142e4565b9150613bdf82614a44565b602082019050919050565b6000613bf76014836142e4565b9150613c0282614a6d565b602082019050919050565b6000613c1a6017836142e4565b9150613c2582614a96565b602082019050919050565b6000613c3d602f836142e4565b9150613c4882614abf565b604082019050919050565b6000613c606021836142e4565b9150613c6b82614b0e565b604082019050919050565b6000613c836000836142d9565b9150613c8e82614b5d565b600082019050919050565b6000613ca66014836142e4565b9150613cb182614b60565b602082019050919050565b6000613cc96031836142e4565b9150613cd482614b89565b604082019050919050565b6000613cec601c836142e4565b9150613cf782614bd8565b602082019050919050565b6000613d0f6013836142e4565b9150613d1a82614c01565b602082019050919050565b613d2e81614489565b82525050565b613d3d81614489565b82525050565b6000613d4f8284613828565b60148201915081905092915050565b6000613d6a828661392d565b9150613d76828561392d565b9150613d82828461395e565b9150819050949350505050565b6000613d9b828661395e565b9150613da7828561392d565b9150613db3828461395e565b9150819050949350505050565b6000613dcb82613c76565b9150819050919050565b6000602082019050613dea6000830184613819565b92915050565b6000608082019050613e056000830187613819565b613e126020830186613819565b613e1f6040830185613d34565b8181036060830152613e3181846138bb565b905095945050505050565b60006020820190508181036000830152613e56818461383f565b905092915050565b6000602082019050613e73600083018461389d565b92915050565b6000602082019050613e8e60008301846138ac565b92915050565b60006020820190508181036000830152613eae81846138f4565b905092915050565b60006020820190508181036000830152613ecf816139dd565b9050919050565b60006020820190508181036000830152613eef81613a00565b9050919050565b60006020820190508181036000830152613f0f81613a23565b9050919050565b60006020820190508181036000830152613f2f81613a46565b9050919050565b60006020820190508181036000830152613f4f81613a69565b9050919050565b60006020820190508181036000830152613f6f81613a8c565b9050919050565b60006020820190508181036000830152613f8f81613aaf565b9050919050565b60006020820190508181036000830152613faf81613ad2565b9050919050565b60006020820190508181036000830152613fcf81613af5565b9050919050565b60006020820190508181036000830152613fef81613b18565b9050919050565b6000602082019050818103600083015261400f81613b3b565b9050919050565b6000602082019050818103600083015261402f81613b5e565b9050919050565b6000602082019050818103600083015261404f81613b81565b9050919050565b6000602082019050818103600083015261406f81613ba4565b9050919050565b6000602082019050818103600083015261408f81613bc7565b9050919050565b600060208201905081810360008301526140af81613bea565b9050919050565b600060208201905081810360008301526140cf81613c0d565b9050919050565b600060208201905081810360008301526140ef81613c30565b9050919050565b6000602082019050818103600083015261410f81613c53565b9050919050565b6000602082019050818103600083015261412f81613c99565b9050919050565b6000602082019050818103600083015261414f81613cbc565b9050919050565b6000602082019050818103600083015261416f81613cdf565b9050919050565b6000602082019050818103600083015261418f81613d02565b9050919050565b60006020820190506141ab6000830184613d34565b92915050565b60006141bb6141cc565b90506141c78282614507565b919050565b6000604051905090565b600067ffffffffffffffff8211156141f1576141f0614663565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561421d5761421c614663565b5b61422682614692565b9050602081019050919050565b600067ffffffffffffffff82111561424e5761424d614663565b5b61425782614692565b9050602081019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061430b82614489565b915061431683614489565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561434b5761434a6145d6565b5b828201905092915050565b600061436182614489565b915061436c83614489565b92508261437c5761437b614605565b5b828204905092915050565b600061439282614489565b915061439d83614489565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156143d6576143d56145d6565b5b828202905092915050565b60006143ec82614489565b91506143f783614489565b92508282101561440a576144096145d6565b5b828203905092915050565b600061442082614469565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156144c05780820151818401526020810190506144a5565b838111156144cf576000848401525b50505050565b600060028204905060018216806144ed57607f821691505b6020821081141561450157614500614634565b5b50919050565b61451082614692565b810181811067ffffffffffffffff8211171561452f5761452e614663565b5b80604052505050565b600061454382614489565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614576576145756145d6565b5b600182019050919050565b600061458c82614593565b9050919050565b600061459e826146a3565b9050919050565b60006145b082614489565b91506145bb83614489565b9250826145cb576145ca614605565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f496e76616c6964206d696e7420616d6f756e7421000000000000000000000000600082015250565b7f6d6178204e465420706572206164647265737320657863656564656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f496e76616c6964206d65726b6c652070726f6f66000000000000000000000000600082015250565b7f54686520636f6e74726163742069732070617573656421000000000000000000600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b50565b7f4d617820737570706c7920657863656564656421000000000000000000000000600082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f4d6178207072656d696e7420737570706c792065786365656465642100000000600082015250565b7f496e73756666696369656e742066756e64732100000000000000000000000000600082015250565b614c3381614415565b8114614c3e57600080fd5b50565b614c4a81614427565b8114614c5557600080fd5b50565b614c6181614433565b8114614c6c57600080fd5b50565b614c788161443d565b8114614c8357600080fd5b50565b614c8f81614489565b8114614c9a57600080fd5b5056fea264697066735822122055229fe8091f85e157e1927cf79288a1bcb2746e76c6a768b64f3b9cdea08ed964736f6c63430008020033
Verified Source Code Full Match
Compiler: v0.8.2+commit.661d1103
EVM: istanbul
Optimization: No
diverse.sol 199 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract diverse is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private supply;
string public uriPrefix = "";
string public uriSuffix = ".json";
string public hiddenMetadataUri;
uint256 public cost = 0.25 ether;
uint256 public maxSupply = 5000;
uint256 public maxMintAmount = 3;
uint256 public premintSupply = 1500;
bool public paused = true;
bool public revealed = false;
bool public onlyWhitelisted = true;
bytes32 public root;
mapping(address => uint256) public addressMintedBalance;
constructor(bytes32 _setroot) ERC721("Diverse", "Diverse") {
setHiddenMetadataUri("ipfs://Qmew9yLykVPr3jDHbwcjiGLftJwJ4JtEj5NsNHTMLWVaGm/");
root = _setroot;
}
modifier mintCompliance(uint256 _mintAmount) {
require(_mintAmount > 0 && _mintAmount <= maxMintAmount, "Invalid mint amount!");
require(supply.current() + _mintAmount <= maxSupply, "Max supply exceeded!");
_;
}
function totalSupply() public view returns (uint256) {
return supply.current();
}
function mint(uint256 _mintAmount,bytes32[] calldata proof) public payable mintCompliance(_mintAmount) {
require(!paused, "The contract is paused!");
require(msg.value >= cost * _mintAmount, "Insufficient funds!");
if(onlyWhitelisted == true){
require(_verify(_leaf(msg.sender), proof) != false, "Invalid merkle proof");
require(supply.current() + _mintAmount <= premintSupply, "Max premint supply exceeded!");
}
uint256 ownerMintedCount = addressMintedBalance[msg.sender];
require(ownerMintedCount + _mintAmount <= maxMintAmount, "max NFT per address exceeded");
_mintLoop(msg.sender, _mintAmount);
}
function mintForAddress(uint256 _mintAmount, address _receiver) public onlyOwner {
_mintLoop(_receiver, _mintAmount);
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 ownerTokenCount = balanceOf(_owner);
uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount);
uint256 currentTokenId = 1;
uint256 ownedTokenIndex = 0;
while (ownedTokenIndex < ownerTokenCount && currentTokenId <= maxSupply) {
address currentTokenOwner = ownerOf(currentTokenId);
if (currentTokenOwner == _owner) {
ownedTokenIds[ownedTokenIndex] = currentTokenId;
ownedTokenIndex++;
}
currentTokenId++;
}
return ownedTokenIds;
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(_tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
if(revealed == false) {
return bytes(hiddenMetadataUri).length > 0
? string(abi.encodePacked(hiddenMetadataUri, _tokenId.toString(), uriSuffix))
: "";
}
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, _tokenId.toString(), uriSuffix))
: "";
}
function _leaf(address account)
public pure returns (bytes32)
{
return keccak256(abi.encodePacked(account));
}
function _verify(bytes32 leaf, bytes32[] memory proof)
public view returns (bool)
{
return MerkleProof.verify(proof,root, leaf);
}
function setRevealed(bool _state) public onlyOwner {
revealed = _state;
}
function addroot(bytes32 _root)public onlyOwner{
root = _root;
}
function setCost(uint256 _cost) public onlyOwner {
cost = _cost;
}
function setwhitelisted(bool _state)public onlyOwner{
onlyWhitelisted = _state;
}
function setmaxMintAmount(uint256 _maxMintAmount) public onlyOwner {
maxMintAmount = _maxMintAmount;
}
function setpreMintsupply(uint256 _MaxMintAmount) public onlyOwner {
premintSupply = _MaxMintAmount;
}
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
hiddenMetadataUri = _hiddenMetadataUri;
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
uriPrefix = _uriPrefix;
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
uriSuffix = _uriSuffix;
}
function setPaused(bool _state) public onlyOwner {
paused = _state;
}
function Totalminted() public view returns(uint256){
return totalSupply();
}
function getcost() public view returns(uint256){
return cost;
}
function withdraw(address _address ) public onlyOwner {
// This will transfer the remaining contract balance to the owner.
// Do not remove this otherwise you will not be able to withdraw the funds.
// =============================================================================
(bool os, ) = payable(_address).call{value: address(this).balance}("");
require(os);
// =============================================================================
}
function _mintLoop(address _receiver, uint256 _mintAmount) internal {
for (uint256 i = 0; i < _mintAmount; i++) {
addressMintedBalance[msg.sender]++;
supply.increment();
_safeMint(_receiver, supply.current());
}
}
function _baseURI() internal view virtual override returns (string memory) {
return uriPrefix;
}
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return 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.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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.1 (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);
}
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
ERC721.sol 447 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// 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 {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: 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);
_afterTokenTransfer(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);
_afterTokenTransfer(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 from incorrect owner");
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);
_afterTokenTransfer(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 Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev 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 {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
MerkleProof.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
Read Contract
Totalminted 0x631f9b5c → uint256
_leaf 0x49912e8d → bytes32
_verify 0x46f265fd → bool
addressMintedBalance 0x18cae269 → uint256
balanceOf 0x70a08231 → uint256
cost 0x13faede6 → uint256
getApproved 0x081812fc → address
getcost 0x8583ff24 → uint256
hiddenMetadataUri 0xa45ba8e7 → string
isApprovedForAll 0xe985e9c5 → bool
maxMintAmount 0x239c70ae → uint256
maxSupply 0xd5abeb01 → uint256
name 0x06fdde03 → string
onlyWhitelisted 0x9c70b512 → bool
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
premintSupply 0x74b1ceaf → uint256
revealed 0x51830227 → bool
root 0xebf0c717 → bytes32
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
uriPrefix 0x62b99ad4 → string
uriSuffix 0x5503a0e8 → string
walletOfOwner 0x438b6300 → uint256[]
Write Contract 20 functions
These functions modify contract state and require a wallet transaction to execute.
addroot 0x46e8cdd9
bytes32 _root
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xba41b0c6
uint256 _mintAmount
bytes32[] proof
mintForAddress 0xefbd73f4
uint256 _mintAmount
address _receiver
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
setCost 0x44a0d68a
uint256 _cost
setHiddenMetadataUri 0x4fdd43cb
string _hiddenMetadataUri
setPaused 0x16c38b3c
bool _state
setRevealed 0xe0a80853
bool _state
setUriPrefix 0x7ec4a659
string _uriPrefix
setUriSuffix 0x16ba10e0
string _uriSuffix
setmaxMintAmount 0x7f00c7a6
uint256 _maxMintAmount
setpreMintsupply 0xf58e1964
uint256 _MaxMintAmount
setwhitelisted 0x0c2c7c64
bool _state
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x51cff8d9
address _address
Recent Transactions
No transactions found for this address