fix: validate destination address on send view (closes #67) #68

Merged
sneak merged 4 commits from fix/67-validate-send-address into main 2026-02-28 21:38:22 +01:00
Collaborator

Adds validation on the To address field in the send view before allowing the user to proceed to review.

Changes

  • Validate Ethereum addresses (0x prefix + 40 hex chars)
  • EIP-55 checksum validation for mixed-case addresses (all-lowercase accepted)
  • Basic ENS name format validation
  • Block sending to the zero address
  • Warn (but allow) sending to own address
  • Inline error message with reserved height (no layout shift)
  • Review button disabled while address is invalid
  • Re-validation on click as safety net

Closes #67

Adds validation on the To address field in the send view before allowing the user to proceed to review. ## Changes - Validate Ethereum addresses (0x prefix + 40 hex chars) - EIP-55 checksum validation for mixed-case addresses (all-lowercase accepted) - Basic ENS name format validation - Block sending to the zero address - Warn (but allow) sending to own address - Inline error message with reserved height (no layout shift) - Review button disabled while address is invalid - Re-validation on click as safety net Closes #67
sneak was assigned by clawbot 2026-02-28 20:42:17 +01:00
clawbot added 1 commit 2026-02-28 20:42:17 +01:00
fix: validate destination address on send view
All checks were successful
check / check (push) Successful in 22s
8379ab4685
- Validate Ethereum addresses (0x + 40 hex chars) and ENS names
- EIP-55 checksum validation for mixed-case addresses
- Block sending to zero address (0x0000...0000)
- Warn when sending to own address (allow but show warning)
- Inline error messages with reserved space (no layout shift)
- Disable Review button while address is invalid

Closes #67
clawbot force-pushed fix/67-validate-send-address from 8379ab4685 to 2f11c43dd8 2026-02-28 20:44:59 +01:00 Compare
clawbot added the needs-review label 2026-02-28 20:45:06 +01:00
Author
Collaborator

Rebased onto main to resolve merge conflict in src/popup/views/send.js (the TOKEN_BY_ADDRESSresolveSymbol rename). Resolution keeps resolveSymbol import from main and adds the ethers import + validation code from this branch.

docker build . passes (lint, format, build all green).

Rebased onto main to resolve merge conflict in `src/popup/views/send.js` (the `TOKEN_BY_ADDRESS` → `resolveSymbol` rename). Resolution keeps `resolveSymbol` import from main and adds the `ethers` import + validation code from this branch. `docker build .` passes (lint, format, build all green).
clawbot added merge-ready and removed needs-review labels 2026-02-28 20:51:58 +01:00
Author
Collaborator

Review: Approved — merge-ready

Code review passed. The validation implementation is thorough:

  • Ethereum address format validation (0x + 40 hex chars)
  • EIP-55 checksum validation via ethers getAddress
  • Zero address rejection
  • ENS name format check (resolution delegated to provider)
  • Own-address warning (non-blocking)
  • Clean UI: inline error with reserved space (no layout shift), review button disabled while invalid
  • Re-validation on button click as defense-in-depth

docker build . passes (lint, format, build all green). Assigning to @sneak for merge.

**Review: ✅ Approved — merge-ready** Code review passed. The validation implementation is thorough: - Ethereum address format validation (0x + 40 hex chars) - EIP-55 checksum validation via ethers `getAddress` - Zero address rejection - ENS name format check (resolution delegated to provider) - Own-address warning (non-blocking) - Clean UI: inline error with reserved space (no layout shift), review button disabled while invalid - Re-validation on button click as defense-in-depth `docker build .` passes (lint, format, build all green). Assigning to @sneak for merge.
sneak added 1 commit 2026-02-28 21:10:37 +01:00
Merge branch 'main' into fix/67-validate-send-address
All checks were successful
check / check (push) Successful in 21s
7cfb3404cf
Owner

after leaving the send view, the warning/error field is not reset, so returning to send even when the destination field is empty, an error or warning remains.

after leaving the `send` view, the warning/error field is not reset, so returning to `send` even when the destination field is empty, an error or warning remains.
sneak added needs-reworkbot and removed merge-ready labels 2026-02-28 21:12:50 +01:00
sneak removed their assignment 2026-02-28 21:12:54 +01:00
clawbot self-assigned this 2026-02-28 21:15:48 +01:00
clawbot force-pushed fix/67-validate-send-address from 7cfb3404cf to 9de7791553 2026-02-28 21:18:01 +01:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-02-28 21:18:26 +01:00
Author
Collaborator

Rework complete. Fixed the validation state persistence bug.

Changes

  • Added resetSendValidation() to send.js — clears the error/warning text and disables the review button
  • Called resetSendValidation() when navigating to the send view from home, address detail, and address token views
  • Navigating back from confirm-tx intentionally preserves form state (user is returning to their in-progress form)

docker build . passes (lint, format, build all green).

**Rework complete.** Fixed the validation state persistence bug. ### Changes - Added `resetSendValidation()` to `send.js` — clears the error/warning text and disables the review button - Called `resetSendValidation()` when navigating to the send view from home, address detail, and address token views - Navigating back from confirm-tx intentionally preserves form state (user is returning to their in-progress form) `docker build .` passes (lint, format, build all green).
clawbot removed their assignment 2026-02-28 21:18:31 +01:00
sneak added 1 commit 2026-02-28 21:25:11 +01:00
Merge branch 'main' into fix/67-validate-send-address
All checks were successful
check / check (push) Successful in 23s
8e1856415a
clawbot self-assigned this 2026-02-28 21:34:30 +01:00
clawbot added merge-ready and removed needs-reviewbot labels 2026-02-28 21:35:36 +01:00
clawbot removed their assignment 2026-02-28 21:35:36 +01:00
sneak was assigned by clawbot 2026-02-28 21:35:37 +01:00
Author
Collaborator

Review (rework): Approved — merge-ready

The rework correctly fixes the validation state persistence bug reported by sneak:

  • resetSendValidation() clears error/warning text and disables the review button
  • Called from all three navigation paths to the send view (home, addressDetail, addressToken)
  • Returning to the send view now starts with a clean slate

docker build . passes (lint, build all green). Assigned to @sneak for merge.

**Review (rework): ✅ Approved — merge-ready** The rework correctly fixes the validation state persistence bug reported by sneak: - `resetSendValidation()` clears error/warning text and disables the review button - Called from all three navigation paths to the send view (home, addressDetail, addressToken) - Returning to the send view now starts with a clean slate `docker build .` passes (lint, build all green). Assigned to @sneak for merge.
sneak added 1 commit 2026-02-28 21:37:40 +01:00
Merge branch 'main' into fix/67-validate-send-address
All checks were successful
check / check (push) Successful in 22s
33ae5784e2
sneak merged commit 3b6b18d168 into main 2026-02-28 21:38:22 +01:00
sneak deleted branch fix/67-validate-send-address 2026-02-28 21:38:22 +01:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#68