An Ethereum Dapp for tracking the authenticity of sugar
To run the test first start a local node
truffle develop
Then in another terminal run the tests
truffle test
To deploy the smart contracts run
truffle develop
truffle(develop)> migrate
To start the frontend server run
npm run dev
- Input the UPC and press the fetch data button to get the product information.
- Input the farm name, farm information, longitude, latitude and product notes, then press the Harvest button to change the product state to harvested.
- Press the Send to Mill button to change the product state to sent to mill.
- Press the Receive from Farm to change the product tate to received by mill.
- Press the Mill button to change the product state to milled.
- Press the Send to Refinery button to change the product state to send to refinery.
- Press the Receive from Mill button to change the product state to received by refinery.
- Press the Refine button to change the product state to refined.
- Press the Pack button to change the product state to packed.
- Input the price to distributor and press the Sell to Distributor button to change the product state to for sale to distributor.
- Press the Buy button to change the product state to bought by distributor.
- Press the Send to Retailer button to change the product state to sent to retailer.
- Press the Receive from Distributor button to change the product state to received by retailer.
- Input the price to consumer and press the Sell to Consumer button to change the product state to for sale to consumer.
- Press the Buy button to change the product state to bought by consumer.
- Input an address and press one of the buttons to add a role to the address.
- Contract address on Goerli Testnet: 0xb25C0E0300084E7Ac34786B9316ce6d37cdD26EF
- Transaction ID: 0x2144eefb009cca0fb19dbd23e23b49166d6b3eb87aaa01e64636d73cac05e8da
- @truffle/contract: used for connecting to the smart contracts in the frontend
- @truffle/hdwallet-provider: used for connecting to Infura and deploying to the testnet
- web3: used for interacting with smart contracts
- dotenv: used for storing secrets in an .env file
IPFS is not used in this project
- Node 16.13.2
- Truffle 5.6.9
- Web3 1.8.1