Skip to content

HAMSTR-813 auto release on arbitrated release#16

Merged
jrkosinski merged 1 commit intoLoadPipe:multi-head-escrow-rdfrom
HQS-Gun:HAMSTR-813-auto-release-on-arbitrated-release
Jul 30, 2025
Merged

HAMSTR-813 auto release on arbitrated release#16
jrkosinski merged 1 commit intoLoadPipe:multi-head-escrow-rdfrom
HQS-Gun:HAMSTR-813-auto-release-on-arbitrated-release

Conversation

@HQS-Gun
Copy link

@HQS-Gun HQS-Gun commented Jul 30, 2025

Motivation

In the new arbitration logic, the lifecycle of arbitration goes like this:
Proposal
A buyer or seller submits a proposal to either refund (to payer) or release (to receiver) a specific amount. At that point, it’s just a proposal.
Voting
Arbiters (those who are registered as arbiters for the escrow) vote on the proposal. When it reaches a certain number of ‘yes’ votes, it’s automatically set to “ACCEPTED” status. But it isn’t executed at that point.
Execution
Anyone can execute a proposal, IF it’s been accepted (if it’s status is ACCEPTED, that is). But it’s a separate step… if nobody calls the execute method on the arbitration module, then the effect of the accepted proposal never takes effect.

Changes:

  1. Add autoExecute boolean property to ArbitrationProposal struct
  2. Update proposeArbitration() function to accept autoExecute parameter
  3. Implement auto-execution logic in voteArbitration() when proposal becomes ACCEPTED
  4. Add executeArbitrationProposal() method to PolyEscrow for ArbitrationModule to call
  5. Update all existing test calls to include new autoExecute parameter

Test:

  1. testAutoExecuteFalse() - Verifies proposals with autoExecute=false become ACCEPTED but don't auto-execute
  2. testAutoExecuteTrue() - Verifies proposals with autoExecute=true automatically execute when ACCEPTED
  3. Run forge test --match-contract AutoExecuteTest to verify both behaviors work correctly.

@jrkosinski jrkosinski merged commit a0ad9c8 into LoadPipe:multi-head-escrow-rd Jul 30, 2025
1 check failed
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.

2 participants