How it works
The CELO ERC-20 contract keeps no balances of its own.balanceOf returns the account’s native balance, and transfer and transferFrom trigger a native transfer through a contract built into the chain (a precompile) that only the CELO token can call. The token duality specification gives the precompile’s address, parameters and gas cost.
The Registry, the on-chain directory of Celo’s core contracts, lists the CELO ERC-20 contract as GoldToken. Core Contracts gives the Registry and GoldToken addresses on each network.
Why it matters on Celo
An account has one CELO balance that both interfaces read and change, so unlike ETH and WETH there is nothing to wrap or unwrap. Wallets and apps can use native transfers, the ERC-20 interface, or both, and they see the same balance either way.Resources
Related
- Token duality specification - the transfer precompile’s address, parameters and gas cost
- Core Contracts - where to find the CELO ERC-20 contract on each network
- Celo for Ethereum developers - why tracking CELO balances means following native transfers as well as ERC-20
Transferevents