ERC-20: Fungible Token Standard
The canonical Ethereum standard for fungible tokens — currencies, stablecoins, governance tokens, LP tokens. Six methods plus two events that wallets, exchanges, and DeFi protocols depend on.
Required Interface
| Method | Returns | Purpose |
|---|---|---|
name / symbol / decimals | metadata | Token identification |
totalSupply() | uint256 | Total tokens in circulation |
balanceOf(address) | uint256 | Account balance |
transfer(address,uint256) | bool | Move tokens to recipient |
approve(address,uint256) | bool | Authorize a spender |
allowance(address,address) | uint256 | Read approved allowance |
transferFrom(address,address,uint256) | bool | Spend on behalf of owner |
Events: Transfer(from,to,value), Approval(owner,spender,value).
Authorization Model
ERC-20 uses msg.sender + approve/allowance: to let another contract spend your tokens, you grant an allowance, then the spender calls transferFrom. This pattern is the source of well-known vulnerabilities (infinite-approval drains, approve front-running).
Neo Equivalent: NEP-17
NEP-17 simplifies and hardens the model: 4-parameter transfer(from, to, amount, data) with witness-based authorization, no approve/allowance in the core spec, and an onNEP17Payment callback that recipients implement to accept tokens.
Live on Neo TestNet
Both implementations are deployed on Neo N3 TestNet (network magic 894710606).
| Implementation | TestNet Address | Contract Hash | Deploy Tx |
|---|---|---|---|
Solidity (neo-solc) | NZbQsZAbH3eBdZZYShj6CgG1ZkVEbjZhwF | 0xd76434af829dc4c936c12648aa77932fa94c0f96 | 0x37897c9d…85be43e |
Neo C# (nccs) | NRGNZQRrb5TuDo4fA5KPiqZQB29Uybp1zJ | 0x1f3a9b414de1c60434543dd8a05ac5e08b75b43a | (re-used from earlier deploy) |
Cross-implementation invocations match: symbol, decimals, totalSupply, balanceOf, plus a write op (faucet for Solidity / _deploy initial mint for C#) — same values on both. Source pairs and assertion runner under docs/standards-mirror/deployments/erc-20/.
