<!-- tempo-docs-context -->
> Source: [/docs/guide/issuance/create-a-stablecoin](https://tempo.xyz/developers/docs/guide/issuance/create-a-stablecoin.md)
> Section: [Tempo EVM](https://tempo.xyz/developers/docs/development.md). Build on Tempo EVM: wallets and keys, transactions and fees, TIP-20 Tokens, contracts, exchange, network details, nodes, protocol specifications, and changelog.
> [Documentation index](https://tempo.xyz/developers/llms.txt) · [Docs skill](https://tempo.xyz/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.xyz/developers/llms.txt) and Markdown pages directly.

# How to create a TIP-20 stablecoin

Create a stablecoin using [TIP-20 Tokens](https://tempo.xyz/developers/docs/protocol/tip20/overview). Set its name and symbol, and choose the administrator that manages its roles and supply. The examples use Moderato testnet.

## Create a token from your backend

Use the [funded test account and Viem client](https://tempo.xyz/developers/docs/guide/payments/send-a-payment#send-from-your-backend) from the payment guide. The connected account becomes the token administrator.

```ts [create-token.ts]
import { client } from './viem.config'

const { token, receipt } = await client.token.createSync({
  name: 'Demo USD',
  symbol: 'DEMO',
  currency: 'USD',
})

console.log({ token, transactionHash: receipt.transactionHash })
```

Creation deploys the token; follow [Mint stablecoins](https://tempo.xyz/developers/docs/guide/issuance/mint-stablecoins) to grant the issuer role and mint supply. The browser walkthrough below implements the same creation operation with Wagmi.

## Stablecoin creation demo

Connect a test account and deploy a token on Moderato.

**Interactive demo: Create a Stablecoin**

1. Connect
2. Add funds
3. Create token

Source: [tempoxyz/examples/tree/main/examples/issuance](https://github.com/tempoxyz/examples/tree/main/examples/issuance)

## Stablecoin creation steps

::::steps
### Set up Wagmi for stablecoin creation

Ensure that you have set up your project with Wagmi, a Tempo chain config, and a wallet connector:

* [Connection details](https://tempo.xyz/developers/docs/quickstart/connection-details)
* [TypeScript SDK](https://tempo.xyz/developers/docs/sdk/typescript)
* [Wallet integration](https://tempo.xyz/developers/docs/quickstart/wallet-developers)

<span id="add-testnet-funds-for-deployment" />

### Fund the test account

Use the [Moderato faucet](https://tempo.xyz/developers/docs/quickstart/faucet) to add AlphaUSD for transaction fees. For mainnet, [fund your account](https://tempo.xyz/developers/docs/guide/getting-funds) through a supported deposit path.

**Interactive demo: Add Funds**

1. Add funds

:::code-group
```tsx twoslash [AddFunds.ts]
// @noErrors
import { Hooks } from 'wagmi/tempo'
import { useConnection } from 'wagmi'

export function AddFunds() {
  const { address } = useConnection()
  const addFunds = Hooks.faucet.useFund()

  return (
    <button
      onClick={() => { if (address) addFunds.mutate({ account: address }) }}
      disabled={!address || addFunds.isPending}
    >
      Add Funds
    </button>
  )
}
```

```tsx twoslash [config.ts] filename="config.ts"
// @noErrors
import { tempoModerato } from 'viem/chains'
import { createConfig, http } from 'wagmi'
import { tempoWallet } from 'wagmi/connectors'

export const config = createConfig({
  connectors: [tempoWallet()],
  chains: [tempoModerato],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoModerato.id]: http(),
  },
})
```
:::

### Add stablecoin form fields

Add form fields for the token name and symbol.

**Interactive demo: Create Form**

1. Add funds
2. Create token

:::code-group
```tsx twoslash [CreateStablecoin.tsx]
// @noErrors
export function CreateStablecoin() {
  return (
    <div>
      <form
        onSubmit={(event) => {
          event.preventDefault()
          const formData = new FormData(event.target as HTMLFormElement)
          const name = formData.get('name') as string
          const symbol = formData.get('symbol') as string
        }}
      >
        <input type="text" name="name" placeholder="demoUSD" required />
        <input type="text" name="symbol" placeholder="DEMO" required />
        <button type="submit">
          Create
        </button>
      </form>
    </div>
  )
}
```

```tsx twoslash [config.ts] filename="config.ts"
// @noErrors
import { tempoModerato } from 'viem/chains'
import { createConfig, http } from 'wagmi'
import { tempoWallet } from 'wagmi/connectors'

export const config = createConfig({
  connectors: [tempoWallet()],
  chains: [tempoModerato],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoModerato.id]: http(),
  },
})
```
:::

### Add stablecoin deployment logic

Now that we have some input fields, we need to add some logic to handle the submission of the form to create the stablecoin.

After this step, your users will be able to create a stablecoin by clicking the "Create" button!

Tokens can also carry an optional on-chain [`logoURI`](https://tempo.xyz/developers/docs/protocol/tip20/spec#logo-uri) that wallets and explorers read directly from the token contract. It's set on the token contract and is independent of this creation flow; for the recommended format, use a square, rasterized PNG or WebP. The URI string, not the image, is limited to 256 bytes and must use the `https`, `http`, `ipfs`, or `data` scheme.

:::warning
The `currency` field is **immutable** after token creation and affects fee payment eligibility, DEX routing, and quote token pairing. See [Currency Declaration](https://tempo.xyz/developers/docs/protocol/tip20/overview#currency-declaration) for guidelines on choosing the right value. **Only `USD` stablecoins can be used to pay transaction fees on Tempo.**
:::

**Interactive demo: Create Form**

1. Create token

:::code-group
```tsx twoslash [CreateStablecoin.tsx]
import { Hooks } from 'wagmi/tempo' // [!code ++]

// @noErrors
export function CreateStablecoin() {
  const create = Hooks.token.useCreateSync() // [!code ++]

  return (
    <div>
      <form
        onSubmit={(event) => {
          event.preventDefault()
          const formData = new FormData(event.target as HTMLFormElement)
          const name = formData.get('name') as string
          const symbol = formData.get('symbol') as string
          create.mutate({ // [!code ++]
            name, // [!code ++]
            symbol, // [!code ++]
            currency: 'USD', // [!code ++]
          }) // [!code ++]
        }}
      >
        <input type="text" name="name" placeholder="demoUSD" required />
        <input type="text" name="symbol" placeholder="DEMO" required />
        <button type="submit">
          Create
        </button>
      </form>
    </div>
  )
}
```

```tsx twoslash [config.ts] filename="config.ts"
// @noErrors
import { tempoModerato } from 'viem/chains'
import { createConfig, http } from 'wagmi'
import { tempoWallet } from 'wagmi/connectors'

export const config = createConfig({
  connectors: [tempoWallet()],
  chains: [tempoModerato],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoModerato.id]: http(),
  },
})
```
:::

### Add stablecoin creation success state

Now that users can submit the form and create a stablecoin, let's add a basic success state to display
the name of the stablecoin and a link to the transaction receipt.

:::code-group
```tsx twoslash [CreateStablecoin.tsx]
import { Hooks } from 'wagmi/tempo' 

// @noErrors
export function CreateStablecoin() {
  const create = Hooks.token.useCreateSync() 

  return (
    <div>
      <form
        onSubmit={(event) => {
          event.preventDefault()
          const formData = new FormData(event.target as HTMLFormElement)
          const name = formData.get('name') as string
          const symbol = formData.get('symbol') as string
          create.mutate({ 
            name, 
            symbol, 
            currency: 'USD', 
          }) 
        }}
      >
        <input type="text" name="name" placeholder="demoUSD" required />
        <input type="text" name="symbol" placeholder="DEMO" required />
        <button type="submit" disabled={create.isPending}>
          {create.isPending ? 'Creating…' : 'Create'}
        </button>
      </form>

      {create.error && <p role="alert">{create.error.message}</p>}
      {create.data && ( // [!code ++]
        <div> {/* [!code ++] */}
          {create.data.name} created successfully! {/* [!code ++] */}
          <a href={`https://explore.testnet.tempo.xyz/tx/${create.data.receipt.transactionHash}`}> {/* [!code ++] */}
            View receipt {/* [!code ++] */}
          </a> {/* [!code ++] */}
        </div> {/* [!code ++] */}
      )} {/* [!code ++] */}
    </div>
  )
}
```

```tsx twoslash [config.ts] filename="config.ts"
// @noErrors
import { tempoModerato } from 'viem/chains'
import { createConfig, http } from 'wagmi'
import { tempoWallet } from 'wagmi/connectors'

export const config = createConfig({
  connectors: [tempoWallet()],
  chains: [tempoModerato],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoModerato.id]: http(),
  },
})
```
:::

### Next steps after creating a stablecoin

Now that you have created your first stablecoin, you can now:

* [Add your token to the Token List](https://tempo.xyz/developers/docs/quickstart/tokenlist#adding-a-new-token) so it appears in wallets, explorers, and other apps on Tempo
* learn the [Best Practices](#stablecoin-creation-best-practices) below
* follow a guide on how to [mint](https://tempo.xyz/developers/docs/guide/issuance/mint-stablecoins) and [more](https://tempo.xyz/developers/docs/guide/issuance/manage-stablecoin) with your stablecoin.
::::

## Stablecoin creation best practices

### Stablecoin creation loading state

Disable the form's submit button while `create.isPending` is true. The complete form above uses the same `useCreateSync` mutation for submission and pending state.

### Stablecoin creation error handling

Display `create.error.message` beside the form when creation fails. Keep the form available so the user can correct the inputs and retry.

## Stablecoin creation learning resources

* [TIP-20 Tokens](https://tempo.xyz/developers/docs/protocol/tip20/overview) — Learn more about TIP-20 tokens on Tempo
