Bug
tempo wallet whoami --network testnet always shows balance: 0 even when the wallet is funded on testnet (chain 42431 / tempo-moderato).
Root Cause
In src/shared/constants.ts, usdcToken is hardcoded to the mainnet USDC.e address:
export const usdcToken = "0x20c000000000000000000000b9537d11c60e8b50" as const;
In src/shared/network.ts, the tokenSymbol() and tokenDecimals() functions always use this constant regardless of the network. The whoami command queries balance against this token address even when --network testnet is passed, so it queries the wrong token contract on the moderato chain.
The escrow contract already has a testnet variant (moderatoEscrow), but the token address does not.
Expected Behavior
whoami --network testnet should query the testnet token contract (e.g. pathUSD at 0x20c0000000000000000000000000000000000000) and display the correct balance.
Actual Behavior
$ tempo wallet whoami --network testnet --verbose
ready: true
wallet: 0x0d1d42f13768af56800a09fdd629e1b669d3692b
balance:
total: "0.000000"
...
symbol: USDC.e
token: 0x20c000000000000000000000b9537d11c60e8b50
Balance is always 0 on testnet despite the wallet holding ~$4M in testnet tokens (verified on the testnet explorer).
Environment
- tempo CLI: 1.10.1
- wallet-cli: 0.6.5
- OS: macOS (arm64)
Suggested Fix
Add a moderatoToken constant (or make the token address network-aware in network.ts), similar to how escrowContract() already switches on chain ID:
export function tokenAddress(chain: number) {
return (chain === 42431 ? moderatoToken : usdcToken) as Address;
}
Bug
tempo wallet whoami --network testnetalways showsbalance: 0even when the wallet is funded on testnet (chain 42431 / tempo-moderato).Root Cause
In
src/shared/constants.ts,usdcTokenis hardcoded to the mainnet USDC.e address:In
src/shared/network.ts, thetokenSymbol()andtokenDecimals()functions always use this constant regardless of the network. Thewhoamicommand queries balance against this token address even when--network testnetis passed, so it queries the wrong token contract on the moderato chain.The escrow contract already has a testnet variant (
moderatoEscrow), but the token address does not.Expected Behavior
whoami --network testnetshould query the testnet token contract (e.g. pathUSD at0x20c0000000000000000000000000000000000000) and display the correct balance.Actual Behavior
Balance is always 0 on testnet despite the wallet holding ~$4M in testnet tokens (verified on the testnet explorer).
Environment
Suggested Fix
Add a
moderatoTokenconstant (or make the token address network-aware innetwork.ts), similar to howescrowContract()already switches on chain ID: