Skip to content

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented May 26, 2025

This PR loosen the starknet address validator, to accept both checksum (current) and lowercase (new) addresses as valid. It stil require that addresses are fully padded.,

This will align with the evmAddress validation, which is currently accepting both lowercase and checksum.

Without this patch, the validator will reject all checksum starknet address. In the ui side, we don't check for case when sending starknet address (like adding member in the space settings), so valid data on the UI will be rejected by sequencer.

@wa0x6e wa0x6e requested review from Copilot and ChaituVR May 26, 2025 03:17
@wa0x6e wa0x6e marked this pull request as ready for review May 26, 2025 03:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Loosens the Starknet address validator to accept both lowercase and checksum addresses by comparing values in lowercase, aligning it with the existing evmAddress behavior.

  • Replaces strict equality check with a lowercase comparison in the Starknet address format validator.
  • Ensures both checksum and lowercase Starknet addresses pass validation.
Comments suppressed due to low confidence (2)

src/utils.ts:135

  • No unit tests were updated to cover the new acceptance of both lowercase and checksum Starknet addresses. Consider adding tests for both formats to ensure the validator behaves as expected.
return (

src/utils.ts:136

  • [nitpick] Consider updating documentation or inline comments to clarify that the starknetAddress format now accepts both lowercase and checksum addresses.
validateAndParseAddress(value).toLowerCase() === value.toLowerCase()

@bonustrack
Copy link
Member

Is there a way to double vote if we support both casing? I believe in the hub db we have only checksummed address, not lowercased ones

@wa0x6e
Copy link
Contributor Author

wa0x6e commented May 26, 2025

Is there a way to double vote if we support both casing? I believe in the hub db we have only checksummed address, not lowercased ones

We already support both casing for evm address

On the backend side, we have another compare after lowercasing everything

Copy link
Member

@bonustrack bonustrack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@wa0x6e wa0x6e merged commit 34151ef into master May 30, 2025
4 checks passed
@wa0x6e wa0x6e deleted the fix-less-strict-starknet-address-validator branch May 30, 2025 16:21
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.

2 participants