You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typical Starknet address cannot be pasted into the faucet because the input has a validator that checks if address length equals to 42.
It's not correct because in Starknet addresses are felt and can be 32 bytes long (which corresponds to address length of 66 including '0x' prefix).
Also I believe it's not correct to check for minimal length in Starknet because leading zeroes are often dropped and 0x1 is a technically correct address.
The bug was introduced in #398
Relevant lines of code:
Issue Overview
Typical Starknet address cannot be pasted into the faucet because the input has a validator that checks if address length equals to 42.
It's not correct because in Starknet addresses are felt and can be 32 bytes long (which corresponds to address length of 66 including '0x' prefix).
Also I believe it's not correct to check for minimal length in Starknet because leading zeroes are often dropped and 0x1 is a technically correct address.
The bug was introduced in #398
Relevant lines of code:
scaffold-stark-2/packages/nextjs/components/scaffold-stark/Input/AddressInput.tsx
Lines 31 to 40 in 6e9eb83
Proposed Solutions or Ideas
I guess it will be sufficient to test for
/^0x[0-9A-Fa-f]{1,64}$/
and remove all redundant checks like/0x.*0x/
andsanitizedValue.length !== 42
The text was updated successfully, but these errors were encountered: