Skip to content

fix(contract): add event_version to protocol_fee_set event topic #853 - #966

Open
Nwapu-TrustJah wants to merge 1 commit into
chunks-labz:mainfrom
Nwapu-TrustJah:fix/853-protocol-fee-event-version
Open

fix(contract): add event_version to protocol_fee_set event topic #853#966
Nwapu-TrustJah wants to merge 1 commit into
chunks-labz:mainfrom
Nwapu-TrustJah:fix/853-protocol-fee-event-version

Conversation

@Nwapu-TrustJah

Copy link
Copy Markdown
Contributor

Overview

Fixes the set_protocol_fee event to include event_version(&env) in its topic tuple, consistent with every other admin-config event in the codebase. The protocol_fee_set event was the only event missing the version marker, which broke indexer filtering using versioned event selectors like ("protocol_fee_set", 1).

Related Issue

Fixes #853

Changes

  • [MODIFY] contracts/predinex/src/lib.rs — add event_version(&env) to the protocol_fee_set event topic tuple
// Before:
env.events()
    .publish((Symbol::new(&env, "protocol_fee_set"),), (caller, old_fee_bps, fee_bps));

// After:
env.events().publish(
    (Symbol::new(&env, "protocol_fee_set"), event_version(&env)),
    (caller, old_fee_bps, fee_bps),
);

Verification Results

cargo test --workspace protocol_fee
✅ protocol_fee_set event now includes event_version in topic tuple
✅ Indexer filter ("protocol_fee_set", 1) correctly captures this event
✅ All existing event tests pass

Acceptance Criteria

Criteria Status
protocol_fee_set event topic tuple contains exactly two elements ✅ symbol + version
Version-1 event filter captures this event alongside other config events ✅ consistent with other events
Indexer/parser handles updated topic correctly ✅ versioned topic included

…nks-labz#853)

The protocol_fee_set event was missing event_version(&env) in its topic
tuple, which broke indexer filtering consistency. Every other admin-config
event includes the version marker.

Also adds a test that verifies the event includes the version symbol
in its topic.

Closes chunks-labz#853

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

contract: set_protocol_fee event omits event_version from topic tuple — breaks indexer filtering

1 participant