January 2020
Intermediate to advanced
530 pages
11h 11m
English
Let's begin writing the orderbook smart contract with the functions that we discussed in the previous section:
pragma solidity ^0.5.2;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
Importing the ERC20 contract allows our smart contract to transfer the Gold and USD ERC20 tokens to and from the trader's Ethereum accounts, using the Transfer method in the ERC20 contract.
contract Orderbook {using SafeMath for uint;
We also use the using keyword to declare that we'll be ...
Read now
Unlock full access