Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Security Tokens and Stablecoins Quick Start Guide

You're reading from   Security Tokens and Stablecoins Quick Start Guide Learn how to build STO and stablecoin decentralized applications

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781838551063
Length 234 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Weimin Sun Weimin Sun
Author Profile Icon Weimin Sun
Weimin Sun
Xun (Brian) Wu Xun (Brian) Wu
Author Profile Icon Xun (Brian) Wu
Xun (Brian) Wu
Angela Kwok Angela Kwok
Author Profile Icon Angela Kwok
Angela Kwok
Arrow right icon
View More author details
Toc

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 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 $19.99/month. Cancel anytime
Banner background image