Skip to content

fix: handle anonymous events in encodeEventTopics#4576

Closed
tenderdeve wants to merge 1 commit into
wevm:mainfrom
tenderdeve:fix/4461-anonymous-event-topics
Closed

fix: handle anonymous events in encodeEventTopics#4576
tenderdeve wants to merge 1 commit into
wevm:mainfrom
tenderdeve:fix/4461-anonymous-event-topics

Conversation

@tenderdeve
Copy link
Copy Markdown

encodeEventTopics unconditionally prepended the event signature as topic[0], which is incorrect for anonymous events. Anonymous events have no signature topic per the Solidity ABI spec, so all 4 topic slots are available for indexed parameters.

This skips the signature when abiItem.anonymous is true and widens the return type accordingly.

Fixes #4461

Anonymous events should not have their signature prepended as topic[0].
Previously, encodeEventTopics unconditionally added the event signature
as the first topic, which is incorrect for anonymous events per the
Solidity ABI spec.

Fixes wevm#4461
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

@tenderdeve is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 4, 2026

⚠️ No Changeset found

Latest commit: fea0837

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

@jxom jxom closed this May 4, 2026
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.

encodeEventTopics() (and watchLogs()) do not handle anonymous events

2 participants