Creating an LC smart contract

The LC smart contract will serve as an interface for the LC Master contract so that we can create and deploy a new contract. The smart contract will consist of the following components:

  • Data structure
    • LCNew: To capture and store the LC details
  • Functions
    • viewLCDetails: To view the LC details
    • settleLC: To invoke a settlement request to the LC
  • Modifiers
    • onlyAuth: Only permits buyer, seller, and the bank to access to the method
    • onlySeller: Only permits the seller to access the method
  • Event
    • SettleLCSuccessful: Triggered after a successful settlement request

Now, let's start creating the LC smart contract by following these steps:

  1. Start by creating a file called LC.sol.
  2. We will first declare the compiler ...

Get Blockchain Development for Finance Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.