ERC-777: Token Standard With Hooks
ERC-777 was an attempt to fix ERC-20's biggest ergonomics issue — tokens sent to a contract that wasn't expecting them get stuck. It adds tokensReceived and tokensToSend hooks, registered via the ERC-1820 registry, plus an operator model decoupled from amount-based allowances.
The Catch
ERC-777 introduced a serious re-entrancy footgun: the recipient's tokensReceived hook runs during the transfer, before balance updates are finalized in some implementations. imBTC and Lendf.Me both lost ~$25M each in April 2020 to re-entrancy attacks via ERC-777 hooks. Most projects today avoid ERC-777 for this reason.
Neo Equivalent: NEP-17 + NEP-27 (Designed Right)
NEP-17's standard transfer is the ERC-777 equivalent — without the hazard. The recipient callback onNEP17Payment(from, amount, data) fires after the sender balance is debited and the recipient balance is credited. Re-entry into the token contract during the callback cannot double-spend because state is already final.
Live on Neo TestNet
Both implementations are deployed on Neo N3 TestNet (network magic 894710606).
| Implementation | Contract Hash | Deploy Tx |
|---|---|---|
Solidity (neo-solc) | 0xd0f1fb49a76b1e6aaf63cf2e2e132607950e5e7d | 0x3b71ed0a…fb3fe |
Neo C# (nccs) | 0x0d64d453a705033c2698de7a4de9e5fd934b2849 | 0x2072ca9f…25da73 |
Cross-implementation invocations match on symbol, decimals, balanceOf / getOwner. Source pairs under docs/standards-mirror/deployments/erc-777/.
