Skip to main content

ERC-20 interaction

Standard ERC-20 contracts work on Sei without modification. This page shows the common read and write operations with viem and ethers.

Try it: deploy an ERC-20

Compile and deploy a real ERC-20 to Sei Testnet from the browser. The Remix sandbox preloads an OpenZeppelin-based DemoToken. Then use the read and write patterns below with your deployed address. First, add Sei Testnet to your wallet: In Remix, compile the contract on the Solidity Compiler tab. Then deploy it from the Deploy & Run tab with Environment set to Injected Provider - MetaMask.

Setup

Reading token metadata

Reading balances and allowances

Transferring tokens

Approving a spender

Watching transfer events

Fetching historical transfers

CosmWasm token compatibility

CW20 tokens on Sei have ERC-20 pointer contracts that expose the standard ERC-20 interface. You can use all of the patterns above with a CW20 pointer address. To look up the pointer address, see Pointer Contracts.