-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Summary
Envio does not currently support indexing anonymous Solidity events that use all 4 topic slots for indexed parameters. Since anonymous events don't emit the event signature as topic0, they can use all 4 topic slots for indexed data — but Envio's codegen assumes topic0 is always the event selector and only supports up to 3 indexed parameters.
Current Behavior
- Adding
indexedto all 4 parameters inconfig.yamlcauses codegen to fail becauseLogSelection.parseEventFiltersOrThrowonly supports up to~topic3. - Removing
indexedfrom the event definitions allows codegen to pass, but the indexer cannot match the events on-chain since the topic layout doesn't match. - The generated code in
Types.res.jssets"anonymous": falsein the ABI and uses asighashfortopic0filtering, neither of which apply to anonymous events.
Expected Behavior
Envio should support anonymous events by:
- Allowing 4 indexed parameters in event definitions (since
topic0is not used for the event selector) - Setting
"anonymous": truein the generated ABI - Skipping
sighash/topic0filtering for anonymous events
Testing steps
You can test the indexing of an annonymous event by using this contract:
- Chain ID: Mainnet
- Contract name:
LockstakeMigrator - Contract address:
0x473d777f608C3C24B441AB6bD4bBcA6b7F9AF90B - Event:
event Migrate(
address indexed oldUrn,
address indexed newUrn,
address indexed caller,
uint256 indexed ink
) anonymous;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels