Supply Chain Dapp
Get full transparency over the products that you intend on purchasing. From its origin and to the stage where it gets shipped to you, view the whole path/journey the product has taken.
Demo
About
The problem it solves As a consumer, we are worried about the quality of products available at the retail store, their origin, etc. For example, when we buy fruits, vegetables, eggs, meat, it would be really helpful to know the origin source of the product and how old it is. Also, the intermediaries in the supply chain have to ensure the products that they’re getting from their precedents in the chain are upto the mark. We have used the immutability and traceability of blockchain to stimulate a supply chain model which can help all the players in the supply chain to access the history of the product upto that player right from its inception. Basically, this encapsulates the various stages of transformations that the product had to go through before the final product became available. Eg: Final product: Cotton Shirt. The chain would start right from the farmer growing the cotton for that shirt. The intermediary nodes in the chain would include spinning and knitting, dyeing, printing, logistics, and retail. Like every single transformation involved in the process until the final product (Shirt, in this case) is available at the retail store.
How it's made
Challenges we ran into Smart Contract Challenges: The biggest challenge was to ideate the whole supply chain in terms of graph incorporating the transformations the product goes through at various stages. We were first thinking of ERC20 tokens for transfer without graphs. But the problem there is that it involves direct transfer of material from one person to another. Take a case where a person who manufactures cloth will take raw material from 5 different places. Now this transfer logic can’t be implemented using ERC20 as it is transferred as a whole from one person to the other. Mapping in solidity has a few restrictions which we ran into while implementing the logic of our app. Like we can’t access the keys of the mapping, so we can’t directly send the mapping to the frontend. Hence, we had to use an alternate approach there. Frontend Challenges: The biggest challenge on the frontend side was to fetch data from blockchain and convert it into javascript data structures. As it was our first time using Ethers.js to interact with the blockchain, it was a roller coaster ride to get comfortable using it. We didn’t know we could use events in solidity to return the value from transactional function calls. But as soon as we got to know that, we implemented it after a thorough research.