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
Security Tokens and Stablecoins Quick Start Guide

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

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781838551063
Pages 234 pages
Edition 1st Edition
Languages
Concepts
Authors (3):
Weimin Sun Weimin Sun
Profile icon Weimin Sun
Xun (Brian) Wu Xun (Brian) Wu
Profile icon Xun (Brian) Wu
Angela Kwok Angela Kwok
Profile icon Angela Kwok
View More author details

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 €14.99/month. Cancel anytime}