Skip to main content

States

Every Pacta agreement is always in one of six states:

State Transitions

Created → Active

Happens automatically when both parties deposit their funds. The agreement moves to Active the moment the second deposit lands.

Active → Settled

Happens when:
  1. All release conditions in the bitmask are satisfied
  2. Any address calls settle()
Settlement is permissionless — bots, keepers, or AI agents can trigger it.

Active → Cancelled

  • The creator can cancel before party B deposits
  • Either party can cancel if only one has deposited
  • Both parties can agree to cancel via mutualCancel()
  • Anyone can cancel an expired agreement via cancelExpired()

Active → Disputed

Either party can raise a dispute at any time while the agreement is Active. Once raised, only the arbiter can move the agreement forward.

Disputed → Dispute Resolved

The arbiter calls resolveDispute() and specifies who wins. Funds are distributed accordingly.

In Code

Checking Deposit and Approval Status

Claiming Funds After Settlement

Settlement does not automatically send funds to each party’s wallet. Each party must call claimCoin() to pull their allocation. This is by design — it keeps settlement atomic and gas efficient.