EVM -> Solana

ERC20 on Solana: The Token Program

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.

Ethereum
ERC20 contract
One contract per token.
Code
transfer, approve, transferFrom
Storage
Name, symbol, decimals, balances, allowances
Solana
Token Program
Deployed once, shared by every token
owns
Mint account
Supply, decimals, authorities
Token account
Alice's balance
Token account
Bob's balance
An ERC20 contract holds every balance. 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:

Bash
spl-token create-token
spl-token create-account <MINT_ADDRESS>
spl-token mint <MINT_ADDRESS> 100
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.

ERC20
name(), symbol()
Solana
Token metadata
Read the name and symbol from the token's metadata, stored in a Metaplex metadata account or on the mint with the metadata extension.
ERC20
decimals()
Solana
Mint account field
Read decimals from the mint account.
ERC20
totalSupply()
Solana
Mint account field
Read supply from the mint account.
ERC20
balanceOf()
Solana
Token account amount
Derive 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.
ERC20
transfer()
Solana
TransferChecked
Move tokens between two token accounts of the same mint. The owner signs.
ERC20
approve()
Solana
ApproveChecked
Set one delegate and a delegated amount on a token account.
ERC20
transferFrom()
Solana
TransferChecked signed by the delegate
The delegate signs the same transfer instruction and spends from its delegated amount.
ERC20
allowance()
Solana
Token account fields
Read 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.

TypeScript
import { address, createSolanaRpc } from "@solana/kit";
import {
  fetchMint,
  findAssociatedTokenPda,
  TOKEN_PROGRAM_ADDRESS,
} from "@solana-program/token";

const rpc = createSolanaRpc("https://api.devnet.solana.com");
const mint = address("<MINT_ADDRESS>");
const owner = address("<WALLET_ADDRESS>");

// decimals() and totalSupply()
const { data } = await fetchMint(rpc, mint);
console.log(data.decimals, data.supply);

// balanceOf(owner)
const [tokenAccount] = await findAssociatedTokenPda({
  owner,
  mint,
  tokenProgram: TOKEN_PROGRAM_ADDRESS,
});
const { value } = await rpc.getTokenAccountBalance(tokenAccount).send();
console.log(value.amount);

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:

TypeScript
import { fetchMetadataFromSeeds } from "@metaplex-foundation/mpl-token-metadata-kit";

// name() and symbol()
const metadata = await fetchMetadataFromSeeds(rpc, { mint });
console.log(metadata.data.name, metadata.data.symbol);

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.

01
Derive the token accounts
Compute the sender's and recipient's associated token accounts from each owner and the mint.
02
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.
03
Transfer
Add TransferChecked, which verifies the mint and decimals before it moves tokens.
04
Send one transaction
Both instructions succeed or fail together.
A token transfer to a new holder.
TypeScript
const [source] = await findAssociatedTokenPda({
  owner: sender.address,
  mint,
  tokenProgram: TOKEN_PROGRAM_ADDRESS,
});
const [destination] = await findAssociatedTokenPda({
  owner: recipient,
  mint,
  tokenProgram: TOKEN_PROGRAM_ADDRESS,
});

const instructions = [
  // Creates the recipient's token account only if it does not exist yet.
  getCreateAssociatedTokenIdempotentInstruction({
    payer: sender,
    ata: destination,
    owner: recipient,
    mint,
  }),
  getTransferCheckedInstruction({
    source,
    mint,
    destination,
    authority: sender,
    amount: 1_000_000n, // 1 token with 6 decimals
    decimals: 6,
  }),
];
Amounts are in base units
Instructions 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.
TypeScript
const approve = getApproveCheckedInstruction({
  source, // the sender's token account
  mint,
  delegate, // address allowed to spend
  owner: sender, // the token account owner signs the approval
  amount: 1_000_000n,
  decimals: 6,
});

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 mint
Most 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

© 2026 Solana Foundation. Tutti i diritti riservati.
ERC20 on Solana: The Token Program | Solana