Address Contract Verified
Address
0xF9b0D42bd7DD5efA9142FaAdeF945364FbC61137
Balance
0 ETH
Nonce
1
Code Size
16238 bytes
Creator
0xFAFd5411...a296 at tx 0xefd8c680...c7ec6a
Indexed Transactions
0
Contract Bytecode
16238 bytes
0x6080604052600436106101e35760003560e01c8063715018a611610102578063a9673ec511610095578063d52967c811610064578063d52967c8146106b8578063d5abeb01146106d4578063e985e9c5146106ff578063f2fde38b1461073c576101e3565b8063a9673ec514610600578063b88d4fde14610629578063c87b56dd14610652578063d031370b1461068f576101e3565b80638da5cb5b116100d15780638da5cb5b146105565780638f53e9d41461058157806395d89b41146105ac578063a22cb465146105d7576101e3565b8063715018a6146104d457806378a89567146104eb5780637cb64759146105165780638456cb591461053f576101e3565b8063419b321f1161017a5780636352211e116101495780636352211e146104065780636c0360eb146104435780636f8b44b01461046e57806370a0823114610497576101e3565b8063419b321f1461034c57806342842e0e1461038957806355f804b3146103b25780635c975abb146103db576101e3565b8063239c70ae116101b6578063239c70ae146102b657806323b872dd146102e15780632eb4a7ab1461030a5780633f4ba83a14610335576101e3565b806301ffc9a7146101e857806306fdde0314610225578063081812fc14610250578063095ea7b31461028d575b600080fd5b3480156101f457600080fd5b5061020f600480360381019061020a9190612bad565b610765565b60405161021c91906131b3565b60405180910390f35b34801561023157600080fd5b5061023a610847565b60405161024791906131e9565b60405180910390f35b34801561025c57600080fd5b5061027760048036038101906102729190612cc4565b6108d9565b604051610284919061314c565b60405180910390f35b34801561029957600080fd5b506102b460048036038101906102af9190612b48565b61095e565b005b3480156102c257600080fd5b506102cb610a76565b6040516102d891906134cb565b60405180910390f35b3480156102ed57600080fd5b5061030860048036038101906103039190612a42565b610a7c565b005b34801561031657600080fd5b5061031f610adc565b60405161032c91906131ce565b60405180910390f35b34801561034157600080fd5b5061034a610ae2565b005b34801561035857600080fd5b50610373600480360381019061036e9190612bff565b610b7b565b60405161038091906134cb565b60405180910390f35b34801561039557600080fd5b506103b060048036038101906103ab9190612a42565b610ba9565b005b3480156103be57600080fd5b506103d960048036038101906103d49190612bff565b610bc9565b005b3480156103e757600080fd5b506103f0610c5f565b6040516103fd91906131b3565b60405180910390f35b34801561041257600080fd5b5061042d60048036038101906104289190612cc4565b610c72565b60405161043a919061314c565b60405180910390f35b34801561044f57600080fd5b50610458610d24565b60405161046591906131e9565b60405180910390f35b34801561047a57600080fd5b5061049560048036038101906104909190612cc4565b610db2565b005b3480156104a357600080fd5b506104be60048036038101906104b991906129dd565b610e38565b6040516104cb91906134cb565b60405180910390f35b3480156104e057600080fd5b506104e9610ef0565b005b3480156104f757600080fd5b50610500610f78565b60405161050d91906134cb565b60405180910390f35b34801561052257600080fd5b5061053d60048036038101906105389190612b84565b610f89565b005b34801561054b57600080fd5b5061055461100f565b005b34801561056257600080fd5b5061056b6110a8565b604051610578919061314c565b60405180910390f35b34801561058d57600080fd5b506105966110d2565b6040516105a391906134cb565b60405180910390f35b3480156105b857600080fd5b506105c16110d8565b6040516105ce91906131e9565b60405180910390f35b3480156105e357600080fd5b506105fe60048036038101906105f99190612b0c565b61116a565b005b34801561060c57600080fd5b5061062760048036038101906106229190612cc4565b611180565b005b34801561063557600080fd5b50610650600480360381019061064b9190612a91565b611206565b005b34801561065e57600080fd5b5061067960048036038101906106749190612cc4565b611268565b60405161068691906131e9565b60405180910390f35b34801561069b57600080fd5b506106b660048036038101906106b19190612cc4565b61130f565b005b6106d260048036038101906106cd9190612c40565b611450565b005b3480156106e057600080fd5b506106e9611751565b6040516106f691906134cb565b60405180910390f35b34801561070b57600080fd5b5061072660048036038101906107219190612a06565b611757565b60405161073391906131b3565b60405180910390f35b34801561074857600080fd5b50610763600480360381019061075e91906129dd565b6117eb565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061083057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610840575061083f826118e3565b5b9050919050565b6060600080546108569061372b565b80601f01602080910402602001604051908101604052809291908181526020018280546108829061372b565b80156108cf5780601f106108a4576101008083540402835291602001916108cf565b820191906000526020600020905b8154815290600101906020018083116108b257829003601f168201915b5050505050905090565b60006108e48261194d565b610923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091a906133cb565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061096982610c72565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d19061346b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166109f96119b9565b73ffffffffffffffffffffffffffffffffffffffff161480610a285750610a2781610a226119b9565b611757565b5b610a67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5e9061334b565b60405180910390fd5b610a7183836119c1565b505050565b60095481565b610a8d610a876119b9565b82611a7a565b610acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac39061348b565b60405180910390fd5b610ad7838383611b58565b505050565b600b5481565b610aea6119b9565b73ffffffffffffffffffffffffffffffffffffffff16610b086110a8565b73ffffffffffffffffffffffffffffffffffffffff1614610b5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b559061340b565b60405180910390fd5b6000600c60006101000a81548160ff021916908315150217905550565b600d818051602081018201805184825260208301602085012081835280955050505050506000915090505481565b610bc483838360405180602001604052806000815250611206565b505050565b610bd16119b9565b73ffffffffffffffffffffffffffffffffffffffff16610bef6110a8565b73ffffffffffffffffffffffffffffffffffffffff1614610c45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3c9061340b565b60405180910390fd5b8060079080519060200190610c5b9291906127a2565b5050565b600c60009054906101000a900460ff1681565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d129061338b565b60405180910390fd5b80915050919050565b60078054610d319061372b565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5d9061372b565b8015610daa5780601f10610d7f57610100808354040283529160200191610daa565b820191906000526020600020905b815481529060010190602001808311610d8d57829003601f168201915b505050505081565b610dba6119b9565b73ffffffffffffffffffffffffffffffffffffffff16610dd86110a8565b73ffffffffffffffffffffffffffffffffffffffff1614610e2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e259061340b565b60405180910390fd5b8060088190555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ea9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea09061336b565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610ef86119b9565b73ffffffffffffffffffffffffffffffffffffffff16610f166110a8565b73ffffffffffffffffffffffffffffffffffffffff1614610f6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f639061340b565b60405180910390fd5b610f766000611db4565b565b6000610f84600e611e7a565b905090565b610f916119b9565b73ffffffffffffffffffffffffffffffffffffffff16610faf6110a8565b73ffffffffffffffffffffffffffffffffffffffff1614611005576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffc9061340b565b60405180910390fd5b80600b8190555050565b6110176119b9565b73ffffffffffffffffffffffffffffffffffffffff166110356110a8565b73ffffffffffffffffffffffffffffffffffffffff161461108b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110829061340b565b60405180910390fd5b6001600c60006101000a81548160ff021916908315150217905550565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600a5481565b6060600180546110e79061372b565b80601f01602080910402602001604051908101604052809291908181526020018280546111139061372b565b80156111605780601f1061113557610100808354040283529160200191611160565b820191906000526020600020905b81548152906001019060200180831161114357829003601f168201915b5050505050905090565b61117c6111756119b9565b8383611e88565b5050565b6111886119b9565b73ffffffffffffffffffffffffffffffffffffffff166111a66110a8565b73ffffffffffffffffffffffffffffffffffffffff16146111fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f39061340b565b60405180910390fd5b80600a8190555050565b6112176112116119b9565b83611a7a565b611256576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124d9061348b565b60405180910390fd5b61126284848484611ff5565b50505050565b60606112738261194d565b6112b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a99061320b565b60405180910390fd5b60006112bc612051565b905060008151116112dc5760405180602001604052806000815250611307565b806112e6846120e3565b6040516020016112f7929190613128565b6040516020818303038152906040525b915050919050565b6113176119b9565b73ffffffffffffffffffffffffffffffffffffffff166113356110a8565b73ffffffffffffffffffffffffffffffffffffffff161461138b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113829061340b565b60405180910390fd5b6000611397600e611e7a565b90506008546113af838361229090919063ffffffff16565b11156113f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e79061324b565b60405180910390fd5b60005b8281101561144b576000611407600e611e7a565b90506008548110156114375761141d600e6122a6565b6000611429600e611e7a565b905061143533826122bc565b505b5080806114439061378e565b9150506113f3565b505050565b6000600d856040516114629190613111565b9081526020016040518091039020549050600061147f600e611e7a565b9050600c60009054906101000a900460ff16156114d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c8906134ab565b60405180910390fd5b600954831115611516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150d9061322b565b60405180910390fd5b60008311611559576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115509061328b565b60405180910390fd5b60085461156f848361229090919063ffffffff16565b11156115b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a79061324b565b60405180910390fd5b600a5483836115bf91906135b0565b1115611600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f7906133eb565b60405180910390fd5b6000866040516020016116139190613111565b604051602081830303815290604052805190602001209050611679868680806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600b54836122da565b6116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af9061344b565b60405180910390fd5b60005b848110156117475760006116cf600e611e7a565b905060085481101561173357600d896040516116eb9190613111565b9081526020016040518091039020600081548092919061170a9061378e565b9190505550611719600e6122a6565b6000611725600e611e7a565b905061173133826122bc565b505b50808061173f9061378e565b9150506116bb565b5050505050505050565b60085481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6117f36119b9565b73ffffffffffffffffffffffffffffffffffffffff166118116110a8565b73ffffffffffffffffffffffffffffffffffffffff1614611867576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185e9061340b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ce906132ab565b60405180910390fd5b6118e081611db4565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611a3483610c72565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611a858261194d565b611ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abb9061332b565b60405180910390fd5b6000611acf83610c72565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611b3e57508373ffffffffffffffffffffffffffffffffffffffff16611b26846108d9565b73ffffffffffffffffffffffffffffffffffffffff16145b80611b4f5750611b4e8185611757565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611b7882610c72565b73ffffffffffffffffffffffffffffffffffffffff1614611bce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc59061342b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c35906132eb565b60405180910390fd5b611c498383836122f1565b611c546000826119c1565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ca49190613637565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611cfb91906135b0565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081600001549050919050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eee9061330b565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611fe891906131b3565b60405180910390a3505050565b612000848484611b58565b61200c848484846122f6565b61204b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120429061326b565b60405180910390fd5b50505050565b6060600780546120609061372b565b80601f016020809104026020016040519081016040528092919081815260200182805461208c9061372b565b80156120d95780601f106120ae576101008083540402835291602001916120d9565b820191906000526020600020905b8154815290600101906020018083116120bc57829003601f168201915b5050505050905090565b6060600082141561212b576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061228b565b600082905060005b6000821461215d5780806121469061378e565b915050600a826121569190613606565b9150612133565b60008167ffffffffffffffff81111561219f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156121d15781602001600182028036833780820191505090505b5090505b60008514612284576001826121ea9190613637565b9150600a856121f991906137e1565b603061220591906135b0565b60f81b818381518110612241577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561227d9190613606565b94506121d5565b8093505050505b919050565b6000818361229e91906135b0565b905092915050565b6001816000016000828254019250508190555050565b6122d682826040518060200160405280600081525061248d565b5050565b6000826122e785846124e8565b1490509392505050565b505050565b60006123178473ffffffffffffffffffffffffffffffffffffffff166125c1565b15612480578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026123406119b9565b8786866040518563ffffffff1660e01b81526004016123629493929190613167565b602060405180830381600087803b15801561237c57600080fd5b505af19250505080156123ad57506040513d601f19601f820116820180604052508101906123aa9190612bd6565b60015b612430573d80600081146123dd576040519150601f19603f3d011682016040523d82523d6000602084013e6123e2565b606091505b50600081511415612428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241f9061326b565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612485565b600190505b949350505050565b61249783836125d4565b6124a460008484846122f6565b6124e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124da9061326b565b60405180910390fd5b505050565b60008082905060005b84518110156125b6576000858281518110612535577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190508083116125765782816040516020016125599291906130e5565b6040516020818303038152906040528051906020012092506125a2565b80836040516020016125899291906130e5565b6040516020818303038152906040528051906020012092505b5080806125ae9061378e565b9150506124f1565b508091505092915050565b600080823b905060008111915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161263b906133ab565b60405180910390fd5b61264d8161194d565b1561268d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612684906132cb565b60405180910390fd5b612699600083836122f1565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126e991906135b0565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b8280546127ae9061372b565b90600052602060002090601f0160209004810192826127d05760008555612817565b82601f106127e957805160ff1916838001178555612817565b82800160010185558215612817579182015b828111156128165782518255916020019190600101906127fb565b5b5090506128249190612828565b5090565b5b80821115612841576000816000905550600101612829565b5090565b60006128586128538461350b565b6134e6565b90508281526020810184848401111561287057600080fd5b61287b8482856136e9565b509392505050565b60006128966128918461353c565b6134e6565b9050828152602081018484840111156128ae57600080fd5b6128b98482856136e9565b509392505050565b6000813590506128d081613ec5565b92915050565b60008083601f8401126128e857600080fd5b8235905067ffffffffffffffff81111561290157600080fd5b60208301915083602082028301111561291957600080fd5b9250929050565b60008135905061292f81613edc565b92915050565b60008135905061294481613ef3565b92915050565b60008135905061295981613f0a565b92915050565b60008151905061296e81613f0a565b92915050565b600082601f83011261298557600080fd5b8135612995848260208601612845565b91505092915050565b600082601f8301126129af57600080fd5b81356129bf848260208601612883565b91505092915050565b6000813590506129d781613f21565b92915050565b6000602082840312156129ef57600080fd5b60006129fd848285016128c1565b91505092915050565b60008060408385031215612a1957600080fd5b6000612a27858286016128c1565b9250506020612a38858286016128c1565b9150509250929050565b600080600060608486031215612a5757600080fd5b6000612a65868287016128c1565b9350506020612a76868287016128c1565b9250506040612a87868287016129c8565b9150509250925092565b60008060008060808587031215612aa757600080fd5b6000612ab5878288016128c1565b9450506020612ac6878288016128c1565b9350506040612ad7878288016129c8565b925050606085013567ffffffffffffffff811115612af457600080fd5b612b0087828801612974565b91505092959194509250565b60008060408385031215612b1f57600080fd5b6000612b2d858286016128c1565b9250506020612b3e85828601612920565b9150509250929050565b60008060408385031215612b5b57600080fd5b6000612b69858286016128c1565b9250506020612b7a858286016129c8565b9150509250929050565b600060208284031215612b9657600080fd5b6000612ba484828501612935565b91505092915050565b600060208284031215612bbf57600080fd5b6000612bcd8482850161294a565b91505092915050565b600060208284031215612be857600080fd5b6000612bf68482850161295f565b91505092915050565b600060208284031215612c1157600080fd5b600082013567ffffffffffffffff811115612c2b57600080fd5b612c378482850161299e565b91505092915050565b60008060008060608587031215612c5657600080fd5b600085013567ffffffffffffffff811115612c7057600080fd5b612c7c8782880161299e565b945050602085013567ffffffffffffffff811115612c9957600080fd5b612ca5878288016128d6565b93509350506040612cb8878288016129c8565b91505092959194509250565b600060208284031215612cd657600080fd5b6000612ce4848285016129c8565b91505092915050565b612cf68161366b565b82525050565b612d058161367d565b82525050565b612d1481613689565b82525050565b612d2b612d2682613689565b6137d7565b82525050565b6000612d3c8261356d565b612d468185613583565b9350612d568185602086016136f8565b612d5f816138ce565b840191505092915050565b6000612d7582613578565b612d7f8185613594565b9350612d8f8185602086016136f8565b612d98816138ce565b840191505092915050565b6000612dae82613578565b612db881856135a5565b9350612dc88185602086016136f8565b80840191505092915050565b6000612de1601383613594565b9150612dec826138df565b602082019050919050565b6000612e04602983613594565b9150612e0f82613908565b604082019050919050565b6000612e27602283613594565b9150612e3282613957565b604082019050919050565b6000612e4a603283613594565b9150612e55826139a6565b604082019050919050565b6000612e6d602583613594565b9150612e78826139f5565b604082019050919050565b6000612e90602683613594565b9150612e9b82613a44565b604082019050919050565b6000612eb3601c83613594565b9150612ebe82613a93565b602082019050919050565b6000612ed6602483613594565b9150612ee182613abc565b604082019050919050565b6000612ef9601983613594565b9150612f0482613b0b565b602082019050919050565b6000612f1c602c83613594565b9150612f2782613b34565b604082019050919050565b6000612f3f603883613594565b9150612f4a82613b83565b604082019050919050565b6000612f62602a83613594565b9150612f6d82613bd2565b604082019050919050565b6000612f85602983613594565b9150612f9082613c21565b604082019050919050565b6000612fa8602083613594565b9150612fb382613c70565b602082019050919050565b6000612fcb602c83613594565b9150612fd682613c99565b604082019050919050565b6000612fee602683613594565b9150612ff982613ce8565b604082019050919050565b6000613011602083613594565b915061301c82613d37565b602082019050919050565b6000613034602983613594565b915061303f82613d60565b604082019050919050565b6000613057602383613594565b915061306282613daf565b604082019050919050565b600061307a602183613594565b915061308582613dfe565b604082019050919050565b600061309d603183613594565b91506130a882613e4d565b604082019050919050565b60006130c0601283613594565b91506130cb82613e9c565b602082019050919050565b6130df816136df565b82525050565b60006130f18285612d1a565b6020820191506131018284612d1a565b6020820191508190509392505050565b600061311d8284612da3565b915081905092915050565b60006131348285612da3565b91506131408284612da3565b91508190509392505050565b60006020820190506131616000830184612ced565b92915050565b600060808201905061317c6000830187612ced565b6131896020830186612ced565b61319660408301856130d6565b81810360608301526131a88184612d31565b905095945050505050565b60006020820190506131c86000830184612cfc565b92915050565b60006020820190506131e36000830184612d0b565b92915050565b600060208201905081810360008301526132038184612d6a565b905092915050565b6000602082019050818103600083015261322481612dd4565b9050919050565b6000602082019050818103600083015261324481612df7565b9050919050565b6000602082019050818103600083015261326481612e1a565b9050919050565b6000602082019050818103600083015261328481612e3d565b9050919050565b600060208201905081810360008301526132a481612e60565b9050919050565b600060208201905081810360008301526132c481612e83565b9050919050565b600060208201905081810360008301526132e481612ea6565b9050919050565b6000602082019050818103600083015261330481612ec9565b9050919050565b6000602082019050818103600083015261332481612eec565b9050919050565b6000602082019050818103600083015261334481612f0f565b9050919050565b6000602082019050818103600083015261336481612f32565b9050919050565b6000602082019050818103600083015261338481612f55565b9050919050565b600060208201905081810360008301526133a481612f78565b9050919050565b600060208201905081810360008301526133c481612f9b565b9050919050565b600060208201905081810360008301526133e481612fbe565b9050919050565b6000602082019050818103600083015261340481612fe1565b9050919050565b6000602082019050818103600083015261342481613004565b9050919050565b6000602082019050818103600083015261344481613027565b9050919050565b600060208201905081810360008301526134648161304a565b9050919050565b600060208201905081810360008301526134848161306d565b9050919050565b600060208201905081810360008301526134a481613090565b9050919050565b600060208201905081810360008301526134c4816130b3565b9050919050565b60006020820190506134e060008301846130d6565b92915050565b60006134f0613501565b90506134fc828261375d565b919050565b6000604051905090565b600067ffffffffffffffff8211156135265761352561389f565b5b61352f826138ce565b9050602081019050919050565b600067ffffffffffffffff8211156135575761355661389f565b5b613560826138ce565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006135bb826136df565b91506135c6836136df565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135fb576135fa613812565b5b828201905092915050565b6000613611826136df565b915061361c836136df565b92508261362c5761362b613841565b5b828204905092915050565b6000613642826136df565b915061364d836136df565b9250828210156136605761365f613812565b5b828203905092915050565b6000613676826136bf565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156137165780820151818401526020810190506136fb565b83811115613725576000848401525b50505050565b6000600282049050600182168061374357607f821691505b6020821081141561375757613756613870565b5b50919050565b613766826138ce565b810181811067ffffffffffffffff821117156137855761378461389f565b5b80604052505050565b6000613799826136df565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137cc576137cb613812565b5b600182019050919050565b6000819050919050565b60006137ec826136df565b91506137f7836136df565b92508261380757613806613841565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f546f6b656e20646f65736e277420657869737400000000000000000000000000600082015250565b7f446f6e2774206265206772656564792d2048696c6c62696c6c79206c696d697460008201527f2065786365656465640000000000000000000000000000000000000000000000602082015250565b7f4e6f7420656e6f7567682048696c6c62696c6c69657320666f7220726571756560008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f596f75206e65656420746f204d696e74206174206c6561737420312048696c6c60008201527f62696c6c79000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4e6f206d6f72652048696c6c62696c6c69657320666f7220746869732054696360008201527f6b6574203a280000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f596f7520646f206e6f74206861766520612076616c6964206d696e742074696360008201527f6b65740000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f436f6e7472616374206973207061757365640000000000000000000000000000600082015250565b613ece8161366b565b8114613ed957600080fd5b50565b613ee58161367d565b8114613ef057600080fd5b50565b613efc81613689565b8114613f0757600080fd5b50565b613f1381613693565b8114613f1e57600080fd5b50565b613f2a816136df565b8114613f3557600080fd5b5056fea2646970667358221220bed3d845fa6830d9f96716aa0791adbf8e85d1cf1de9477a9bfd7a5d3cfeaca664736f6c63430008020033
Verified Source Code Full Match
Compiler: v0.8.2+commit.661d1103
EVM: istanbul
Optimization: No
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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 424 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev 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 {}
}
SafeMath.sol 227 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
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;
}
HillbillyHoller721-Ticketing-LowGas.sol 108 lines
// Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract HillbillyHoller721LGG2 is ERC721, Ownable {
using Strings for uint256;
using SafeMath for uint256;
using Counters for Counters.Counter;
string public baseURI;
uint256 public maxSupply = 1974;
uint256 public maxMintAmount = 10;
uint256 public limitPerTicket = 10;
bytes32 public merkleRoot;
bool public paused = true;
mapping(string => uint256) public ticketMintedBalance;
Counters.Counter private _tokenIdCounter;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
setBaseURI(_initBaseURI);
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
// Public
function mint(string memory _ticket, bytes32[] calldata _merkleProof, uint256 _mintAmount) public payable {
uint256 ticketMintedCount = ticketMintedBalance[_ticket];
uint256 supply = _tokenIdCounter.current();
require(!paused, "Contract is paused");
require(_mintAmount <= maxMintAmount, "Don't be greedy- Hillbilly limit exceeded");
require(_mintAmount > 0, "You need to Mint at least 1 Hillbilly");
require(supply.add(_mintAmount) <= maxSupply, "Not enough Hillbillies for request");
require(ticketMintedCount + _mintAmount <= limitPerTicket, "No more Hillbillies for this Ticket :(");
bytes32 leaf = keccak256(abi.encodePacked(_ticket));
require(MerkleProof.verify(_merkleProof, merkleRoot, leaf), "You do not have a valid mint ticket");
for(uint256 i = 0; i < _mintAmount; i++) {
uint256 mintIndex = _tokenIdCounter.current();
if (mintIndex < maxSupply) {
ticketMintedBalance[_ticket]++;
_tokenIdCounter.increment();
uint256 newTokenId = _tokenIdCounter.current();
_safeMint(msg.sender, newTokenId);
}
}
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "Token doesn't exist" );
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString()))
: "";
}
// Support functions
function reserveTokens(uint256 _amount) public onlyOwner {
uint256 supply = _tokenIdCounter.current();
require(supply.add(_amount) <= maxSupply, "Not enough Hillbillies for request");
for(uint256 i = 0; i < _amount; i++) {
uint256 mintIndex = _tokenIdCounter.current();
if (mintIndex < maxSupply) {
_tokenIdCounter.increment();
uint256 newTokenId = _tokenIdCounter.current();
_safeMint(msg.sender, newTokenId);
}
}
}
function getTokenCount() public view returns (uint256) {
return _tokenIdCounter.current();
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner() {
merkleRoot = _merkleRoot;
}
function setMaxSupply(uint256 _maxSupply) public onlyOwner() {
maxSupply = _maxSupply;
}
function setPerTicketLimit(uint256 _limit) public onlyOwner() {
limitPerTicket = _limit;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function pause() public onlyOwner {
paused = true;
}
function unpause() public onlyOwner {
paused = false;
}
}
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 52 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
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
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
getApproved 0x081812fc → address
getTokenCount 0x78a89567 → uint256
isApprovedForAll 0xe985e9c5 → bool
limitPerTicket 0x8f53e9d4 → uint256
maxMintAmount 0x239c70ae → uint256
maxSupply 0xd5abeb01 → uint256
merkleRoot 0x2eb4a7ab → bytes32
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
ticketMintedBalance 0x419b321f → uint256
tokenURI 0xc87b56dd → string
Write Contract 15 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xd52967c8
string _ticket
bytes32[] _merkleProof
uint256 _mintAmount
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
reserveTokens 0xd031370b
uint256 _amount
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _newBaseURI
setMaxSupply 0x6f8b44b0
uint256 _maxSupply
setMerkleRoot 0x7cb64759
bytes32 _merkleRoot
setPerTicketLimit 0xa9673ec5
uint256 _limit
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
Recent Transactions
No transactions found for this address