solidityerc20bep20

What if we don't emit event in smartcontract


In ERC20 interface, there are 2 events to be implemented. ​

event Transfer(address indexed from, address indexed to, uint256 value);

event Approval(address indexed owner, address indexed spender, uint256 value);

What if we actually implement transfer and approve functions but never emit the events. Will transaction still appear on bscscan or etherscan, or will it be a quiet transaction that only transactor knows?


Solution

  • BscScan and EtherScan use the Transfer() event to update their statistics of token holders and to display amount of tokens transfered in the transaction detail page.

    If you don't emit the event, it

    But the contract would still transfer the tokens, and Etherscan would still show the transaction detail page (just without the tokens data).