2
votes

I am trying to create a smart contract for renting things [any items ] I want the items to be an ERC 721 token . From what I read ,to implement ERC 721 tokens I need implement the ERC721 class from the open zepplin library.

So the token contract will have things like tokenId ,should I just use my carId instead ,because I want Each token to represent a car.

1

1 Answers

3
votes

Your use-case is exactly what ERC-721 is for. By using ERC-721, every physical item (a car in your case) can become a non-fungible token on the blockchain. Non-fungible tokens are unique, one-of-a-kind assets on the blockchain where every token is identified with a unique ID (yes, use carId as tokenId).

There are many implementations available. I'd recommend https://github.com/0xcert/ethereum-erc721 implementation which is also listed on the official ERC-721 EIP page https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. Just for the record, I'm also one of the authors. There's a nice example https://github.com/0xcert/ethereum-erc721#usage which you can leverage to cover your use-case.