Writing the contract

Now, let's start writing our LC Master smart contract, which will contain the components we discussed in the previous section, as follows:

  1. Create a file called LCMaster.sol.
  2. Let's start writing the contract. We first need to define the version of the Solidity compiler we'll be using, as shown in the following code snippet:
pragma solidity ^0.5.2;
  1. Next, we import our dependent contracts, like this:
import "./LC.sol";import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
  1. Since our contract transfers the USD ERC20 token, we implement the ERC20Interface by importing ERC20.sol from OpenZeppelin. This allows us to access the methods of the USD token contract from the LC Master contract. LC.sol is the interface ...

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.