Skip to content

Feat/629 admin controls pause unpause#735

Merged
Idrhas merged 3 commits into
Farm-credit:mainfrom
xtrial01:feat/629-admin-controls-pause-unpause
Jun 30, 2026
Merged

Feat/629 admin controls pause unpause#735
Idrhas merged 3 commits into
Farm-credit:mainfrom
xtrial01:feat/629-admin-controls-pause-unpause

Conversation

@xtrial01

Copy link
Copy Markdown

Summary

Implements an emergency pause/unpause mechanism in the admin-controls contract. When the system is paused, all state-changing operations across contracts (minting, transferring, etc.) are blocked until an admin explicitly unpauses.

Closes #629


Changes

contracts/admin-controls

  • Added pause() function — callable only by admins, sets the paused state
  • Added unpause() function — callable only by admins, clears the paused state

State-changing endpoint guards

  • contracts/carbon-marketplace/src/lib.rs — paused check added
  • contracts/escrow/src/lib.rs — paused check added
  • contracts/farmer-registry/src/lib.rs — paused check added
  • contracts/planter-registry/src/lib.rs — paused check added
  • contracts/harvesta-errors/src/lib.rs — added relevant error variant for paused state

Workspace

  • contracts/Cargo.toml / Cargo.lock — updated to include admin-controls as a workspace member
  • Dependent contract Cargo.toml files updated accordingly

Acceptance criteria

  • pause() and unpause() are callable only by admins
  • Check guards integrated across all state-changing endpoints
  • Minting and transferring blocked when system is paused

Testing

  • Unit tests for pause() / unpause() access control
  • Unit tests confirming state-changing ops revert when paused
  • Manual test on testnet

xtrial01 and others added 3 commits June 29, 2026 22:10
…#629)

- Add pause() and unpause() callable only by admins
- Integrate paused check guards on all state-changing endpoints
- Block minting and transferring when contract is paused
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

@Idrhas
Idrhas merged commit 1306534 into Farm-credit:main Jun 30, 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

Development

Successfully merging this pull request may close these issues.

[Contract] Add Pause/Unpause Emergency Freeze to admin-controls

2 participants