Skip to content

feat(pause): emit events on pause and unpause - #843

Merged
dzekojohn4 merged 1 commit into
UnityChainxx:mainfrom
1Judah:feat/issue-682-pause-events
Oct 20, 2026
Merged

dzekojohn4 merged 1 commit into
UnityChainxx:mainfrom
1Judah:feat/issue-682-pause-events

Conversation

@1Judah

@1Judah 1Judah commented Oct 20, 2026

Copy link
Copy Markdown

Summary

Adds event emission to the contract's emergency pause and unpause entrypoints. This makes pause-state transitions observable off-chain so indexers, dashboards, and monitoring can react when the contract is halted or resumed.

Problem

The contract already exposed pause and unpause to halt and restore sensitive entrypoints, and is_paused to read the current state. However, transitioning the pause state produced no on-chain event. Clients could only detect a change by polling is_paused, and there was no canonical log entry recording when or in what order the contract was paused or unpaused.

Changes Made

  • pause now publishes a paused event after setting the paused flag.
  • unpause now publishes an unpaused event after clearing the paused flag.

Both entrypoints remain admin-gated via the existing require_admin helper, and both events are emitted only after the storage write succeeds. Only onchain/contracts/stellar_hunts/src/lib.rs was modified.

Implementation Details

The event follows the same pattern used elsewhere in the contract: env.events().publish with a Symbol topic. Because the pause flag carries no payload, the topic tuple is paired with an empty data value. Publishing after the state write keeps the event consistent with the persisted flag.

Closes #677

Closes #679

Closes #682

Closes #684

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@1Judah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dzekojohn4 dzekojohn4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dzekojohn4
dzekojohn4 merged commit 2262f16 into UnityChainxx:main Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants