Documentation Index
Fetch the complete documentation index at: https://pacta.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
States
Every Pacta agreement is always in one of six states:| State | Value | Meaning |
|---|---|---|
Created | 0 | Agreement exists on-chain. Waiting for deposits. |
Active | 1 | Both parties have deposited. Waiting for conditions to be met. |
Settled | 2 | All conditions met. Funds released to recipients. |
Cancelled | 3 | Agreement was cancelled before settlement. |
Disputed | 4 | A party raised a dispute. Waiting for arbiter to rule. |
DisputeResolved | 5 | Arbiter has ruled. Funds distributed per resolution. |
State Transitions
Created → Active
Happens automatically when both parties deposit their funds. The agreement moves toActive the moment the second deposit lands.
Active → Settled
Happens when:- All release conditions in the bitmask are satisfied
- Any address calls
settle()
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 isActive. Once raised, only the arbiter can move the agreement forward.
Disputed → Dispute Resolved
The arbiter callsresolveDispute() 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 callclaimCoin() to pull their allocation. This is by design — it keeps settlement atomic and gas efficient.