Dev-only Stacks Testnet token that mimics the basic shape of sBTC as a fungible token, but is not the canonical sBTC bridge asset.
contracts/test-sbtc-faucet.clar: token + faucet contractsettings/Testnet.example.toml: safe testnet config templatesettings/Devnet.example.toml: safe devnet config template
- Exposes SIP-010-style token methods:
transfer,get-name,get-symbol,get-decimals,get-balance,get-total-supply,get-token-uri - Lets anyone call
faucet-mintwhile the faucet is enabled - Lets the deployer call
owner-mint,owner-burn,set-faucet-enabled,set-faucet-max-amount, andset-token-uri
- Install Clarinet.
- Copy
settings/Testnet.example.tomltosettings/Testnet.toml. - Replace the mnemonic in
settings/Testnet.tomlwith your Stacks Testnet deployer mnemonic. - From this repo, run:
clarinet deployments generate --testnet
clarinet deployments apply --testnetExample with Clarinet console-style contract call through a wallet/tooling flow:
- Call
faucet-mint - Params:
amount: integer in 8 decimalsrecipient: recipient principal
Example amount reference:
u100000000= 1.00000000 tsBTCu1000000= 0.01000000 tsBTC
This repo also includes a small script for broadcasting faucet-mint and owner-mint calls to Stacks.
Install dependencies:
npm installUse a mnemonic:
npm run token-cli -- \
--action faucet \
--recipient ST2... \
--ui-amount 1 \
--contract-address ST2... \
--contract-name test-sbtc-faucet \
--mnemonic "your 24 word seed phrase" \
--network testnetUse a private key:
npm run token-cli -- \
--action owner-mint \
--recipient ST2... \
--amount 100000000 \
--contract-address ST2... \
--contract-name test-sbtc-faucet \
--private-key your_private_key_hex \
--network testnetNotes:
faucetmaps to the contract functionfaucet-mintowner-mintmaps to the contract functionowner-mint- use
--amountfor raw base units or--ui-amountfor a decimal token amount 100000000raw =1.00000000 tsBTC--ui-amountsupports up to 8 decimal places- faucet calls now do a read-only preflight and fail locally if the faucet is disabled or the amount exceeds the on-chain faucet max
owner-mintonly works from the deployer / owner account
You cannot mutate already-deployed Clarity code in place.
If you need new logic, deploy a new contract name or version, for example:
test-sbtc-faucet-v2test-sbtc-faucet-v3
You can keep some settings mutable through data vars, which this contract already does for:
- faucet enabled flag
- faucet max amount
- token URI
If you want a stronger upgrade path, use a separate registry/proxy pattern and point apps at the registry rather than a fixed token contract.
MIT