Address Contract Partially Verified
Address
0xFd082F6e5fC7Cf1b6393969c64bF4D7Cff774E7A
Balance
0 ETH
Nonce
1
Code Size
20799 bytes
Creator
0xFC92a065...C3d8 at tx 0x0cf29fd3...c56c08
Indexed Transactions
0
Contract Bytecode
20799 bytes
0x6080604052600436106101e35760003560e01c8063715018a611610102578063b394437511610095578063dd9c1f2311610064578063dd9c1f23146106fc578063e985e9c514610713578063f2fde38b14610750578063fe70683614610779576101e3565b8063b394437514610656578063b88d4fde1461067f578063c87b56dd146106a8578063cccba79e146106e5576101e3565b806397aba7f9116100d157806397aba7f9146105745780639c14bda9146105b1578063a22cb465146105ee578063a7bb580314610617576101e3565b8063715018a6146104dc578063831617c8146104f35780638da5cb5b1461051e57806395d89b4114610549576101e3565b80632ac0aa9f1161017a57806342842e0e1161014957806342842e0e146104105780636352211e14610439578063708c32631461047657806370a082311461049f576101e3565b80632ac0aa9f146103705780633432f4911461038c5780633bcb4a08146103b557806340ae3fd5146103e0576101e3565b8063095ea7b3116101b6578063095ea7b3146102ca5780630bc766a2146102f3578063167518161461030a57806323b872dd14610347576101e3565b806301ffc9a7146101e857806303163d551461022557806306fdde0314610262578063081812fc1461028d575b600080fd5b3480156101f457600080fd5b5061020f600480360381019061020a91906136a6565b6107a2565b60405161021c9190614077565b60405180910390f35b34801561023157600080fd5b5061024c600480360381019061024791906138c2565b610884565b6040516102599190614077565b60405180910390f35b34801561026e57600080fd5b506102776109f4565b60405161028491906140d7565b60405180910390f35b34801561029957600080fd5b506102b460048036038101906102af9190613895565b610a86565b6040516102c19190613fee565b60405180910390f35b3480156102d657600080fd5b506102f160048036038101906102ec9190613563565b610b0b565b005b3480156102ff57600080fd5b50610308610c23565b005b34801561031657600080fd5b50610331600480360381019061032c9190613895565b610cbc565b60405161033e9190614077565b60405180910390f35b34801561035357600080fd5b5061036e6004803603810190610369919061344d565b610d05565b005b61038a600480360381019061038591906135a3565b610d65565b005b34801561039857600080fd5b506103b360048036038101906103ae9190613749565b61125a565b005b3480156103c157600080fd5b506103ca61130a565b6040516103d79190614055565b60405180910390f35b6103fa60048036038101906103f5919061380a565b611450565b6040516104079190614479565b60405180910390f35b34801561041c57600080fd5b506104376004803603810190610432919061344d565b61193b565b005b34801561044557600080fd5b50610460600480360381019061045b9190613895565b61195b565b60405161046d9190613fee565b60405180910390f35b34801561048257600080fd5b5061049d60048036038101906104989190613895565b611a0d565b005b3480156104ab57600080fd5b506104c660048036038101906104c191906133b3565b611a93565b6040516104d39190614479565b60405180910390f35b3480156104e857600080fd5b506104f1611b4b565b005b3480156104ff57600080fd5b50610508611bd3565b6040516105159190614479565b60405180910390f35b34801561052a57600080fd5b50610533611be4565b6040516105409190613fee565b60405180910390f35b34801561055557600080fd5b5061055e611c0e565b60405161056b91906140d7565b60405180910390f35b34801561058057600080fd5b5061059b6004803603810190610596919061364a565b611ca0565b6040516105a89190613fee565b60405180910390f35b3480156105bd57600080fd5b506105d860048036038101906105d39190613792565b611d15565b6040516105e59190613fee565b60405180910390f35b3480156105fa57600080fd5b5061061560048036038101906106109190613523565b611d58565b005b34801561062357600080fd5b5061063e60048036038101906106399190613700565b611ed9565b60405161064d93929190614494565b60405180910390f35b34801561066257600080fd5b5061067d600480360381019061067891906133b3565b611f1c565b005b34801561068b57600080fd5b506106a660048036038101906106a191906134a0565b611fdc565b005b3480156106b457600080fd5b506106cf60048036038101906106ca9190613895565b61203e565b6040516106dc91906140d7565b60405180910390f35b3480156106f157600080fd5b506106fa6120c4565b005b34801561070857600080fd5b5061071161217c565b005b34801561071f57600080fd5b5061073a6004803603810190610735919061340d565b612224565b6040516107479190614077565b60405180910390f35b34801561075c57600080fd5b50610777600480360381019061077291906133b3565b6122b8565b005b34801561078557600080fd5b506107a0600480360381019061079b9190613915565b6123b0565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061086d57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061087d575061087c826124f1565b5b9050919050565b600061088e61255b565b73ffffffffffffffffffffffffffffffffffffffff166108ac611be4565b73ffffffffffffffffffffffffffffffffffffffff1614610902576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f990614319565b60405180910390fd5b60011515831515141561095f578173ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610955573d6000803e3d6000fd5b50600190506109ed565b4784106109a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610998906141f9565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501580156109e7573d6000803e3d6000fd5b50600190505b9392505050565b606060008054610a03906147e1565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2f906147e1565b8015610a7c5780601f10610a5157610100808354040283529160200191610a7c565b820191906000526020600020905b815481529060010190602001808311610a5f57829003601f168201915b5050505050905090565b6000610a9182612563565b610ad0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac7906142d9565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610b168261195b565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7e90614379565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610ba661255b565b73ffffffffffffffffffffffffffffffffffffffff161480610bd55750610bd481610bcf61255b565b612224565b5b610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90614259565b60405180910390fd5b610c1e83836125cf565b505050565b610c2b61255b565b73ffffffffffffffffffffffffffffffffffffffff16610c49611be4565b73ffffffffffffffffffffffffffffffffffffffff1614610c9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9690614319565b60405180910390fd5b6001600c60146101000a81548160ff021916908315150217905550565b6000610d058210610ccc57600080fd5b6000601183610d058110610ce357610ce26148f5565b5b015490506001811415610cfa576001915050610d00565b60009150505b919050565b610d16610d1061255b565b82612688565b610d55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4c906143b9565b60405180910390fd5b610d60838383612766565b505050565b600a60009054906101000a900460ff16610d7e57600080fd5b600860149054906101000a900460ff16610d9757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610e0057503073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b610e0957600080fd5b81518351148015610e1b575080518351145b610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e51906140f9565b60405180910390fd5b6001600954610e6991906146ce565b8351610e7560076129c2565b610e7f9190614678565b1115610ec0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb790614199565b60405180910390fd5b60005b8351811015611254576010848281518110610ee157610ee06148f5565b5b6020026020010151604051610ef69190613f8b565b908152602001604051809103902060009054906101000a900460ff1615610f1c57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e858481518110610f8457610f836148f5565b5b60200260200101516040518263ffffffff1660e01b8152600401610fa89190614479565b60206040518083038186803b158015610fc057600080fd5b505afa158015610fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff891906133e0565b73ffffffffffffffffffffffffffffffffffffffff161461101857600080fd5b610d0583828151811061102e5761102d6148f5565b5b60200260200101511061104057600080fd5b60006011848381518110611057576110566148f5565b5b6020026020010151610d058110611071576110706148f5565b5b01541461107d57600080fd5b6110bb848281518110611093576110926148f5565b5b60200260200101518383815181106110ae576110ad6148f5565b5b6020026020010151611d15565b73ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461111457600080fd5b600061112060076129c2565b905061114e600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826129d0565b61118b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383604051806020016040528060008152506129ee565b6111af818684815181106111a2576111a16148f5565b5b6020026020010151612a4a565b600160108684815181106111c6576111c56148f5565b5b60200260200101516040516111db9190613f8b565b908152602001604051809103902060006101000a81548160ff02191690831515021790555060016011858481518110611217576112166148f5565b5b6020026020010151610d058110611231576112306148f5565b5b01819055506112406007612abe565b50808061124c90614844565b915050610ec3565b50505050565b61126261255b565b73ffffffffffffffffffffffffffffffffffffffff16611280611be4565b73ffffffffffffffffffffffffffffffffffffffff16146112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd90614319565b60405180910390fd5b600c60149054906101000a900460ff16156112f057600080fd5b80600d9080519060200190611306929190612f72565b5050565b6060600061131860076129c2565b67ffffffffffffffff81111561133157611330614924565b5b60405190808252806020026020018201604052801561136457816020015b606081526020019060019003908161134f5790505b50905060005b61137460076129c2565b81101561144857600f60008281526020019081526020016000208054611399906147e1565b80601f01602080910402602001604051908101604052809291908181526020018280546113c5906147e1565b80156114125780601f106113e757610100808354040283529160200191611412565b820191906000526020600020905b8154815290600101906020018083116113f557829003601f168201915b505050505082828151811061142a576114296148f5565b5b6020026020010181905250808061144090614844565b91505061136a565b508091505090565b600061145c8483611d15565b73ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114b557600080fd5b600015156010856040516114c99190613f8b565b908152602001604051809103902060009054906101000a900460ff16151514611527576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151e90614119565b60405180910390fd5b600a60009054906101000a900460ff16611576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156d906143d9565b60405180910390fd5b600b543410156115bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b290614399565b60405180910390fd5b60016009546115ca91906146ce565b6115d460076129c2565b1115611615576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160c90614219565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561167e57503073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b61168757600080fd5b600860149054906101000a900460ff161561186e573373ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff1660e01b815260040161170e9190614479565b60206040518083038186803b15801561172657600080fd5b505afa15801561173a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175e91906133e0565b73ffffffffffffffffffffffffffffffffffffffff16146117b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ab906143f9565b60405180910390fd5b610d0583106117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90614439565b60405180910390fd5b6000601184610d05811061180f5761180e6148f5565b5b015414611851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184890614459565b60405180910390fd5b6001601184610d058110611868576118676148f5565b5b01819055505b600061187a60076129c2565b90506118a8600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826129d0565b6118e5600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383604051806020016040528060008152506129ee565b6118ef8186612a4a565b60016010866040516119019190613f8b565b908152602001604051809103902060006101000a81548160ff0219169083151502179055506119306007612abe565b809150509392505050565b61195683838360405180602001604052806000815250611fdc565b505050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fb90614299565b60405180910390fd5b80915050919050565b611a1561255b565b73ffffffffffffffffffffffffffffffffffffffff16611a33611be4565b73ffffffffffffffffffffffffffffffffffffffff1614611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8090614319565b60405180910390fd5b80600b8190555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afb90614279565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611b5361255b565b73ffffffffffffffffffffffffffffffffffffffff16611b71611be4565b73ffffffffffffffffffffffffffffffffffffffff1614611bc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bbe90614319565b60405180910390fd5b611bd16000612ad4565b565b6000611bdf60076129c2565b905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054611c1d906147e1565b80601f0160208091040260200160405190810160405280929190818152602001828054611c49906147e1565b8015611c965780601f10611c6b57610100808354040283529160200191611c96565b820191906000526020600020905b815481529060010190602001808311611c7957829003601f168201915b5050505050905090565b600080600080611caf85611ed9565b80935081945082955050505060018684848460405160008152602001604052604051611cde9493929190614092565b6020604051602081039080840390855afa158015611d00573d6000803e3d6000fd5b50505060206040510351935050505092915050565b60008060095484604051602001611d2d929190613fc6565b604051602081830303815290604052805190602001209050611d4f8184611ca0565b91505092915050565b611d6061255b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc5906141d9565b60405180910390fd5b8060056000611ddb61255b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611e8861255b565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611ecd9190614077565b60405180910390a35050565b60008060006041845114611eec57600080fd5b60008060006020870151925060408701519150606087015160001a90508083839550955095505050509193909250565b611f2461255b565b73ffffffffffffffffffffffffffffffffffffffff16611f42611be4565b73ffffffffffffffffffffffffffffffffffffffff1614611f98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8f90614319565b60405180910390fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611fed611fe761255b565b83612688565b61202c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612023906143b9565b60405180910390fd5b612038848484846129ee565b50505050565b606061204982612563565b612088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207f90614419565b60405180910390fd5b600d600f60008481526020019081526020016000206040516020016120ae929190613fa2565b6040516020818303038152906040529050919050565b6120cc61255b565b73ffffffffffffffffffffffffffffffffffffffff166120ea611be4565b73ffffffffffffffffffffffffffffffffffffffff1614612140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213790614319565b60405180910390fd5b600860149054906101000a900460ff1615600860146101000a81548160ff02191690831515021790555061217a66753d533d968000611a0d565b565b61218461255b565b73ffffffffffffffffffffffffffffffffffffffff166121a2611be4565b73ffffffffffffffffffffffffffffffffffffffff16146121f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ef90614319565b60405180910390fd5b600a60009054906101000a900460ff1615600a60006101000a81548160ff021916908315150217905550565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6122c061255b565b73ffffffffffffffffffffffffffffffffffffffff166122de611be4565b73ffffffffffffffffffffffffffffffffffffffff1614612334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161232b90614319565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156123a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239b90614159565b60405180910390fd5b6123ad81612ad4565b50565b6123b861255b565b73ffffffffffffffffffffffffffffffffffffffff166123d6611be4565b73ffffffffffffffffffffffffffffffffffffffff161461242c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242390614319565b60405180910390fd5b600c60149054906101000a900460ff161561244657600080fd5b61244f82612563565b61248e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612485906142f9565b60405180910390fd5b80600f600084815260200190815260200160002090805190602001906124b5929190612f72565b5060016010826040516124c89190613f8b565b908152602001604051809103902060006101000a81548160ff0219169083151502179055505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166126428361195b565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061269382612563565b6126d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126c990614239565b60405180910390fd5b60006126dd8361195b565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061274c57508373ffffffffffffffffffffffffffffffffffffffff1661273484610a86565b73ffffffffffffffffffffffffffffffffffffffff16145b8061275d575061275c8185612224565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166127868261195b565b73ffffffffffffffffffffffffffffffffffffffff16146127dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d390614339565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561284c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612843906141b9565b60405180910390fd5b612857838383612b9a565b6128626000826125cf565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546128b291906146ce565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546129099190614678565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600081600001549050919050565b6129ea828260405180602001604052806000815250612b9f565b5050565b6129f9848484612766565b612a0584848484612bfa565b612a44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3b90614139565b60405180910390fd5b50505050565b612a5382612563565b612a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8990614359565b60405180910390fd5b80600f60008481526020019081526020016000209080519060200190612ab9929190612f72565b505050565b6001816000016000828254019250508190555050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b505050565b612ba98383612d91565b612bb66000848484612bfa565b612bf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bec90614139565b60405180910390fd5b505050565b6000612c1b8473ffffffffffffffffffffffffffffffffffffffff16612f5f565b15612d84578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612c4461255b565b8786866040518563ffffffff1660e01b8152600401612c669493929190614009565b602060405180830381600087803b158015612c8057600080fd5b505af1925050508015612cb157506040513d601f19601f82011682018060405250810190612cae91906136d3565b60015b612d34573d8060008114612ce1576040519150601f19603f3d011682016040523d82523d6000602084013e612ce6565b606091505b50600081511415612d2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d2390614139565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612d89565b600190505b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612e01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612df8906142b9565b60405180910390fd5b612e0a81612563565b15612e4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e4190614179565b60405180910390fd5b612e5660008383612b9a565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612ea69190614678565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b828054612f7e906147e1565b90600052602060002090601f016020900481019282612fa05760008555612fe7565b82601f10612fb957805160ff1916838001178555612fe7565b82800160010185558215612fe7579182015b82811115612fe6578251825591602001919060010190612fcb565b5b509050612ff49190612ff8565b5090565b5b80821115613011576000816000905550600101612ff9565b5090565b6000613028613023846144f0565b6144cb565b9050808382526020820190508285602086028201111561304b5761304a614958565b5b60005b8581101561309957813567ffffffffffffffff81111561307157613070614953565b5b80860161307e8982613342565b8552602085019450602084019350505060018101905061304e565b5050509392505050565b60006130b66130b18461451c565b6144cb565b905080838252602082019050828560208602820111156130d9576130d8614958565b5b60005b8581101561312757813567ffffffffffffffff8111156130ff576130fe614953565b5b80860161310c8982613370565b855260208501945060208401935050506001810190506130dc565b5050509392505050565b600061314461313f84614548565b6144cb565b9050808382526020820190508285602086028201111561316757613166614958565b5b60005b85811015613197578161317d888261339e565b84526020840193506020830192505060018101905061316a565b5050509392505050565b60006131b46131af84614574565b6144cb565b9050828152602081018484840111156131d0576131cf61495d565b5b6131db84828561479f565b509392505050565b60006131f66131f1846145a5565b6144cb565b9050828152602081018484840111156132125761321161495d565b5b61321d84828561479f565b509392505050565b6000813590506132348161507f565b92915050565b6000815190506132498161507f565b92915050565b60008135905061325e81615096565b92915050565b600082601f83011261327957613278614953565b5b8135613289848260208601613015565b91505092915050565b600082601f8301126132a7576132a6614953565b5b81356132b78482602086016130a3565b91505092915050565b600082601f8301126132d5576132d4614953565b5b81356132e5848260208601613131565b91505092915050565b6000813590506132fd816150ad565b92915050565b600081359050613312816150c4565b92915050565b600081359050613327816150db565b92915050565b60008151905061333c816150db565b92915050565b600082601f83011261335757613356614953565b5b81356133678482602086016131a1565b91505092915050565b600082601f83011261338557613384614953565b5b81356133958482602086016131e3565b91505092915050565b6000813590506133ad816150f2565b92915050565b6000602082840312156133c9576133c8614967565b5b60006133d784828501613225565b91505092915050565b6000602082840312156133f6576133f5614967565b5b60006134048482850161323a565b91505092915050565b6000806040838503121561342457613423614967565b5b600061343285828601613225565b925050602061344385828601613225565b9150509250929050565b60008060006060848603121561346657613465614967565b5b600061347486828701613225565b935050602061348586828701613225565b92505060406134968682870161339e565b9150509250925092565b600080600080608085870312156134ba576134b9614967565b5b60006134c887828801613225565b94505060206134d987828801613225565b93505060406134ea8782880161339e565b925050606085013567ffffffffffffffff81111561350b5761350a614962565b5b61351787828801613342565b91505092959194509250565b6000806040838503121561353a57613539614967565b5b600061354885828601613225565b9250506020613559858286016132ee565b9150509250929050565b6000806040838503121561357a57613579614967565b5b600061358885828601613225565b92505060206135998582860161339e565b9150509250929050565b6000806000606084860312156135bc576135bb614967565b5b600084013567ffffffffffffffff8111156135da576135d9614962565b5b6135e686828701613292565b935050602084013567ffffffffffffffff81111561360757613606614962565b5b613613868287016132c0565b925050604084013567ffffffffffffffff81111561363457613633614962565b5b61364086828701613264565b9150509250925092565b6000806040838503121561366157613660614967565b5b600061366f85828601613303565b925050602083013567ffffffffffffffff8111156136905761368f614962565b5b61369c85828601613342565b9150509250929050565b6000602082840312156136bc576136bb614967565b5b60006136ca84828501613318565b91505092915050565b6000602082840312156136e9576136e8614967565b5b60006136f78482850161332d565b91505092915050565b60006020828403121561371657613715614967565b5b600082013567ffffffffffffffff81111561373457613733614962565b5b61374084828501613342565b91505092915050565b60006020828403121561375f5761375e614967565b5b600082013567ffffffffffffffff81111561377d5761377c614962565b5b61378984828501613370565b91505092915050565b600080604083850312156137a9576137a8614967565b5b600083013567ffffffffffffffff8111156137c7576137c6614962565b5b6137d385828601613370565b925050602083013567ffffffffffffffff8111156137f4576137f3614962565b5b61380085828601613342565b9150509250929050565b60008060006060848603121561382357613822614967565b5b600084013567ffffffffffffffff81111561384157613840614962565b5b61384d86828701613370565b935050602061385e8682870161339e565b925050604084013567ffffffffffffffff81111561387f5761387e614962565b5b61388b86828701613342565b9150509250925092565b6000602082840312156138ab576138aa614967565b5b60006138b98482850161339e565b91505092915050565b6000806000606084860312156138db576138da614967565b5b60006138e98682870161339e565b93505060206138fa868287016132ee565b925050604061390b8682870161324f565b9150509250925092565b6000806040838503121561392c5761392b614967565b5b600061393a8582860161339e565b925050602083013567ffffffffffffffff81111561395b5761395a614962565b5b61396785828601613370565b9150509250929050565b600061397d8383613a60565b905092915050565b61398e81614702565b82525050565b600061399f826145fb565b6139a98185614629565b9350836020820285016139bb856145d6565b8060005b858110156139f757848403895281516139d88582613971565b94506139e38361461c565b925060208a019950506001810190506139bf565b50829750879550505050505092915050565b613a1281614726565b82525050565b613a2181614732565b82525050565b6000613a3282614606565b613a3c818561463a565b9350613a4c8185602086016147ae565b613a558161496c565b840191505092915050565b6000613a6b82614611565b613a75818561464b565b9350613a858185602086016147ae565b613a8e8161496c565b840191505092915050565b6000613aa482614611565b613aae818561465c565b9350613abe8185602086016147ae565b613ac78161496c565b840191505092915050565b6000613add82614611565b613ae7818561466d565b9350613af78185602086016147ae565b80840191505092915050565b60008154613b10816147e1565b613b1a818661466d565b94506001821660008114613b355760018114613b4657613b79565b60ff19831686528186019350613b79565b613b4f856145e6565b60005b83811015613b7157815481890152600182019150602081019050613b52565b838801955050505b50505092915050565b6000613b8f60258361465c565b9150613b9a8261497d565b604082019050919050565b6000613bb260148361465c565b9150613bbd826149cc565b602082019050919050565b6000613bd560328361465c565b9150613be0826149f5565b604082019050919050565b6000613bf860268361465c565b9150613c0382614a44565b604082019050919050565b6000613c1b601c8361465c565b9150613c2682614a93565b602082019050919050565b6000613c3e60378361465c565b9150613c4982614abc565b604082019050919050565b6000613c6160248361465c565b9150613c6c82614b0b565b604082019050919050565b6000613c8460198361465c565b9150613c8f82614b5a565b602082019050919050565b6000613ca760238361465c565b9150613cb282614b83565b604082019050919050565b6000613cca60208361465c565b9150613cd582614bd2565b602082019050919050565b6000613ced602c8361465c565b9150613cf882614bfb565b604082019050919050565b6000613d1060388361465c565b9150613d1b82614c4a565b604082019050919050565b6000613d33602a8361465c565b9150613d3e82614c99565b604082019050919050565b6000613d5660298361465c565b9150613d6182614ce8565b604082019050919050565b6000613d7960208361465c565b9150613d8482614d37565b602082019050919050565b6000613d9c602c8361465c565b9150613da782614d60565b604082019050919050565b6000613dbf602c8361465c565b9150613dca82614daf565b604082019050919050565b6000613de260208361465c565b9150613ded82614dfe565b602082019050919050565b6000613e0560298361465c565b9150613e1082614e27565b604082019050919050565b6000613e28601c8361465c565b9150613e3382614e76565b602082019050919050565b6000613e4b60218361465c565b9150613e5682614e9f565b604082019050919050565b6000613e6e60168361465c565b9150613e7982614eee565b602082019050919050565b6000613e9160318361465c565b9150613e9c82614f17565b604082019050919050565b6000613eb460118361465c565b9150613ebf82614f66565b602082019050919050565b6000613ed760238361465c565b9150613ee282614f8f565b604082019050919050565b6000613efa60248361465c565b9150613f0582614fde565b604082019050919050565b6000613f1d60188361465c565b9150613f288261502d565b602082019050919050565b6000613f4060198361465c565b9150613f4b82615056565b602082019050919050565b613f5f81614788565b82525050565b613f76613f7182614788565b61488d565b82525050565b613f8581614792565b82525050565b6000613f978284613ad2565b915081905092915050565b6000613fae8285613b03565b9150613fba8284613b03565b91508190509392505050565b6000613fd28285613f65565b602082019150613fe28284613ad2565b91508190509392505050565b60006020820190506140036000830184613985565b92915050565b600060808201905061401e6000830187613985565b61402b6020830186613985565b6140386040830185613f56565b818103606083015261404a8184613a27565b905095945050505050565b6000602082019050818103600083015261406f8184613994565b905092915050565b600060208201905061408c6000830184613a09565b92915050565b60006080820190506140a76000830187613a18565b6140b46020830186613f7c565b6140c16040830185613a18565b6140ce6060830184613a18565b95945050505050565b600060208201905081810360008301526140f18184613a99565b905092915050565b6000602082019050818103600083015261411281613b82565b9050919050565b6000602082019050818103600083015261413281613ba5565b9050919050565b6000602082019050818103600083015261415281613bc8565b9050919050565b6000602082019050818103600083015261417281613beb565b9050919050565b6000602082019050818103600083015261419281613c0e565b9050919050565b600060208201905081810360008301526141b281613c31565b9050919050565b600060208201905081810360008301526141d281613c54565b9050919050565b600060208201905081810360008301526141f281613c77565b9050919050565b6000602082019050818103600083015261421281613c9a565b9050919050565b6000602082019050818103600083015261423281613cbd565b9050919050565b6000602082019050818103600083015261425281613ce0565b9050919050565b6000602082019050818103600083015261427281613d03565b9050919050565b6000602082019050818103600083015261429281613d26565b9050919050565b600060208201905081810360008301526142b281613d49565b9050919050565b600060208201905081810360008301526142d281613d6c565b9050919050565b600060208201905081810360008301526142f281613d8f565b9050919050565b6000602082019050818103600083015261431281613db2565b9050919050565b6000602082019050818103600083015261433281613dd5565b9050919050565b6000602082019050818103600083015261435281613df8565b9050919050565b6000602082019050818103600083015261437281613e1b565b9050919050565b6000602082019050818103600083015261439281613e3e565b9050919050565b600060208201905081810360008301526143b281613e61565b9050919050565b600060208201905081810360008301526143d281613e84565b9050919050565b600060208201905081810360008301526143f281613ea7565b9050919050565b6000602082019050818103600083015261441281613eca565b9050919050565b6000602082019050818103600083015261443281613eed565b9050919050565b6000602082019050818103600083015261445281613f10565b9050919050565b6000602082019050818103600083015261447281613f33565b9050919050565b600060208201905061448e6000830184613f56565b92915050565b60006060820190506144a96000830186613f7c565b6144b66020830185613a18565b6144c36040830184613a18565b949350505050565b60006144d56144e6565b90506144e18282614813565b919050565b6000604051905090565b600067ffffffffffffffff82111561450b5761450a614924565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561453757614536614924565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561456357614562614924565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561458f5761458e614924565b5b6145988261496c565b9050602081019050919050565b600067ffffffffffffffff8211156145c0576145bf614924565b5b6145c98261496c565b9050602081019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600061468382614788565b915061468e83614788565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156146c3576146c2614897565b5b828201905092915050565b60006146d982614788565b91506146e483614788565b9250828210156146f7576146f6614897565b5b828203905092915050565b600061470d82614768565b9050919050565b600061471f82614768565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b838110156147cc5780820151818401526020810190506147b1565b838111156147db576000848401525b50505050565b600060028204905060018216806147f957607f821691505b6020821081141561480d5761480c6148c6565b5b50919050565b61481c8261496c565b810181811067ffffffffffffffff8211171561483b5761483a614924565b5b80604052505050565b600061484f82614788565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561488257614881614897565b5b600182019050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f496e636f7272656374206e756d626572206f662061726775656d656e7473207060008201527f6173736564000000000000000000000000000000000000000000000000000000602082015250565b7f546f6b656e20616c7265616479206d696e746564000000000000000000000000600082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f596f7572206d696e7420776f756c6420657863656564206d617820737570706c60008201527f79206f66204c6f6e67204e65636b69652046656c6c6173000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f436f6e7472616374206973206e6f7420776f7274682074686174206d7563682060008201527f7965740000000000000000000000000000000000000000000000000000000000602082015250565b7f4c6f6e67204e65636b69652046656c6c61732061726520736f6c64206f757421600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920736574206f66206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f55524920736574206f66206e6f6e6578697374656e7420746f6b656e00000000600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f496e636f7272656374207061796d656e742073656e7400000000000000000000600082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f53616c65206e6f74206c69766520796574000000000000000000000000000000600082015250565b7f596f7520617265206e6f7420746865206f776e6572206f66207468697320746f60008201527f6b656e0000000000000000000000000000000000000000000000000000000000602082015250565b7f546f6b656e55524920717565727920666f72206e6f6e6578697374656e74207460008201527f6f6b656e00000000000000000000000000000000000000000000000000000000602082015250565b7f51756572696564206e6f6e2d6578697374616e74204c4e4c0000000000000000600082015250565b7f546f6b656e20697320616c72656164792072656465656d656400000000000000600082015250565b61508881614702565b811461509357600080fd5b50565b61509f81614714565b81146150aa57600080fd5b50565b6150b681614726565b81146150c157600080fd5b50565b6150cd81614732565b81146150d857600080fd5b50565b6150e48161473c565b81146150ef57600080fd5b50565b6150fb81614788565b811461510657600080fd5b5056fea2646970667358221220f9ed75ba04c67b57cc20b337be85552c1779f408fca9e478efe1423984b3045864736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
LongNeckieFellas.sol 209 lines
// SPDX-License-Identifier: MIT
// Author: Giovanni Vignone
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
abstract contract LNL {
function ownerOf(uint256 tokenId) public virtual view returns (address);
function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256);
function balanceOf(address owner) external virtual view returns (uint256 balance);
}
contract LongNeckieFellas is ERC721, Ownable {
using Counters for Counters.Counter;
Counters.Counter private LongNeckieFellasID;
LNL private lnlConnection;
bool redeemable;
uint256 private maxsupply;
bool salelive;
uint256 private currentprice;
address private contractdeployer;
bool private metadatafrozen;
string private metadataStorage;
address private LNFVerify;
mapping(uint256 => string) private _tokenURIs;
mapping(string => bool) private _isTokenURISet;
//We may have to potentially implement a mapping(string => uint256 to ensure no multiples)
uint[3333] private isRedeemed; // 1 = yes, 0 = no
constructor(address lnlContract, address _verification) ERC721("Long Neckie Fellas", "LNF") {
maxsupply = 3333;
contractdeployer = msg.sender;
lnlConnection = LNL(lnlContract);
redeemable = true;
LNFVerify = _verification;
}
function checkValidData(string memory ipfsCID, bytes memory sig) public view returns(address){
bytes32 message = keccak256(abi.encodePacked(maxsupply, ipfsCID));
return (recoverSigner(message, sig));
}
function recoverSigner(bytes32 message, bytes memory sig) public pure returns (address)
{
uint8 v;
bytes32 r;
bytes32 s;
(v, r, s) = splitSignature(sig);
return ecrecover(message, v, r, s);
}
function splitSignature(bytes memory sig) public pure returns (uint8, bytes32, bytes32)
{
require(sig.length == 65);
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
return (v, r, s);
}
function changeSaleToPublic() public onlyOwner{
redeemable = !redeemable;
_changePrice(33000000000000000);
}
function _changePrice(uint256 updatedprice) public onlyOwner {
currentprice = updatedprice;
}
function _changeVerifyAddress(address newVerification) public onlyOwner{
LNFVerify = newVerification;
}
function changeSaleState() public onlyOwner{
salelive = !salelive;
}
function _withdraw(uint256 amountinwei, bool getall, address payable exportaddress) onlyOwner public returns (bool){
if(getall == true){
exportaddress.transfer(address(this).balance);
return true;
}
require(amountinwei<address(this).balance,"Contract is not worth that much yet");
exportaddress.transfer(amountinwei);
return true;
}
function mintAllLongNeckieFellas(string[] memory allLNF, uint256[] memory tokenURILNLs, bytes[] memory sigs)
public payable
{
require(salelive);
require(redeemable);
require(msg.sender != address(0) && msg.sender != address(this));
require(allLNF.length == tokenURILNLs.length && allLNF.length == sigs.length, "Incorrect number of arguements passed");
require(LongNeckieFellasID.current() + allLNF.length <= maxsupply-1, "Your mint would exceed max supply of Long Neckie Fellas");
for (uint256 i = 0; i< allLNF.length; i++){
require(!_isTokenURISet[allLNF[i]]);
require(lnlConnection.ownerOf(tokenURILNLs[i]) == msg.sender);
require(tokenURILNLs[i]<3333);
require(isRedeemed[tokenURILNLs[i]] == 0);
require(LNFVerify == checkValidData(allLNF[i], sigs[i]));
uint256 uniquetokenID = LongNeckieFellasID.current();
_safeMint(contractdeployer, uniquetokenID);
_safeTransfer(contractdeployer, msg.sender, uniquetokenID, "");
_setTokenURI(uniquetokenID, allLNF[i]);
_isTokenURISet[allLNF[i]] = true;
isRedeemed[tokenURILNLs[i]] = 1;
LongNeckieFellasID.increment();
}
}
function createLongNeckieFella(string memory ipfsCID, uint256 tokenURILNL, bytes memory sig)
public payable
returns (uint256)
{
require(LNFVerify == checkValidData(ipfsCID, sig));
require(_isTokenURISet[ipfsCID] == false, "Token already minted");
require(salelive, "Sale not live yet");
require(msg.value >= currentprice, "Incorrect payment sent");
require(LongNeckieFellasID.current() <= maxsupply-1, "Long Neckie Fellas are sold out!");
require(msg.sender != address(0) && msg.sender != address(this));
if(redeemable){
require(lnlConnection.ownerOf(tokenURILNL) == msg.sender, "You are not the owner of this token");
require(tokenURILNL<3333, "Queried non-existant LNL");
require(isRedeemed[tokenURILNL] == 0, "Token is already redeemed");
isRedeemed[tokenURILNL] = 1;
}
uint256 uniquetokenID = LongNeckieFellasID.current();
_safeMint(contractdeployer, uniquetokenID);
_safeTransfer(contractdeployer, msg.sender, uniquetokenID, "");
_setTokenURI(uniquetokenID, ipfsCID);
_isTokenURISet[ipfsCID] = true;
LongNeckieFellasID.increment();
return uniquetokenID;
}
//Metadata functions...
function isLongNeckieLadyRedeemed(uint _LNLTokenId) public view returns (bool){
require(_LNLTokenId<isRedeemed.length);
uint tokeninfo = isRedeemed[_LNLTokenId];
if (tokeninfo == 1){
return true;
}
return false;
}
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "TokenURI query for nonexistent token");
return string(abi.encodePacked(metadataStorage, _tokenURIs[tokenId]));
}
function changeStorageLocation(string memory url) public onlyOwner {
require(!metadatafrozen);
metadataStorage = url;
}
function _freezemetadata() onlyOwner public{
metadatafrozen = true;
//Metadata is permanently frozen once this function is called
}
function _changeMetadata(uint256 tokenId, string memory _tokenURI) onlyOwner public {
require(!metadatafrozen);
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
_isTokenURISet[_tokenURI] = true;
}
function _nextLNF() public view returns (uint256){
return LongNeckieFellasID.current();
}
function _getAllMetadata() public view returns (string[] memory){
string[] memory ret = new string[](LongNeckieFellasID.current());
for(uint i = 0; i<LongNeckieFellasID.current();i++){
ret[i] = _tokenURIs[i];
}
return ret;
}
}
Address.sol 216 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 23 lines
// SPDX-License-Identifier: MIT
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 66 lines
// SPDX-License-Identifier: MIT
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 71 lines
// SPDX-License-Identifier: MIT
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() {
_setOwner(_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 {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Counters.sol 42 lines
// SPDX-License-Identifier: MIT
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 411 lines
// SPDX-License-Identifier: MIT
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 {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev 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 {}
}
IERC721.sol 142 lines
// SPDX-License-Identifier: MIT
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 28 lines
// SPDX-License-Identifier: MIT
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 24 lines
// SPDX-License-Identifier: MIT
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 26 lines
// SPDX-License-Identifier: MIT
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);
}
IERC721Metadata.sol 26 lines
// SPDX-License-Identifier: MIT
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);
}
ERC721Enumerable.sol 162 lines
// SPDX-License-Identifier: MIT
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();
}
}
IERC721Enumerable.sol 28 lines
// SPDX-License-Identifier: MIT
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 tokenId);
/**
* @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);
}
Read Contract
_getAllMetadata 0x3bcb4a08 → string[]
_nextLNF 0x831617c8 → uint256
balanceOf 0x70a08231 → uint256
checkValidData 0x9c14bda9 → address
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
isLongNeckieLadyRedeemed 0x16751816 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
recoverSigner 0x97aba7f9 → address
splitSignature 0xa7bb5803 → uint8, bytes32, bytes32
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
_changeMetadata 0xfe706836
uint256 tokenId
string _tokenURI
_changePrice 0x708c3263
uint256 updatedprice
_changeVerifyAddress 0xb3944375
address newVerification
_freezemetadata 0x0bc766a2
No parameters
_withdraw 0x03163d55
uint256 amountinwei
bool getall
address exportaddress
returns: bool
approve 0x095ea7b3
address to
uint256 tokenId
changeSaleState 0xdd9c1f23
No parameters
changeSaleToPublic 0xcccba79e
No parameters
changeStorageLocation 0x3432f491
string url
createLongNeckieFella 0x40ae3fd5
string ipfsCID
uint256 tokenURILNL
bytes sig
returns: uint256
mintAllLongNeckieFellas 0x2ac0aa9f
string[] allLNF
uint256[] tokenURILNLs
bytes[] sigs
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
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address