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.