This CLI tool allows you to interact with the Intmax2 network. It includes functionalities such as:
- Generating keys (from scratch or from Ethereum private keys)
- Depositing assets (native tokens, ERC20, ERC721, ERC1155) into the rollup
- Transferring assets (single and batch transfers)
- Checking balances and transaction history
- Managing withdrawals (including syncing and claiming)
- Rust and Cargo installed
- Environment variables properly configured
Please copy the .env.example
file to .env
and adjust it as needed:
cp .env.example .env
Set your Alchemy API keys for L1_RPC_URL
and L2_RPC_URL
in the .env
file.
To update the CLI tool to the latest version, simply pull the latest changes from the repository:
git pull
After pulling the latest changes, the tool will automatically use the updated version when you run any commands.
You can see all commands and options by running:
cargo run -r -- --help
Available Commands:
generate-key
: Generate a new key pairgenerate-from-eth-key
: Generate a key pair from an Ethereum private keytransfer
: Send a single transfer transactionbatch-transfer
: Process multiple transfers from a CSV filedeposit
: Deposit assets into the rollupbalance
: Check account balancehistory
: View transaction historywithdrawal-status
: Check withdrawal statusclaim-withdrawals
: Claim processed withdrawalssync-withdrawals
: Synchronize withdrawal data
Generate a new key pair:
cargo run -r -- generate-key
Generate from Ethereum private key:
cargo run -r -- generate-from-eth-key --eth-private-key 0x...
Native token:
cargo run -r -- deposit \
--eth-private-key 0x... \
--private-key 0x... \
--token-type NATIVE \
--amount 100000000
ERC20 token:
cargo run -r -- deposit \
--eth-private-key 0x... \
--private-key 0x... \
--token-type ERC20 \
--amount 20000000 \
--token-address 0x...
ERC721 token:
cargo run -r -- deposit \
--eth-private-key 0x... \
--private-key 0x... \
--token-type ERC721 \
--token-address 0x... \
--token-id 0
ERC1155 token:
cargo run -r -- deposit \
--eth-private-key 0x... \
--private-key 0x... \
--token-type ERC1155 \
--amount 3 \
--token-address 0x... \
--token-id 0
Single transfer:
cargo run -r -- transfer \
--private-key 0x... \
--to 0x... \
--amount 100 \
--token-index 0
Batch transfer (using CSV):
cargo run -r -- batch-transfer \
--private-key 0x... \
--csv-path "transfers.csv"
Example CSV format (transfers.csv):
recipient,amount,tokenIndex
0x123...,100,1
0x456...,200,2
0x789...,300,3
Note: The batch transfer is limited to a maximum of 5 transfers per transaction. If you need to process more transfers, please split them into multiple CSV files or transactions.
Check balance:
cargo run -r -- balance --private-key 0x...
View transaction history:
cargo run -r -- history --private-key 0x...
Check withdrawal status:
cargo run -r -- withdrawal-status --private-key 0x...
Sync withdrawals:
cargo run -r -- sync-withdrawals --private-key 0x...
Claim withdrawals:
cargo run -r -- claim-withdrawals \
--eth-private-key 0x... \
--private-key 0x...
Note: For all commands that require private keys, ensure you're using the correct format (0x-prefixed hexadecimal).