Bug
claim command casts opts.address directly to Address type without validation. agent register does the same with opts.wallet. Invalid addresses produce confusing RPC errors instead of a clear CLI error.
Fix:
- Validate with viem
isAddress() before casting
- Show clear error: "Invalid address: "
Affected files:
packages/cli/src/commands/claim.ts
packages/cli/src/commands/agent-register.ts
Rules for T3:
- NEVER store keys/secrets in plain text files without .gitignore protection
- NEVER hardcode addresses, keys, or sensitive values
- Communicate via AgentChattr MCP chat by tagging agents (@t1, @T2A, @t2b). Your terminal is NOT visible to other agents.
Checklist:
Bug
claimcommand castsopts.addressdirectly toAddresstype without validation.agent registerdoes the same withopts.wallet. Invalid addresses produce confusing RPC errors instead of a clear CLI error.Fix:
isAddress()before castingAffected files:
packages/cli/src/commands/claim.tspackages/cli/src/commands/agent-register.tsRules for T3:
Checklist:
isAddress()validation before all Address castsnpm run lintandnpm run typecheckpass