From 32f7a70f4ce48674a3a7c0d5daea71dde2ca2e27 Mon Sep 17 00:00:00 2001 From: Daniel Goldman Date: Mon, 5 Feb 2024 09:41:47 -0500 Subject: [PATCH] fix outboundTransferCustomRefund comment; sender, not _to, is callValueRefundAddress --- .../tokenbridge/ethereum/gateway/L1ArbitrumGateway.sol | 6 ++++-- contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/contracts/tokenbridge/ethereum/gateway/L1ArbitrumGateway.sol b/contracts/tokenbridge/ethereum/gateway/L1ArbitrumGateway.sol index 8ac88717a4..6c032ad045 100644 --- a/contracts/tokenbridge/ethereum/gateway/L1ArbitrumGateway.sol +++ b/contracts/tokenbridge/ethereum/gateway/L1ArbitrumGateway.sol @@ -224,10 +224,12 @@ abstract contract L1ArbitrumGateway is * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed + * The msg.sender that calls this methid, or its L2 alias if it has code in L1, will be set to the callValueRefundAddress; + * this means it can cancel the retryable ticket if its auto-redeem fails, and also that it receives the l2 callvalue refund + * (although note that for this method there is no l2 callvalue). * @param _l1Token L1 address of ERC20 * @param _refundTo Account, or its L2 alias if it have code in L1, to be credited with excess gas refund in L2 - * @param _to Account to be credited with the tokens in the L2 (can be the user's L2 account or a contract), not subject to L2 aliasing - This account, or its L2 alias if it have code in L1, will also be able to cancel the retryable ticket and receive callvalue refund + * @param _to Account to be credited with the tokens in the L2 (can be an EOA or a contract), not subject to L2 aliasing * @param _amount Token Amount * @param _maxGas Max gas deducted from user's L2 balance to cover L2 execution * @param _gasPriceBid Gas price for L2 execution diff --git a/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol b/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol index f5aef49d97..1b7c258ac9 100644 --- a/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol +++ b/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol @@ -294,10 +294,12 @@ contract L1GatewayRouter is * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed + * The msg.sender that calls this methid, or its L2 alias if it has code in L1, will be set to the callValueRefundAddress; + * this means it can cancel the retryable ticket if its auto-redeem fails, and also that it receives the l2 callvalue refund + * (although note that for this method there is no l2 callvalue). * @param _token L1 address of ERC20 * @param _refundTo Account, or its L2 alias if it have code in L1, to be credited with excess gas refund in L2 - * @param _to Account to be credited with the tokens in the L2 (can be the user's L2 account or a contract), not subject to L2 aliasing - This account, or its L2 alias if it have code in L1, will also be able to cancel the retryable ticket and receive callvalue refund + * @param _to Account to be credited with the tokens in the L2 (can be an EOA or a contract), not subject to L2 aliasing. * @param _amount Token Amount * @param _maxGas Max gas deducted from user's L2 balance to cover L2 execution * @param _gasPriceBid Gas price for L2 execution