Skip to content

docs(examples): add end-to-end tokenfactory minting example#46

Open
Karry2019web wants to merge 2 commits into
Safrochain-Org:mainfrom
Karry2019web:feat/tokenfactory-example
Open

docs(examples): add end-to-end tokenfactory minting example#46
Karry2019web wants to merge 2 commits into
Safrochain-Org:mainfrom
Karry2019web:feat/tokenfactory-example

Conversation

@Karry2019web
Copy link
Copy Markdown
Contributor

Closes #39

Summary

Adds a complete end-to-end example for the x/tokenfactory module at examples/tokenfactory/, containing:

  1. README.md — narrated walkthrough covering the full lifecycle:

    • Setup (local node, keys, genesis)
    • Create denom (permissionless factory/{creator}/{subdenom})
    • Set denom metadata (name, symbol, display units)
    • Mint tokens (to self and directly to recipient)
    • Bank transfer (the new denom behaves like any native coin)
    • Burn tokens (from any address as admin)
    • Force transfer (admin power)
    • Change admin / renounce admin
    • Various query commands (params, denom-authority-metadata, denoms-from-creator, bank queries)
    • Cleanup
  2. run.sh — automated shell script that runs through every step with colored output, balance verification, and error handling.

What's demonstrated

Step Command Notes
Create safrochaind tx tokenfactory create-denom Permissionless, namespaced by creator
Metadata modify-metadata JSON metadata for wallet rendering
Mint mint with mint_to_address Admin can mint to any address
Transfer bank send Standard Cosmos SDK
Burn burn with burn_from_address Admin can burn from any address
Force transfer force-transfer Admin power
Change admin change-admin Transfer or renounce (burn address)
Query denom-authority-metadata, denoms-from-creator Various tokenfactory queries

Implementation notes

  • Uses the autocli commands from x/tokenfactory/module/autocli.go
  • Bech32 prefix addr_safro, bond denom usaft (testnet)
  • Denom creation fee: 10,000,000 usaft (from DefaultParams())
  • Script handles errors gracefully with set -euo pipefail
  • All addresses and denoms are dynamically resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(examples): add end-to-end x/tokenfactory minting example (create denom → mint → transfer → burn)

1 participant