Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x656D34A8309363302e46De99853F4cef30B85A1D
Balance 0 ETH
Nonce 1
Code Size 18744 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

18744 bytes
0x6080604052600436106101e35760003560e01c80636352211e11610102578063a22cb46511610095578063c87b56dd11610064578063c87b56dd14610698578063d5abeb01146106d5578063e985e9c514610700578063f2fde38b1461073d576101e3565b8063a22cb465146105ff578063a897367b14610628578063aeffe13414610644578063b88d4fde1461066f576101e3565b80637d8afe04116100d15780637d8afe04146105555780638da5cb5b1461058057806395d89b41146105ab57806399755624146105d6576101e3565b80636352211e1461049957806370a08231146104d6578063715018a6146105135780637286c5d51461052a576101e3565b80633ba523c71161017a57806355f804b31161014957806355f804b3146103fe57806358891a37146104275780635b2a55e4146104435780636327c7741461046e576101e3565b80633ba523c7146103635780633ccfd60b1461038e57806342842e0e146103985780634f6ccce7146103c1576101e3565b806310aec4a6116101b657806310aec4a6146102b657806318160ddd146102d257806323b872dd146102fd5780632f745c5914610326576101e3565b806301ffc9a7146101e857806306fdde0314610225578063081812fc14610250578063095ea7b31461028d575b600080fd5b3480156101f457600080fd5b5061020f600480360381019061020a9190613206565b610766565b60405161021c9190613929565b60405180910390f35b34801561023157600080fd5b5061023a6107e0565b6040516102479190613989565b60405180910390f35b34801561025c57600080fd5b5061027760048036038101906102729190613299565b610872565b60405161028491906138c2565b60405180910390f35b34801561029957600080fd5b506102b460048036038101906102af91906131ca565b6108f7565b005b6102d060048036038101906102cb91906132c2565b610a0f565b005b3480156102de57600080fd5b506102e7610be6565b6040516102f49190613d0b565b60405180910390f35b34801561030957600080fd5b50610324600480360381019061031f91906130c4565b610bf3565b005b34801561033257600080fd5b5061034d600480360381019061034891906131ca565b610c53565b60405161035a9190613d0b565b60405180910390f35b34801561036f57600080fd5b50610378610cf8565b6040516103859190613d0b565b60405180910390f35b610396610d04565b005b3480156103a457600080fd5b506103bf60048036038101906103ba91906130c4565b610e43565b005b3480156103cd57600080fd5b506103e860048036038101906103e39190613299565b610e63565b6040516103f59190613d0b565b60405180910390f35b34801561040a57600080fd5b5061042560048036038101906104209190613258565b610efa565b005b610441600480360381019061043c91906131ca565b610f90565b005b34801561044f57600080fd5b506104586111b4565b60405161046591906138c2565b60405180910390f35b34801561047a57600080fd5b506104836111da565b6040516104909190613d0b565b60405180910390f35b3480156104a557600080fd5b506104c060048036038101906104bb9190613299565b6111e0565b6040516104cd91906138c2565b60405180910390f35b3480156104e257600080fd5b506104fd60048036038101906104f8919061305f565b611292565b60405161050a9190613d0b565b60405180910390f35b34801561051f57600080fd5b5061052861134a565b005b34801561053657600080fd5b5061053f6113d2565b60405161054c91906138c2565b60405180910390f35b34801561056157600080fd5b5061056a6113ea565b6040516105779190613d0b565b60405180910390f35b34801561058c57600080fd5b506105956113ef565b6040516105a291906138c2565b60405180910390f35b3480156105b757600080fd5b506105c0611419565b6040516105cd9190613989565b60405180910390f35b3480156105e257600080fd5b506105fd60048036038101906105f8919061305f565b6114ab565b005b34801561060b57600080fd5b506106266004803603810190610621919061318e565b61156b565b005b610642600480360381019061063d9190613299565b611581565b005b34801561065057600080fd5b506106596116fd565b6040516106669190613d0b565b60405180910390f35b34801561067b57600080fd5b5061069660048036038101906106919190613113565b611703565b005b3480156106a457600080fd5b506106bf60048036038101906106ba9190613299565b611765565b6040516106cc9190613989565b60405180910390f35b3480156106e157600080fd5b506106ea61180c565b6040516106f79190613d0b565b60405180910390f35b34801561070c57600080fd5b5061072760048036038101906107229190613088565b611812565b6040516107349190613929565b60405180910390f35b34801561074957600080fd5b50610764600480360381019061075f919061305f565b6118a6565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107d957506107d8826119c6565b5b9050919050565b6060600080546107ef90613fdd565b80601f016020809104026020016040519081016040528092919081815260200182805461081b90613fdd565b80156108685780601f1061083d57610100808354040283529160200191610868565b820191906000526020600020905b81548152906001019060200180831161084b57829003601f168201915b5050505050905090565b600061087d82611aa8565b6108bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b390613bcb565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610902826111e0565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096a90613c4b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610992611b14565b73ffffffffffffffffffffffffffffffffffffffff1614806109c157506109c0816109bb611b14565b611812565b5b610a00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f790613b0b565b60405180910390fd5b610a0a8383611b1c565b505050565b836122b8600b541115610a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4e90613bab565b60405180910390fd5b6003610a6233611292565b11158015610a71575060038111155b610ab0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa790613a0b565b60405180910390fd5b8067011c37937e080000610ac49190613e82565b341015610b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afd90613b2b565b60405180910390fd5b610b11848484611bd5565b610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4790613aeb565b60405180910390fd5b60005b85811015610b9257600b6000815480929190610b6e90614040565b9190505550610b7f33600b54611d61565b8080610b8a90614040565b915050610b53565b506003610b9e33611292565b1115610bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd690613a0b565b60405180910390fd5b5050505050565b6000600880549050905090565b610c04610bfe611b14565b82611d7f565b610c43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3a90613cab565b60405180910390fd5b610c4e838383611e5d565b505050565b6000610c5e83611292565b8210610c9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c96906139cb565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b67011c37937e08000081565b610d0c611b14565b73ffffffffffffffffffffffffffffffffffffffff16610d2a6113ef565b73ffffffffffffffffffffffffffffffffffffffff1614610d80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7790613c0b565b60405180910390fd5b6000734aae0981ec489ee1710c6cb1f6b203ab6e02075473ffffffffffffffffffffffffffffffffffffffff1647604051610dba906138ad565b60006040518083038185875af1925050503d8060008114610df7576040519150601f19603f3d011682016040523d82523d6000602084013e610dfc565b606091505b5050905080610e40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3790613c6b565b60405180910390fd5b50565b610e5e83838360405180602001604052806000815250611703565b505050565b6000610e6d610be6565b8210610eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea590613ccb565b60405180910390fd5b60088281548110610ee8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b610f02611b14565b73ffffffffffffffffffffffffffffffffffffffff16610f206113ef565b73ffffffffffffffffffffffffffffffffffffffff1614610f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6d90613c0b565b60405180910390fd5b80600c9080519060200190610f8c929190612e59565b5050565b348167011c37937e080000610fa59190613e82565b1015610fe6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fdd90613ceb565b60405180910390fd5b6122b881600b54610ff79190613dfb565b1115611038576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102f90613beb565b60405180910390fd5b600361104383611292565b11158015611052575060038111155b611091576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108890613a0b565b60405180910390fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611121576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611118906139ab565b60405180910390fd5b60005b8181101561116357600b600081548092919061113f90614040565b919050555061115083600b54611d61565b808061115b90614040565b915050611124565b50600361116f83611292565b11156111b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a790613a0b565b60405180910390fd5b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128090613b6b565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611303576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112fa90613b4b565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611352611b14565b73ffffffffffffffffffffffffffffffffffffffff166113706113ef565b73ffffffffffffffffffffffffffffffffffffffff16146113c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bd90613c0b565b60405180910390fd5b6113d060006120c4565b565b734aae0981ec489ee1710c6cb1f6b203ab6e02075481565b60c981565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606001805461142890613fdd565b80601f016020809104026020016040519081016040528092919081815260200182805461145490613fdd565b80156114a15780601f10611476576101008083540402835291602001916114a1565b820191906000526020600020905b81548152906001019060200180831161148457829003601f168201915b5050505050905090565b6114b3611b14565b73ffffffffffffffffffffffffffffffffffffffff166114d16113ef565b73ffffffffffffffffffffffffffffffffffffffff1614611527576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151e90613c0b565b60405180910390fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61157d611576611b14565b838361218a565b5050565b611589611b14565b73ffffffffffffffffffffffffffffffffffffffff166115a76113ef565b73ffffffffffffffffffffffffffffffffffffffff16146115fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f490613c0b565b60405180910390fd5b80600d600082825461160f9190613dfb565b9250508190555060c9600d54111561165c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165390613c8b565b60405180910390fd5b60005b818110156116b257600b600081548092919061167a90614040565b919050555061169f734aae0981ec489ee1710c6cb1f6b203ab6e020754600b54611d61565b80806116aa90614040565b91505061165f565b506122b8600b5411156116fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f190613bab565b60405180910390fd5b50565b600b5481565b61171461170e611b14565b83611d7f565b611753576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174a90613cab565b60405180910390fd5b61175f848484846122f7565b50505050565b606061177082611aa8565b6117af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a690613c2b565b60405180910390fd5b60006117b9612353565b905060008151116117d95760405180602001604052806000815250611804565b806117e3846123e5565b6040516020016117f4929190613889565b6040516020818303038152906040525b915050919050565b6122b881565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6118ae611b14565b73ffffffffffffffffffffffffffffffffffffffff166118cc6113ef565b73ffffffffffffffffffffffffffffffffffffffff1614611922576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191990613c0b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611992576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198990613a2b565b60405180910390fd5b61199b816120c4565b50565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a9157507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611aa15750611aa082612592565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611b8f836111e0565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611c0b5760009050611d5a565b601b8460ff1614158015611c235750601c8460ff1614155b15611c315760009050611d5a565b60006040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250905060008133604051602001611c7f9190613846565b60405160208183030381529060405280519060200120604051602001611ca6929190613861565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051611ce39493929190613944565b6020604051602081039080840390855afa158015611d05573d6000803e3d6000fd5b50505060206040510351905073fcdd24e44a8c669c2798394fc7091b84d360d91673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161493505050505b9392505050565b611d7b8282604051806020016040528060008152506125fc565b5050565b6000611d8a82611aa8565b611dc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc090613acb565b60405180910390fd5b6000611dd4836111e0565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611e165750611e158185611812565b5b80611e5457508373ffffffffffffffffffffffffffffffffffffffff16611e3c84610872565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611e7d826111e0565b73ffffffffffffffffffffffffffffffffffffffff1614611ed3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eca90613a4b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3a90613a8b565b60405180910390fd5b611f4e838383612657565b611f59600082611b1c565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fa99190613edc565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546120009190613dfb565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46120bf83838361276b565b505050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156121f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f090613aab565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516122ea9190613929565b60405180910390a3505050565b612302848484611e5d565b61230e84848484612770565b61234d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612344906139eb565b60405180910390fd5b50505050565b6060600c805461236290613fdd565b80601f016020809104026020016040519081016040528092919081815260200182805461238e90613fdd565b80156123db5780601f106123b0576101008083540402835291602001916123db565b820191906000526020600020905b8154815290600101906020018083116123be57829003601f168201915b5050505050905090565b6060600082141561242d576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061258d565b600082905060005b6000821461245f57808061244890614040565b915050600a826124589190613e51565b9150612435565b60008167ffffffffffffffff8111156124a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156124d35781602001600182028036833780820191505090505b5090505b60008514612586576001826124ec9190613edc565b9150600a856124fb91906140b7565b60306125079190613dfb565b60f81b818381518110612543577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561257f9190613e51565b94506124d7565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6126068383612907565b6126136000848484612770565b612652576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612649906139eb565b60405180910390fd5b505050565b6126628383836119c1565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156126a5576126a081612ae1565b6126e4565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146126e3576126e28382612b2a565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156127275761272281612c97565b612766565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612765576127648282612dda565b5b5b505050565b505050565b60006127918473ffffffffffffffffffffffffffffffffffffffff1661199e565b156128fa578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026127ba611b14565b8786866040518563ffffffff1660e01b81526004016127dc94939291906138dd565b602060405180830381600087803b1580156127f657600080fd5b505af192505050801561282757506040513d601f19601f82011682018060405250810190612824919061322f565b60015b6128aa573d8060008114612857576040519150601f19603f3d011682016040523d82523d6000602084013e61285c565b606091505b506000815114156128a2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612899906139eb565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506128ff565b600190505b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161296e90613b8b565b60405180910390fd5b61298081611aa8565b156129c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129b790613a6b565b60405180910390fd5b6129cc60008383612657565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612a1c9190613dfb565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612add6000838361276b565b5050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612b3784611292565b612b419190613edc565b9050600060076000848152602001908152602001600020549050818114612c26576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050612cab9190613edc565b9050600060096000848152602001908152602001600020549050600060088381548110612d01577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490508060088381548110612d49577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480612dbe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000612de583611292565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b828054612e6590613fdd565b90600052602060002090601f016020900481019282612e875760008555612ece565b82601f10612ea057805160ff1916838001178555612ece565b82800160010185558215612ece579182015b82811115612ecd578251825591602001919060010190612eb2565b5b509050612edb9190612edf565b5090565b5b80821115612ef8576000816000905550600101612ee0565b5090565b6000612f0f612f0a84613d4b565b613d26565b905082815260208101848484011115612f2757600080fd5b612f32848285613f9b565b509392505050565b6000612f4d612f4884613d7c565b613d26565b905082815260208101848484011115612f6557600080fd5b612f70848285613f9b565b509392505050565b600081359050612f8781614878565b92915050565b600081359050612f9c8161488f565b92915050565b600081359050612fb1816148a6565b92915050565b600081359050612fc6816148bd565b92915050565b600081519050612fdb816148bd565b92915050565b600082601f830112612ff257600080fd5b8135613002848260208601612efc565b91505092915050565b600082601f83011261301c57600080fd5b813561302c848260208601612f3a565b91505092915050565b600081359050613044816148d4565b92915050565b600081359050613059816148eb565b92915050565b60006020828403121561307157600080fd5b600061307f84828501612f78565b91505092915050565b6000806040838503121561309b57600080fd5b60006130a985828601612f78565b92505060206130ba85828601612f78565b9150509250929050565b6000806000606084860312156130d957600080fd5b60006130e786828701612f78565b93505060206130f886828701612f78565b925050604061310986828701613035565b9150509250925092565b6000806000806080858703121561312957600080fd5b600061313787828801612f78565b945050602061314887828801612f78565b935050604061315987828801613035565b925050606085013567ffffffffffffffff81111561317657600080fd5b61318287828801612fe1565b91505092959194509250565b600080604083850312156131a157600080fd5b60006131af85828601612f78565b92505060206131c085828601612f8d565b9150509250929050565b600080604083850312156131dd57600080fd5b60006131eb85828601612f78565b92505060206131fc85828601613035565b9150509250929050565b60006020828403121561321857600080fd5b600061322684828501612fb7565b91505092915050565b60006020828403121561324157600080fd5b600061324f84828501612fcc565b91505092915050565b60006020828403121561326a57600080fd5b600082013567ffffffffffffffff81111561328457600080fd5b6132908482850161300b565b91505092915050565b6000602082840312156132ab57600080fd5b60006132b984828501613035565b91505092915050565b600080600080608085870312156132d857600080fd5b60006132e687828801613035565b94505060206132f78782880161304a565b935050604061330887828801612fa2565b925050606061331987828801612fa2565b91505092959194509250565b61332e81613f10565b82525050565b61334561334082613f10565b614089565b82525050565b61335481613f22565b82525050565b61336381613f2e565b82525050565b61337a61337582613f2e565b61409b565b82525050565b600061338b82613dad565b6133958185613dc3565b93506133a5818560208601613faa565b6133ae816141a4565b840191505092915050565b60006133c482613dad565b6133ce8185613dd4565b93506133de818560208601613faa565b80840191505092915050565b60006133f582613db8565b6133ff8185613ddf565b935061340f818560208601613faa565b613418816141a4565b840191505092915050565b600061342e82613db8565b6134388185613df0565b9350613448818560208601613faa565b80840191505092915050565b6000613461602483613ddf565b915061346c826141c2565b604082019050919050565b6000613484602b83613ddf565b915061348f82614211565b604082019050919050565b60006134a7603283613ddf565b91506134b282614260565b604082019050919050565b60006134ca601c83613ddf565b91506134d5826142af565b602082019050919050565b60006134ed602683613ddf565b91506134f8826142d8565b604082019050919050565b6000613510602583613ddf565b915061351b82614327565b604082019050919050565b6000613533601c83613ddf565b915061353e82614376565b602082019050919050565b6000613556602483613ddf565b91506135618261439f565b604082019050919050565b6000613579601983613ddf565b9150613584826143ee565b602082019050919050565b600061359c602c83613ddf565b91506135a782614417565b604082019050919050565b60006135bf602283613ddf565b91506135ca82614466565b604082019050919050565b60006135e2603883613ddf565b91506135ed826144b5565b604082019050919050565b6000613605601b83613ddf565b915061361082614504565b602082019050919050565b6000613628602a83613ddf565b91506136338261452d565b604082019050919050565b600061364b602983613ddf565b91506136568261457c565b604082019050919050565b600061366e602083613ddf565b9150613679826145cb565b602082019050919050565b6000613691601183613ddf565b915061369c826145f4565b602082019050919050565b60006136b4602c83613ddf565b91506136bf8261461d565b604082019050919050565b60006136d7600c83613ddf565b91506136e28261466c565b602082019050919050565b60006136fa602083613ddf565b915061370582614695565b602082019050919050565b600061371d602f83613ddf565b9150613728826146be565b604082019050919050565b6000613740602183613ddf565b915061374b8261470d565b604082019050919050565b6000613763601583613ddf565b915061376e8261475c565b602082019050919050565b6000613786600d83613ddf565b915061379182614785565b602082019050919050565b60006137a9600083613dd4565b91506137b4826147ae565b600082019050919050565b60006137cc603183613ddf565b91506137d7826147b1565b604082019050919050565b60006137ef602c83613ddf565b91506137fa82614800565b604082019050919050565b6000613812601883613ddf565b915061381d8261484f565b602082019050919050565b61383181613f84565b82525050565b61384081613f8e565b82525050565b60006138528284613334565b60148201915081905092915050565b600061386d82856133b9565b91506138798284613369565b6020820191508190509392505050565b60006138958285613423565b91506138a18284613423565b91508190509392505050565b60006138b88261379c565b9150819050919050565b60006020820190506138d76000830184613325565b92915050565b60006080820190506138f26000830187613325565b6138ff6020830186613325565b61390c6040830185613828565b818103606083015261391e8184613380565b905095945050505050565b600060208201905061393e600083018461334b565b92915050565b6000608082019050613959600083018761335a565b6139666020830186613837565b613973604083018561335a565b613980606083018461335a565b95945050505050565b600060208201905081810360008301526139a381846133ea565b905092915050565b600060208201905081810360008301526139c481613454565b9050919050565b600060208201905081810360008301526139e481613477565b9050919050565b60006020820190508181036000830152613a048161349a565b9050919050565b60006020820190508181036000830152613a24816134bd565b9050919050565b60006020820190508181036000830152613a44816134e0565b9050919050565b60006020820190508181036000830152613a6481613503565b9050919050565b60006020820190508181036000830152613a8481613526565b9050919050565b60006020820190508181036000830152613aa481613549565b9050919050565b60006020820190508181036000830152613ac48161356c565b9050919050565b60006020820190508181036000830152613ae48161358f565b9050919050565b60006020820190508181036000830152613b04816135b2565b9050919050565b60006020820190508181036000830152613b24816135d5565b9050919050565b60006020820190508181036000830152613b44816135f8565b9050919050565b60006020820190508181036000830152613b648161361b565b9050919050565b60006020820190508181036000830152613b848161363e565b9050919050565b60006020820190508181036000830152613ba481613661565b9050919050565b60006020820190508181036000830152613bc481613684565b9050919050565b60006020820190508181036000830152613be4816136a7565b9050919050565b60006020820190508181036000830152613c04816136ca565b9050919050565b60006020820190508181036000830152613c24816136ed565b9050919050565b60006020820190508181036000830152613c4481613710565b9050919050565b60006020820190508181036000830152613c6481613733565b9050919050565b60006020820190508181036000830152613c8481613756565b9050919050565b60006020820190508181036000830152613ca481613779565b9050919050565b60006020820190508181036000830152613cc4816137bf565b9050919050565b60006020820190508181036000830152613ce4816137e2565b9050919050565b60006020820190508181036000830152613d0481613805565b9050919050565b6000602082019050613d206000830184613828565b92915050565b6000613d30613d41565b9050613d3c828261400f565b919050565b6000604051905090565b600067ffffffffffffffff821115613d6657613d65614175565b5b613d6f826141a4565b9050602081019050919050565b600067ffffffffffffffff821115613d9757613d96614175565b5b613da0826141a4565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000613e0682613f84565b9150613e1183613f84565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613e4657613e456140e8565b5b828201905092915050565b6000613e5c82613f84565b9150613e6783613f84565b925082613e7757613e76614117565b5b828204905092915050565b6000613e8d82613f84565b9150613e9883613f84565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ed157613ed06140e8565b5b828202905092915050565b6000613ee782613f84565b9150613ef283613f84565b925082821015613f0557613f046140e8565b5b828203905092915050565b6000613f1b82613f64565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015613fc8578082015181840152602081019050613fad565b83811115613fd7576000848401525b50505050565b60006002820490506001821680613ff557607f821691505b6020821081141561400957614008614146565b5b50919050565b614018826141a4565b810181811067ffffffffffffffff8211171561403757614036614175565b5b80604052505050565b600061404b82613f84565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561407e5761407d6140e8565b5b600182019050919050565b6000614094826140a5565b9050919050565b6000819050919050565b60006140b0826141b5565b9050919050565b60006140c282613f84565b91506140cd83613f84565b9250826140dd576140dc614117565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f546869732066756e6374696f6e20697320666f722043726f73736d696e74206f60008201527f6e6c792e00000000000000000000000000000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4120757365722063616e206f6e6c79206d696e742033204e4654732100000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f556e61626c6520746f2076657269667920736572766572207369676e6174757260008201527f6521000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f56616c7565206f662066756e6473206e6f7420636f7272656374210000000000600082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4e6f20746f6b656e494473206c65667421000000000000000000000000000000600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4e6f206d6f7265206c6566740000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f576974686472617720756e7375636365737366756c0000000000000000000000600082015250565b7f6e6f206d6f7265206d696e747300000000000000000000000000000000000000600082015250565b50565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f496e636f7272656374204554482076616c75652073656e740000000000000000600082015250565b61488181613f10565b811461488c57600080fd5b50565b61489881613f22565b81146148a357600080fd5b50565b6148af81613f2e565b81146148ba57600080fd5b50565b6148c681613f38565b81146148d157600080fd5b50565b6148dd81613f84565b81146148e857600080fd5b50565b6148f481613f8e565b81146148ff57600080fd5b5056fea26469706673582212208c1a18113edf5427f8c84a0e6322bb782d3033e56df5ebcc2bfa0d09d42c1e8464736f6c63430008040033

Verified Source Code Full Match

Compiler: v0.8.4+commit.c7e474f2 EVM: istanbul Optimization: No
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);
    }
}
ERC721Enumerable.sol 163 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @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` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * 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 override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}
ERC721.sol 447 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 overridden 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 || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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 {}
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
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);
}
Genesis.sol 145 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';

contract Genesis is ERC721Enumerable, Ownable {
    using Strings for uint256;

    // Total number of tokenIds minted
    uint256 public tokenIDs = 6;

    // Variables for metadata links
    string _baseTokenURI;

    // Variables for the token
    // Constant number for how many NFTs an address is allowed to mint.
    uint256 private constant maxNumberUserCanMint = 3;
    // Max Supply of the NFT
    uint256 public constant maxSupply = 8888;
    uint256 public ownerMints = 0;
    uint256 public constant ownerMintsMax = 201;

    address public crossmintAddress;

    // Constant values
    uint256 public constant costPerToken = 0.08 ether;

    // public key for signing
    address internal constant publicKey = 0xFCDD24e44A8c669c2798394fc7091b84D360d916;

    // This is ESG's Gnosis Safe Wallet
    address public constant legendaryWallet = 0x4AAe0981Ec489eE1710C6cB1F6b203ab6e020754; 

    constructor() ERC721('R Planet', 'RPlanet') {
        _safeMint(legendaryWallet, 1);
        _safeMint(legendaryWallet, 2);
        _safeMint(legendaryWallet, 3);
        _safeMint(legendaryWallet, 4);
        _safeMint(legendaryWallet, 5);
        _safeMint(legendaryWallet, 6);
        _baseTokenURI = 'https://rplanet-placeholder.s3.amazonaws.com/metadata/';
        setCrossmintAddress(0xdAb1a1854214684acE522439684a145E62505233);

        _transferOwnership(0x962c53CC0d27Bc962b68E25bA51E2e412Bf5ff91);
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _baseTokenURI;
    }

    function setBaseURI(string memory _uri) public onlyOwner {
        _baseTokenURI = _uri;
    }

    // Function to make sure we still have NFTs in stock prior to minting
    modifier isMintValid(uint256 count) {
        require(tokenIDs <= maxSupply, 'No tokenIDs left!');
        require(balanceOf(msg.sender) <= maxNumberUserCanMint && count <= maxNumberUserCanMint, 'A user can only mint 3 NFTs!');
        require(msg.value >= costPerToken * count, 'Value of funds not correct!');
        _;
    }

    function mint(
        uint256 count,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) public payable isMintValid(count) {
        // Verify that the signature was signed using our server private key
        require(verifySignedAddress(_v, _r, _s), 'Unable to verify server signature!');

        for (uint i = 0; i < count; i++) {
            tokenIDs++;
            _safeMint(msg.sender, tokenIDs);
        }

        require(balanceOf(msg.sender) <= maxNumberUserCanMint, 'A user can only mint 3 NFTs!');
    }

    function crossmint(address mintTo, uint256 _count) public payable {
        require(costPerToken * _count >= msg.value, "Incorrect ETH value sent");
        require(tokenIDs + _count <= maxSupply, "No more left");
        require(balanceOf(mintTo) <= maxNumberUserCanMint && _count <= maxNumberUserCanMint, 'A user can only mint 3 NFTs!');

        // 0xdAb1a1854214684acE522439684a145E62505233
        require(msg.sender == crossmintAddress,
            "This function is for Crossmint only."
        );

        for (uint i = 0; i < _count; i++) {
            tokenIDs++;
            _safeMint(mintTo, tokenIDs);
        }

        require(balanceOf(mintTo) <= maxNumberUserCanMint, 'A user can only mint 3 NFTs!');
    }

    // The Project Management team will be participating in the private
    // sale and will be minting NFTs for team allocation, partner appreciation,
    // corp treasury, and partnership allocations.
    function ownerOnlyMint(uint256 _count) public payable onlyOwner {
        ownerMints += _count;

        require(ownerMints <= ownerMintsMax, "no more mints");

        for (uint i = 0; i < _count; i++) {
            tokenIDs++;
            _safeMint(legendaryWallet, tokenIDs);
        }

        require(tokenIDs <= maxSupply, 'No tokenIDs left!');
    }


    // include a setting function so that you can change this later
    function setCrossmintAddress(address _crossmintAddress) public onlyOwner {
        crossmintAddress = _crossmintAddress;
    }

    // Function to verify that the signature was signed using our server private key
    function verifySignedAddress(
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) internal view returns (bool) {
        if (uint256(_s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return false;
        }
        if (_v != 27 && _v != 28) {
            return false;
        }

        bytes memory prefix = '\x19Ethereum Signed Message:\n32';
        bytes32 prefixedHashMessage = keccak256(abi.encodePacked(prefix, keccak256(abi.encodePacked(msg.sender))));
        address signer = ecrecover(prefixedHashMessage, _v, _r, _s);
        return signer == publicKey;
    }

    function withdraw() public onlyOwner payable {
        (bool os, ) = legendaryWallet.call{value: address(this).balance}('');
        require(os, 'Withdraw unsuccessful');
    }
}
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);
    }
}
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;
    }
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * 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;

    /**
     * @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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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);
}
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);
}
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);
            }
        }
    }
}

Read Contract

balanceOf 0x70a08231 → uint256
costPerToken 0x3ba523c7 → uint256
crossmintAddress 0x5b2a55e4 → address
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
legendaryWallet 0x7286c5d5 → address
maxSupply 0xd5abeb01 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerMints 0x6327c774 → uint256
ownerMintsMax 0x7d8afe04 → uint256
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenIDs 0xaeffe134 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256

Write Contract 13 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address to
uint256 tokenId
crossmint 0x58891a37
address mintTo
uint256 _count
mint 0x10aec4a6
uint256 count
uint8 _v
bytes32 _r
bytes32 _s
ownerOnlyMint 0xa897367b
uint256 _count
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _uri
setCrossmintAddress 0x99755624
address _crossmintAddress
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters

Recent Transactions

No transactions found for this address