Fix: add missing ContractInitialized and PauseToggled events across all contracts - #44
Open
Songu3020 wants to merge 3 commits into
Open
Fix: add missing ContractInitialized and PauseToggled events across all contracts#44Songu3020 wants to merge 3 commits into
Songu3020 wants to merge 3 commits into
Conversation
- Created test snapshot for pool balance reflecting funding, ensuring that the balance updates correctly after funding. - Added test snapshot for verifying that the pool balance returns zero initially. - Implemented test snapshot to confirm that token decimals return the expected value of seven.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#closes
#29
Problem
Several state-changing operations across the six contracts didn't emit events, creating an asymmetry that broke off-chain indexers relying on events as the source of truth:
reward-pool::set_pause— toggled global pause with no event.reward-pool::initialize— bootstrap with no event.course-registry::initialize— same.badge-nft::initialize— same.stake-vault::initialize,quest-engine::initialize,governance::initialize— these already emitted init events correctly.With half the contracts silent on init and pause, indexers had no way to reconstruct admin wiring from events alone and were forced to poll instead of reacting to the moment a contract was initialized or paused.
Fix
Added two new, consistently-named event types emitted across all six contracts:
ContractInitialized { admin, role_addresses... }— now emitted by everyinitialize(), including the three that previously emitted nothing (reward-pool,course-registry,badge-nft), and left unchanged in behavior for the three that already emitted an init event.PauseToggled { admin, status }— now emitted symmetrically by everyset_pause(), includingreward-pool::set_pause(previously silent) andquest-engine::set_pause(brought in line with the others).Naming follows the
ContractInitialized,PauseToggled,AdminTransferredconvention noted in the issue, keeping this consistent with the related two-step admin transfer work (#20).Files changed
reward-pool,course-registry,badge-nft,stake-vault,quest-engine,governanceTesting
ContractInitializedis emitted on every contract'sinitialize().PauseToggledis emitted on every contract'sset_pause(), includingreward-poolandquest-engine.stake-vault,quest-engine, andgovernanceinit events remain green — no behavior change for contracts that already emitted correctly.