As everything becomes more digital, there's a need to replicate the properties of physical items like scarcity, uniqueness, and proof of ownership.
This repository digitalizes the physical products like shoes, cars etc. using blockchain technology
Contract (NFT.sol )
This contract is extended ERC721.
- Ownership is managed through the uniqueID and metadata that no other token can replicate
- NFTs are minted through smart contracts that assign ownership and manage the transferability of the NFT's
NFTs give the ability to assign or claim ownership of any unique piece of digital data, trackable by using Ethereum's blockchain as a public ledger.
Following informations are stored in NFT metadata file:
- Brand name
- Product Id
- Images associated to the product
- Manufacturer Name
- Manufacturer Location
- Upload Date and time
- Description about the product
Install the dependencies using:
npm install
The contract can be deployed using the script at deploy.js with command
node scripts/deploy.js
The NFT can be minted using the script at web3storage.js with following modifications.
- Change contract address
const contractAddress = "0x9a0CDaD1066D648F10FE96a2F92eaa87048bC71b";
- Make a
details.json
with product information - Make a
.env
file with keys likePVT_KEY
,ROPSTEN
node url,MUMBAI
node url,PUBLIC_KEY
,WEB3STORAGE_TOKEN
,MORALIS_KEY
node scripts/web3storage.js
Details from the NFT can be retrieved using the script at retrieve.js with following changes:
- Change contract address
const contractAddress = "0x9a0CDaD1066D648F10FE96a2F92eaa87048bC71b";
with deployed contract - Change chain
const chain="mumbai"
. - Enter the token id information
const tokenID = 4;
node scripts/retrieve.js