Address Contract Partially Verified
Address
0x659982ba58e0b57f43046D9f3Cd91c18BEd6DB05
Balance
0 ETH
Nonce
1
Code Size
17870 bytes
Creator
0x02101384...2422 at tx 0x500548b6...a01683
Indexed Transactions
0
Contract Bytecode
17870 bytes
0x60806040526004361061021a5760003560e01c80636352211e11610123578063a22cb465116100ab578063d5abeb011161006f578063d5abeb01146107ae578063dc33e681146107d9578063e985e9c514610816578063efbd73f414610853578063f2fde38b1461087c5761021a565b8063a22cb465146106c9578063a2309ff8146106f2578063b88d4fde1461071d578063bc951b9114610746578063c87b56dd146107715761021a565b80637cb64759116100f25780637cb64759146105f85780638da5cb5b1461062157806395d89b411461064c5780639fac68cb14610677578063a157696b146106a05761021a565b80636352211e1461053e57806370a082311461057b578063715018a6146105b8578063766b7d09146105cf5761021a565b80633ccfd60b116101a657806345de0d9b1161017557806345de0d9b146104665780634b4687b5146104825780634f558e79146104ad57806355f804b3146104ea5780635c975abb146105135761021a565b80633ccfd60b146103c057806342842e0e146103d7578063438b63001461040057806344a0d68a1461043d5761021a565b806313faede6116101ed57806313faede6146102ed57806316c38b3c1461031857806318160ddd1461034157806323b872dd1461036c5780632eb4a7ab146103955761021a565b806301ffc9a71461021f57806306fdde031461025c578063081812fc14610287578063095ea7b3146102c4575b600080fd5b34801561022b57600080fd5b5061024660048036038101906102419190613771565b6108a5565b6040516102539190613ca9565b60405180910390f35b34801561026857600080fd5b50610271610987565b60405161027e9190613cdf565b60405180910390f35b34801561029357600080fd5b506102ae60048036038101906102a99190613818565b610a19565b6040516102bb9190613c20565b60405180910390f35b3480156102d057600080fd5b506102eb60048036038101906102e69190613677565b610a95565b005b3480156102f957600080fd5b50610302610ba0565b60405161030f9190613e21565b60405180910390f35b34801561032457600080fd5b5061033f600480360381019061033a9190613717565b610ba6565b005b34801561034d57600080fd5b50610356610c3f565b6040516103639190613e21565b60405180910390f35b34801561037857600080fd5b50610393600480360381019061038e9190613561565b610c56565b005b3480156103a157600080fd5b506103aa610c66565b6040516103b79190613cc4565b60405180910390f35b3480156103cc57600080fd5b506103d5610c6c565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613561565b610d68565b005b34801561040c57600080fd5b50610427600480360381019061042291906134f4565b610d88565b6040516104349190613c87565b60405180910390f35b34801561044957600080fd5b50610464600480360381019061045f9190613818565b610e93565b005b610480600480360381019061047b91906136b7565b610f19565b005b34801561048e57600080fd5b5061049761123f565b6040516104a49190613ca9565b60405180910390f35b3480156104b957600080fd5b506104d460048036038101906104cf9190613818565b611252565b6040516104e19190613ca9565b60405180910390f35b3480156104f657600080fd5b50610511600480360381019061050c91906137cb565b611264565b005b34801561051f57600080fd5b506105286112f6565b6040516105359190613ca9565b60405180910390f35b34801561054a57600080fd5b5061056560048036038101906105609190613818565b611309565b6040516105729190613c20565b60405180910390f35b34801561058757600080fd5b506105a2600480360381019061059d91906134f4565b61131f565b6040516105af9190613e21565b60405180910390f35b3480156105c457600080fd5b506105cd6113ef565b005b3480156105db57600080fd5b506105f660048036038101906105f19190613818565b611477565b005b34801561060457600080fd5b5061061f600480360381019061061a9190613744565b6114fd565b005b34801561062d57600080fd5b50610636611583565b6040516106439190613c20565b60405180910390f35b34801561065857600080fd5b506106616115ac565b60405161066e9190613cdf565b60405180910390f35b34801561068357600080fd5b5061069e60048036038101906106999190613885565b61163e565b005b3480156106ac57600080fd5b506106c760048036038101906106c29190613717565b61164c565b005b3480156106d557600080fd5b506106f060048036038101906106eb9190613637565b6116e5565b005b3480156106fe57600080fd5b5061070761185d565b6040516107149190613e21565b60405180910390f35b34801561072957600080fd5b50610744600480360381019061073f91906135b4565b61186c565b005b34801561075257600080fd5b5061075b6118e8565b6040516107689190613e21565b60405180910390f35b34801561077d57600080fd5b5061079860048036038101906107939190613818565b6118ee565b6040516107a59190613cdf565b60405180910390f35b3480156107ba57600080fd5b506107c3611995565b6040516107d09190613e21565b60405180910390f35b3480156107e557600080fd5b5061080060048036038101906107fb91906134f4565b61199b565b60405161080d9190613e21565b60405180910390f35b34801561082257600080fd5b5061083d60048036038101906108389190613521565b6119ad565b60405161084a9190613ca9565b60405180910390f35b34801561085f57600080fd5b5061087a60048036038101906108759190613845565b611a41565b005b34801561088857600080fd5b506108a3600480360381019061089e91906134f4565b611b67565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061097057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610980575061097f82611c5f565b5b9050919050565b606060038054610996906140ee565b80601f01602080910402602001604051908101604052809291908181526020018280546109c2906140ee565b8015610a0f5780601f106109e457610100808354040283529160200191610a0f565b820191906000526020600020905b8154815290600101906020018083116109f257829003601f168201915b5050505050905090565b6000610a2482611cc9565b610a5a576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610aa082611309565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b08576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610b27611d17565b73ffffffffffffffffffffffffffffffffffffffff1614158015610b595750610b5781610b52611d17565b6119ad565b155b15610b90576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b9b838383611d1f565b505050565b600a5481565b610bae611d17565b73ffffffffffffffffffffffffffffffffffffffff16610bcc611583565b73ffffffffffffffffffffffffffffffffffffffff1614610c22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1990613d81565b60405180910390fd5b80600d60006101000a81548160ff02191690831515021790555050565b6000610c49611dd1565b6002546001540303905090565b610c61838383611dda565b505050565b600e5481565b610c74611d17565b73ffffffffffffffffffffffffffffffffffffffff16610c92611583565b73ffffffffffffffffffffffffffffffffffffffff1614610ce8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cdf90613d81565b60405180910390fd5b6000610cf2611583565b73ffffffffffffffffffffffffffffffffffffffff1647604051610d1590613c0b565b60006040518083038185875af1925050503d8060008114610d52576040519150601f19603f3d011682016040523d82523d6000602084013e610d57565b606091505b5050905080610d6557600080fd5b50565b610d838383836040518060200160405280600081525061186c565b505050565b60606000610d958361131f565b905060008167ffffffffffffffff811115610db357610db26142ab565b5b604051908082528060200260200182016040528015610de15781602001602082028036833780820191505090505b50905060006001905060005b8381108015610dfe5750600b548211155b15610e87576000610e0e83611309565b90508673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e735782848381518110610e5857610e5761427c565b5b6020026020010181815250508180610e6f90614151565b9250505b8280610e7e90614151565b93505050610ded565b82945050505050919050565b610e9b611d17565b73ffffffffffffffffffffffffffffffffffffffff16610eb9611583565b73ffffffffffffffffffffffffffffffffffffffff1614610f0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0690613d81565b60405180910390fd5b80600a8190555050565b8060008111610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5490613d41565b60405180910390fd5b600b5481610f6961185d565b610f739190613f19565b1115610fb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fab90613de1565b60405180910390fd5b600d60009054906101000a900460ff1615611004576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffb90613da1565b60405180910390fd5b60011515600d60019054906101000a900460ff16151514156111865781600a5461102e9190613fa0565b341015611070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106790613e01565b60405180910390fd5b600c548261107d3361199b565b6110879190613f19565b11156110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf90613d01565b60405180910390fd5b6000336040516020016110db9190613bc1565b604051602081830303815290604052805190602001209050611141858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600e5483612290565b611180576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117790613d61565b60405180910390fd5b5061122f565b81600a546111949190613fa0565b3410156111d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cd90613e01565b60405180910390fd5b600c54826111e33361199b565b6111ed9190613f19565b111561122e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122590613d01565b60405180910390fd5b5b61123933836122a7565b50505050565b600d60019054906101000a900460ff1681565b600061125d82611cc9565b9050919050565b61126c611d17565b73ffffffffffffffffffffffffffffffffffffffff1661128a611583565b73ffffffffffffffffffffffffffffffffffffffff16146112e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d790613d81565b60405180910390fd5b8181600991906112f1929190613274565b505050565b600d60009054906101000a900460ff1681565b6000611314826122c5565b600001519050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611387576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff169050919050565b6113f7611d17565b73ffffffffffffffffffffffffffffffffffffffff16611415611583565b73ffffffffffffffffffffffffffffffffffffffff161461146b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146290613d81565b60405180910390fd5b6114756000612554565b565b61147f611d17565b73ffffffffffffffffffffffffffffffffffffffff1661149d611583565b73ffffffffffffffffffffffffffffffffffffffff16146114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea90613d81565b60405180910390fd5b80600c8190555050565b611505611d17565b73ffffffffffffffffffffffffffffffffffffffff16611523611583565b73ffffffffffffffffffffffffffffffffffffffff1614611579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157090613d81565b60405180910390fd5b80600e8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600480546115bb906140ee565b80601f01602080910402602001604051908101604052809291908181526020018280546115e7906140ee565b80156116345780601f1061160957610100808354040283529160200191611634565b820191906000526020600020905b81548152906001019060200180831161161757829003601f168201915b5050505050905090565b6116488282612618565b5050565b611654611d17565b73ffffffffffffffffffffffffffffffffffffffff16611672611583565b73ffffffffffffffffffffffffffffffffffffffff16146116c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bf90613d81565b60405180910390fd5b80600d60016101000a81548160ff02191690831515021790555050565b6116ed611d17565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611752576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806008600061175f611d17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff1661180c611d17565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516118519190613ca9565b60405180910390a35050565b6000611867612a08565b905090565b611877848484611dda565b6118968373ffffffffffffffffffffffffffffffffffffffff16612a1b565b80156118ab57506118a984848484612a3e565b155b156118e2576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b600c5481565b60606118f982611cc9565b611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192f90613dc1565b60405180910390fd5b6000611942612b9e565b90506000815111611962576040518060200160405280600081525061198d565b8061196c84612c30565b60405160200161197d929190613bdc565b6040516020818303038152906040525b915050919050565b600b5481565b60006119a682612d91565b9050919050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b8160008111611a85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7c90613d41565b60405180910390fd5b600b5481611a9161185d565b611a9b9190613f19565b1115611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad390613de1565b60405180910390fd5b611ae4611d17565b73ffffffffffffffffffffffffffffffffffffffff16611b02611583565b73ffffffffffffffffffffffffffffffffffffffff1614611b58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4f90613d81565b60405180910390fd5b611b6282846122a7565b505050565b611b6f611d17565b73ffffffffffffffffffffffffffffffffffffffff16611b8d611583565b73ffffffffffffffffffffffffffffffffffffffff1614611be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bda90613d81565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4a90613d21565b60405180910390fd5b611c5c81612554565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600081611cd4611dd1565b11158015611ce3575060015482105b8015611d10575060056000838152602001908152602001600020600001601c9054906101000a900460ff16155b9050919050565b600033905090565b826007600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b60006001905090565b6000611de5826122c5565b90508373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614611e50576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff16611e71611d17565b73ffffffffffffffffffffffffffffffffffffffff161480611ea05750611e9f85611e9a611d17565b6119ad565b5b80611ee55750611eae611d17565b73ffffffffffffffffffffffffffffffffffffffff16611ecd84610a19565b73ffffffffffffffffffffffffffffffffffffffff16145b905080611f1e576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611f85576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f928585856001612dfb565b611f9e60008487611d1f565b6001600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160392506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000600560008581526020019081526020016000209050848160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550428160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060006001850190506000600560008381526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561221e57600154821461221d57878160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084602001518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b5b505050828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46122898585856001612e01565b5050505050565b60008261229d8584612e07565b1490509392505050565b6122c1828260405180602001604052806000815250612e7c565b5050565b6122cd6132fa565b6000829050806122db611dd1565b111580156122ea575060015481105b1561251d576000600560008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff1615151515815250509050806040015161251b57600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16146123ff57809250505061254f565b5b60011561251a57818060019003925050600560008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff1615151515815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161461251557809250505061254f565b612400565b5b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000612623836122c5565b905060008160000151905082156127045760008173ffffffffffffffffffffffffffffffffffffffff16612655611d17565b73ffffffffffffffffffffffffffffffffffffffff16148061268457506126838261267e611d17565b6119ad565b5b806126c95750612692611d17565b73ffffffffffffffffffffffffffffffffffffffff166126b186610a19565b73ffffffffffffffffffffffffffffffffffffffff16145b905080612702576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b612712816000866001612dfb565b61271e60008583611d1f565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060018160000160008282829054906101000a900467ffffffffffffffff160392506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060018160000160108282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000600560008781526020019081526020016000209050828160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550428160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550600181600001601c6101000a81548160ff02191690831515021790555060006001870190506000600560008381526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561298257600154821461298157848160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085602001518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b5b5050505083600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46129f0816000866001612e01565b60026000815480929190600101919050555050505050565b6000612a12611dd1565b60015403905090565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612a64611d17565b8786866040518563ffffffff1660e01b8152600401612a869493929190613c3b565b602060405180830381600087803b158015612aa057600080fd5b505af1925050508015612ad157506040513d601f19601f82011682018060405250810190612ace919061379e565b60015b612b4b573d8060008114612b01576040519150601f19603f3d011682016040523d82523d6000602084013e612b06565b606091505b50600081511415612b43576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b606060098054612bad906140ee565b80601f0160208091040260200160405190810160405280929190818152602001828054612bd9906140ee565b8015612c265780601f10612bfb57610100808354040283529160200191612c26565b820191906000526020600020905b815481529060010190602001808311612c0957829003601f168201915b5050505050905090565b60606000821415612c78576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612d8c565b600082905060005b60008214612caa578080612c9390614151565b915050600a82612ca39190613f6f565b9150612c80565b60008167ffffffffffffffff811115612cc657612cc56142ab565b5b6040519080825280601f01601f191660200182016040528015612cf85781602001600182028036833780820191505090505b5090505b60008514612d8557600182612d119190613ffa565b9150600a85612d2091906141be565b6030612d2c9190613f19565b60f81b818381518110612d4257612d4161427c565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612d7e9190613f6f565b9450612cfc565b8093505050505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff169050919050565b50505050565b50505050565b60008082905060005b8451811015612e71576000858281518110612e2e57612e2d61427c565b5b60200260200101519050808311612e5057612e498382612e8e565b9250612e5d565b612e5a8184612e8e565b92505b508080612e6990614151565b915050612e10565b508091505092915050565b612e898383836001612ea5565b505050565b600082600052816020526040600020905092915050565b60006001549050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612f13576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000841415612f4e576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612f5b6000868387612dfb565b83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160088282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550846005600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426005600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060008190506000858201905083801561312557506131248773ffffffffffffffffffffffffffffffffffffffff16612a1b565b5b156131eb575b818773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461319a6000888480600101955088612a3e565b6131d0576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8082141561312b5782600154146131e657600080fd5b613257565b5b818060010192508773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4808214156131ec575b81600181905550505061326d6000868387612e01565b5050505050565b828054613280906140ee565b90600052602060002090601f0160209004810192826132a257600085556132e9565b82601f106132bb57803560ff19168380011785556132e9565b828001600101855582156132e9579182015b828111156132e85782358255916020019190600101906132cd565b5b5090506132f6919061333d565b5090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681526020016000151581525090565b5b8082111561335657600081600090555060010161333e565b5090565b600061336d61336884613e61565b613e3c565b905082815260208101848484011115613389576133886142e9565b5b6133948482856140ac565b509392505050565b6000813590506133ab81614525565b92915050565b60008083601f8401126133c7576133c66142df565b5b8235905067ffffffffffffffff8111156133e4576133e36142da565b5b602083019150836020820283011115613400576133ff6142e4565b5b9250929050565b6000813590506134168161453c565b92915050565b60008135905061342b81614553565b92915050565b6000813590506134408161456a565b92915050565b6000815190506134558161456a565b92915050565b600082601f8301126134705761346f6142df565b5b813561348084826020860161335a565b91505092915050565b60008083601f84011261349f5761349e6142df565b5b8235905067ffffffffffffffff8111156134bc576134bb6142da565b5b6020830191508360018202830111156134d8576134d76142e4565b5b9250929050565b6000813590506134ee81614581565b92915050565b60006020828403121561350a576135096142f3565b5b60006135188482850161339c565b91505092915050565b60008060408385031215613538576135376142f3565b5b60006135468582860161339c565b92505060206135578582860161339c565b9150509250929050565b60008060006060848603121561357a576135796142f3565b5b60006135888682870161339c565b93505060206135998682870161339c565b92505060406135aa868287016134df565b9150509250925092565b600080600080608085870312156135ce576135cd6142f3565b5b60006135dc8782880161339c565b94505060206135ed8782880161339c565b93505060406135fe878288016134df565b925050606085013567ffffffffffffffff81111561361f5761361e6142ee565b5b61362b8782880161345b565b91505092959194509250565b6000806040838503121561364e5761364d6142f3565b5b600061365c8582860161339c565b925050602061366d85828601613407565b9150509250929050565b6000806040838503121561368e5761368d6142f3565b5b600061369c8582860161339c565b92505060206136ad858286016134df565b9150509250929050565b6000806000604084860312156136d0576136cf6142f3565b5b600084013567ffffffffffffffff8111156136ee576136ed6142ee565b5b6136fa868287016133b1565b9350935050602061370d868287016134df565b9150509250925092565b60006020828403121561372d5761372c6142f3565b5b600061373b84828501613407565b91505092915050565b60006020828403121561375a576137596142f3565b5b60006137688482850161341c565b91505092915050565b600060208284031215613787576137866142f3565b5b600061379584828501613431565b91505092915050565b6000602082840312156137b4576137b36142f3565b5b60006137c284828501613446565b91505092915050565b600080602083850312156137e2576137e16142f3565b5b600083013567ffffffffffffffff811115613800576137ff6142ee565b5b61380c85828601613489565b92509250509250929050565b60006020828403121561382e5761382d6142f3565b5b600061383c848285016134df565b91505092915050565b6000806040838503121561385c5761385b6142f3565b5b600061386a858286016134df565b925050602061387b8582860161339c565b9150509250929050565b6000806040838503121561389c5761389b6142f3565b5b60006138aa858286016134df565b92505060206138bb85828601613407565b9150509250929050565b60006138d18383613ba3565b60208301905092915050565b6138e68161402e565b82525050565b6138fd6138f88261402e565b61419a565b82525050565b600061390e82613ea2565b6139188185613ed0565b935061392383613e92565b8060005b8381101561395457815161393b88826138c5565b975061394683613ec3565b925050600181019050613927565b5085935050505092915050565b61396a81614040565b82525050565b6139798161404c565b82525050565b600061398a82613ead565b6139948185613ee1565b93506139a48185602086016140bb565b6139ad816142f8565b840191505092915050565b60006139c382613eb8565b6139cd8185613efd565b93506139dd8185602086016140bb565b6139e6816142f8565b840191505092915050565b60006139fc82613eb8565b613a068185613f0e565b9350613a168185602086016140bb565b80840191505092915050565b6000613a2f601483613efd565b9150613a3a82614316565b602082019050919050565b6000613a52602683613efd565b9150613a5d8261433f565b604082019050919050565b6000613a75601483613efd565b9150613a808261438e565b602082019050919050565b6000613a98602283613efd565b9150613aa3826143b7565b604082019050919050565b6000613abb600583613f0e565b9150613ac682614406565b600582019050919050565b6000613ade602083613efd565b9150613ae98261442f565b602082019050919050565b6000613b01601783613efd565b9150613b0c82614458565b602082019050919050565b6000613b24602f83613efd565b9150613b2f82614481565b604082019050919050565b6000613b47600083613ef2565b9150613b52826144d0565b600082019050919050565b6000613b6a601483613efd565b9150613b75826144d3565b602082019050919050565b6000613b8d601383613efd565b9150613b98826144fc565b602082019050919050565b613bac816140a2565b82525050565b613bbb816140a2565b82525050565b6000613bcd82846138ec565b60148201915081905092915050565b6000613be882856139f1565b9150613bf482846139f1565b9150613bff82613aae565b91508190509392505050565b6000613c1682613b3a565b9150819050919050565b6000602082019050613c3560008301846138dd565b92915050565b6000608082019050613c5060008301876138dd565b613c5d60208301866138dd565b613c6a6040830185613bb2565b8181036060830152613c7c818461397f565b905095945050505050565b60006020820190508181036000830152613ca18184613903565b905092915050565b6000602082019050613cbe6000830184613961565b92915050565b6000602082019050613cd96000830184613970565b92915050565b60006020820190508181036000830152613cf981846139b8565b905092915050565b60006020820190508181036000830152613d1a81613a22565b9050919050565b60006020820190508181036000830152613d3a81613a45565b9050919050565b60006020820190508181036000830152613d5a81613a68565b9050919050565b60006020820190508181036000830152613d7a81613a8b565b9050919050565b60006020820190508181036000830152613d9a81613ad1565b9050919050565b60006020820190508181036000830152613dba81613af4565b9050919050565b60006020820190508181036000830152613dda81613b17565b9050919050565b60006020820190508181036000830152613dfa81613b5d565b9050919050565b60006020820190508181036000830152613e1a81613b80565b9050919050565b6000602082019050613e366000830184613bb2565b92915050565b6000613e46613e57565b9050613e528282614120565b919050565b6000604051905090565b600067ffffffffffffffff821115613e7c57613e7b6142ab565b5b613e85826142f8565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000613f24826140a2565b9150613f2f836140a2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613f6457613f636141ef565b5b828201905092915050565b6000613f7a826140a2565b9150613f85836140a2565b925082613f9557613f9461421e565b5b828204905092915050565b6000613fab826140a2565b9150613fb6836140a2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fef57613fee6141ef565b5b828202905092915050565b6000614005826140a2565b9150614010836140a2565b925082821015614023576140226141ef565b5b828203905092915050565b600061403982614082565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156140d95780820151818401526020810190506140be565b838111156140e8576000848401525b50505050565b6000600282049050600182168061410657607f821691505b6020821081141561411a5761411961424d565b5b50919050565b614129826142f8565b810181811067ffffffffffffffff82111715614148576141476142ab565b5b80604052505050565b600061415c826140a2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561418f5761418e6141ef565b5b600182019050919050565b60006141a5826141ac565b9050919050565b60006141b782614309565b9050919050565b60006141c9826140a2565b91506141d4836140a2565b9250826141e4576141e361421e565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f4d696e74206c696d69742065786365656465642e000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f496e76616c6964206d696e7420616d6f756e7421000000000000000000000000600082015250565b7f4e6f742070617274206f66207468652050726573616c652077686974656c697360008201527f742e000000000000000000000000000000000000000000000000000000000000602082015250565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f54686520636f6e74726163742069732070617573656421000000000000000000600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b50565b7f4d617820737570706c7920657863656564656421000000000000000000000000600082015250565b7f496e73756666696369656e742066756e64732100000000000000000000000000600082015250565b61452e8161402e565b811461453957600080fd5b50565b61454581614040565b811461455057600080fd5b50565b61455c8161404c565b811461456757600080fd5b50565b61457381614056565b811461457e57600080fd5b50565b61458a816140a2565b811461459557600080fd5b5056fea2646970667358221220c2b24037838283048b33e1c8f9a402f6c4c830baeccb435d75343d334696eb7a64736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
LittleApeWorld.sol 2126 lines
// SPDX-License-Identifier: MIT
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol
// 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.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
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 Merkle 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)
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// 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);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// 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);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// 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);
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// 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);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/utils/Context.sol
// 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;
}
}
// File: contracts/erc721a.sol
// Creator: Chiru Labs
pragma solidity ^0.8.4;
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
*
* Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
*
* Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Compiler will pack this into a single 256bit word.
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps track of the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
}
// Compiler will pack this into a single 256bit word.
struct AddressData {
// Realistically, 2**64-1 is more than enough.
uint64 balance;
// Keeps track of mint count with minimal overhead for tokenomics.
uint64 numberMinted;
// Keeps track of burn count with minimal overhead for tokenomics.
uint64 numberBurned;
// For miscellaneous variable(s) pertaining to the address
// (e.g. number of whitelist mint slots used).
// If there are multiple variables, please pack them into a uint64.
uint64 aux;
}
// The tokenId of the next token to be minted.
uint256 internal _currentIndex;
// The number of tokens burned.
uint256 internal _burnCounter;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details.
mapping(uint256 => TokenOwnership) internal _ownerships;
// Mapping owner address to address data
mapping(address => AddressData) private _addressData;
// 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;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
/**
* To change the starting tokenId, please override this function.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 1;
}
/**
* @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
*/
function totalSupply() public view returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than _currentIndex - _startTokenId() times
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
/**
* Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view returns (uint256) {
// Counter underflow is impossible as _currentIndex does not decrement,
// and it is initialized to _startTokenId()
unchecked {
return _currentIndex - _startTokenId();
}
}
/**
* @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 override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return uint256(_addressData[owner].balance);
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return uint256(_addressData[owner].numberMinted);
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return uint256(_addressData[owner].numberBurned);
}
/**
* Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return _addressData[owner].aux;
}
/**
* Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal {
_addressData[owner].aux = aux;
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr && curr < _currentIndex) {
TokenOwnership memory ownership = _ownerships[curr];
if (!ownership.burned) {
if (ownership.addr != address(0)) {
return ownership;
}
// Invariant:
// There will always be an ownership that has an address and is not burned
// before an ownership that does not have an address and is not burned.
// Hence, curr will not underflow.
while (true) {
curr--;
ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
}
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return _ownershipOf(tokenId).addr;
}
/**
* @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) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
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 override {
address owner = ERC721A.ownerOf(tokenId);
if (to == owner) revert ApprovalToCurrentOwner();
if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
if (operator == _msgSender()) revert ApproveToCaller();
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
_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 {
_transfer(from, to, tokenId);
if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @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`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return _startTokenId() <= tokenId && tokenId < _currentIndex &&
!_ownerships[tokenId].burned;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, '');
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
_mint(to, quantity, _data, true);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _mint(
address to,
uint256 quantity,
bytes memory _data,
bool safe
) internal {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
// updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
unchecked {
_addressData[to].balance += uint64(quantity);
_addressData[to].numberMinted += uint64(quantity);
_ownerships[startTokenId].addr = to;
_ownerships[startTokenId].startTimestamp = uint64(block.timestamp);
uint256 updatedIndex = startTokenId;
uint256 end = updatedIndex + quantity;
if (safe && to.isContract()) {
do {
emit Transfer(address(0), to, updatedIndex);
if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (updatedIndex != end);
// Reentrancy protection
if (_currentIndex != startTokenId) revert();
} else {
do {
emit Transfer(address(0), to, updatedIndex++);
} while (updatedIndex != end);
}
_currentIndex = updatedIndex;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* 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
) private {
TokenOwnership memory prevOwnership = _ownershipOf(tokenId);
if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
bool isApprovedOrOwner = (_msgSender() == from ||
isApprovedForAll(from, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, from);
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
unchecked {
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
TokenOwnership storage currSlot = _ownerships[tokenId];
currSlot.addr = to;
currSlot.startTimestamp = uint64(block.timestamp);
// If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
// This will suffice for checking _exists(nextTokenId),
// as a burned slot cannot contain the zero address.
if (nextTokenId != _currentIndex) {
nextSlot.addr = from;
nextSlot.startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev This is equivalent to _burn(tokenId, false)
*/
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
TokenOwnership memory prevOwnership = _ownershipOf(tokenId);
address from = prevOwnership.addr;
if (approvalCheck) {
bool isApprovedOrOwner = (_msgSender() == from ||
isApprovedForAll(from, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, from);
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
unchecked {
AddressData storage addressData = _addressData[from];
addressData.balance -= 1;
addressData.numberBurned += 1;
// Keep track of who burned the token, and the timestamp of burning.
TokenOwnership storage currSlot = _ownerships[tokenId];
currSlot.addr = from;
currSlot.startTimestamp = uint64(block.timestamp);
currSlot.burned = true;
// If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
// This will suffice for checking _exists(nextTokenId),
// as a burned slot cannot contain the zero address.
if (nextTokenId != _currentIndex) {
nextSlot.addr = from;
nextSlot.startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
// Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
unchecked {
_burnCounter++;
}
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
/**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
* And also called before burning one token.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* 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, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
* minting.
* And also called after one token has been burned.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
* transferred to `to`.
* - When `from` is zero, `tokenId` has been minted for `to`.
* - When `to` is zero, `tokenId` has been burned by `from`.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
}
// File: contracts/contract.sol
pragma solidity ^0.8.4;
contract LittleApeWorld is Ownable, ERC721A {
using Strings for uint256;
string private _baseTokenURI;
uint256 public cost = 0.069 ether;
uint256 public maxSupply = 7777;
uint256 public maxMintAmountPerWallet = 5;
bool public paused = true;
bool public whitelistOnly = true;
bytes32 public merkleRoot = "";
constructor() ERC721A("Little Ape World", "LAW") {}
modifier mintCompliance(uint256 _mintAmount) {
require(_mintAmount > 0 , "Invalid mint amount!");
require(totalMinted() + _mintAmount <= maxSupply, "Max supply exceeded!");
_;
}
function mint(bytes32[] calldata _merkleProof, uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
require(!paused, "The contract is paused!");
if(whitelistOnly==true){
require(msg.value >= cost * _mintAmount, "Insufficient funds!");
require(numberMinted(msg.sender) + _mintAmount <= maxMintAmountPerWallet, "Mint limit exceeded." );
//verify the provided _merkleProof
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(_merkleProof, m...
// [truncated — 53103 bytes total]
Read Contract
balanceOf 0x70a08231 → uint256
cost 0x13faede6 → uint256
exists 0x4f558e79 → bool
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxMintAmountPerWallet 0xbc951b91 → uint256
maxSupply 0xd5abeb01 → uint256
merkleRoot 0x2eb4a7ab → bytes32
name 0x06fdde03 → string
numberMinted 0xdc33e681 → uint256
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalMinted 0xa2309ff8 → uint256
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]
whitelistOnly 0x4b4687b5 → bool
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
burn 0x9fac68cb
uint256 tokenId
bool approvalCheck
mint 0x45de0d9b
bytes32[] _merkleProof
uint256 _mintAmount
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
setBaseURI 0x55f804b3
string baseURI
setCost 0x44a0d68a
uint256 _cost
setMaxMintAmountPerWallet 0x766b7d09
uint256 _maxMintAmountPerWallet
setMerkleRoot 0x7cb64759
bytes32 _merkleRoot
setPaused 0x16c38b3c
bool _state
setWhitelistedOnly 0xa157696b
bool _state
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address