Book Image

Security Tokens and Stablecoins Quick Start Guide

By : Weimin Sun, Xun (Brian) Wu, Angela Kwok
Book Image

Security Tokens and Stablecoins Quick Start Guide

By: Weimin Sun, Xun (Brian) Wu, Angela Kwok

Overview of this book

The failure of initial coin offerings (ICOs) is no accident, as most ICOs do not link to a real asset and are not regulated. Realizing the shortcomings of ICOs, the blockchain community and potential investors embraced security token offerings (STOs) and stablecoins enthusiastically. In this book, we start with an overview of the blockchain technology along with its basic concepts. We introduce the concept behind STO, and cover the basic requirements for launching a STO and the relevant regulations governing its issuance. We discuss U.S. securities laws development in launching security digital tokens using blockchain technology and show some real use cases. We also explore the process of STO launches and legal considerations. We introduce popular security tokens in the current blockchain space and talk about how to develop a security token DApp, including smart contract development for ERC1404 tokens. Later, you'll learn to build frontend side functionalities to interact with smart contracts. Finally, we discuss stablecoin technical design functionalities for issuing and operating STO tokens by interacting with Ethereum smart contracts. By the end of this book, you will have learned more about STOs and gained a detailed knowledge of building relevant applications—all with the help of practical examples.
Table of Contents (9 chapters)

Writing Dapp web components

We just deployed our ERC1404 security token contract to the Ganache network. In this section, we will write the UI code to interact with the smart contact.

Ethereum provides the web3.js JavaScript API, which can connect to a local or remote blockchain node through HTTP or an Interprocess Communication (IPC) protocol. The API provides methods that allow a web client to interact with the Ethereum network.

The MetaMask Chrome extension is a very popular Ethereum browser tool that can provide a user-friendly interface; you can connect to a local or a remote blockchain environment and interact with a smart contract in the blockchain. If you have MetaMask installed, you can call it by using the following code:

  if (typeof web3 !== 'undefined') { 
    // Provided a web3 instance is provided already by Meta Mask. 
    App.web3Provider = web3.currentProvider...