Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Blockchain Development for Finance Projects

You're reading from   Blockchain Development for Finance Projects Building next-generation financial applications using Ethereum, Hyperledger Fabric, and Stellar

Arrow left icon
Product type Paperback
Published in Jan 2020
Publisher Packt
ISBN-13 9781838829094
Length 530 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Ishan Roy Ishan Roy
Author Profile Icon Ishan Roy
Ishan Roy
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Blockchain Payments and Remittances
2. Blockchain in Financial Services FREE CHAPTER 3. Building a Blockchain Wallet for Fungible and Non-Fungible Assets 4. Designing a Payment Gateway for Online Merchants 5. Corporate Remittances and Settlement 6. Enabling Cross-Border Remittances with Real-Time KYC/AML Verification 7. Section 2: Blockchain Workflows Using Smart Contracts
8. Building a Letter of Credit Workflow Module Using Smart Contracts 9. Section 3: Securing Digital Documents and Files Using Blockchain
10. Building a Tamper-Proof Document Storage System 11. Section 4: Decentralized Trading Exchanges Using Blockchain
12. Building a Decentralized Trading Exchange 13. Developing a Currency Trading Exchange for Market Making 14. Looking into the Future 15. Other Books You May Enjoy Appendix: Application Checklist

Creating a USD token for accounting

We need to create a USD currency token that will be used by us, simply for accounting purposes. In an enterprise application, this token will act as a dummy asset, mapped one to one to the actual funds owned by the bank. In our system, we'll use it to represent the funds allocated by the bank to the LC escrow account and track the movement of funds across the banking system.

Let's start writing our ERC20 smart contract, which will be used to issue and distribute this token, by following these steps:

  1. Start by creating the USD.sol file. We first declare the compiler version, as shown in the following code snippet:
pragma solidity ^0.5.2;
  1. Next, import the contracts that we need to create our ERC20 token, as follows:
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
import "openzeppelin-solidity...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime