Deploy Your First Token
Deploy an ERC-20 fungible token on Polygon Amoy testnet in under 5 minutes.
Prerequisites
- An Urblock account with a test API key (
sk_test_...) - Node.js ≥ 18
1. Install the SDK
npm install @urblock/sdk
2. Initialize the Client
import { Urblock } from "@urblock/sdk";
const urblock = new Urblock("sk_test_...");
3. Provision a Connect Account
Every tenant now operates through Connect smart accounts rather than custodial HD wallets. Finish Connect setup in the dashboard or create the account through /v1/connect/accounts before running write flows.
4. Deploy the Token
const token = await urblock.tokens.create({
name: "My First Token",
symbol: "MFT",
standard: "ERC20",
network: "polygon_amoy",
initial_supply: "1000000000000000000000000", // 1M tokens (18 decimals)
features: {
mintable: true,
burnable: true,
pausable: true,
},
idempotency_key: "deploy-mft-001",
});
console.log(token.id); // tok_...
console.log(token.status); // "deploying"
The deploy is asynchronous — the SDK returns immediately with status: "deploying". The contract is deployed on-chain via a background job.
5. Check Deployment Status
Poll or set up a webhook to know when the token is deployed:
// Polling
const deployed = await urblock.tokens.retrieve(token.id);
console.log(deployed.status); // "deployed"
console.log(deployed.contract_address); // 0x...
6. Mint Tokens
Once deployed, mint tokens to any address:
const tx = await urblock.transactions.mint(token.id, {
to: wallet.address,
amount: "500000000000000000000", // 500 tokens
idempotency_key: "mint-001",
});
console.log(tx.id); // tx_...
console.log(tx.status); // "pending"
7. Check Balance
const balance = await urblock.tokens.getBalance(token.id, {
address: wallet.address,
nft_token_id: "0",
});
console.log(balance.balance); // "500000000000000000000"
curl Equivalent
# Deploy
curl -X POST https://api.urblock.io/v1/tokens \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"name": "My First Token",
"symbol": "MFT",
"standard": "ERC20",
"network": "polygon_amoy",
"initial_supply": "1000000000000000000000000",
"features": { "mintable": true, "burnable": true, "pausable": true },
"idempotency_key": "deploy-mft-001"
}'
# Mint
curl -X POST https://api.urblock.io/v1/tokens/tok_.../mint \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"to": "0x...",
"amount": "500000000000000000000",
"idempotency_key": "mint-001"
}'
Supported Token Standards
| Standard | Description |
|---|---|
ERC20 | Fungible token |
ERC20_VOTES | Fungible token with delegation / governance voting |
ERC721 | Non-fungible token (NFT) |
ERC1155 | Multi-token (fungible + non-fungible) |
ERC3643 | T-REX security token with compliance |
SBT | Soulbound Token (non-transferable, EIP-5192) |
ERC1363 | Payable token (EIP-1363) |
ERC20_SOLADY | Gas-optimized ERC-20 (Solady) |
ERC721_SOLADY | Gas-optimized ERC-721 (Solady) |
ERC1155_SOLADY | Gas-optimized ERC-1155 (Solady) |
Next Steps
- Mint and Transfer Tokens — transfer tokens between addresses
- NFT Collection — deploy an ERC-721 NFT collection
- Security Tokens — deploy T-REX compliant tokens
- Token Standards — compare all 10 supported standards
- Async Operations — how deploy status works