Skip to main content
Create a fiat-backed token with one call to the B20 Factory, using the STABLECOIN variant. Decimals are fixed at 6, and the token carries an immutable, self-declared currency code such as USD. The type is sealed into the token address at creation and cannot change.

Demo

The demo uses a local browser-generated account to submit real transactions on Base Vibenet. If Vibenet or its B20 features are unavailable, it automatically switches to an illustrative offline version.
New to B20? See the B20 Token Standard for the concepts and a full launch walkthrough. These samples target base-std@be6d045, viem@2.55.11, and Base Foundry v1.1.1.

How the Stablecoin Variant Works

Passing STABLECOIN to createB20 writes discriminant byte 0x01 into position [10] of the token address. After the call returns:
  • decimals() returns 6 (hardcoded; you do not pass a decimals value).
  • currency() returns the immutable code you provided (for example "USD"). B20 checks the format only, not that the code is a real currency.
  • The IB20Stablecoin surface is live at that address.
  • Asset-only selectors (announce, updateUIMultiplier, batchMint) do not execute on this address.
The currency field is required and must be uppercase ASCII A to Z only. An empty code reverts MissingRequiredField; any other byte reverts InvalidCurrency.

Create and Verify the Stablecoin

The params blob is ABI-encoded with a leading version byte (currently 1) as B20StablecoinCreateParams: version, name, symbol, initialAdmin, and currency. Optional initCalls run on the new token in the same transaction; the factory drops access after they complete. See the B20 token standard for the complete interface, roles, and policies.
The factory emits B20Created, and the returned token address is ready for minting.
B20 tokens are open by default. Configure roles, policies, and the supply cap during creation before issuing value.

See Also

Mint Supply

Increase circulating supply.

Restrict Who Can Hold It

Allowlist eligible holders.