Skip to main content
Technical reference for the custom stablecoin. The source code is available on GitHub at coinbase/custom-stablecoin. For code examples and common workflows, see Quickstart and Examples.

Overview

Each custom stablecoin is an ERC-20 token that extends the standard with additional capabilities:Your stablecoin’s contract address is provided during onboarding. See Key Addresses for the testnet CBTUSD address.
Coinbase may update the stablecoin implementation over time. Your contract address does not change on update, and the public interface described below remains stable.

ERC-20 functions

transfer

Transfers amount tokens from the caller to to.Failure scenarios:

transferFrom

Transfers amount tokens from from to to, deducting from the caller’s allowance.Failure scenarios:

approve

Sets the caller’s allowance for spender to amount.Failure scenarios:

balanceOf

Returns the token balance of account.

totalSupply

Returns the total token supply currently in circulation.

allowance

Returns the remaining number of tokens spender is allowed to transfer on behalf of owner.

decimals

Returns the number of decimal places used for token amounts (between 6 and 18, set at deployment).

name

Returns the token name (set at deployment).

symbol

Returns the token symbol (set at deployment).

Memo functions

These functions attach a 32-byte memo to a transfer. The Memo event is emitted immediately after the ERC-20 Transfer event. Memos are useful for correlating on-chain transactions with off-chain order IDs, payment references, or other business records.
Memo values are permanently visible on the public blockchain. Do not include sensitive information such as customer names, account numbers, or PII. If you need to attach sensitive data, encrypt it off-chain before encoding it as bytes32 and decrypt it off-chain when reading the event. Use only non-sensitive references (such as a hashed or opaque order ID) as the on-chain memo value.

transferWithMemo

Transfers amount from the caller to to with a memo.

transferFromWithMemo

Transfers amount from from to to with a memo, deducting from the caller’s allowance.

ERC-2612 Permit

Permit allows a token holder to authorize a spender using an off-chain EIP-712 signature, so the spender can pull tokens without the holder sending a prior approval transaction.

permit

Sets spender’s allowance for owner to value, validated by an EIP-712 signature signed by owner.Failure scenarios:

nonces

Returns the current ERC-2612 nonce for owner. This is a sequential counter — increment after each permit call.

DOMAIN_SEPARATOR

Returns the EIP-712 domain separator for this contract. Most signing libraries compute this automatically from name(), "1" (version), chainId, and the contract address — you rarely need to call this directly.

ERC-3009 Transfer with authorization

ERC-3009 meta-transactions let a token holder sign a time-bounded transfer authorization. Any party can submit the transaction on-chain. Nonces are random 32-byte values (not sequential) to support multiple concurrent authorizations.ERC-3009 vs ERC-2612 Permit — when to use each:

transferWithAuthorization

Executes a transfer from from to to validated by a signed authorization. The authorization must be signed by from. Anyone may submit the transaction.Failure scenarios:

receiveWithAuthorization

Same parameters as transferWithAuthorization, but msg.sender must equal to. This prevents front-running by restricting submission to the intended recipient.

cancelAuthorization

Voids an unused authorization nonce. The authorizer must sign a CancelAuthorization message. Once canceled, the nonce cannot be used for a transfer.

authorizationState

Returns true if the authorization nonce has been used or canceled.

View functions

isBlocklisted

Returns true if account is on the blocklist. Blocklisted addresses cannot be the sender, recipient, or msg.sender of any transfer or approval.

contractURI

Returns the contract-level metadata URI (ERC-7572). The URI typically points to a JSON file containing the token’s name, symbol, and image.

supportsInterface

Returns true for ERC-20 (0x36372b07), ERC-2612 (0x9d8ff7da), and all inherited interfaces.

Safety controls

Custom stablecoins include two safety mechanisms managed by Coinbase. These are transparent on-chain — your integration should handle them gracefully.

Blocklist

Specific addresses can be blocked from sending or receiving tokens. Any transfer involving a blocklisted address will revert with AddressBlocklisted(account). You can check blocklist status before sending with isBlocklisted(address).

Pause

All token transfers can be paused in an emergency. Any transfer attempted while paused will revert with EnforcedPause(). Monitor the Paused and Unpaused events to detect state changes.

Events


Errors


Quickstart

Get up and running in 10 minutes

Examples

Code samples for transfers, permit, and ERC-3009

Key Addresses

Contract and mint addresses

Overview

Learn about Custom Stablecoins