Skip to content

feat(admin): add contract pause/unpause emergency circuit-breaker - #448

Merged
3m1n3nc3 merged 3 commits into
geevapp:mainfrom
OWK50GA:feat/contract-emergency-pause
Aug 30, 2026
Merged

feat(admin): add contract pause/unpause emergency circuit-breaker#448
3m1n3nc3 merged 3 commits into
geevapp:mainfrom
OWK50GA:feat/contract-emergency-pause

Conversation

@OWK50GA

@OWK50GA OWK50GA commented Aug 30, 2026

Copy link
Copy Markdown

Pull Request Template

Description

  • Add require_not_paused guard to block value-moving entrypoints when paused
  • Implement pause and unpause admin-only functions for emergency control
  • Add ContractPaused and ContractUnpaused event types for state transitions
  • Guard create_giveaway, enter_giveaway, and claim_prize with pause check
  • Guard donate and claim_help_request_funds with pause check
  • Persist pause state in instance storage under DataKey::Paused
  • Allow admin_withdraw and unpause to remain callable while paused
  • Add comprehensive test coverage for pause/unpause lifecycle and access control
  • Add 15 test snapshot files validating pause behavior across all guarded entrypoints

Checklist

  • I have tested my changes locally
  • I have updated documentation as needed
  • I have run npx prisma generate after schema changes
  • I have run npx prisma migrate dev or npx prisma migrate deploy as appropriate

Post-Merge Steps for Maintainers

If this PR includes changes to the Prisma schema:

  1. Run the following command to apply the migration to your database:

    npx prisma migrate deploy

    or, for local development:

    npx prisma migrate dev
  2. Ensure your CI pipeline runs the migration before tests (add this step if missing):

    - name: Run Prisma Migrate
      run: npx prisma migrate deploy
  3. Make sure the database user in CI has permission to run migrations.


If you have any questions, please comment on this PR.

Closes #434

OWK50GA added 3 commits August 30, 2026 18:11
- Add `require_not_paused` guard to block value-moving entrypoints when paused
- Implement `pause` and `unpause` admin-only functions for emergency control
- Add `ContractPaused` and `ContractUnpaused` event types for state transitions
- Guard `create_giveaway`, `enter_giveaway`, and `claim_prize` with pause check
- Guard `donate` and `claim_help_request_funds` with pause check
- Persist pause state in instance storage under `DataKey::Paused`
- Allow `admin_withdraw` and `unpause` to remain callable while paused
- Add comprehensive test coverage for pause/unpause lifecycle and access control
- Add 15 test snapshot files validating pause behavior across all guarded entrypoints
- Move `require_not_paused` import to top of file in giveaway.rs
- Move `require_not_paused` import to top of file in mutual_aid.rs
- Standardize import ordering across modules for consistency
@3m1n3nc3
3m1n3nc3 merged commit 53e20fb into geevapp:main Aug 30, 2026
2 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.

[Admin] Add emergency pause circuit breaker for geev-core

2 participants