Skip to main content

Overview

CompactArbiter serves as the core integration layer with TheCompact’s resource locking system, enabling arbiters to unlock tokens and assets that were previously locked on origin chains.
TheCompact is a protocol for cross-chain resource management where users can lock resources on one chain and later unlock them on another chain through cryptographic proofs and signatures.

Key Capabilities

  • Multichain claims: Unlocking resources when the current chain is the notarized chain
  • Exogenous claims: Unlocking resources when operating on a non-notarized chain
  • Batch operations: Efficient processing of multiple token unlocks in single transaction
  • Signature validation: EIP-712 compliant mandate verification for secure unlocking
  • Cross-chain coordination: Managing state transitions across multiple blockchain networks

Architecture

The contract abstracts away the complexity of TheCompact’s claim operations while providing standardized interfaces for settlement-specific arbiters to leverage resource unlocking.
Security: All claim operations include sponsor validation to prevent unauthorized unlocking. Mandate hashes ensure cryptographic integrity of cross-chain operations. Failed claims revert transactions to maintain atomic settlement guarantees.

Constructor

address
required
The address of TheCompact claims contract that manages resource locks and unlocks. Must be a valid ITheCompactClaims implementation for the target network.
The compact address cannot be changed after deployment. Ensure you provide the correct address during contract initialization.

State Variables

CLAIM

TheCompact claims contract interface for unlocking locked resources. This is the core interface to TheCompact protocol for resource management.

STRING_MANDATE_STRIPPED

EIP-712 typestring for mandate verification in TheCompact claims.
This is the witness typestring used by TheCompact for validating cross-chain mandates. The string defines the structure of the mandate data that gets hashed and signed. The “stripped” version excludes the leading “Mandate mandate)” portion as required by TheCompact.

Claim Functions

Notarized Chain Unlock

Unlocks resources from TheCompact for orders originating from the notarized chain.
Handles the case where resources were locked on the chain where the order was notarized, and now need to be unlocked for cross-chain settlement. Uses batchMultichainClaim for standard cross-chain resource unlocking.

Parameters

Types.Order
required
The order containing token inputs and settlement details.
bytes32[]
required
Additional chain elements for multi-chain validation.
bytes
required
The signature from the origin chain authorizing the unlock.
bytes
required
The allocator-specific data for resource allocation.
address
required
The address that will receive the unlocked tokens.
bytes32
required
The mandate hash for TheCompact validation.

Returns

bytes32
The claim hash returned by TheCompact, used for tracking and validation.

Implementation

The function handles both single and batch token unlocking:
For orders with a single token input, uses multichainClaim for gas efficiency:
Prevents the arbiter from being the sponsor with require(sponsor != address(this), InvalidOrderData()) as a security check. Ensures the claim was successful with require(claimHash != bytes32(0), ClaimFailed()).

Exogenous Chain Unlock

Unlocks resources from TheCompact for orders originating from external (non-notarized) chains.
Handles the case where resources were locked on a different chain than where the order was notarized. Uses exogenousBatchClaim for cross-chain resource unlocking where the current chain is not the notarized chain.

Parameters

Types.Order
required
The order containing token inputs and settlement details.
bytes
required
The signature from the origin chain authorizing the unlock.
uint256
required
The chain ID where the order was originally notarized.
uint256
required
The index of the current chain in the cross-chain element array.
bytes32[]
required
Additional chain elements for multi-chain validation.
bytes
required
The allocator-specific data for resource allocation.
address
required
The address that will receive the unlocked tokens.
bytes32
required
The mandate hash for TheCompact validation.

Returns

bytes32
The claim hash returned by TheCompact, used for tracking and validation.

Implementation

Similar to notarized chain unlocking, handles both single and batch tokens:

Modifiers

requireOtherChain

Validates that an order is for cross-chain settlement.
Ensures the order doesn’t have target operations (which would indicate same-chain execution) and that the notarized chain ID differs from the current chain.

Errors

ClaimFailed

Thrown when a claim operation to TheCompact fails. This indicates that the unlock operation did not succeed, typically due to invalid signatures, expired claims, or insufficient locked resources.

InvalidOrderData

Thrown when order data is invalid or malformed. This can occur when:
  • Target operations are present in a cross-chain order
  • Notarized chain ID equals current chain ID for exogenous claims
  • Sponsor address is the arbiter contract itself

Events

ProcessedClaim

Emitted when a claim is successfully processed through TheCompact.
address
The address that sponsored the original order.
uint256
The unique identifier of the processed order.
bytes32
The hash returned by TheCompact claim operations.

Gas Optimization

Single vs batch claim operations are automatically selected based on token count:
  • 1 token: Uses multichainClaim or exogenousClaim (lower gas)
  • Multiple tokens: Uses batchMultichainClaim or exogenousBatchClaim (optimized batch processing)
Immutable interface storage minimizes gas costs for repeated operations.

Source Code Reference

Location: /src/base/arbiter/CompactArbiter/CompactArbiter.sol:46