AddressAliasHelper
State Variables
offset
uint160 private constant offset =
uint160(0x1111000000000000000000000000000000001111);
Functions
applyL1ToL2Alias
Utility function converts the address that submitted a tx to the inbox on L1 to the msg.sender viewed on L2
function applyL1ToL2Alias(address l1Address)
internal
pure
returns (address l2Address);
Parameters
Name | Type | Description |
---|---|---|
l1Address | address | the address in the L1 that triggered the tx to L2 |
Returns
Name | Type | Description |
---|---|---|
l2Address | address | L2 address as viewed in msg.sender |
undoL1ToL2Alias
Utility function that converts the msg.sender viewed on L2 to the address that submitted a tx to the inbox on L1
function undoL1ToL2Alias(address l2Address)
internal
pure
returns (address l1Address);
Parameters
Name | Type | Description |
---|---|---|
l2Address | address | L2 address as viewed in msg.sender |
Returns
Name | Type | Description |
---|---|---|
l1Address | address | the address in the L1 that triggered the tx to L2 |
actualRefundRecipient
Utility function used to calculate the correct refund recipient
function actualRefundRecipient(
address _refundRecipient,
address _originalCaller
) internal view returns (address _recipient);
Parameters
Name | Type | Description |
---|---|---|
_refundRecipient | address | the address that should receive the refund |
_originalCaller | address | the address that triggered the tx to L2 |
Returns
Name | Type | Description |
---|---|---|
_recipient | address | the corrected address that should receive the refund |