4

EIP-777 came out in late 2017 and yet many projects still use ERC20 token standard. The only one I've heard of using ERC777 was UNI which was hacked because the attacker was able to set how the tokensToSend function was called and by whom.

Anyway, I see the mint, burn, and send/receive hooks as rather useful and instead of trying to re-invent the wheel by developing this functionality in an ERC20 based Dapp was thinking that ERC777 should just be used rather than ERC20.

If you take a look at the Ethereum Token Standards, they simply list ERC20 as one of the most "popular" but never refer to it as "best practice".

2
3

As you mentioned, ERC777 has send/receive hooks. These hooks allow for a number of neat features, however they open the door for reentrancy attacks. This is the same type of attack that drained the DAO (using ETH).

I believe the reason ERC777 is not widely used is because some smart contract developers do not defend against token reentrancy. Most contracts are created with the assumption that tokens cannot be reentrant, and ERC777 breaks this assumption.

2
  • 1
    Thanks Shane. Do you have any good link/tips on how to defend against token reentrancy? – B537B7725DC58715F6E6BFA7AFC20C Mar 31 at 20:45
  • Yea I think the best way to learn would be to study what happened to The DAO. Here is one great resource! – Shane Fontaine Mar 31 at 22:40

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.