Skip to content

[bug] farming-pool: unlock_assets doesn't emit credits_earned event #381

Description

@ritaifeoluwa

Problem

unlock_assets returns total credits but doesn't emit an event with the credits earned. Indexers cannot track credit distributions.

Impact

  • Off-chain systems cannot track credit distributions
  • No audit trail for credit earnings
  • Credit analytics require storage scans

Fix

Add an event emission:

env.events().publish(
    (symbol_short!("pool"), symbol_short!("credits_earned")),
    (user, amount, total_credits),
);

Location

contracts/farming-pool/src/lib.rs, unlock_assets function, after line 500.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfarming-poolFarmingPool contract

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions