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.
Problem
unlock_assetsreturns total credits but doesn't emit an event with the credits earned. Indexers cannot track credit distributions.Impact
Fix
Add an event emission:
Location
contracts/farming-pool/src/lib.rs,unlock_assetsfunction, after line 500.