The ERC721 standard has mainly three events, Transfer, Approval, and ApprovalForAll. These events are emitted from the different function calls of the ERC721 implementation, as we have seen in the ERC721 implementation section. For example, the _mint() function triggers the Transfer event upon successful execution of the function.
The Transfer event is triggered when any token-transfer-related function is called. However, for approvals, there are two types of approval an owner can give:
- Single Token Approval: The owner of the token gives approval for a single NFT to another address. This triggers the Approval event.
- Operator Approval: The owner can give access to all of the tokens they own to an operator. This triggers the ApprovalForAll event.
As the blockchain is a series of transactions, the events are also stored along with the transaction...