Skip to main content
. 2022 Sep 5;11(17):2716. doi: 10.3390/foods11172716
Algorithms A5. Smart Contract 5: Adulteration Check
Input: product id, batch number, order number, product quantity, addr
1. if addr is valid && addr has adding authentication
2. addProduct_Adulteration_Info(product id, batch number, order number, product quantity)
3. x= getProduct_Adulteration_Info(product id)
4. if x==1
5. No adulterants found in the product
6. stage_sypplychain[]= getProduct_Status(product id)
7. updateProduct_Info(product id, batch number, order number, stage_sypplychain.name,1)
8. end
9. else
10. Product comprises of adulterants
11. y=addProduct_Nutrition_Info(product id)
12. stage_sypplychain= getProduct_Status(product id)
13. updateProduct_Info(product id, y, batch number, order number, stage_sypplychain.name,1)
14. Initiate execution of Remove Product smart contract
15. end
16. end
17. else
18. Invalid or authorised address
19. go to step 1 and enter a valid address
20. end