forked from OpenZeppelin/openzeppelin-contracts
/
CrossChainEnabledArbitrumL1.sol
43 lines (37 loc) · 1.38 KB
/
CrossChainEnabledArbitrumL1.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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../CrossChainEnabled.sol";
import "./LibArbitrumL1.sol";
/**
* @dev [Arbitrum](https://arbitrum.io/) specialization or the
* {CrossChainEnabled} abstraction the L1 side (mainnet).
*
* This version should only be deployed on L1 to process cross-chain messages
* originating from L2. For the other side, use {CrossChainEnabledArbitrumL2}.
*
* The inbox contract is provided and maintained by the arbitrum team. You can
* find the address of this contract on the rinkeby testnet in
* [Arbitrum's developer documentation](https://developer.offchainlabs.com/docs/public_testnet#l1).
*
* _Available since v4.6._
*/
abstract contract CrossChainEnabledArbitrumL1 is CrossChainEnabled {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable _inbox;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address inbox) {
_inbox = inbox;
}
/**
* @dev see {CrossChainEnabled-_isCrossChain}
*/
function _isCrossChain() internal view virtual override returns (bool) {
return LibArbitrumL1.isCrossChain(_inbox);
}
/**
* @dev see {CrossChainEnabled-_crossChainSender}
*/
function _crossChainSender() internal view virtual override onlyCrossChain returns (address) {
return LibArbitrumL1.crossChainSender(_inbox);
}
}