I posted this two times on two different channels on Solana Discord without replies. I'm posting here now praying there's an answer. And yes I even googled but no joy.
3 Answers
All tokens on Solana that aren't native SOL are referred to as "SPL Tokens" and created using the Token Program (SPL stands for Solana Program Library). Stablecoins like USDC and USDT are also just another SPL Token.
Although tokens have names like "USDC" or "USDT", SPL Tokens are really identified by their "Mint Address".
Circle's USDC docs show the mint address of USDC on Mainnet is EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
. Circle also has a USDC mint address on testnet.
There is no official USDC mint on devnet. However for testing on devnet, you can create two new SPL Tokens, mint yourself these tokens, and use the "Mint Address" for each token as a placeholder to represent "USDC" and "USDT" in your program.
You can create new SPL Tokens on devnet using either Solana CLI or the @solana/spl-token
library.
If using @solana/spl-token
, you can use:
createMint
- to create new token mints (set yourself as mint authority)
getOrCreateAssociatedTokenAccount
- to get/create a token account to hold tokens for a specific token mint
mintTo
- to mint tokens from the token mint you created to a token account
Alternatively, you get an unofficial devnet SPL Token already named "USDC-Dev" with the "Mint Address" Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr
here:
Let's say you have a program that only accepts tokens like USDC or USDT. On the testnet, Circle has released USDC (https://explorer.solana.com/address/4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU?cluster=devnet), and if you want to get it, go to https://usdcfaucet.com/. I don't know about USDT on the testnet though.
Note that the USDC main net and test net addresses are different, so you can technically "create your own USDC" by creating a new mint and treating it like USDC in your contract. Instructions on how to do that are here: https://spl.solana.com/token
-
This is accurate, but testnet is for future releases of the Solana chain itself. Most developers will be using
devnet
orlocalnet
.– mikemaccana ♦Commented Mar 26 at 2:03
The instructions on how to get USDC are here:
https://developers.circle.com/stablecoins/docs/quickstart-transfer-10-usdc-on-solana
I tried the faucet before following those instructions and I never got the USDC despite waiting for around 30 mins, and I wasn't able to retry.
So I followed the instructions in link and generated several transactions Circle's API, but all of them remain in "pending" state for hours.
[{
"id": "ece3f65a-ef6d-4b30-9e1e-2ee92ab26bc0",
"source": {
"type": "wallet",
"id": "1017017096"
}
"destination": {
"type": "blockchain",
"address": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk",
"chain": "SOL"
}
"amount": {
"amount": "10.00",
"currency": "USD"
}
"status": "pending",
"createDate": "2024-04-30T05:29:57.811Z"
},
{
"id": "9eaf4140-5f15-4c17-817d-3e33ce5c1145",
"source": {
"type": "wallet",
"id": "1017017096"
}
"destination": {
"type": "blockchain",
"address": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk",
"chain": "SOL"
}
"amount": {
"amount": "1000.00",
"currency": "USD"
}
"status": "pending",
"createDate": "2024-04-30T05:20:14.105Z"
}
{
"id": "85c0a29b-eafb-4852-8d0b-25a30b19824c",
"source": {
"type": "wallet",
"id": "1017017096"
}
"destination": {
"type": "blockchain",
"address": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk",
"chain": "SOL"
}
"amount": {
"amount": "10.00",
"currency": "USD"
}
"status": "pending",
"createDate": "2024-04-30T05:14:30.711Z"
}
{
"id": "ff3f1568-5985-4415-b65d-5fb127d6c87f",
"source": {
"type": "wallet",
"id": "1017017096"
}
"destination": {
"type": "blockchain",
"address": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk",
"chain": "SOL"
}
"amount": {
"amount": "1000.00",
"currency": "USD"
}
"status": "pending",
"createDate": "2024-04-30T04:55:44.592Z"
}
]
Circle's instructions end with: Monitor the Status of your Payout/Transfer by its id (the UUID), and nothing happens, they never get past the pending state.
The instructions to transfer using the js lib at the bottom of the page are assuming that one of the accounts actually got the funds, but this never happens.