IAppChainGateway
Inherits: IMigratable, IRegistryParametersErrors
The AppChainGateway exposes the ability to receive parameters from the settlement chain gateway.
Functions
initialize
Initializes the parameter registry, as used by a proxy contract.
function initialize() external;
withdraw
Withdraws funds from the app chain to the settlement chain.
function withdraw(address recipient_) external payable;
Parameters
| Name | Type | Description |
|---|---|---|
recipient_ | address | The address to which the funds will be delivered to on the settlement chain. |
withdrawIntoUnderlying
Withdraws funds from the app chain to the settlement chain, unwrapped as underlying fee token.
function withdrawIntoUnderlying(address recipient_) external payable;
Parameters
| Name | Type | Description |
|---|---|---|
recipient_ | address | The address to which the funds will be delivered to on the settlement chain. |
receiveDeposit
Receives funds from the settlement chain.
The recipient will receive the forwarded amount attached as payable.
function receiveDeposit(address recipient_) external payable;
Parameters
| Name | Type | Description |
|---|---|---|
recipient_ | address | The address to which the funds will be delivered to. |
receiveParameters
Receives parameters from the settlement chain.
The caller must be the settlement chain gateway's L3 alias address.
function receiveParameters(uint256 nonce_, string[] calldata keys_, bytes32[] calldata values_) external;
Parameters
| Name | Type | Description |
|---|---|---|
nonce_ | uint256 | The nonce of the parameter transmission (to prevent out-of-sequence resets). |
keys_ | string[] | The keys of the parameters. |
values_ | bytes32[] | The values of each parameter. |
updatePauseStatus
Updates the pause status.
Ensures the new pause status is not equal to the old pause status.
function updatePauseStatus() external;
parameterRegistry
The address of the parameter registry.
function parameterRegistry() external view returns (address parameterRegistry_);
settlementChainGateway
The address of the settlement chain gateway.
function settlementChainGateway() external view returns (address settlementChainGateway_);
settlementChainGatewayAlias
The L3 alias address of the settlement chain gateway (i.e. the expected caller of the receiveParameters
function).
function settlementChainGatewayAlias() external view returns (address settlementChainGatewayAlias_);
migratorParameterKey
The parameter registry key used to fetch the migrator.
function migratorParameterKey() external pure returns (string memory key_);
pausedParameterKey
The parameter registry key used to fetch the paused status.
function pausedParameterKey() external pure returns (string memory key_);
paused
The pause status.
function paused() external view returns (bool paused_);
Events
ParametersReceived
Emitted when parameters are received from the settlement chain.
The values are not emitted, as they are not relevant to indexing this contract, and will be emitted
by the app chain parameter registry.
event ParametersReceived(uint256 indexed nonce, string[] keys);
Parameters
| Name | Type | Description |
|---|---|---|
nonce | uint256 | The nonce of the parameter transmission (to prevent out-of-sequence parameter updates). |
keys | string[] | The keys of the parameters. |
DepositReceived
Emitted when funds are deposited from the settlement chain.
event DepositReceived(address indexed recipient, uint256 amount);
Parameters
| Name | Type | Description |
|---|---|---|
recipient | address | The address to which the funds will be delivered to. |
amount | uint256 | The amount of funds received. |
PauseStatusUpdated
Emitted when the pause status is set.
event PauseStatusUpdated(bool indexed paused);
Parameters
| Name | Type | Description |
|---|---|---|
paused | bool | The new pause status. |
Withdrawal
Emitted when funds are withdrawn from the app chain.
event Withdrawal(uint256 indexed messageId, address indexed recipient, uint256 amount);
Parameters
| Name | Type | Description |
|---|---|---|
messageId | uint256 | The message ID of the withdrawal. |
recipient | address | The address to which the funds will be delivered to on the settlement chain. |
amount | uint256 | The amount of funds withdrawn. |
Errors
ZeroParameterRegistry
Thrown when the parameter registry address is zero (i.e. address(0)).
error ZeroParameterRegistry();
ZeroSettlementChainGateway
Thrown when the settlement chain gateway address is zero (i.e. address(0)).
error ZeroSettlementChainGateway();
NotSettlementChainGateway
Thrown when the caller is not the settlement chain gateway (i.e. its L3 alias address).
error NotSettlementChainGateway();
ZeroRecipient
Thrown when the recipient address is zero (i.e. address(0)).
error ZeroRecipient();
ZeroWithdrawalAmount
Thrown when the withdrawal amount is zero.
error ZeroWithdrawalAmount();
NoChange
Thrown when there is no change to an updated parameter.
error NoChange();
Paused
Thrown when any pausable function is called when the contract is paused.
error Paused();
TransferFailed
Thrown when the transfer fails.
error TransferFailed();