ILayerZeroReceiver interface to receive cross-chain messages.
Contract Overview
Location:contracts/prover/LayerZeroProver.sol
contracts/prover/LayerZeroProver.sol
Constructor
FromLayerZeroProver.sol:57-74:
contracts/prover/LayerZeroProver.sol
Parameters
address
Address of the local LayerZero V2 endpoint contract
address
Address authorized to configure LayerZero settings (configs, paths, etc.)
address
Address of the Portal contract that manages rewards
bytes32[]
Array of trusted prover addresses on other chains (as bytes32 for cross-VM compatibility)
uint256
Minimum gas limit for cross-chain messages. Defaults to 200,000 if zero.
The constructor automatically sets the delegate on the LayerZero endpoint (line 73):
Prove Function
Inherited fromMessageBridgeProver.sol:112-117:
contracts/prover/MessageBridgeProver.sol
Data Parameter Structure
Thedata parameter must be ABI-encoded as an UnpackedData struct (from LayerZeroProver.sol:19-24):
contracts/prover/LayerZeroProver.sol
Gas limits below
MIN_GAS_LIMIT (200,000) are automatically increased to the minimum (from LayerZeroProver.sol:190-192).Message Dispatch
Internal dispatch implementation fromLayerZeroProver.sol:133-156:
contracts/prover/LayerZeroProver.sol
Message Formatting
FromLayerZeroProver.sol:239-267:
contracts/prover/LayerZeroProver.sol
Message Reception
FromLayerZeroProver.sol:85-98:
contracts/prover/LayerZeroProver.sol
lzReceive() function:
- Validates call is from the LayerZero endpoint
- Validates sender address is non-zero
- Checks sender is whitelisted
- Extracts chain ID from message prefix
- Processes intent proofs
Additional LayerZero Methods
Allow Initialize Path
FromLayerZeroProver.sol:105-110:
contracts/prover/LayerZeroProver.sol
Next Nonce
FromLayerZeroProver.sol:117-123:
contracts/prover/LayerZeroProver.sol
Fee Calculation
FromLayerZeroProver.sol:166-176:
contracts/prover/LayerZeroProver.sol
LayerZeroProver.sol:202-221):
contracts/prover/LayerZeroProver.sol
Usage Example
Endpoint ID Reference
Common V2 endpoint IDs (verify before use):Security Considerations
Whitelist Validation
Only whitelisted prover addresses can send proof messages. This is validated in_handleCrossChainMessage() from MessageBridgeProver.sol:81-82:
contracts/prover/MessageBridgeProver.sol
Delegate Configuration
The delegate address has full control over LayerZero configurations. Set this carefully during deployment.Gas Limit Enforcement
The contract enforces a minimum gas limit (fromLayerZeroProver.sol:190-192):
contracts/prover/LayerZeroProver.sol
Related Contracts
- BaseProver - Base proving functionality
- MessageBridgeProver - Message bridge base contract
- Inbox - Intent fulfillment and proving