Where are my tokens ???

(or please use the Transfer event when minting tokens)

Dave Appleton
hellogold
Published in
3 min readJul 11, 2017

--

Normally, whenever ERC20 tokens are transferred or created, the block explorers will show that the token transfer took place.

Token transfer indicated

It seems that in a number of crowd-sales recently have had the contributors examining the transactions on Etherscan.io and clamouring to ask why their tokens were not being allocated.

No token transfers shown

This seems to have taken its rise from a few crowd-sale contracts that have taken the BAT contracts as the gold standard.

RAW log information from DDF’s CreateDDF(address indexed _to, uint256 _value) event

The BAT crowd-sale (BAToken.sol) and vesting (BASafe.sol) contracts are, indeed nicely written but they have one small problem. On allocating new tokens, they do not call the Transfer event, instead preferring to call a custom event CreateBAT which leave log information but is not interpreted by the block explorers.

The CreateBAT call in BAToken.sol

Since ERC20 standards do not actually specify which event (if any) should be called when allocating tokens this is not an error but it does mean that the transaction log on etherscan.io or ethplorer.io gives no indication that the coins have been allocated and ICO teams have been frantically fielding questions from furious depositors who want to know why their tokens were not allocated automatically. It takes time to refer each depositor to the Read Contract page on etherscan.io and ask them to query the balanceOf field.

Checking your balance

A chat with Matthew Tan of Etherscan.io indicated that they were aware of the situation and would be implementing changes to look at custom events in verified contracts but this may not happen immediately.

Conclusion

If you are holding a crowd-sale, base your contract on the BAT token but do not want to have to field these questions, please call the Transfer event instead of a custom create event.

--

--

Dave Appleton
hellogold

HelloGold's blockchain lead and Senior Advisor at Akomba Labs; a technology anachronism who codes, teaches, mentors and consumes far too much caffeine.