This repo is part of my thesis and contains 3 smart contracts: Shipment Manager, ContainerNFT and AuctionNFT.
In the shipping process, every container is represented using an NFT. This makes it easier in ownership transfer and cargo history traceability, easier cargo auctioning, and secure shipping documentaion.
Process flow steps:
- The contract addresses are set.
- Shipper places a shipment request using requestShipment() function.
- Shipping agent approves the required documents and assigns a shipping container number to the request. This is done when the agent books a container pickup for the cargo approveShipmentRequest() function.
- Using the assigned container number, the shipper mints a container nft to his address. The metadata of the NFT is created with the following format in json and stored in IPFS.
Metadata Template
{
shipping container Number:
shipment owner:
shipment receiver:
origin:
destination:
shipment content:
shipper company:
image:
other related Documents link (if necessary)
shipment traits: []
}
- The shipper approves the manager contract to manage the ownership transfers of the NFT using the approveOperator from ContainerNFT SC.
- The shipping agent issues Bill of Lading, and stores it in IPFS using the issueBoL() function, while transferring the NFT ownership to the pickup truck's address at the same time.
- The cargo is transported and the ownership transfer record is updated using the safeTransferFrom() function in ContainerNFT SC as the physical container is handed off from one transported to the next.
- Upon reaching the destination, the receiver places a claim request providing the BoL link using claimCargo().
- The documents required for cargo release are approved by a shipping agent and/or customs using claimCargoDocumentsApproval().
- Then the cargo is released to the receiver by transferring the ownership to the receiver (The last transporter -> receiver using safeTransfefrFrom()).
- The receiver sends a notice to auction the cargo.
- The last transporter approves the manager smart contract to manage the NFT using approveOperator() function from ContainerNFT SC.
- The agent approves the auction while also transferring the NFT to the AuctionNFT SC using the approveAuction() function.
- The agent can then invoke the start() function from the AuctionNFT SC to start the auction.
- The shipping agent sets the starting bid amount, and auction duration and auctions the cargo.
- After the auction ends, the cargo ownership is transferred to the highest bidder using the end() function from the AuctionNFT SC.
NB. The auction sc is operated by the agent.
Final: The token can be burn using the ContainerNFT SC if the receiver or bidder deem it necessay.