Skip to content

Commit

Permalink
fix: correct address regex in AddressInput (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfastov authored Jan 19, 2025
1 parent 1f7e5fe commit ffdb0b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@ export const AddressInput = ({
return;
}

const isValid =
/^(0x)([a-fA-F0-9]{40})$/.test(sanitizedValue) &&
!/0x.*0x/.test(sanitizedValue);
const isValid = /^0x[a-f0-9]{1,64}$/.test(sanitizedValue);
if (!isValid) {
return;
}

if (sanitizedValue.length !== 42) {
return;
}

onChange(newValue);
},
[onChange],
Expand Down
4 changes: 2 additions & 2 deletions packages/snfoundry/scripts-ts/helpers/deploy-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main() {

if (argv._.length > 0) {
console.error(
`❌ Invalid arguments, only --network, --fee, or --reset/--no-reset can be passed in`,
`❌ Invalid arguments, only --network, --fee, or --reset/--no-reset can be passed in`
);
return;
}
Expand All @@ -41,7 +41,7 @@ function main() {
` --fee ${argv.fee || "eth"}` +
` ${!argv.reset && "--no-reset "}` +
` && ts-node ../scripts-ts/helpers/parse-deployments.ts && cd ..`,
{ stdio: "inherit" },
{ stdio: "inherit" }
);
} catch (error) {
console.error("Error during deployment:", error);
Expand Down

0 comments on commit ffdb0b3

Please sign in to comment.