CrossChainEnabledArbitrumL2.sol 1.1 KB

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