Skip to main content

Overview

BaseProver is an abstract contract that provides core storage and functionality for tracking proven intents and their claimants. All prover implementations inherit from this contract. Contract: contracts/prover/BaseProver.sol Inheritance: IProver, ERC165

Key Concepts

Proof Data Structure

Each proven intent is stored with:
  • claimant: Address eligible to claim rewards
  • destination: Chain ID where the intent was proven

Intent Tracking

Proven intents are tracked in the _provenIntents mapping. An empty struct (zero claimant) indicates an intent hasn’t been proven yet.

Constructor

Initializes the BaseProver contract.
address
required
Address of the Portal contract. Cannot be zero address.
Errors:
  • ZeroPortal(): Thrown if portal address is zero

State Variables

PORTAL

Address of the Portal contract. Immutable to prevent unauthorized changes.

View Functions

provenIntents

Returns proof data for a given intent hash.
bytes32
required
The intent hash to query
Returns: ProofData struct containing:
  • claimant (address): Address eligible to claim rewards
  • destination (uint64): Chain ID where intent was proven
Location: contracts/prover/BaseProver.sol:34

Internal Functions

_processIntentProofs

Processes intent proofs from a cross-chain message.
bytes
required
Encoded (intentHash, claimant) pairs. Must be a multiple of 64 bytes (32 for hash + 32 for claimant).
uint64
required
Chain ID where the intent is being proven
Behavior:
  • Returns early if data is empty
  • Validates data length is multiple of 64 bytes
  • Skips non-EVM addresses that can’t be converted
  • Skips zero addresses
  • Emits IntentAlreadyProven for already-proven intents (doesn’t revert)
  • Emits IntentProven for newly proven intents
Errors:
  • ArrayLengthMismatch(): Data length is not a multiple of 64 bytes
Location: contracts/prover/BaseProver.sol:57

External Functions

challengeIntentProof

Challenges an intent proof if the destination chain ID doesn’t match. This is a safety mechanism to ensure intents are only claimable when executed on their intended destination chains.
uint64
required
The intended destination chain ID
bytes32
required
The hash of the intent’s route
bytes32
required
The hash of the reward specification
Behavior:
  • Computes intentHash from destination, routeHash, and rewardHash
  • Only invalidates if proof exists AND destination doesn’t match
  • Deletes the proof from storage
  • Emits IntentProofInvalidated event
Note: Can be called by anyone to remove invalid proofs. Location: contracts/prover/BaseProver.sol:112

supportsInterface

Implements ERC165 interface detection.
bytes4
required
Interface identifier to check
Returns: true if the interface is supported

Events

IntentProven

Emitted when an intent is successfully proven.

IntentAlreadyProven

Emitted when attempting to prove an already-proven intent. Uses event instead of error to allow batch processing to continue.

IntentProofInvalidated

Emitted when an intent proof is invalidated via challenge.

Errors

ZeroPortal

Thrown when portal address is zero during construction.

ArrayLengthMismatch

Thrown when proof data length is not a multiple of 64 bytes.