Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/rhinestonewtf/warp-router/llms.txt

Use this file to discover all available pages before exploring further.

Overview

ArbiterBase is the foundational contract in the Warp Router ecosystem that enables arbiters to unlock and manage funds on behalf of users. It provides dual protocol support for both TheCompact and Permit2 standards, enabling flexible settlement mechanisms.
ArbiterBase combines CompactArbiter, Permit2Arbiter, and PreClaimExecution functionality into a unified base contract that all arbiters extend.

Key Responsibilities

  • Executes pre-claim operations before settlement
  • Computes mandate hashes for protocol validation
  • Maintains Router-only access control for security
  • Orchestrates the settlement flow for both Compact and Permit2 protocols

Security Model

Only the Router can call settlement functions. This prevents unauthorized access to user funds and ensures proper validation of all operations.
The contract enforces strict access control through the onlyRouter modifier, which validates that msg.sender == ROUTER before allowing any settlement operations.

Constructor

constructor(
    address router,
    address compact,
    address addressBook
)
router
address
required
The Router contract address that will have exclusive access to settlement functions.
compact
address
required
TheCompact protocol contract address for Compact-based settlements.
addressBook
address
required
The AddressBook contract for protocol configuration and address lookup.

Pre-Claim Operations

Compact Pre-Claim Operations

function _compactPreClaimOps(
    Types.Order calldata order,
    Types.Signatures calldata sigs,
    bytes32[] calldata otherElements,
    uint256 elementOffset,
    uint256 notarizedChainId
) internal returns (bytes32 mandateHash)
Orchestrates the pre-settlement validation and execution flow for TheCompact protocol.
1

Compute EIP-712 hashes

Computes hashes for order components including target attributes, operations, and qualifier data.
2

Execute pre-claim operations

If pre-claim operations exist and are ERC7579 type, executes them with proper signature validation.
3

Return mandate hash

Returns the computed mandate hash needed for TheCompact claim operations.

Parameters

order
Types.Order
required
The order containing all settlement data including sponsor, operations, and tokens.
sigs
Types.Signatures
required
The signatures required for validation.
otherElements
bytes32[]
required
Additional elements for cross-chain validation.
elementOffset
uint256
required
The offset for element processing in the order array.
notarizedChainId
uint256
required
The chain ID where the order was notarized.

Operation Types

Pre-claim operations support three execution modes:
Executes operations following the ERC7579 smart account standard. Uses sponsor account, pre-claim operations, and signature validation through TheCompact protocol.
_handlePreClaimOpsCompactERC7579({
    account: order.sponsor,
    order: order,
    signature: sigs,
    elementStub: elementStub,
    notarizedChainId: notarizedChainId,
    preClaimGasStipend: preClaimGasStipend,
    sigMode: order.preClaimOps.extractSigMode()
});

Permit2 Pre-Claim Operations

function _permit2PreClaimOps(
    Types.Order calldata order,
    Types.Signatures calldata sigs
) internal returns (bytes32 mandateHash)
Orchestrates the pre-settlement validation and execution flow for Permit2 protocol.
Unlike Compact integration, Permit2 uses a different stub structure and execution path but maintains the same core validation and mandate hash computation logic.

Parameters

order
Types.Order
required
The order containing all settlement data including sponsor, operations, and tokens.
sigs
Types.Signatures
required
The signatures required for validation, specifically uses notarizedClaimSig for Permit2.

Mandate Hash Computation

The mandate hash is computed using EIP-712 structured data hashing:
mandateHash = EIP712TypeHashLib.hashMandateRaw({
    targetAttributes: targetAttributesHash,
    minGas: minGas,
    preClaimOpsHash: preClaimOpsHash,
    destOpsHash: destOpsHash,
    qHash: qHash
});
The mandate hash uniquely identifies the entire order and its operations, serving as cryptographic proof for both TheCompact and Permit2 protocols.

Access Control

onlyRouter Modifier

modifier onlyRouter() {
    _onlyRouter();
    _;
}
Restricts function access to only the authorized Router contract.
This modifier is critical for maintaining the security model of the arbiter system. It ensures that only the Router can execute settlement operations, preventing:
  • Unauthorized access to user funds
  • Bypass of Router’s validation logic
  • Direct manipulation of arbiter state

requireNoOps Modifier

modifier requireNoOps(Types.Operation calldata ops) {
    _requireNoOps(ops);
    _;
}
Enforces that a claim function does not include any operations.
Use this modifier when arbiters want to restrict claim functions to pure token transfers without any additional pre-claim or destination operations. This is useful for:
  • Simple settlement flows that only require token movement
  • Security-sensitive contexts where operation execution should be prohibited
  • Gas-optimized paths that skip operation processing overhead

Gas Validation

function _requireValidGasLeft(uint128 minGas) private view
Validates that sufficient gas is available to satisfy the minGas requirement.
Accounts for EIP-150’s 63/64 rule: when making a call, only 63/64 of remaining gas is forwarded. To ensure minGas is available in the subcall, we need:requiredGas = minGas + (minGas / 63) + 10_000The 10k buffer covers execution overhead between the check and the actual call. This protects against griefing attacks where callers provide just enough gas to pass validation but not enough to execute the operation.

Errors

OnlyRouter

error OnlyRouter();
Thrown when a function is called by an address other than the authorized Router. This error enforces the critical security boundary that prevents unauthorized entities from executing settlement operations.

NoOperationsAllowed

error NoOperationsAllowed();
Thrown when a claim includes operations but the arbiter requires none. This error is raised when the operation hash does not match the NO_OPS constant.

Interface Support

function supportsInterface(bytes4 selector) public pure virtual returns (bool)
Returns whether the contract implements a given interface.
selector
bytes4
required
The interface identifier to check.
Supports:
  • IERC165.supportsInterface
  • IArbiter interface

Qualifier Hash

function qualificationHash(bytes calldata data) external pure virtual returns (bytes32 result)
Returns the hash of the qualifier data for mandate validation.
data
bytes
required
The qualifier data to hash.

Source Code Reference

Location: /src/base/arbiter/ArbiterBase.sol:33

Build docs developers (and LLMs) love