Skip to content

Only strip dataSuffix hex prefix#518

Open
samsamtrum wants to merge 1 commit into
pimlicolabs:mainfrom
samsamtrum:fix-data-suffix-prefix-strip
Open

Only strip dataSuffix hex prefix#518
samsamtrum wants to merge 1 commit into
pimlicolabs:mainfrom
samsamtrum:fix-data-suffix-prefix-strip

Conversation

@samsamtrum

Copy link
Copy Markdown

Summary

Only strips a leading 0x from dataSuffix in writeContract.

Why

writeContract appends dataSuffix to encoded calldata, but currently uses dataSuffix.replace("0x", ""). That removes the first 0x anywhere in the suffix, not necessarily the hex prefix.

For example, a suffix like 12340x5678 would be changed to 12345678 even though it does not have a leading hex prefix.

Change

  • Uses replace(/^0x/, "") so only an actual prefix is stripped.
  • Adds regression coverage for preserving an internal 0x substring.

@changeset-bot

changeset-bot Bot commented May 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5aaa4bb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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