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
Address of the Portal contract. Cannot be zero address.
ZeroPortal(): Thrown if portal address is zero
State Variables
PORTAL
View Functions
provenIntents
The intent hash to query
ProofData struct containing:
claimant(address): Address eligible to claim rewardsdestination(uint64): Chain ID where intent was proven
contracts/prover/BaseProver.sol:34
Internal Functions
_processIntentProofs
Encoded (intentHash, claimant) pairs. Must be a multiple of 64 bytes (32 for hash + 32 for claimant).
Chain ID where the intent is being proven
- 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
IntentAlreadyProvenfor already-proven intents (doesn’t revert) - Emits
IntentProvenfor newly proven intents
ArrayLengthMismatch(): Data length is not a multiple of 64 bytes
contracts/prover/BaseProver.sol:57
External Functions
challengeIntentProof
The intended destination chain ID
The hash of the intent’s route
The hash of the reward specification
- Computes intentHash from destination, routeHash, and rewardHash
- Only invalidates if proof exists AND destination doesn’t match
- Deletes the proof from storage
- Emits
IntentProofInvalidatedevent
contracts/prover/BaseProver.sol:112
supportsInterface
Interface identifier to check
true if the interface is supported