Skip to content

Commit

Permalink
change name of l2Adapter to adapter
Browse files Browse the repository at this point in the history
Signed-off-by: bennett <[email protected]>
  • Loading branch information
bmzig committed Sep 17, 2024
1 parent b360237 commit 2daf57b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions contracts/chain-adapters/Arbitrum_L3_Adapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ import { AdapterInterface } from "./interfaces/AdapterInterface.sol";

// solhint-disable-next-line contract-name-camelcase
contract Arbitrum_L3_Adapter is AdapterInterface {
address public immutable l2Adapter;
address public immutable adapter;
address public immutable l2Forwarder;

error RelayMessageFailed();
error RelayTokensFailed(address l1Token);

/**
* @notice Constructs new Adapter for sending tokens/messages to Arbitrum-like L3s.
* @param _l2Adapter Address of the adapter contract on mainnet which implements message transfers
* @param _adapter Address of the adapter contract on mainnet which implements message transfers
* and token relays.
* @param _l2Forwarder Address of the l2 forwarder contract which relays messages up to the L3 spoke pool.
*/
constructor(address _l2Adapter, address _l2Forwarder) {
l2Adapter = _l2Adapter;
constructor(address _adapter, address _l2Forwarder) {
adapter = _adapter;
l2Forwarder = _l2Forwarder;
}

Expand All @@ -37,9 +38,7 @@ contract Arbitrum_L3_Adapter is AdapterInterface {
* @param message Data to send to target.
*/
function relayMessage(address, bytes memory message) external payable override {
(bool success, ) = l2Adapter.delegatecall(
abi.encodeCall(AdapterInterface.relayMessage, (l2Forwarder, message))
);
(bool success, ) = adapter.delegatecall(abi.encodeCall(AdapterInterface.relayMessage, (l2Forwarder, message)));

Check warning on line 41 in contracts/chain-adapters/Arbitrum_L3_Adapter.sol

View workflow job for this annotation

GitHub Actions / Lint (20)

Avoid to use low level calls

Check warning on line 41 in contracts/chain-adapters/Arbitrum_L3_Adapter.sol

View workflow job for this annotation

GitHub Actions / Lint (20)

Avoid to use low level calls
if (!success) revert RelayMessageFailed();
}

Expand All @@ -52,11 +51,11 @@ contract Arbitrum_L3_Adapter is AdapterInterface {
*/
function relayTokens(
address l1Token,
address l2Token, // l2Token is unused for Arbitrum.
address l2Token,
uint256 amount,
address
) external payable override {
(bool success, ) = l2Adapter.delegatecall(
(bool success, ) = adapter.delegatecall(
abi.encodeCall(AdapterInterface.relayTokens, (l1Token, l2Token, amount, l2Forwarder))
);
if (!success) revert RelayTokensFailed(l1Token);
Expand Down

0 comments on commit 2daf57b

Please sign in to comment.