Deploy a Stablecoin
Deploying a stablecoin is the first step to tokenizing fiat currency on FSCO. This guide walks you through deploying the necessary contracts and registering the stablecoin with your organization.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure:
- You have an FSCO wallet to assign as the stablecoin’s admin (
adminWalletId
) - You’ve chosen a name, symbol, and number of decimals for your token
- You have ensured regulatory compliance in your jurisdiction to create this token
Endpoint
Section titled “Endpoint”POST /v2/stablecoin/deploy
Request Body
Section titled “Request Body”{ "name": "My Stablecoin", "symbol": "USDX", "decimals": 18, "adminWalletId": "wallet-1234", "backingCurrency": "United States Dollar", "backingCurrencySymbol": "$"}
name
: Human-readable token name (e.g. “My Stablecoin”)symbol
: Ticker symbol (e.g. “USDX”)decimals
: Number of decimal places (18 for standard ERC-20)adminWalletId
: FSCO wallet withDEFAULT_ADMIN_ROLE
backingCurrency
: Name of the fiat this stablecoin represents (e.g. “Philippine Peso”)backingCurrencySymbol
: Display symbol for the fiat (e.g. ”₱“)
Example Request
Section titled “Example Request”curl -X POST https://api.fsco.io/v2/stablecoin/deploy \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "My Stablecoin", "symbol": "USDX", "decimals": 18, "adminWalletId": "{{walletId}}", "backingCurrency": "United States Dollar", "backingCurrencySymbol": "$" }'
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;
const deployStablecoin = async () => { const response = await axios.post( 'https://api.fsco.io/v2/stablecoin/deploy', { name: 'My Stablecoin', symbol: 'USDX', decimals: 18, adminWalletId: '{{walletId}}', backingCurrency: 'United States Dollar', backingCurrencySymbol: '$' }, { headers: { Authorization: `Bearer ${FSCO_API_KEY}`, 'Content-Type': 'application/json' } } );
console.log('Stablecoin deployed:', response.data);};
deployStablecoin();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = { "Authorization": f"Bearer {FSCO_API_KEY}", "Content-Type": "application/json",}
payload = { "name": "My Stablecoin", "symbol": "USDX", "decimals": 18, "adminWalletId": "{{walletId}}", "backingCurrency": "United States Dollar", "backingCurrencySymbol": "$",}
response = requests.post( "https://api.fsco.io/v2/stablecoin/deploy", json=payload, headers=headers)
print("Stablecoin deployed:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Text;using System.Threading.Tasks;
class Program{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY");
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var json = @"{ ""name"": ""My Stablecoin"", ""symbol"": ""USDX"", ""decimals"": 18, ""adminWalletId"": ""{{walletId}}"", ""backingCurrency"": ""United States Dollar"", ""backingCurrencySymbol"": ""$"" }"; var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.fsco.io/v2/stablecoin/deploy", content); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Stablecoin deployed: " + responseString); }}
Example Response
Section titled “Example Response”{ "stablecoinId": "{{stablecoinId}}"}
The response returns a
stablecoinId
, which you will use for all future actions such as minting, burning, role assignment, and querying supply.