From 3287bff18ec1cf80f841acdb732f68d55841716b Mon Sep 17 00:00:00 2001 From: Derek Cofausper <256792747+decofe@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:29:28 +0000 Subject: [PATCH] docs(foundry): add cast tip20 create section with ISO 4217 warning Co-authored-by: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019cdde4-6b59-72d1-9e79-04a9cb59565b --- src/pages/sdk/foundry/index.mdx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/pages/sdk/foundry/index.mdx b/src/pages/sdk/foundry/index.mdx index 885e99d..99222b8 100644 --- a/src/pages/sdk/foundry/index.mdx +++ b/src/pages/sdk/foundry/index.mdx @@ -155,6 +155,38 @@ For more verification options including verifying existing contracts and API ver - **Silent failures**: Calling a non-existent function without a fallback succeeds silently ::: +### Deploy a stablecoin with `cast` + +Deploy a [TIP-20](/protocol/tip20/overview) stablecoin using the built-in `cast tip20 create` command: + +```bash +cast tip20 create "myUSD" "MUSD" "USD" \ + --rpc-url $TEMPO_RPC_URL \ + --interactive +``` + +The command validates the currency code against [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) before sending the transaction. If the code is not recognized, you'll see a warning and a confirmation prompt. + +To skip the validation prompt, pass `--force`: + +```bash +cast tip20 create "myToken" "MTK" "FOO" \ + --rpc-url $TEMPO_RPC_URL \ + --interactive \ + --force +``` + +:::warning[Currency code is immutable] +The `currency` field **cannot be changed** after token creation. It must be the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-letter code for the underlying fiat currency (e.g. `"USD"`, `"EUR"`, `"GBP"`) — **not** the token symbol (e.g. don't use `"USDC"` or `"PYUSD"`). + +An incorrect currency code will affect: +- **Fee payment eligibility** — only `"USD"` tokens can pay transaction fees on Tempo +- **DEX routing** — currency codes determine trading pair classification +- **Quote token pairing** — `"USD"` tokens must pair with other USD-denominated TIP-20 tokens + +The same ISO 4217 validation also runs automatically when deploying TIP-20 tokens via `forge script`. +::: + ### Interact & debug with `cast` ```bash