3

I am wondering if its possible a holder to have negative balances as reported by Etherscan. Bellow are the links for the cases that I spotted:

How reliable is for applications that keep track of historical ERC20 token balances based on just ERC20's Transfer events and querying balanceOf for a given address? Does make sense to have negative balances at some point of time?

3

Etherscan is a closed source block explorer so we can speculate only about their behavior.

From WETH contract no transfer event is generated when minting new tokens.

function deposit() public payable {
    balanceOf[msg.sender] += msg.value;
    Deposit(msg.sender, msg.value);  // <--- Desposit event it is not Transfer
}

From the ERC20 specs there's no standard event for minting tokens. Most projects use Transfer(address(0), target, amount).

If Etherscan relies only on Transfer events it might have wrong accounting when a contract mint their own tokens.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.