Skip to main content
PolymerProver uses a fundamentally different architecture from other bridge integrations. Instead of sending cross-chain messages, it emits events on the destination chain that are proven on the source chain using Polymer’s CrossL2ProverV2.

Contract Overview

Location: contracts/prover/PolymerProver.sol
contracts/prover/PolymerProver.sol
PolymerProver extends BaseProver directly, NOT MessageBridgeProver. It does not send cross-chain messages.

Constructor

From PolymerProver.sol:53-65:
contracts/prover/PolymerProver.sol

Parameters

address
Address of the Portal contract that manages rewards
address
Address of Polymer’s CrossL2ProverV2 contract for event validation
uint256
Maximum allowed size for encodedProofs in event data. Must be between 1 and 32,768 bytes.
bytes32[]
Array of whitelisted prover addresses on other chains (as bytes32)

Prove Function

Different from other provers! From PolymerProver.sol:194-206:
contracts/prover/PolymerProver.sol
Unlike other provers, Polymer uses actual chain IDs, not bridge-specific domain IDs. The sourceChainDomainID parameter should be the actual chain ID of the source chain.

Key Differences

  1. No cross-chain message: Only emits an event
  2. No fee calculation: Events are free to emit
  3. No data parameter: The 4th parameter is unused
  4. Uses chain IDs: Not bridge-specific domain IDs

Event Structure

From PolymerProver.sol:27:
contracts/prover/PolymerProver.sol
The event contains:
  • source: Chain ID where the intent was created (indexed)
  • encodedProofs: Encoded (intentHash, claimant) pairs

Event Selector

From PolymerProver.sol:21-22:
contracts/prover/PolymerProver.sol

Validate Function

Proofs are validated on the source chain using validate() (from PolymerProver.sol:83-148):
contracts/prover/PolymerProver.sol

Batch Validation

From PolymerProver.sol:73-77:
contracts/prover/PolymerProver.sol

Validation Constants

From PolymerProver.sol:23-24:
contracts/prover/PolymerProver.sol

Usage Example

On Destination Chain (Emit Event)

On Source Chain (Validate Proof)

Chain ID Reference

Polymer uses actual chain IDs, not bridge-specific domain IDs.
Common chain IDs:

Security Considerations

Whitelist Validation

Only events emitted from whitelisted prover contracts are accepted (from PolymerProver.sol:91-93):
contracts/prover/PolymerProver.sol

Event Signature Validation

The contract validates the exact event signature (from PolymerProver.sol:123):
contracts/prover/PolymerProver.sol

Chain ID Validation

Multiple chain ID checks prevent cross-chain replay attacks:
contracts/prover/PolymerProver.sol

Data Size Limits

The contract enforces maximum event data size (from PolymerProver.sol:60-62):
contracts/prover/PolymerProver.sol

Architecture Comparison

  • BaseProver - Base proving functionality
  • Inbox - Intent fulfillment and proving
  • CrossL2ProverV2 (Polymer) - Event validation contract