-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathOptimismBridgeExecutor.sol
59 lines (55 loc) · 2.12 KB
/
OptimismBridgeExecutor.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.10;
import {ICrossDomainMessenger} from '../dependencies/optimism/interfaces/ICrossDomainMessenger.sol';
import {L2BridgeExecutor} from './L2BridgeExecutor.sol';
/**
* @title OptimismBridgeExecutor
* @author Aave
* @notice Implementation of the Optimism Bridge Executor, able to receive cross-chain transactions from Ethereum
* @dev Queuing an ActionsSet into this Executor can only be done by the Optimism L2 Cross Domain Messenger and having
* the EthereumGovernanceExecutor as xDomainMessageSender
*/
contract OptimismBridgeExecutor is L2BridgeExecutor {
// Address of the Optimism L2 Cross Domain Messenger, in charge of redirecting cross-chain transactions in L2
address public immutable OVM_L2_CROSS_DOMAIN_MESSENGER;
/// @inheritdoc L2BridgeExecutor
modifier onlyEthereumGovernanceExecutor() override {
if (
msg.sender != OVM_L2_CROSS_DOMAIN_MESSENGER ||
ICrossDomainMessenger(OVM_L2_CROSS_DOMAIN_MESSENGER).xDomainMessageSender() !=
_ethereumGovernanceExecutor
) revert UnauthorizedEthereumExecutor();
_;
}
/**
* @dev Constructor
*
* @param ovmL2CrossDomainMessenger The address of the Optimism L2CrossDomainMessenger
* @param ethereumGovernanceExecutor The address of the EthereumGovernanceExecutor
* @param delay The delay before which an actions set can be executed
* @param gracePeriod The time period after a delay during which an actions set can be executed
* @param minimumDelay The minimum bound a delay can be set to
* @param maximumDelay The maximum bound a delay can be set to
* @param guardian The address of the guardian, which can cancel queued proposals (can be zero)
*/
constructor(
address ovmL2CrossDomainMessenger,
address ethereumGovernanceExecutor,
uint256 delay,
uint256 gracePeriod,
uint256 minimumDelay,
uint256 maximumDelay,
address guardian
)
L2BridgeExecutor(
ethereumGovernanceExecutor,
delay,
gracePeriod,
minimumDelay,
maximumDelay,
guardian
)
{
OVM_L2_CROSS_DOMAIN_MESSENGER = ovmL2CrossDomainMessenger;
}
}