Skip to content

robinsjules/SupplyChainOps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Smart contract for partial supply chain operations

This is a smart contract that manages businesses' inventory systems and tracks order shipment and delivery done by couriers to customers. The code implements only a partial segment of the supply chain and focuses more on the logistical aspect.

Deployment

In order to deploy the smart contract, it is assumed that you have a MetaMask wallet connected to a test network such as Mumbai.

Step-by-step guide:

  1. Open the SupplyChainOps.sol file in Remix IDE.
  2. Using the Solidity Complier, compile the smart contract file.
  3. In the Deploy & Run Transactions tab, use Remix VM (Shanghai) as the environment. Use your account and leave the default gas limit as is.
  4. Press Deploy.

You have now successfully compiled and deployed the smart contract. Now, we will move on to the test cases in order to run transactions.

Running transactions

Here are a few ways to test the smart contract:

1. addProduct & getProductQuantity
First, add a product in the inventory by using the addProduct function. The productId can be set to 123 while quantity can be set to 50. Press transact to run this transaction. The terminal will show you if the transaction was successful. You should face no errors with this! You can also check if the function worked by using the getProductQuantity function. Input 123 as the productId and press call. The output will display 50 in the terminal.

2. placeOrder
The placeOrder function allows you to order 1 quantity for a product. Simply input which productId you would like to order.

For future applications

  • Update Product Details: Aside from the addProduct function, an update function would be useful in case of wrong intial inputs (i.e., misspelling).
  • Product Categorization: A feature to categorize products, enabling better organization and filtering options within the inventory. This could include adding categories or tags to products and allowing users to search or filter products based on these categories.
  • Email Notifications: To improve the LowSupplyNotification event, implement an actual notification system to business owners through Chainlink Functions or similar.
  • Front-end Interface: The application would be user-friendly if a user interface were implemented using JavaScript frameworks.

    Some functions are in the midst of being debugged due to transactions being reverted to their initial states.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages