Skip to content

feat(contract): add emergency pause mechanism (#672) - #721

Merged
Dev-AdeTutu merged 1 commit into
Dev-AdeTutu:mainfrom
nupedev:feature/672-emergency-pause
Aug 27, 2026
Merged

feat(contract): add emergency pause mechanism (#672)#721
Dev-AdeTutu merged 1 commit into
Dev-AdeTutu:mainfrom
nupedev:feature/672-emergency-pause

Conversation

@nupedev

@nupedev nupedev commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #672

Adds an emergency pause mechanism to the SolarGrid Soroban contract and exposes the state in the frontend.

Changes

  • Adds admin-only pause(), unpause(), and is_paused() contract methods.
  • Blocks make_payment and register_meter while paused.
  • Keeps update_usage and read-only contract methods available during a pause.
  • Automatically clears a pause at the 48-hour maximum and emits contract_unpaused.
  • Emits contract_paused and contract_unpaused lifecycle events.
  • Adds a global frontend ContractPauseBanner that polls the contract pause view and uses the existing English/French i18n catalogs.
  • Adds the rlib target needed for isolated contract integration tests and fixes the existing apply_usage balance lookup that was preventing usage updates from compiling.

Verification

  • cargo test -p solar_grid --test emergency_pause — 2 passed.
  • git diff --check — passed.

The complete upstream contract unit-test target currently has unrelated pre-existing Symbol/String test-harness compilation errors; the new integration suite passes independently against the production contract library.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

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

@Dev-AdeTutu
Dev-AdeTutu merged commit 8ddd111 into Dev-AdeTutu:main Aug 27, 2026
0 of 4 checks passed
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 emergency pause mechanism to smart contract

2 participants