CrossChainEnabledArbitrumL2.sol 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts (last updated v4.6.0) (crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol)
  3. pragma solidity ^0.8.4;
  4. import "../CrossChainEnabled.sol";
  5. import "./LibArbitrumL2.sol";
  6. /**
  7. * @dev [Arbitrum](https://arbitrum.io/) specialization or the
  8. * {CrossChainEnabled} abstraction the L2 side (arbitrum).
  9. *
  10. * This version should only be deployed on L2 to process cross-chain messages
  11. * originating from L1. For the other side, use {CrossChainEnabledArbitrumL1}.
  12. *
  13. * Arbitrum L2 includes the `ArbSys` contract at a fixed address. Therefore,
  14. * this specialization of {CrossChainEnabled} does not include a constructor.
  15. *
  16. * _Available since v4.6._
  17. */
  18. abstract contract CrossChainEnabledArbitrumL2 is CrossChainEnabled {
  19. /**
  20. * @dev see {CrossChainEnabled-_isCrossChain}
  21. */
  22. function _isCrossChain() internal view virtual override returns (bool) {
  23. return LibArbitrumL2.isCrossChain(LibArbitrumL2.ARBSYS);
  24. }
  25. /**
  26. * @dev see {CrossChainEnabled-_crossChainSender}
  27. */
  28. function _crossChainSender() internal view virtual override onlyCrossChain returns (address) {
  29. return LibArbitrumL2.crossChainSender(LibArbitrumL2.ARBSYS);
  30. }
  31. }