Address Contract Partially Verified
Address
0x5452C7fB99D99fAb3Cc1875E9DA9829Cb50F7A13
Balance
0 ETH
Nonce
1
Code Size
14499 bytes
Creator
0x8c23B96f...af3C at tx 0x131ceb52...4686cd
Indexed Transactions
0
Contract Bytecode
14499 bytes
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063641ce140116100b857806395d89b411161007c57806395d89b4114610363578063a22cb46514610381578063b88d4fde1461039d578063c87b56dd146103b9578063e985e9c5146103e9578063f2fde38b1461041957610142565b8063641ce140146102d357806370a08231146102ef578063715018a61461031f5780637cb64759146103295780638da5cb5b1461034557610142565b806323b872dd1161010a57806323b872dd146101ff5780632eb4a7ab1461021b57806332cb6b0c1461023957806338e21cce1461025757806342842e0e146102875780636352211e146102a357610142565b806301ffc9a71461014757806306fdde0314610177578063081812fc14610195578063095ea7b3146101c557806318160ddd146101e1575b600080fd5b610161600480360381019061015c919061231f565b610435565b60405161016e9190612951565b60405180910390f35b61017f610517565b60405161018c9190612987565b60405180910390f35b6101af60048036038101906101aa9190612379565b6105a9565b6040516101bc91906128ea565b60405180910390f35b6101df60048036038101906101da919061223e565b61062e565b005b6101e9610746565b6040516101f69190612c29565b60405180910390f35b61021960048036038101906102149190612128565b610757565b005b6102236107b7565b604051610230919061296c565b60405180910390f35b6102416107bd565b60405161024e9190612c29565b60405180910390f35b610271600480360381019061026c91906120bb565b6107c3565b60405161027e9190612951565b60405180910390f35b6102a1600480360381019061029c9190612128565b610819565b005b6102bd60048036038101906102b89190612379565b610839565b6040516102ca91906128ea565b60405180910390f35b6102ed60048036038101906102e8919061227e565b6108eb565b005b610309600480360381019061030491906120bb565b610b33565b6040516103169190612c29565b60405180910390f35b610327610beb565b005b610343600480360381019061033e91906122f2565b610c73565b005b61034d610cf9565b60405161035a91906128ea565b60405180910390f35b61036b610d23565b6040516103789190612987565b60405180910390f35b61039b600480360381019061039691906121fe565b610db5565b005b6103b760048036038101906103b2919061217b565b610dcb565b005b6103d360048036038101906103ce9190612379565b610e2d565b6040516103e09190612987565b60405180910390f35b61040360048036038101906103fe91906120e8565b610edd565b6040516104109190612951565b60405180910390f35b610433600480360381019061042e91906120bb565b610f71565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061050057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610510575061050f82611069565b5b9050919050565b60606000805461052690612eb2565b80601f016020809104026020016040519081016040528092919081815260200182805461055290612eb2565b801561059f5780601f106105745761010080835404028352916020019161059f565b820191906000526020600020905b81548152906001019060200180831161058257829003601f168201915b5050505050905090565b60006105b4826110d3565b6105f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ea90612b89565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061063982610839565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156106aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a190612bc9565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166106c961113f565b73ffffffffffffffffffffffffffffffffffffffff1614806106f857506106f7816106f261113f565b610edd565b5b610737576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072e90612b09565b60405180910390fd5b6107418383611147565b505050565b60006107526009611200565b905090565b61076861076261113f565b8261120e565b6107a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079e90612be9565b60405180910390fd5b6107b28383836112ec565b505050565b60075481565b60085481565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61083483838360405180602001604052806000815250610dcb565b505050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d990612b49565b60405180910390fd5b80915050919050565b6108f4836110d3565b15610934576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092b90612ae9565b60405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b8906129a9565b60405180910390fd5b600854831115610a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fd906129c9565b60405180910390fd5b60008385604051602001610a1b9291906128be565b604051602081830303815290604052805190602001209050610a81838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505060075483611553565b610ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab790612c09565b60405180910390fd5b6001600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610b22858561156a565b610b2c6009611588565b5050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ba4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9b90612b29565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bf361113f565b73ffffffffffffffffffffffffffffffffffffffff16610c11610cf9565b73ffffffffffffffffffffffffffffffffffffffff1614610c67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5e90612ba9565b60405180910390fd5b610c71600061159e565b565b610c7b61113f565b73ffffffffffffffffffffffffffffffffffffffff16610c99610cf9565b73ffffffffffffffffffffffffffffffffffffffff1614610cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce690612ba9565b60405180910390fd5b8060078190555050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054610d3290612eb2565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5e90612eb2565b8015610dab5780601f10610d8057610100808354040283529160200191610dab565b820191906000526020600020905b815481529060010190602001808311610d8e57829003601f168201915b5050505050905090565b610dc7610dc061113f565b8383611664565b5050565b610ddc610dd661113f565b8361120e565b610e1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1290612be9565b60405180910390fd5b610e27848484846117d1565b50505050565b6060610e38826110d3565b610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906129e9565b60405180910390fd5b6000610eb3610e858461182d565b610e8e8561182d565b604051602001610e9f929190612863565b60405160208183030381529060405261198e565b905080604051602001610ec69190612841565b604051602081830303815290604052915050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610f7961113f565b73ffffffffffffffffffffffffffffffffffffffff16610f97610cf9565b73ffffffffffffffffffffffffffffffffffffffff1614610fed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe490612ba9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561105d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105490612a29565b60405180910390fd5b6110668161159e565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166111ba83610839565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081600001549050919050565b6000611219826110d3565b611258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124f90612ac9565b60405180910390fd5b600061126383610839565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806112d257508373ffffffffffffffffffffffffffffffffffffffff166112ba846105a9565b73ffffffffffffffffffffffffffffffffffffffff16145b806112e357506112e28185610edd565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1661130c82610839565b73ffffffffffffffffffffffffffffffffffffffff1614611362576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135990612a49565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c990612a89565b60405180910390fd5b6113dd838383611af2565b6113e8600082611147565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546114389190612dbe565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461148f9190612cdd565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461154e838383611af7565b505050565b6000826115608584611afc565b1490509392505050565b611584828260405180602001604052806000815250611b71565b5050565b6001816000016000828254019250508190555050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90612aa9565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516117c49190612951565b60405180910390a3505050565b6117dc8484846112ec565b6117e884848484611bcc565b611827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181e90612a09565b60405180910390fd5b50505050565b60606000821415611875576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050611989565b600082905060005b600082146118a757808061189090612f15565b915050600a826118a09190612d33565b915061187d565b60008167ffffffffffffffff8111156118c3576118c2613079565b5b6040519080825280601f01601f1916602001820160405280156118f55781602001600182028036833780820191505090505b5090505b600085146119825760018261190e9190612dbe565b9150600a8561191d9190612f8c565b60306119299190612cdd565b60f81b81838151811061193f5761193e61304a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561197b9190612d33565b94506118f9565b8093505050505b919050565b60606000825114156119b157604051806020016040528060008152509050611aed565b600060405180606001604052806040815260200161382e60409139905060006003600285516119e09190612cdd565b6119ea9190612d33565b60046119f69190612d64565b67ffffffffffffffff811115611a0f57611a0e613079565b5b6040519080825280601f01601f191660200182016040528015611a415781602001600182028036833780820191505090505b509050600182016020820185865187015b80821015611aad576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845360018401935050611a52565b5050600386510660018114611ac95760028114611adc57611ae4565b603d6001830353603d6002830353611ae4565b603d60018303535b50505080925050505b919050565b505050565b505050565b60008082905060005b8451811015611b66576000858281518110611b2357611b2261304a565b5b60200260200101519050808311611b4557611b3e8382611d63565b9250611b52565b611b4f8184611d63565b92505b508080611b5e90612f15565b915050611b05565b508091505092915050565b611b7b8383611d7a565b611b886000848484611bcc565b611bc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bbe90612a09565b60405180910390fd5b505050565b6000611bed8473ffffffffffffffffffffffffffffffffffffffff16611f54565b15611d56578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02611c1661113f565b8786866040518563ffffffff1660e01b8152600401611c389493929190612905565b602060405180830381600087803b158015611c5257600080fd5b505af1925050508015611c8357506040513d601f19601f82011682018060405250810190611c80919061234c565b60015b611d06573d8060008114611cb3576040519150601f19603f3d011682016040523d82523d6000602084013e611cb8565b606091505b50600081511415611cfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf590612a09565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050611d5b565b600190505b949350505050565b600082600052816020526040600020905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de190612b69565b60405180910390fd5b611df3816110d3565b15611e33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2a90612a69565b60405180910390fd5b611e3f60008383611af2565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e8f9190612cdd565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611f5060008383611af7565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000611f8a611f8584612c69565b612c44565b905082815260208101848484011115611fa657611fa56130b7565b5b611fb1848285612e70565b509392505050565b600081359050611fc8816137ba565b92915050565b60008083601f840112611fe457611fe36130ad565b5b8235905067ffffffffffffffff811115612001576120006130a8565b5b60208301915083602082028301111561201d5761201c6130b2565b5b9250929050565b600081359050612033816137d1565b92915050565b600081359050612048816137e8565b92915050565b60008135905061205d816137ff565b92915050565b600081519050612072816137ff565b92915050565b600082601f83011261208d5761208c6130ad565b5b813561209d848260208601611f77565b91505092915050565b6000813590506120b581613816565b92915050565b6000602082840312156120d1576120d06130c1565b5b60006120df84828501611fb9565b91505092915050565b600080604083850312156120ff576120fe6130c1565b5b600061210d85828601611fb9565b925050602061211e85828601611fb9565b9150509250929050565b600080600060608486031215612141576121406130c1565b5b600061214f86828701611fb9565b935050602061216086828701611fb9565b9250506040612171868287016120a6565b9150509250925092565b60008060008060808587031215612195576121946130c1565b5b60006121a387828801611fb9565b94505060206121b487828801611fb9565b93505060406121c5878288016120a6565b925050606085013567ffffffffffffffff8111156121e6576121e56130bc565b5b6121f287828801612078565b91505092959194509250565b60008060408385031215612215576122146130c1565b5b600061222385828601611fb9565b925050602061223485828601612024565b9150509250929050565b60008060408385031215612255576122546130c1565b5b600061226385828601611fb9565b9250506020612274858286016120a6565b9150509250929050565b60008060008060608587031215612298576122976130c1565b5b60006122a687828801611fb9565b94505060206122b7878288016120a6565b935050604085013567ffffffffffffffff8111156122d8576122d76130bc565b5b6122e487828801611fce565b925092505092959194509250565b600060208284031215612308576123076130c1565b5b600061231684828501612039565b91505092915050565b600060208284031215612335576123346130c1565b5b60006123438482850161204e565b91505092915050565b600060208284031215612362576123616130c1565b5b600061237084828501612063565b91505092915050565b60006020828403121561238f5761238e6130c1565b5b600061239d848285016120a6565b91505092915050565b6123af81612df2565b82525050565b6123c66123c182612df2565b612f5e565b82525050565b6123d581612e04565b82525050565b6123e481612e10565b82525050565b60006123f582612c9a565b6123ff8185612cb0565b935061240f818560208601612e7f565b612418816130c6565b840191505092915050565b600061242e82612ca5565b6124388185612cc1565b9350612448818560208601612e7f565b612451816130c6565b840191505092915050565b600061246782612ca5565b6124718185612cd2565b9350612481818560208601612e7f565b80840191505092915050565b600061249a600e83612cc1565b91506124a5826130e4565b602082019050919050565b60006124bd601383612cc1565b91506124c88261310d565b602082019050919050565b60006124e0601f83612cc1565b91506124eb82613136565b602082019050919050565b6000612503603283612cc1565b915061250e8261315f565b604082019050919050565b6000612526602683612cc1565b9150612531826131ae565b604082019050919050565b6000612549602583612cc1565b9150612554826131fd565b604082019050919050565b600061256c601c83612cc1565b91506125778261324c565b602082019050919050565b600061258f604283612cd2565b915061259a82613275565b604282019050919050565b60006125b2604283612cd2565b91506125bd826132ea565b604282019050919050565b60006125d5602483612cc1565b91506125e08261335f565b604082019050919050565b60006125f8601983612cc1565b9150612603826133ae565b602082019050919050565b600061261b602c83612cc1565b9150612626826133d7565b604082019050919050565b600061263e601583612cc1565b915061264982613426565b602082019050919050565b6000612661603883612cc1565b915061266c8261344f565b604082019050919050565b6000612684602a83612cc1565b915061268f8261349e565b604082019050919050565b60006126a7602983612cc1565b91506126b2826134ed565b604082019050919050565b60006126ca602083612cc1565b91506126d58261353c565b602082019050919050565b60006126ed602c83612cc1565b91506126f882613565565b604082019050919050565b6000612710602083612cc1565b915061271b826135b4565b602082019050919050565b6000612733605083612cd2565b915061273e826135dd565b605082019050919050565b6000612756600683612cd2565b915061276182613652565b600682019050919050565b6000612779602183612cc1565b91506127848261367b565b604082019050919050565b600061279c601d83612cd2565b91506127a7826136ca565b601d82019050919050565b60006127bf603183612cc1565b91506127ca826136f3565b604082019050919050565b60006127e2602783612cd2565b91506127ed82613742565b602782019050919050565b6000612805600d83612cc1565b915061281082613791565b602082019050919050565b61282481612e66565b82525050565b61283b61283682612e66565b612f82565b82525050565b600061284c8261278f565b9150612858828461245c565b915081905092915050565b600061286e826127d5565b915061287a828561245c565b915061288582612726565b9150612890826125a5565b915061289b82612582565b91506128a7828461245c565b91506128b282612749565b91508190509392505050565b60006128ca828561282a565b6020820191506128da82846123b5565b6014820191508190509392505050565b60006020820190506128ff60008301846123a6565b92915050565b600060808201905061291a60008301876123a6565b61292760208301866123a6565b612934604083018561281b565b818103606083015261294681846123ea565b905095945050505050565b600060208201905061296660008301846123cc565b92915050565b600060208201905061298160008301846123db565b92915050565b600060208201905081810360008301526129a18184612423565b905092915050565b600060208201905081810360008301526129c28161248d565b9050919050565b600060208201905081810360008301526129e2816124b0565b9050919050565b60006020820190508181036000830152612a02816124d3565b9050919050565b60006020820190508181036000830152612a22816124f6565b9050919050565b60006020820190508181036000830152612a4281612519565b9050919050565b60006020820190508181036000830152612a628161253c565b9050919050565b60006020820190508181036000830152612a828161255f565b9050919050565b60006020820190508181036000830152612aa2816125c8565b9050919050565b60006020820190508181036000830152612ac2816125eb565b9050919050565b60006020820190508181036000830152612ae28161260e565b9050919050565b60006020820190508181036000830152612b0281612631565b9050919050565b60006020820190508181036000830152612b2281612654565b9050919050565b60006020820190508181036000830152612b4281612677565b9050919050565b60006020820190508181036000830152612b628161269a565b9050919050565b60006020820190508181036000830152612b82816126bd565b9050919050565b60006020820190508181036000830152612ba2816126e0565b9050919050565b60006020820190508181036000830152612bc281612703565b9050919050565b60006020820190508181036000830152612be28161276c565b9050919050565b60006020820190508181036000830152612c02816127b2565b9050919050565b60006020820190508181036000830152612c22816127f8565b9050919050565b6000602082019050612c3e600083018461281b565b92915050565b6000612c4e612c5f565b9050612c5a8282612ee4565b919050565b6000604051905090565b600067ffffffffffffffff821115612c8457612c83613079565b5b612c8d826130c6565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000612ce882612e66565b9150612cf383612e66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d2857612d27612fbd565b5b828201905092915050565b6000612d3e82612e66565b9150612d4983612e66565b925082612d5957612d58612fec565b5b828204905092915050565b6000612d6f82612e66565b9150612d7a83612e66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612db357612db2612fbd565b5b828202905092915050565b6000612dc982612e66565b9150612dd483612e66565b925082821015612de757612de6612fbd565b5b828203905092915050565b6000612dfd82612e46565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015612e9d578082015181840152602081019050612e82565b83811115612eac576000848401525b50505050565b60006002820490506001821680612eca57607f821691505b60208210811415612ede57612edd61301b565b5b50919050565b612eed826130c6565b810181811067ffffffffffffffff82111715612f0c57612f0b613079565b5b80604052505050565b6000612f2082612e66565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f5357612f52612fbd565b5b600182019050919050565b6000612f6982612f70565b9050919050565b6000612f7b826130d7565b9050919050565b6000819050919050565b6000612f9782612e66565b9150612fa283612e66565b925082612fb257612fb1612fec565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f416c7265616479206d696e746564000000000000000000000000000000000000600082015250565b7f4d617820737570706c7920657863656564656400000000000000000000000000600082015250565b7f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e00600082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f2c2022696d616765223a2022697066733a2f2f516d5358395169776a5447426b60008201527f356d32325573635467337672624d77556646736d78567a4d483537686b50443560208201527f552f000000000000000000000000000000000000000000000000000000000000604082015250565b7f61766174617273206d65746963756c6f75736c792064657369676e656420746f60008201527f206964656e74696679205253533320636f6d6d756e697479206d656d6265727360208201527f2e22000000000000000000000000000000000000000000000000000000000000604082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f546f6b656e4964206e6f7420617661696c61626c650000000000000000000000600082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f222c20226465736372697074696f6e223a20225468652047656e65736973205260008201527f53533320417661746172204e4654206973206120636f6c6c656374696f6e206f60208201527f662031302c30303020756e697175652000000000000000000000000000000000604082015250565b7f2e706e67227d0000000000000000000000000000000000000000000000000000600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000600082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f7b226e616d65223a20225468652047656e65736973205253533320417661746160008201527f72204e4654202300000000000000000000000000000000000000000000000000602082015250565b7f496e76616c69642070726f6f6600000000000000000000000000000000000000600082015250565b6137c381612df2565b81146137ce57600080fd5b50565b6137da81612e04565b81146137e557600080fd5b50565b6137f181612e10565b81146137fc57600080fd5b50565b61380881612e1a565b811461381357600080fd5b50565b61381f81612e66565b811461382a57600080fd5b5056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220f5aa9e6c8f7ce0b941686cb45e6c0e8ad2eaf831ed72e838055af4a8d33ae74264736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
NFT.sol 75 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract NFT is ERC721, Ownable {
using Counters for Counters.Counter;
bytes32 public merkleRoot;
uint256 public MAX_SUPPLY = 10000;
Counters.Counter private _tokenCount;
mapping(address => bool) _minted;
constructor(
bytes32 _merkleRoot
) ERC721("The Genesis RSS3 Avatar NFT", "The Genesis RSS3 Avatar NFT") {
merkleRoot = _merkleRoot;
}
function totalSupply() public view returns (uint256) {
return _tokenCount.current();
}
function hasMinted(address account) public view returns (bool) {
return _minted[account];
}
function mint(address to, uint256 tokenId, bytes32[] calldata merkleProof) public {
require(!_exists(tokenId), "TokenId not available");
require(!_minted[to], "Already minted");
require(tokenId <= MAX_SUPPLY, "Max supply exceeded");
// verify the merkle proof.
bytes32 node = keccak256(abi.encodePacked(tokenId, to));
require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Invalid proof');
// set minted flag
_minted[to] = true;
// mint
_safeMint(to, tokenId);
_tokenCount.increment();
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
require(_exists(tokenId), "URI query for nonexistent token");
string memory json = Base64.encode(
bytes(
string(
abi.encodePacked(
'{"name": "The Genesis RSS3 Avatar NFT #',
Strings.toString(tokenId),
'", "description": "The Genesis RSS3 Avatar NFT is a collection of 10,000 unique ',
'avatars meticulously designed to identify RSS3 community members."',
', "image": "ipfs://QmSX9QiwjTGBk5m22UscTg3vrbMwUfFsmxVzMH57hkPD5U/',
Strings.toString(tokenId),
'.png"}'
)
)
)
);
return string(abi.encodePacked("data:application/json;base64,", json));
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
merkleRoot = _merkleRoot;
}
}
Base64.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Base64.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides a set of functions to operate with Base64 strings.
*
* _Available since v4.5._
*/
library Base64 {
/**
* @dev Base64 Encoding/Decoding Table
*/
string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/**
* @dev Converts a `bytes` to its Bytes64 `string` representation.
*/
function encode(bytes memory data) internal pure returns (string memory) {
/**
* Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
* https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
*/
if (data.length == 0) return "";
// Loads the table into memory
string memory table = _TABLE;
// Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
// and split into 4 numbers of 6 bits.
// The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
// - `data.length + 2` -> Round up
// - `/ 3` -> Number of 3-bytes chunks
// - `4 *` -> 4 characters for each chunk
string memory result = new string(4 * ((data.length + 2) / 3));
assembly {
// Prepare the lookup table (skip the first "length" byte)
let tablePtr := add(table, 1)
// Prepare result pointer, jump over length
let resultPtr := add(result, 32)
// Run over the input, 3 bytes at a time
for {
let dataPtr := data
let endPtr := add(data, mload(data))
} lt(dataPtr, endPtr) {
} {
// Advance 3 bytes
dataPtr := add(dataPtr, 3)
let input := mload(dataPtr)
// To write each character, shift the 3 bytes (18 bits) chunk
// 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
// and apply logical AND with 0x3F which is the number of
// the previous character in the ASCII table prior to the Base64 Table
// The result is then added to the table to get the character to write,
// and finally write it in the result pointer but with a left shift
// of 256 (1 byte) - 8 (1 ASCII char) = 248 bits
mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
}
// When data `bytes` is not exactly 3 bytes long
// it is padded with `=` characters at the end
switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
case 2 {
mstore8(sub(resultPtr, 1), 0x3d)
}
}
return result;
}
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
ERC721.sol 447 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
MerkleProof.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
Read Contract
MAX_SUPPLY 0x32cb6b0c → uint256
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
hasMinted 0x38e21cce → bool
isApprovedForAll 0xe985e9c5 → bool
merkleRoot 0x2eb4a7ab → bytes32
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0x641ce140
address to
uint256 tokenId
bytes32[] merkleProof
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
setMerkleRoot 0x7cb64759
bytes32 _merkleRoot
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address