Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contracts/chain-adapters/Arbitrum_SendTokensAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.0;

import "../interfaces/AdapterInterface.sol";
import "./Arbitrum_Adapter.sol"; // Used to import `ArbitrumL1ERC20GatewayLike`
import { ArbitrumL1ERC20GatewayLike } from "./Arbitrum_Adapter.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand All @@ -17,7 +17,7 @@ contract Arbitrum_SendTokensAdapter is AdapterInterface {

uint256 public immutable l2MaxSubmissionCost = 0.01e18;
uint256 public immutable l2GasPrice = 5e9;
uint32 public immutable l2GasLimit = 2_000_000;
uint32 public constant RELAY_TOKENS_L2_GAS_LIMIT = 300_000;

ArbitrumL1ERC20GatewayLike public immutable l1ERC20GatewayRouter;

Expand Down Expand Up @@ -57,7 +57,7 @@ contract Arbitrum_SendTokensAdapter is AdapterInterface {
l1Token,
target,
amount,
l2GasLimit,
RELAY_TOKENS_L2_GAS_LIMIT,
l2GasPrice,
data
);
Expand All @@ -83,7 +83,7 @@ contract Arbitrum_SendTokensAdapter is AdapterInterface {
* @return amount of ETH that this contract needs to hold in order for relayMessage to succeed.
*/
function getL1CallValue() public pure returns (uint256) {
return l2MaxSubmissionCost + l2GasPrice * l2GasLimit;
return l2MaxSubmissionCost + l2GasPrice * RELAY_TOKENS_L2_GAS_LIMIT;
}

function _contractHasSufficientEthBalance() internal view returns (uint256 requiredL1CallValue) {
Expand Down
1 change: 0 additions & 1 deletion deploy/018_deploy_arbitrum_rescueadapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ const func = async function (hre: HardhatRuntimeEnvironment) {
};

module.exports = func;
func.dependencies = ["HubPool"];
func.tags = ["ArbitrumRescueAdapter", "mainnet"];
23 changes: 23 additions & 0 deletions deploy/020_deploy_arbitrum_sendtoken_adapter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { L1_ADDRESS_MAP } from "./consts";

import "hardhat-deploy";
import { HardhatRuntimeEnvironment } from "hardhat/types/runtime";

const func = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts, getChainId } = hre;
const { deploy } = deployments;

const { deployer } = await getNamedAccounts();

const chainId = parseInt(await getChainId());

await deploy("Arbitrum_SendTokensAdapter", {
from: deployer,
log: true,
skipIfAlreadyDeployed: true,
args: [L1_ADDRESS_MAP[chainId].l1ERC20GatewayRouter],
});
};

module.exports = func;
func.tags = ["ArbitrumSendTokensAdapter", "mainnet"];
1 change: 1 addition & 0 deletions deployments/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"AcrossMerkleDistributor": { "address": "0xE50b2cEAC4f60E840Ae513924033E753e2366487", "blockNumber": 15976846 },
"Arbitrum_Adapter": { "address": "0x29528780E29abb8Af95a5e5a125b94766987543F", "blockNumber": 16243583 },
"Arbitrum_RescueAdapter": { "address": "0xC6fA0a4EBd802c01157d6E7fB1bbd2ae196ae375", "blockNumber": 16233939 },
"Arbitrum_SendTokensAdapter": { "address": "0x17a2b3184E5cabB260476685bbfB53b13EE6f393", "blockNumber": 16679355 },
"Boba_Adapter": { "address": "0x33B0Ec794c15D6Cc705818E70d4CaCe7bCfB5Af3", "blockNumber": 14716798 },
"Ethereum_Adapter": { "address": "0x527E872a5c3f0C7c24Fe33F2593cFB890a285084", "blockNumber": 14704381 },
"SpokePool": { "address": "0x4D9079Bb4165aeb4084c526a32695dCfd2F77381", "blockNumber": 14819486 },
Expand Down
244 changes: 244 additions & 0 deletions deployments/mainnet/Arbitrum_SendTokensAdapter.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion test/chain-adapters/Arbitrum_Adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
SignerWithAddress,
createFake,
toWei,
hre,
defaultAbiCoder,
toBN,
} from "../utils";
Expand Down
2 changes: 1 addition & 1 deletion test/chain-adapters/Arbitrum_SendTokensAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe("Arbitrum Chain SendTokens Emergency Adapter", function () {
weth.address,
mockSpoke.address,
tokensToSendToL2,
consts.sampleL2Gas,
consts.sampleL2GasSendTokens,
consts.sampleL2GasPrice,
maxSubmissionCostMessage
);
Expand Down