Skip to content

[Bug] CLI: No address validation — invalid input cast to Address #133

@realproject7

Description

@realproject7

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:

  1. NEVER store keys/secrets in plain text files without .gitignore protection
  2. NEVER hardcode addresses, keys, or sensitive values
  3. Communicate via AgentChattr MCP chat by tagging agents (@t1, @T2A, @t2b). Your terminal is NOT visible to other agents.

Checklist:

  • isAddress() validation before all Address casts
  • Clear error messages for invalid input
  • npm run lint and npm run typecheck pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions