Reader small image

You're reading from  Security Tokens and Stablecoins Quick Start Guide

Product typeBook
Published inApr 2019
Reading LevelBeginner
PublisherPackt
ISBN-139781838551063
Edition1st Edition
Languages
Concepts
Right arrow
Authors (3):
Weimin Sun
Weimin Sun
author image
Weimin Sun

Weimin Sun has 20 years' of experience working in the financial industry. He has worked for top-tier investment and commercial banks such as J.P. Morgan, Bank of America, Citibank, and Morgan Stanley, where he also managed large teams for developing IT applications. Weimin has also held corporate titles such as executive director and senior VP in some of these firms. Weimin has in-depth knowledge of the blockchain technology, data science, data architecture, data modeling, and big data platforms. He holds Ph.D, M.B.A and M.Sc degrees. He has co-authored Blockchain Quick Start Guide and published several statistical journal papers.
Read more about Weimin Sun

Xun (Brian) Wu
Xun (Brian) Wu
author image
Xun (Brian) Wu

Xun (Brian) Wu is a senior blockchain architect and consultant. With over 20 years of hands-on experience across various technologies, including Blockchain, big data, cloud, AI, systems, and infrastructure, Brian has worked on more than 50 projects in his career. He has authored nine books, which have been published by O'Reilly, Packt, and Apress, focusing on popular fields within the Blockchain industry. The titles of his books include: Learn Ethereum (First Edition), Learn Ethereum (Second Edition), Blockchain for Teens, Hands-On Smart Contract Development with Hyperledger Fabric V2, Hyperledger Cookbook, Blockchain Quick Start Guide, Security Tokens and Stablecoins Quick Start Guide, Blockchain by Example, and Seven NoSQL Databases in a Week.
Read more about Xun (Brian) Wu

Angela Kwok
Angela Kwok
author image
Angela Kwok

Angela Kwok, is a lawyer, specializing in high-tech and blockchain start-ups and venture capital financing. She also focuses on general corporate and commercial matters, fund formation, cross-border and domestic investments, mergers and acquisitions, and related tax matters in the TMT industry. She has represented clients in blockchain-related cases.
Read more about Angela Kwok

View More author details
Right arrow

Developing and testing a security token smart contract

As we discussed in the previous section, the ERC-1404 standard adds two more functions by extending ERC20 to enforce transfer restrictions—detectTransferRestriction and messageForTransferRestriction:

  • messageForTransferRestriction returns a human-readable message for a given restriction code. The user can know why a transaction is restricted.
  • The detectTransferRestriction function returns a non-zero value if the receiver address is not in the whiteList addresses, and the transaction needs to be reverted. The function needs to be executed by the token issuer.

Next, let's start to write our token and implement these functions.

Other important ERC-1404 functions are adding an address to a whitelist, verifying a whitelist, and so on.
...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Security Tokens and Stablecoins Quick Start Guide
Published in: Apr 2019Publisher: PacktISBN-13: 9781838551063

Authors (3)

author image
Weimin Sun

Weimin Sun has 20 years' of experience working in the financial industry. He has worked for top-tier investment and commercial banks such as J.P. Morgan, Bank of America, Citibank, and Morgan Stanley, where he also managed large teams for developing IT applications. Weimin has also held corporate titles such as executive director and senior VP in some of these firms. Weimin has in-depth knowledge of the blockchain technology, data science, data architecture, data modeling, and big data platforms. He holds Ph.D, M.B.A and M.Sc degrees. He has co-authored Blockchain Quick Start Guide and published several statistical journal papers.
Read more about Weimin Sun

author image
Xun (Brian) Wu

Xun (Brian) Wu is a senior blockchain architect and consultant. With over 20 years of hands-on experience across various technologies, including Blockchain, big data, cloud, AI, systems, and infrastructure, Brian has worked on more than 50 projects in his career. He has authored nine books, which have been published by O'Reilly, Packt, and Apress, focusing on popular fields within the Blockchain industry. The titles of his books include: Learn Ethereum (First Edition), Learn Ethereum (Second Edition), Blockchain for Teens, Hands-On Smart Contract Development with Hyperledger Fabric V2, Hyperledger Cookbook, Blockchain Quick Start Guide, Security Tokens and Stablecoins Quick Start Guide, Blockchain by Example, and Seven NoSQL Databases in a Week.
Read more about Xun (Brian) Wu

author image
Angela Kwok

Angela Kwok, is a lawyer, specializing in high-tech and blockchain start-ups and venture capital financing. She also focuses on general corporate and commercial matters, fund formation, cross-border and domestic investments, mergers and acquisitions, and related tax matters in the TMT industry. She has represented clients in blockchain-related cases.
Read more about Angela Kwok