Code Monkey home page Code Monkey logo

container-nft's Introduction

Container-NFT

This repo is part of my thesis and contains 3 smart contracts: Shipment Manager, ContainerNFT and AuctionNFT.

Thesis Part-II

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:

  1. The contract addresses are set.
  2. Shipper places a shipment request using requestShipment() function.
  3. 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.
  4. 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: []
  }

  1. The shipper approves the manager contract to manage the ownership transfers of the NFT using the approveOperator from ContainerNFT SC.
  2. 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.
  3. 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.

If the receiver decides to claim the Cargo

  1. Upon reaching the destination, the receiver places a claim request providing the BoL link using claimCargo().
  2. The documents required for cargo release are approved by a shipping agent and/or customs using claimCargoDocumentsApproval().
  3. Then the cargo is released to the receiver by transferring the ownership to the receiver (The last transporter -> receiver using safeTransfefrFrom()).

If the receiver decides to abandon/auction the Cargo

  1. The receiver sends a notice to auction the cargo.
  2. The last transporter approves the manager smart contract to manage the NFT using approveOperator() function from ContainerNFT SC.
  3. The agent approves the auction while also transferring the NFT to the AuctionNFT SC using the approveAuction() function.
  4. The agent can then invoke the start() function from the AuctionNFT SC to start the auction.
  5. The shipping agent sets the starting bid amount, and auction duration and auctions the cargo.
  6. 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.

container-nft's People

Contributors

fairouzk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.