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:
- Start by creating a file called LC.sol.
- We will first declare the compiler version and import our dependent contracts, as shown in the following code block:
pragma solidity ^0.5.2;
import "openzeppelin...