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 @@ -21,6 +21,8 @@ contract Arbitrum_SendTokensAdapter is AdapterInterface {

ArbitrumL1ERC20GatewayLike public immutable l1ERC20GatewayRouter;

address public constant l2RefundL2Address = 0x428AB2BA90Eba0a4Be7aF34C9Ac451ab061AC010;

/**
* @notice Constructs new Adapter.
* @param _l1ERC20GatewayRouter ERC20 gateway router contract to send tokens to Arbitrum.
Expand Down Expand Up @@ -50,11 +52,9 @@ contract Arbitrum_SendTokensAdapter is AdapterInterface {
// maxSubmissionCost to use when creating an L2 retryable ticket: https://github.com/OffchainLabs/arbitrum/blob/e98d14873dd77513b569771f47b5e05b72402c5e/packages/arb-bridge-peripherals/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol#L232
bytes memory data = abi.encode(l2MaxSubmissionCost, "");

// Note: outboundTransfer() will ultimately create a retryable ticket and set this contract's address as the
// refund address. This means that the excess ETH to pay for the L2 transaction will be sent to the aliased
// contract address on L2 and lost.
l1ERC20GatewayRouter.outboundTransfer{ value: requiredL1CallValue }(
l1ERC20GatewayRouter.outboundTransferCustomRefund{ value: requiredL1CallValue }(
l1Token,
l2RefundL2Address,
target,
amount,
RELAY_TOKENS_L2_GAS_LIMIT,
Expand Down
2 changes: 1 addition & 1 deletion deployments/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +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 },
"Arbitrum_SendTokensAdapter": { "address": "0xC06A68DF12376271817FcEBfb45Be996B0e1593E", "blockNumber": 16691987 },
"Boba_Adapter": { "address": "0x33B0Ec794c15D6Cc705818E70d4CaCe7bCfB5Af3", "blockNumber": 14716798 },
"Ethereum_Adapter": { "address": "0x527E872a5c3f0C7c24Fe33F2593cFB890a285084", "blockNumber": 14704381 },
"SpokePool": { "address": "0x4D9079Bb4165aeb4084c526a32695dCfd2F77381", "blockNumber": 14819486 },
Expand Down
39 changes: 26 additions & 13 deletions deployments/mainnet/Arbitrum_SendTokensAdapter.json

Large diffs are not rendered by default.

139 changes: 139 additions & 0 deletions deployments/mainnet/solcInputs/778ed9956c3f76e793496228f16e1373.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions test/chain-adapters/Arbitrum_SendTokensAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ describe("Arbitrum Chain SendTokens Emergency Adapter", function () {
[l1ERC20GatewayRouter],
[toBN(consts.sampleL2MaxSubmissionCost).add(toBN(consts.sampleL2Gas).mul(consts.sampleL2GasPrice))]
);
expect(l1ERC20GatewayRouter.outboundTransfer).to.have.been.calledOnce;
expect(l1ERC20GatewayRouter.outboundTransferCustomRefund).to.have.been.calledOnce;
expect(await weth.allowance(hubPool.address, gatewayAddress)).to.equal(tokensToSendToL2);
const maxSubmissionCostMessage = defaultAbiCoder.encode(
["uint256", "bytes"],
[consts.sampleL2MaxSubmissionCost, "0x"]
);
expect(l1ERC20GatewayRouter.outboundTransfer).to.have.been.calledWith(
expect(l1ERC20GatewayRouter.outboundTransferCustomRefund).to.have.been.calledWith(
weth.address,
"0x428AB2BA90Eba0a4Be7aF34C9Ac451ab061AC010",
mockSpoke.address,
tokensToSendToL2,
consts.sampleL2GasSendTokens,
Expand Down