Skip to content
On Ethereum, every ERC20 token is its own contract. On Solana, a shared token program runs every fungible token, and a new token is a new account. This guide maps each ERC20 function to its Solana equivalent.

​How tokens work on Solana

ERC20 is an interface. Each token deploys a contract that implements it and stores every holder’s balance in that contract. Solana takes the opposite approach: the Token Program is deployed once, and it stores each token and each balance in separate accounts.
On Ethereum, an ERC20 contract holds every balance.On Ethereum, an ERC20 contract holds every balance.

On Ethereum, an ERC20 contract holds every balance.

On Solana, the Token Program keeps each balance in its own account.On Solana, the Token Program keeps each balance in its own account.

On Solana, the Token Program keeps each balance in its own account.

Three account types replace the contract:
  • A mint account represents one token. Its address, the mint address, identifies the token the way a contract address does on Ethereum. It stores the supply, the decimals, and the mint and freeze authorities.
  • A token account holds one owner’s balance of one mint.
  • An associated token account (ATA) is a token account at an address derived from the owner, the mint, and the mint’s token program, so anyone can compute where a wallet holds a given token.
Solana has two token programs. The original Token Program covers minting, transfers, and delegates. The Token Extensions Program, also called Token-2022, includes the same instructions and adds optional features per mint.

​Create a token

You create a token by sending transactions to the Token Program. You write no contract and deploy nothing. With the spl-token CLI, three commands create a mint, create your token account, and mint 100 tokens:
Terminal
StepEthereum (ERC20)Solana (Token Program)
Write the tokenWrite or import a Solidity contract, often from OpenZeppelin.Nothing to write. The Token Program is already deployed.
DeployCompile and deploy the contract. The contract address identifies the token.Create a mint account. The mint address identifies the token.
Mint supplyCall the constructor or a mint function.The mint authority sends a mint instruction to a token account.
ReceiveAny address can hold a balance in the contract’s storage.The recipient needs a token account for the mint. The sender can create it in the same transaction.
Change behaviorUpgrade through a proxy or deploy a new contract.Enable extensions when you create the mint, or write a separate program.
AuditEach token contract needs its own review.Every token runs one of two audited token programs. A transfer hook program is custom code and needs its own review.

​ERC20 functions on Solana

Each ERC20 function maps to a field you read from an account or an instruction you send to the Token Program.
ERC20SolanaHow it maps
name(), symbol()Token metadataRead the name and symbol from the token’s metadata, stored in a Metaplex metadata account or on the mint with the metadata extension.
decimals()Mint account fieldRead decimals from the mint account.
totalSupply()Mint account fieldRead supply from the mint account.
balanceOf()Token account amountDerive the owner’s associated token account for the mint and read its amount. A missing account means a balance of 0. To include other token accounts the owner holds, use getTokenAccountsByOwner.
transfer()TransferCheckedMove tokens between two token accounts of the same mint. The owner signs.
approve()ApproveCheckedSet one delegate and a delegated amount on a token account.
transferFrom()TransferChecked signed by the delegateThe delegate signs the same transfer instruction and spends from its delegated amount.
allowance()Token account fieldsRead delegate and delegated_amount from the token account.

​Read token data

ERC20 view functions become account reads. Fetch the mint account for the decimals and supply, and fetch the owner’s associated token account for the balance. This example uses @solana/kit and @solana-program/token with a mint under the original Token Program. For a Token Extensions mint, pass that program’s address as tokenProgram. The mint account’s owner tells you which program it uses.
The name and symbol are not fields of the mint. A token stores them in one of two places: a Metaplex Token Metadata account linked to the mint, or the metadata extension on a Token Extensions mint. For a mint that uses Metaplex metadata:

​Transfer tokens

A transfer moves tokens from the sender’s token account to the recipient’s token account. Both accounts must exist, so a transfer to a new holder usually carries two instructions in one transaction.
1

Derive the token accounts

Compute the sender’s and recipient’s associated token accounts from each owner and the mint.
2

Create the recipient's account

Add an idempotent create instruction. It does nothing if the account exists. If it does not, the payer funds the rent deposit, a refundable SOL balance that pays for the account’s storage.
3

Transfer

Add TransferChecked, which verifies the mint and decimals before it moves tokens.
4

Send one transaction

Both instructions succeed or fail together.
Amounts are in base unitsInstructions take integer amounts in the token’s smallest unit. For a mint with 6 decimals, 1 token is 1_000_000n. See Transfer tokens for the code that signs and sends the transaction.

​Approvals and delegates

Solana has an approval model, and you need it less often. An ERC20 flow such as a swap takes an approve transaction followed by a call that runs transferFrom. On Solana, the user signs the transaction that calls the program, and that signature lets the program transfer from the user’s token account in the same transaction, so most flows need no standing allowance. When another address must spend later, for example a subscription or an escrow, approve it as a delegate:

ERC20 allowance

  • One allowance per owner and spender, with any number of spenders.
  • Stored in the token contract.
  • Unlimited approvals are common and stay active until revoked.

Solana delegate

  • One delegate and one delegated amount per token account.
  • Stored on the token account.
  • A new approval replaces the previous delegate and amount.
The owner, or the delegate itself, removes a delegate with the Revoke instruction. If a program needs custody across several users, hold the tokens in a token account owned by a program-derived address (PDA), an address that only the program can sign for, instead of collecting delegations.

​Beyond ERC20: Token Extensions

ERC20 projects add features by editing the contract. On Solana, the Token Extensions Program ships common features as options you enable on a mint:
Choose extensions before you create the mintMost extensions cannot be added after an account is initialized. Decide which ones the token needs up front.

​Tradeoffs

ERC20: A contract per token

  • Each token can change any behavior in its own code.
  • Integrators must check that each contract follows the interface.
  • Every new token is a deployment, and custom logic needs an audit.
  • Indexing all tokens means tracking many contracts.

Token Program: Shared programs for every token

  • Tokens share one instruction set, so a basic integration works with any mint.
  • A new token is a transaction, not a deployment.
  • Custom behavior is limited to extensions or a separate program. Integrators check which extensions a mint uses, because transfer fees, transfer hooks, and a permanent delegate change how transfers behave.
  • Each holder needs a token account per mint, funded with a rent deposit.

​Next steps