A Rust CLI with 4 parts for the Mantle network:
- Create token – via Printr mainnet API
- Swap on Printr – buy/sell on Printr bonding curve
- Swap on Fluxion – buy/sell on Fluxion DEX
- Unwrap MNT – Unwrap MNT
Uses ethers-rs for on-chain interactions.
For developers and traders who want to:
- Create tokens – Launch memecoins or custom tokens on Mantle via the Printr API (bonding curve)
- Swap on Printr – Buy tokens with MNT or sell tokens for MNT on Printr’s bonding curve
- Swap on Fluxion – Buy tokens with MNT or sell tokens for MNT on Fluxion DEX
- Unwrap MNT – Unwrap MNT
All interactions go through ethers-rs against Mantle’s L2 RPC.
- Rust toolchain
- Mantle RPC URL and wallet private key (with MNT for gas)
- Printr API key (for
create)
Copy config.sample.toml to config.toml or use env vars with prefix MANTLE_TOKEN_LAUNCH_SCRIPT__.
Required:
mantle.rpc_url– Mantle RPC endpointmantle.chain_id– e.g.5000(mainnet)mantle.private_key– Hex private key (with or without0x)printr.api_base_url– Printr API base URLprintr.api_key– Printr API key
For Fluxion swap (Uniswap V3–style):
fluxion.router_address– Fluxion routerfluxion.wmnt_address– Wrapped MNT addressfluxion.pool_fee– Pool fee tier (e.g.3000= 0.3%,500= 0.05%,10000= 1%)
cargo build
cargo run -- --help| Command | Description |
|---|---|
create |
Create token via Printr API (sub: payload, launch) |
printr |
Swap on Printr bonding curve (sub: buy, sell, sell-all) |
fluxion |
Swap on Fluxion DEX (sub: buy, sell, sell-all) |
deployments |
Get correct curve address for a Printr token (use before printr buy) |
address |
Print wallet address from config (use for --creator) |
unwrap |
Unwrap all WMNT in wallet to native MNT |
Use your wallet address (not a contract) for --creator. Get it from config:
cargo run -- address# Create token and submit on Mantle
cargo run -- create launch --name "MyToken" --symbol "MTK" --creator $(cargo run -q -- address)
# Or use the address directly
cargo run -- create launch --name "MyToken" --symbol "MTK" --creator 0xYourWalletAddress
# Get unsigned payload (sign elsewhere)
cargo run -- create payload --name "MyToken" --symbol "MTK" --creator $(cargo run -q -- address)| Option | Description |
|---|---|
--name |
Token name |
--symbol |
Token symbol |
--description |
Token description (optional) |
--creator |
Creator wallet (0x...) |
--chains |
Chain IDs (default: eip155:5000) |
Printr buy/sell calls go to the bonding-curve proxy at 0xb77726291b125515d0a7affeea2b04f2ff243172 (ERC-1967, implementation 0x0601d6...). The --token-address identifies which token to trade. Buy uses the spend() function internally.
Get the token address:
# Get Mantle deployment address for a Printr token
cargo run -- deployments YOUR_TOKEN_IDUse the printed token address in the buy/sell commands:
# Buy token with MNT (amounts are decimal, in wei)
cargo run -- printr buy \
--token-address 0xTokenAddressFromDeployments \
--mnt-amount 1000000000000000000 \
--max-price 5000000000000
# Sell token for MNT (specify amount)
cargo run -- printr sell \
--token-address 0xTokenAddressFromDeployments \
--token-amount 1000000000000000000 \
--min-mnt-out 0
# Sell entire token balance
cargo run -- printr sell-all \
--token-address 0xTokenAddressFromDeploymentsSell and sell-all automatically approve the Printr proxy before selling.
| Option | Description |
|---|---|
--token-address |
Token address from deployments command |
--mnt-amount |
MNT to spend in wei, decimal (for buy) |
--token-amount |
Token amount in wei, decimal (for sell) |
--max-price |
Max price per token (slippage cap for buy). Use a reasonable value, e.g. 5000000000000 |
--min-mnt-out |
Min MNT received (slippage for sell / sell-all, default: 0) |
--printr-contract |
Override bonding-curve proxy address (default: 0xb777...3172) |
Fluxion uses Uniswap V3–style exactInputSingle. Buy and sell approve the router as needed.
# Buy token with MNT
cargo run -- fluxion buy \
--token 0xTokenAddress \
--mnt-amount 1000000000000000000 \
--min-tokens-out 0
# Sell token for MNT (approves router first)
cargo run -- fluxion sell \
--token 0xTokenAddress \
--token-amount 1000000000000000000 \
--min-mnt-out 0
# Sell entire token balance
cargo run -- fluxion sell-all \
--token 0xTokenAddress \
--min-mnt-out 0| Option | Description |
|---|---|
--token |
Token contract address |
--mnt-amount |
MNT in wei (for buy) |
--token-amount |
Token in wei (for sell) |
--min-tokens-out |
Min tokens received (buy) |
--min-mnt-out |
Min MNT received (sell / sell-all) |
Convert all WMNT (Wrapped MNT) in your wallet to native MNT. Uses fluxion.wmnt_address from config.
cargo run -- unwrap- "Contract call reverted" on Printr buy: Check that
--max-priceis a reasonable value (notmax). Look at recent trades on Mantlescan for the token to find typical maxPrice values. Amounts are parsed as decimal (not hex). - Printr bonding curve reverts: Ensure the token is deployed and
status: liveviacargo run -- deployments TOKEN_ID. The buy callsspend()on proxy0xb77726291b125515d0a7affeea2b04f2ff243172. - Fluxion sell reverts: Ensure you have enough token balance and approval. Set
fluxion.pool_feeto match the pool’s fee tier (e.g.3000for 0.3%).
Rust, tokio, ethers-rs, reqwest, clap, config, dotenvy, hex
Contact: Telegram