You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// @param _amount The total amount of tokens to be bridged
155
155
/// @param _l2TxGasLimit The L2 gas limit to be used in the corresponding L2 transaction
156
156
/// @param _l2TxGasPerPubdataByte The gasPerPubdataByteLimit to be used in the corresponding L2 transaction
157
-
/// @param _refundRecipient The address on L2 that will receive the refund for the transaction. If the transaction fails,
158
-
/// it will also be the address to receive `_l2Value`. If zero, the refund will be sent to the sender of the transaction.
157
+
/// @param _refundRecipient The address on L2 that will receive the refund for the transaction.
158
+
/// @dev If the L2 deposit finalization transaction fails, the `_refundRecipient` will receive the `_l2Value`.
159
+
/// Please note, the contract may change the refund recipient's address to eliminate sending funds to addresses out of control.
160
+
/// - If `_refundRecipient` is a contract on L1, the refund will be sent to the aliased `_refundRecipient`.
161
+
/// - If `_refundRecipient` is set to `address(0)` and the sender has NO deployed bytecode on L1, the refund will be sent to the `msg.sender` address.
162
+
/// - If `_refundRecipient` is set to `address(0)` and the sender has deployed bytecode on L1, the refund will be sent to the aliased `msg.sender` address.
163
+
/// @dev The address aliasing of L1 contracts as refund recipient on L2 is necessary to guarantee that the funds are controllable through the Mailbox,
164
+
/// since the Mailbox applies address aliasing to the from address for the L2 tx if the L1 msg.sender is a contract.
165
+
/// Without address aliasing for L1 contracts as refund recipients they would not be able to make proper L2 tx requests
166
+
/// through the Mailbox to use or withdraw the funds from L2, and the funds would be lost.
159
167
/// @return l2TxHash The L2 transaction hash of deposit finalization
0 commit comments