Skip to content

DEX-ADDR-1: Add 32-byte address validation for token routes#3

Merged
LucienSong merged 1 commit into
mainfrom
security/dex-addr-validation
May 26, 2026
Merged

DEX-ADDR-1: Add 32-byte address validation for token routes#3
LucienSong merged 1 commit into
mainfrom
security/dex-addr-validation

Conversation

@LucienSong
Copy link
Copy Markdown
Contributor

Validation function added to enforce canonical Shell address format (0x + 64 hex lowercase chars).

Fixes: DEX-ADDR-1

  • Added isValidAddress() to verify canonical format
  • Applied validation in token route lookups and swap router

Implement canonical address validation (0x + 64 lowercase hex) to prevent
invalid addresses from being passed to swap routes. Add isValidAddress()
and normalizeAddress() utilities to enforce Shell's 32-byte BLAKE3 address
format at the token configuration and swap router levels.

- Add isValidAddress() to verify canonical format
- Add normalizeAddress() to normalize with validation
- Apply validation in getTokenAddress() for all token lookups
- Add validation in swapRouter before API calls

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 26, 2026 15:59
@LucienSong LucienSong merged commit dd9e969 into main May 26, 2026
1 check failed
@LucienSong LucienSong deleted the security/dex-addr-validation branch May 26, 2026 15:59
@LucienSong LucienSong review requested due to automatic review settings May 26, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant