Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Blockchain Development for Finance Projects

You're reading from  Blockchain Development for Finance Projects

Product type Book
Published in Jan 2020
Publisher Packt
ISBN-13 9781838829094
Pages 530 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Ishan Roy Ishan Roy
Profile icon Ishan Roy

Table of Contents (17) Chapters

Preface 1. Section 1: Blockchain Payments and Remittances
2. Blockchain in Financial Services 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 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 version and import our dependent contracts, as shown in the following code block:
pragma solidity ^0.5.2;

import "openzeppelin...
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 $15.99/month. Cancel anytime}