Transfer Tokens

The bwick token transfer command sends CW20 tokens from your account to another address.

Usage

bwick token transfer <contract> <recipient> <amount> --from <key>

Arguments

ArgumentDescription
contractToken contract address
recipientDestination address
amountAmount to send (in smallest unit)

Flags

FlagDescriptionRequired
--fromYour signing keyYes
--dry-runSimulate onlyNo

Examples

Basic Transfer

bwick token transfer bwick1tokencontract... bwick1recipient... 1000000 --from mykey

Transfer All Tokens

First check your balance:
bwick token balance bwick1tokencontract... --key mykey
# Balance: 5000000
Then transfer:
bwick token transfer bwick1tokencontract... bwick1recipient... 5000000 --from mykey

Dry Run

bwick token transfer bwick1tokencontract... bwick1recipient... 1000000 --from mykey --dry-run
Output:
Dry run mode - transaction not broadcast

Estimated gas: 120,000
Estimated fee: 1,200 ubwick

Transfer Details:
  Token: bwick1tokencontract...
  From: bwick1youraddress...
  To: bwick1recipient...
  Amount: 1,000,000

Output

Successful transfer:
Tokens Transferred Successfully!

Token:     bwick1tokencontract...
From:      bwick1youraddress...
To:        bwick1recipient...
Amount:    1,000,000
TxHash:    ABC123DEF456...
Gas Used:  115678
Block:     12345

Verify Transfer

Check balances after transfer:
# Your balance
bwick token balance bwick1tokencontract... --key mykey

# Recipient balance
bwick token balance bwick1tokencontract... bwick1recipient...

Amount Calculation

Amount is in the token’s smallest unit. For 6 decimals:
DisplayAmount (base)
1 MTK1,000,000
0.5 MTK500,000
100 MTK100,000,000
Example: Send 10 tokens:
bwick token transfer bwick1contract... bwick1recipient... 10000000 --from mykey
#                                                  ^ 10 * 10^6

Batch Transfers

Sequential

bwick token transfer bwick1contract... bwick1addr1... 1000000 --from mykey
bwick token transfer bwick1contract... bwick1addr2... 2000000 --from mykey
bwick token transfer bwick1contract... bwick1addr3... 3000000 --from mykey

Script

#!/bin/bash
CONTRACT="bwick1tokencontract..."
KEY="mykey"

# Recipients and amounts
declare -A TRANSFERS=(
  ["bwick1addr1..."]="1000000"
  ["bwick1addr2..."]="2000000"
  ["bwick1addr3..."]="3000000"
)

for addr in "${!TRANSFERS[@]}"; do
  amount=${TRANSFERS[$addr]}
  echo "Sending $amount to $addr..."
  bwick token transfer $CONTRACT $addr $amount --from $KEY
  sleep 1
done

Error Handling

ErrorMeaningSolution
”insufficient token balance”Not enough tokensCheck balance first
”invalid address”Bad recipient formatVerify address format (bwick1…)
“contract not found”Wrong contract addressVerify contract exists

Check Balance Before Transfer

# Check your balance
BALANCE=$(bwick token balance bwick1contract... --key mykey --output json | jq -r '.balance')

# Compare with amount
if [ "$BALANCE" -lt "1000000" ]; then
  echo "Insufficient balance: $BALANCE"
  exit 1
fi

Under the Hood

bwick token transfer executes a MsgExecuteContract:
{
  "contract": "bwick1tokencontract...",
  "msg": {
    "transfer": {
      "recipient": "bwick1recipient...",
      "amount": "1000000"
    }
  },
  "funds": []
}

Transfer vs Send

CW20 has two transfer methods:
MethodUse Case
transferSend to regular address
sendSend to contract with callback
The bwick token transfer command uses transfer. For contract interactions, use bwick program execute.

Troubleshooting

Check your current balance:
bwick token balance bwick1contract... --key mykey
You can only transfer what you have.
Ensure the address:
  • Starts with bwick1
  • Is the correct length
  • Has valid checksum
The node may be slow. Check status:
curl https://rpc.bwick.fun/status | jq '.result.sync_info'
Retry the transfer if needed.