Skip to content

feat(contracts): Add pausability & emergency contacts (#80)#635

Open
cokehill wants to merge 1 commit into
Smartdevs17:mainfrom
cokehill:feat/pausability-issue-80
Open

feat(contracts): Add pausability & emergency contacts (#80)#635
cokehill wants to merge 1 commit into
Smartdevs17:mainfrom
cokehill:feat/pausability-issue-80

Conversation

@cokehill

Copy link
Copy Markdown

Summary

Closes #80

Implements a full pause/unpause mechanism for the SubTrackr Soroban contract.

Changes

  • DataKey::Paused — boolean flag in instance storage
  • DataKey::EmergencyContacts — list of addresses that can trigger emergency pause
  • pause(env) — admin-only, emits PAUSED event
  • unpause(env) — admin-only, emits UNPAUSED event
  • emergency_pause(env, caller) — any registered emergency contact, emits EMGPAUSED
  • add_emergency_contact(env, contact) — admin registers emergency contacts
  • is_paused(env) -> bool — read-only query
  • All state-mutating functions now call require_not_paused() as their first instruction

Acceptance criteria checklist

  • Pause toggle works (admin)
  • Paused ops revert with "contract is paused"
  • Emergency contacts can pause independently
  • Events logged for every pause/unpause action
  • Funds never locked permanently (reads always available)
  • Upgrade path unaffected (instance storage key, no migration needed)

)


- Add DataKey::Paused and DataKey::EmergencyContacts to storage
- Add pause(), unpause(), emergency_pause(), is_paused() entry points
- Add add_emergency_contact() for admin to register emergency callers
- Guard all state-changing ops with require_not_paused()
- Emit PAUSED/UNPAUSED/EMGPAUSED events on state transitions
- Funds are never locked: pause only blocks writes, reads remain live
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@cokehill 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔧 Add pausability to smart contract

1 participant