Conversation
|
@somotochukwu-dev 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! 🚀 |
|
@Stanley-Owoh is attempting to deploy a commit to the Jaja's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Kindly resolve the conflicts |
…o add-contract-pause-emergency-stop-373
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(smart-contracts): add per-contract emergency pause mechanism
Summary
Introduces a per-contract emergency-stop (pause) mechanism across all Soroban smart contracts so a flawed upgrade can never brick funds or state. When paused, all mutable entry points are rejected with
ContractPaused; read-only queries remain unaffected. Every pause/unpause emits an on-chain event for off-chain monitoring.What changed
7 contracts modified — each follows the canonical
agent_registrypattern:agent_biddingpause()/unpause()/is_paused()(bidding, paused/unpaused)error-registrypause()/unpause()/is_paused()(errreg, paused/unpaused)upgrade-managerpause()/unpause()/is_paused()(upgrade, paused/unpaused)error-resolverpause()/unpause()/is_paused()(errres, paused/unpaused)task_storepause()/unpause()/is_paused()dispute_resolutionpause(bool)→pause()/unpause()/is_paused()(dispute, paused/unpaused)agent_marketplacepause(bool)→pause()/unpause()/is_paused()(market, paused/unpaused)New error variants:
agent_bidding::Error::ContractPaused = 18error_registry::Error::ContractPaused = 4upgrade_manager::ContractError::ContractPaused = 13error_resolver::ContractError::ContractPaused = 4task_store::Error::ContractPaused = 10(
dispute_resolutionandagent_marketplacealready hadContractPaused = 4.)New storage keys (where absent):
DataKey::Admin— set duringinitialize()(agent_bidding, error-registry, task_store)DataKey::Paused— boolean, defaults tofalseDesign decisions
pause()/unpause()instead ofpause(bool)— matches theagent_registrycanonical pattern, avoids accidental unpause via misordered argument, and makes events unambiguous.require_not_pausedgating — every mutable entry point callsrequire_not_paused(&env)?as its first operation; error code isContractPaused(contract-local, no cross-contract collision).pause,unpause, andinitializeall emit scoped events ((prefix, "paused"),(prefix, "unpaused"),(prefix, "init")) for off-chain monitoring.get_*,list_*,is_*functions remain ungated so dashboards and indexers continue to work during an emergency pause.Verification
Non-workspace crates (
task_store,dispute_resolution,agent_marketplace) were verified to compile viacargo buildand their pause tests are correct, but their full test suites are blocked by pre-existing issues unrelated to this change.Resolves
Closes #373