Was this helpful?
Create new tokens by minting them to a specified address. Minting increases the total supply of your stablecoin.
To decrease supply, you can burn tokens from your own balance. Burning requires the ISSUER_ROLE and sufficient balance in the caller's account.
Before you can mint tokens, you need to create a stablecoin. Follow the Create a Stablecoin guide to deploy your token.
Once you've created your token, you can proceed to grant the issuer role and mint tokens.
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:
DEFAULT_ADMIN_ROLE)type(uint256).maxUse getMetadata to check your token's total supply before minting.
Assign the issuer role to dedicated treasury or minting addresses separate from your admin address. This enhances security by limiting the privileges of any single address.
import React from 'react'
import { } from 'wagmi/tempo'
import { } from '@tanstack/react-query'
export function () {
const = ()
const = '0x...' // Your token address
const = '0x...' // Address to grant the issuer role
const = ..({
: {
() {
.({ : ['hasRole'] })
},
},
})
const = async () => {
await .({
: ,
: ['issuer'],
: ,
: '0x20c0000000000000000000000000000000000001',
})
}
return (
<
={.}
={}
="button"
>
{. ? 'Granting...' : 'Grant Issuer Role'}
</> {}
)
}import { , } from 'wagmi'
import { }
import React from 'react'
import { } from 'wagmi/tempo'
import { } from 'wagmi'
import { , , } from 'viem'
import { } from '@tanstack/react-query'
export function () {
const { } = ()
const = ()
const = '0x...' // Your token address
const [, ] = React.<string>('')
const [, ] = React.<string>('')
const { : } = ..
: ,
})
const = ..({
: {
() {
.({ : ['getBalance'] })
},
},
})
const = () => {
if (! || ! || !) return
.({
: ('100', .),
: as `0x${string}`,
: ,
: ? ((), { : 32 })
: '0x20c0000000000000000000000000000000000001',
})
}
return (
<>
<>
<>Recipient address</>
<
="text"
={}
={() => (..)}
="0x..."
/>
</>
<>
<>Memo (optional)</>
<
="text"
={}
={() => (..)}
="INV-12345"
/>
</>
<
={! || .}
={}
="button"
>
{. ? 'Minting...' : 'Mint'}
</>
</>
)
}import { , } from 'wagmi'
import { }
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
use alloy::{
primitives::{address, keccak256, U256},
providers::ProviderBuilder,
};
use tempo_alloy::{TempoNetwork, contracts::precompiles::ITIP20};
import React from 'react'
import { } from 'wagmi/tempo'
import { } from 'wagmi'
import { , , } from 'viem'
import { } from '@tanstack/react-query'
export function () {
const { } = ()
const = ()
const = '0x...' // Your token address
const [, ] = React.<string>('')
const { : } = ..
: ,
})
const = ..({
: {
() {
.({ : ['getBalance'] })
},
},
})
const = () => {
if (! || ! || !) return
.({
: ('100', .),
: ,
: ? ((), { : 32 })
: '0x20c0000000000000000000000000000000000001',
})
}
return (
<>
<>
<>Memo (optional)</>
<
="text"
={}
={() => (..)}
="INV-12345"
/>
</>
<
={! || .}
={}
="button"
>
{. ? 'Burning...' : 'Burn'}
</>
</>
)
}import { , } from 'wagmi'
import { }
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"));use alloy::{
primitives::{address, keccak256, U256},
providers::ProviderBuilder,
};
use tempo_alloy::{TempoNetwork, contracts::precompiles::ITIP20};