Skip to content

Escrow Contract Enhancements#677

Merged
nanaf6203-bit merged 4 commits into
MettaChain:mainfrom
ahmadogo:cipher
Jun 26, 2026
Merged

Escrow Contract Enhancements#677
nanaf6203-bit merged 4 commits into
MettaChain:mainfrom
ahmadogo:cipher

Conversation

@ahmadogo

Copy link
Copy Markdown
Contributor

This PR introduces two major enhancements to the escrow contract: a governance-controlled pause/unpause mechanism and an automatic refund feature for expired escrows.
closes #566

  1. Governance-Controlled Pause/Unpause
    To provide administrators with better control over the contract's lifecycle, we've introduced a pausable state.
    closes fix(escrow): Refund expired escrows when no dispute was opened #567
    Changes:
  • New ESCROW_ADMIN Role: A new ESCROW_ADMIN role has been added to access_control.rs to manage the contract's pausable state.
    closes test(escrow): Add fuzz tests for dispute-evidence edge cases #568

  • Pause and Unpause Functions: Only accounts with the ESCROW_ADMIN role can call the new pause() and unpause() functions.

  • State Guard: The create_escrow_advanced, dispute, and release_funds functions are now protected by a when_not_paused guard, preventing them from being executed when the contract is paused.
    closes feat(escrow): Emit structured events for milestone-state transitions #569

  • Events: Paused and Unpaused events are now emitted to allow for off-chain monitoring of the contract's state.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

Escrow hardening is always appreciated @ahmadogo — landed!

Copy link
Copy Markdown
Contributor

@ahmadogo just a heads-up — the recent batch of merges that landed ahead of yours touched some shared surface this PR also lives in (errors/traits around escrow), so this one is now reporting a conflict. The escrow error-model + types work here looks good to me; would you mind rebasing onto current main and pushing it again? I will pick it up as soon as it is clean. 🙏

Copy link
Copy Markdown
Contributor

Escrow enhancements are focused and the access-control trait tweak looks intentional. Cargo.lock refresh is fine. Merging. ✅

Copy link
Copy Markdown
Contributor

🟡 Holding for author coordination. This PR and #698 both modify the same files in escrow (contracts/escrow/src/errors.rs, lib.rs, types.rs, plus Cargo.lock), which prevents a clean automatic merge. The escrow enhancements themselves look solid. Could you rebase onto current main and co-ordinate with the #698 author so both can land cleanly?

@nanaf6203-bit nanaf6203-bit merged commit f57dd85 into MettaChain:main Jun 26, 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

2 participants