-
-
Home page with XDC network selection
-
Connecting wallet
-
Creating a new XDC FreightContract
-
Confirming contract deploy
-
Logo
-
Images uploaded to IPFS
-
Initial item metadata
-
QR code
-
QR code for the item can be printed and attached physically.
-
Recipient can update each item with new images. These updates are saved to the item's specific XDC contract.
-
Successful update
-
Example deployed contract. Update transactions are listed
-
About page
-
Contract code snippet showing freight update contract method
Blockfreight
Blockfreight is a XDC blockchain product tracking platform for any parcel.
Generate unique blockchain-backed QR codes that can either be presented or placed on the cargo of interest.
Built for the XDC Defi 2022 hackathon.
Supports both testnet and mainnet contract deployments.
Demo video: https://youtu.be/kPAAVL1GLqo
Deployed with mainnet here url: https://blockfreight.surge.sh/create
Going after the best ported Dapp to XDC prize category and designed to work as a light blockchain-based package tracking platform similar to apps like Flexport.
Motivation
Often excel spreadsheets that track the history of inventory and deliveries are shared via email.
For those vendors using existing software platforms (such as Flexport), much of the data is only held centrally within those platforms, subject to custom terms and conditions, and modifiable by their internal teams. Also often need to have a formal app B2B subscription plan.
Other common challenges that occur outside of platforms can include limitations from the non-universal nature of email (emails are private between sender and recipient), delays might not be accurately or consistently reported, and products might be lost.
Using XDC smart contracts, Blockfreight can:
- Enable an immutable, append-only, history of interactions with given parcels.
- Create a permission framework (optional) that enforces only certain wallets or user accounts can log events against a given item.
- Store the data in a transparent way for all parties, where no single party has to be the custodian of the data log.
- Perform low cost, high volume, and fast transactions.
Technologies used
XDC: Serves as the primary smart contract network for the Blockfreight application. XDC enables fast and low cost smart contract transactions that make it easy to use Blockfreight in the field without heavy additional costs or time delays.
IPFS: Record keeping and storage. IPFS is used as the backend for the QR code scanning data lookup and enables uploading new images of the cargo at different checkpoints or if the status of the item has changed visibly during transit (ex: item experienced damage). Notes uploaded are also saved to the contract.
Every completed freight update via the QR code emits a FreightEvent that gets indexed and appended to the parcel's contract.
emit FreightEvent(_requestId, lastSender, lat, lng, notes, _location);
Useful links
- Hardhat: https://hardhat.org/tutorial/writing-and-compiling-contracts
- Hackathon: https://chainlinkfall2022.devpost.com/
- Common supply chain / shipping problems: https://www.bluecart.com/blog/common-shipping-issues
Running the app
Define the follow environment variables.
REACT_APP_STORAGE_KEY= // Your web3.storage key (for file storage).
REACT_APP_ACTIVE_CHAIN_ID= // 51 or 50 currently for xdc testnet or mainnet (defaults to mainnet).
yarn; yarn start
Blockfreight should now be running on port 3000.
Potential future work
- Add subscription costs for creating different record types, auditing, and organization permissioning.
- Enable data export of blockchain logs to more native or traditional formats such as excel or pdf.
- Add support for user logins in addition to metamask (or wallet-based) logins.
Home page

See full information on the github here: https://github.com/cbonoz/xdcfa22
Built With
- ethers
- ipfs
- react
- web3
- xdc

Log in or sign up for Devpost to join the conversation.