Mint Tokens
Thexyz token mint command creates new tokens and sends them to a specified address. Only the designated minter can mint tokens.
Usage
Arguments
| Argument | Description |
|---|---|
contract | Token contract address |
recipient | Address to receive tokens |
amount | Amount to mint (in smallest unit) |
Flags
| Flag | Description | Required |
|---|---|---|
--from | Signing key (must be minter) | Yes |
--dry-run | Simulate without broadcasting | No |
Examples
Mint to Yourself
Mint to Another Address
Dry Run
Output
Successful mint:Minter Authorization
Only the designated minter can mint tokens:Error: Not the Minter
Mint Caps
If the token has a cap, minting beyond it fails:Amount Calculation
The amount is in the smallest unit (base amount). For a token with 6 decimals:| Display Amount | Base Amount |
|---|---|
| 1 MTK | 1,000,000 |
| 100 MTK | 100,000,000 |
| 0.001 MTK | 1,000 |
Batch Minting
For multiple recipients, run multiple commands:Under the Hood
xyz token mint executes a MsgExecuteContract:
Troubleshooting
Permission denied
Permission denied
You’re not the designated minter. Check:
Would exceed cap
Would exceed cap
The token has a maximum supply. Check:
Contract not found
Contract not found
Verify the contract address: