<!-- tempo-docs-context -->
> Source: [/docs/guide/issuance/mint-stablecoins](https://tempo.com/developers/docs/guide/issuance/mint-stablecoins.md)
> Section: [Tempo EVM](https://tempo.com/developers/docs/development.md). Build on Tempo EVM: wallets and keys, payments, transactions and fees, TIP-20 Tokens, contracts, exchange, network details, nodes, protocol specifications, and changelog.
> [Documentation index](https://tempo.com/developers/llms.txt) · [Docs skill](https://tempo.com/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.com/developers/llms.txt) and Markdown pages directly.

# How to mint TIP-20 stablecoins

Mint tokens to a recipient using an account with the issuer role. These examples use a token created on Moderato testnet.

## Separate token supply from issuance and redemption

Minting increases token supply; burning decreases it. Reserve funding and fiat redemptions happen offchain, so keep the approved request, token operation, and bank movement as separate records.

For each operation, record the network, token contract, amount in base units, signing account, request ID, transaction hash, and outcome. Before retrying after a timeout, check whether the original transaction landed; a repeated mint creates more supply.

A TIP-20 role authorizes contract calls, not regulatory approval. The [GENIUS Act guide](https://tempo.com/developers/docs/resources/guides/genius-act) covers the U.S. framework, and [payment reconciliation](https://tempo.com/developers/docs/resources/guides/payment-reconciliation) covers payment records.

## Stablecoin minting steps

::::steps
### Create the stablecoin to mint

Follow [Create a Stablecoin](https://tempo.com/developers/docs/guide/issuance/create-a-stablecoin) to deploy your token.

### Grant the stablecoin issuer role

Assign the issuer role to the address that will mint tokens. Minting requires the **`ISSUER_ROLE`**.

**Interactive demo: Grant Issuer Role**

1. Connect
2. Add funds
3. Create or load token
4. Grant token roles

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

:::code-group
```tsx twoslash [GrantIssuerRole.tsx]
import React from 'react'
import { Hooks } from 'wagmi/tempo'
import { useQueryClient } from '@tanstack/react-query'

// @noErrors
export function GrantIssuerRole() {
  const queryClient = useQueryClient()
  const tokenAddress = '0x...' // Your token address
  const issuerAddress = '0x...' // Address to grant the issuer role

  const grant = Hooks.token.useGrantRolesSync({ // [!code hl]
    mutation: { // [!code hl]
      onSettled() { // [!code hl]
        queryClient.refetchQueries({ queryKey: ['hasRole'] }) // [!code hl]
      }, // [!code hl]
    }, // [!code hl]
  }) // [!code hl]

  const handleGrantIssuer = async () => { // [!code hl]
    await grant.mutate({ // [!code hl]
      token: tokenAddress, // [!code hl]
      roles: ['issuer'], // [!code hl]
      to: issuerAddress, // [!code hl]
      feeToken: '0x20c0000000000000000000000000000000000001', // [!code hl]
    }) // [!code hl]
  } // [!code hl]

  return (
    <button // [!code hl]
      disabled={grant.isPending} // [!code hl]
      onClick={handleGrantIssuer} // [!code hl]
      type="button" // [!code hl]
    > {/* [!code hl] */}
    {grant.isPending ? 'Granting...' : 'Grant Issuer Role'} {/* [!code hl] */}
    </button> {/* [!code hl] */}
  )
}
```

```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(),
  },
})
```
:::

### Mint stablecoins to a recipient

Use the issuer role to mint within the supply cap and the token’s transfer-policy rules.

**Interactive demo: Mint Tokens**

1. Connect
2. Add funds
3. Create or load token
4. Grant token roles
5. Mint token

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

:::code-group
```tsx twoslash [MintToken.tsx]
import React from 'react'
import { Hooks } from 'wagmi/tempo'
import { useConnection } from 'wagmi'
import { parseUnits, toHex } from 'viem'
import { useQueryClient } from '@tanstack/react-query'

// @noErrors
export function MintToken() {
  const { address } = useConnection()
  const queryClient = useQueryClient()
  const tokenAddress = '0x...' // Your token address
  const [recipient, setRecipient] = React.useState<string>('')
  const [memo, setMemo] = React.useState<string>('')

  const { data: metadata } = Hooks.token.useGetMetadata({ // [!code hl]
    token: tokenAddress, // [!code hl]
  }) // [!code hl]

  const mint = Hooks.token.useMintSync({ // [!code hl]
    mutation: { // [!code hl]
      onSettled() { // [!code hl]
        queryClient.refetchQueries({ queryKey: ['getBalance'] }) // [!code hl]
      }, // [!code hl]
    }, // [!code hl]
  }) // [!code hl]

  const handleMint = () => { // [!code hl]
    if (!tokenAddress || !recipient || !metadata) return // [!code hl]
    mint.mutate({ // [!code hl]
      amount: parseUnits('100', metadata.decimals), // [!code hl]
      to: recipient as `0x${string}`, // [!code hl]
      token: tokenAddress, // [!code hl]
      memo: memo ? toHex(memo, { size: 32 }) : undefined, // [!code hl]
      feeToken: '0x20c0000000000000000000000000000000000001', // [!code hl]
    }) // [!code hl]
  } // [!code hl]

  return (
    <>
      <div>
        <label>Recipient address</label>
        <input
          type="text"
          value={recipient}
          onChange={(e) => setRecipient(e.target.value)}
          placeholder="0x..."
        />
      </div>
      <div>
        <label>Memo (optional)</label>
        <input
          type="text"
          value={memo}
          onChange={(e) => setMemo(e.target.value)}
          placeholder="INV-12345"
        />
      </div>
      <button // [!code hl]
        disabled={!address || mint.isPending} // [!code hl]
        onClick={handleMint} // [!code hl]
        type="button" // [!code hl]
      > {/* [!code hl] */}
      {mint.isPending ? 'Minting...' : 'Mint'} {/* [!code hl] */}
      </button> {/* [!code hl] */}
    </>
  )
}
```

```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(),
  },
})
```

```solidity [Solidity]
TIP20 token = TIP20(0x20c0000000000000000000000000000000000004);

// Mint 1,000 tokens to the treasury (USD has 6 decimals)
address treasuryAddress = 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef;
token.mint(treasuryAddress, 1_000_000_000);

// Mint with a memo for tracking
token.mintWithMemo(
  treasuryAddress,
  1_000_000_000,
  keccak256("Q1_2024_TREASURY_ALLOCATION")
);
```

```rust [Rust]
use alloy::{
    primitives::{address, keccak256, U256},
    providers::ProviderBuilder,
};
use tempo_alloy::{TempoNetwork, contracts::precompiles::ITIP20};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let provider = ProviderBuilder::new_with_network::<TempoNetwork>()
        .connect(&std::env::var("RPC_URL").expect("No RPC URL set"))
        .await?;

    let token = ITIP20::new( // [!code focus]
        address!("0x20c0000000000000000000000000000000000004"), // [!code focus]
        &provider, // [!code focus]
    ); // [!code focus]

    let treasury_address = address!("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); // [!code focus]

    // Mint 1,000 tokens to the treasury (USD has 6 decimals)
    token // [!code focus]
        .mint(treasury_address, U256::from(1_000_000_000)) // [!code focus]
        .send() // [!code focus]
        .await? // [!code focus]
        .get_receipt() // [!code focus]
        .await?; // [!code focus]

    // Mint with a memo for tracking
    token // [!code focus]
        .mintWithMemo( // [!code focus]
            treasury_address, // [!code focus]
            U256::from(1_000_000_000), // [!code focus]
            keccak256("Q1_2024_TREASURY_ALLOCATION"), // [!code focus]
        ) // [!code focus]
        .send() // [!code focus]
        .await? // [!code focus]
        .get_receipt() // [!code focus]
        .await?; // [!code focus]

    println!("Tokens minted successfully"); // [!code focus]

    Ok(())
}
```
:::
::::

## Stablecoin minting recipes

### Burn stablecoins

To decrease supply, burn tokens from your own balance. Burning requires the **`ISSUER_ROLE`** and sufficient balance in the caller's account.

**Interactive demo: Burn Your Token**

1. Connect
2. Add funds
3. Create or load token
4. Grant token roles
5. Mint token
6. Burn token

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

:::code-group
```tsx twoslash [BurnToken.tsx]
import React from 'react'
import { Hooks } from 'wagmi/tempo'
import { useConnection } from 'wagmi'
import { parseUnits, toHex } from 'viem'
import { useQueryClient } from '@tanstack/react-query'

// @noErrors
export function BurnToken() {
  const { address } = useConnection()
  const queryClient = useQueryClient()
  const tokenAddress = '0x...' // Your token address
  const [memo, setMemo] = React.useState<string>('')

  const { data: metadata } = Hooks.token.useGetMetadata({ // [!code hl]
    token: tokenAddress, // [!code hl]
  }) // [!code hl]

  const burn = Hooks.token.useBurnSync({ // [!code hl]
    mutation: { // [!code hl]
      onSettled() { // [!code hl]
        queryClient.refetchQueries({ queryKey: ['getBalance'] }) // [!code hl]
      }, // [!code hl]
    }, // [!code hl]
  }) // [!code hl]

  const handleBurn = () => { // [!code hl]
    if (!tokenAddress || !address || !metadata) return // [!code hl]
    burn.mutate({ // [!code hl]
      amount: parseUnits('100', metadata.decimals), // [!code hl]
      token: tokenAddress, // [!code hl]
      memo: memo ? toHex(memo, { size: 32 }) : undefined, // [!code hl]
      feeToken: '0x20c0000000000000000000000000000000000001', // [!code hl]
    }) // [!code hl]
  } // [!code hl]

  return (
    <>
      <div>
        <label>Memo (optional)</label>
        <input
          type="text"
          value={memo}
          onChange={(e) => setMemo(e.target.value)}
          placeholder="INV-12345"
        />
      </div>
      <button // [!code hl]
        disabled={!address || burn.isPending} // [!code hl]
        onClick={handleBurn} // [!code hl]
        type="button" // [!code hl]
      > {/* [!code hl] */}
      {burn.isPending ? 'Burning...' : 'Burn'} {/* [!code hl] */}
      </button> {/* [!code hl] */}
    </>
  )
}
```

```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(),
  },
})
```

```solidity [Solidity]
TIP20 token = TIP20(0x20c0000000000000000000000000000000000004);

// Burn 100 tokens from your own balance
token.burn(100_000_000);

// Burn with a memo for tracking
token.burnWithMemo(100_000_000, keccak256("REDEMPTION_Q1_2024"));
```

```rust [Rust]
use alloy::{
    primitives::{address, keccak256, U256},
    providers::ProviderBuilder,
};
use tempo_alloy::{TempoNetwork, contracts::precompiles::ITIP20};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let provider = ProviderBuilder::new_with_network::<TempoNetwork>()
        .connect(&std::env::var("RPC_URL").expect("No RPC URL set"))
        .await?;

    let token = ITIP20::new( // [!code focus]
        address!("0x20c0000000000000000000000000000000000004"), // [!code focus]
        &provider, // [!code focus]
    ); // [!code focus]

    // Burn 100 tokens from your own balance
    token // [!code focus]
        .burn(U256::from(100_000_000)) // [!code focus]
        .send() // [!code focus]
        .await? // [!code focus]
        .get_receipt() // [!code focus]
        .await?; // [!code focus]

    // Burn with a memo for tracking
    token // [!code focus]
        .burnWithMemo( // [!code focus]
            U256::from(100_000_000), // [!code focus]
            keccak256("REDEMPTION_Q1_2024"), // [!code focus]
        ) // [!code focus]
        .send() // [!code focus]
        .await? // [!code focus]
        .get_receipt() // [!code focus]
        .await?; // [!code focus]

    println!("Tokens burned successfully"); // [!code focus]

    Ok(())
}
```
:::

## Stablecoin minting best practices

### Monitor stablecoin supply caps

If your token has a supply cap set, any `mint()` or `mintWithMemo()` call that would exceed the cap will revert with `SupplyCapExceeded()`. You must either:

* Burn tokens to reduce total supply below the cap
* Increase the supply cap (requires `DEFAULT_ADMIN_ROLE`)
* Set the largest supported cap with `type(uint128).max` (2¹²⁸ − 1 base units)

Use [`getMetadata`](https://viem.sh/tempo/actions/token.getMetadata) to check your token's total supply before minting.

### Separate stablecoin roles

Assign the issuer role to dedicated treasury or minting addresses, separate from your admin address, so no single key holds every privilege.

## Stablecoin minting learning resources

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

[Manage Your Stablecoin](https://tempo.com/developers/docs/guide/issuance/manage-stablecoin): Learn about role-based access control and token management
