InputEncoding
Defines the encoding of inputs added by core trustless and permissionless contracts, such as portals.
Functions
encodeEtherDeposit
Encode an Ether deposit.
function encodeEtherDeposit(address sender, uint256 value, bytes calldata execLayerData)
internal
pure
returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
sender | address | The Ether sender |
value | uint256 | The amount of Wei being sent |
execLayerData | bytes | Additional data to be interpreted by the execution layer |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The encoded input payload |
encodeERC20Deposit
Encode an ERC-20 token deposit.
function encodeERC20Deposit(
IERC20 token,
address sender,
uint256 value,
bytes calldata execLayerData
) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
token | IERC20 | The token contract |
sender | address | The token sender |
value | uint256 | The amount of tokens being sent |
execLayerData | bytes | Additional data to be interpreted by the execution layer |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The encoded input payload |
encodeERC721Deposit
Encode an ERC-721 token deposit.
baseLayerData
should be forwarded to token
.
function encodeERC721Deposit(
IERC721 token,
address sender,
uint256 tokenId,
bytes calldata baseLayerData,
bytes calldata execLayerData
) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
token | IERC721 | The token contract |
sender | address | The token sender |
tokenId | uint256 | The token identifier |
baseLayerData | bytes | Additional data to be interpreted by the base layer |
execLayerData | bytes | Additional data to be interpreted by the execution layer |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The encoded input payload |
encodeSingleERC1155Deposit
Encode an ERC-1155 single token deposit.
baseLayerData
should be forwarded to token
.
function encodeSingleERC1155Deposit(
IERC1155 token,
address sender,
uint256 tokenId,
uint256 value,
bytes calldata baseLayerData,
bytes calldata execLayerData
) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
token | IERC1155 | The ERC-1155 token contract |
sender | address | The token sender |
tokenId | uint256 | The identifier of the token being transferred |
value | uint256 | Transfer amount |
baseLayerData | bytes | Additional data to be interpreted by the base layer |
execLayerData | bytes | Additional data to be interpreted by the execution layer |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The encoded input payload |
encodeBatchERC1155Deposit
Encode an ERC-1155 batch token deposit.
baseLayerData
should be forwarded to token
.
function encodeBatchERC1155Deposit(
IERC1155 token,
address sender,
uint256[] calldata tokenIds,
uint256[] calldata values,
bytes calldata baseLayerData,
bytes calldata execLayerData
) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
token | IERC1155 | The ERC-1155 token contract |
sender | address | The token sender |
tokenIds | uint256[] | The identifiers of the tokens being transferred |
values | uint256[] | Transfer amounts per token type |
baseLayerData | bytes | Additional data to be interpreted by the base layer |
execLayerData | bytes | Additional data to be interpreted by the execution layer |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The encoded input payload |