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
FromPolymerProver.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! FromPolymerProver.sol:194-206:
contracts/prover/PolymerProver.sol
Key Differences
- No cross-chain message: Only emits an event
- No fee calculation: Events are free to emit
- No data parameter: The 4th parameter is unused
- Uses chain IDs: Not bridge-specific domain IDs
Event Structure
FromPolymerProver.sol:27:
contracts/prover/PolymerProver.sol
source: Chain ID where the intent was created (indexed)encodedProofs: Encoded (intentHash, claimant) pairs
Event Selector
FromPolymerProver.sol:21-22:
contracts/prover/PolymerProver.sol
Validate Function
Proofs are validated on the source chain usingvalidate() (from PolymerProver.sol:83-148):
contracts/prover/PolymerProver.sol
Batch Validation
FromPolymerProver.sol:73-77:
contracts/prover/PolymerProver.sol
Validation Constants
FromPolymerProver.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.
Security Considerations
Whitelist Validation
Only events emitted from whitelisted prover contracts are accepted (fromPolymerProver.sol:91-93):
contracts/prover/PolymerProver.sol
Event Signature Validation
The contract validates the exact event signature (fromPolymerProver.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 (fromPolymerProver.sol:60-62):
contracts/prover/PolymerProver.sol
Architecture Comparison
Related Contracts
- BaseProver - Base proving functionality
- Inbox - Intent fulfillment and proving
- CrossL2ProverV2 (Polymer) - Event validation contract