August 2019
Intermediate to advanced
486 pages
13h 52m
English
The Approval event must be triggered on any successful call to the approve() function, even if the approval call is made for a zero amount. The zero value approval is also valid and can be given to an address to revoke approvals that had been given to someone prior to this.
In the new updated ERC20 implementations of OpenZeppelin, the Approval event is triggered even when the allowed balance is changed while executing the transferFrom() function. We will look into the new implementation of ERC20 in Chapter 9, Deep Dive into the OpenZeppelin Library.
The Approval event in the Solidity contract must be defined as follows:
event Approval(address indexed owner, address indexed spender, uint256 value);
The event takes the following ...