Support dynamic array event sources#1871
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4081e31. Configure here.
| | Expr.param name => | ||
| pure (some | ||
| { lengthExpr := YulExpr.ident s!"{name}_length" | ||
| dataOffsetExpr := indexedDynamicBaseOffsetExpr dynamicSource name |
There was a problem hiding this comment.
Wrong base offset for param array event source
High Severity
In eventDynamicArraySource?, the Expr.param name case sets dataOffsetExpr to indexedDynamicBaseOffsetExpr dynamicSource name, which resolves to {name}_abs_offset (the position of the array's length word). The old code used YulExpr.ident s!"{name}_data_offset", which points 32 bytes later to the first data element. Since dataOffsetExpr is used as the base for element iteration (dataOffsetExpr + i * elemWordSize), every element read is off by −32 bytes — element 0 reads the length word itself, and all subsequent reads are shifted.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 4081e31. Configure here.


Summary
Notes
This extends the encoder/model path needed for source-shaped dynamic array event payloads. The current executable surface still has , so fully source-level heterogeneous event argument lists remain a separate follow-up.
Verification
Note
Medium Risk
Extends event ABI encoding/validation for dynamic arrays and changes macro lowering of
emitarguments, which can affect generated Yul for event payloads and topic hashing. Scope is limited to dynamic-array event args, with added feature tests to catch regressions.Overview
Enables event emission to source
uint256[]-style dynamic array payloads not only from direct parameters, but also from memory-backed locals and projected dynamic members (via new sentinelExpr.*Lengthforms), by plumbing a unifiedEventDynamicArraySourceinto both indexed-topic hashing and unindexed data encoding.Adds validation for these new event-argument shapes, updates the Verity macro so
emitlowers eligible array expressions into the new sentinels, and adds compilation-model feature tests that ensure both memory and projected dynamic array sources compile.Reviewed by Cursor Bugbot for commit 4081e31. Bugbot is set up for automated code reviews on this repo. Configure here.