Solidity API
AxelarValuedExpressExecutableWithToken
constructor
constructor(address gateway_) internal
contractCallValue
function contractCallValue(string sourceChain, string sourceAddress, bytes payload) public view virtual returns (address tokenAddress, uint256 value)
contractCallWithTokenValue
function contractCallWithTokenValue(string sourceChain, string sourceAddress, bytes payload, string symbol, uint256 amount) public view virtual returns (address tokenAddress, uint256 value)
Returns the value (token address and amount) associated with a contract call with token.
Parameters
Name |
Type |
Description |
sourceChain |
string |
The source chain. |
sourceAddress |
string |
The source address. |
payload |
bytes |
The payload data. |
symbol |
string |
The token symbol. |
amount |
uint256 |
The amount of tokens. |
Return Values
Name |
Type |
Description |
tokenAddress |
address |
The address of the token used. |
value |
uint256 |
The value associated with the contract call. |
executeWithToken
function executeWithToken(bytes32 commandId, string sourceChain, string sourceAddress, bytes payload, string tokenSymbol, uint256 amount) external
Executes the specified command sent from another chain and includes a token transfer.
This function should be implemented to handle incoming commands that include token transfers.
It will be called by an implementation of IAxelarGatewayWithToken
.
Parameters
Name |
Type |
Description |
commandId |
bytes32 |
The identifier of the command to execute. |
sourceChain |
string |
The name of the source chain from where the command originated. |
sourceAddress |
string |
The address on the source chain that sent the command. |
payload |
bytes |
The payload of the command to be executed. |
tokenSymbol |
string |
The symbol of the token to be transferred with this command. |
amount |
uint256 |
The amount of tokens to be transferred with this command. |
expressExecuteWithToken
function expressExecuteWithToken(bytes32 commandId, string sourceChain, string sourceAddress, bytes payload, string symbol, uint256 amount) external payable virtual
Express executes a contract call with token.
Parameters
Name |
Type |
Description |
commandId |
bytes32 |
The commandId for the contractCallWithToken. |
sourceChain |
string |
The source chain. |
sourceAddress |
string |
The source address. |
payload |
bytes |
The payload data. |
symbol |
string |
The token symbol. |
amount |
uint256 |
The amount of token. |
getExpressExecutorWithToken
function getExpressExecutorWithToken(bytes32 commandId, string sourceChain, string sourceAddress, bytes32 payloadHash, string symbol, uint256 amount) external view returns (address expressExecutor)
Returns the express executor with token for a given command.
Parameters
Name |
Type |
Description |
commandId |
bytes32 |
The commandId for the contractCallWithToken. |
sourceChain |
string |
The source chain. |
sourceAddress |
string |
The source address. |
payloadHash |
bytes32 |
The hash of the payload. |
symbol |
string |
The token symbol. |
amount |
uint256 |
The amount of tokens. |
Return Values
Name |
Type |
Description |
expressExecutor |
address |
The address of the express executor. |
_executeWithToken
function _executeWithToken(bytes32 commandId, string sourceChain, string sourceAddress, bytes payload, string tokenSymbol, uint256 amount) internal virtual
Internal virtual function to be overridden by child contracts to execute the command with token transfer.
It allows child contracts to define their custom command execution logic involving tokens.
Parameters
Name |
Type |
Description |
commandId |
bytes32 |
The unique identifier of the cross-chain message being executed. |
sourceChain |
string |
The name of the source chain from which the message originated. |
sourceAddress |
string |
The address on the source chain that sent the message. |
payload |
bytes |
The payload of the message payload. |
tokenSymbol |
string |
The symbol of the token to be transferred. |
amount |
uint256 |
The amount of tokens to be transferred. |
gatewayWithToken
function gatewayWithToken() internal view returns (contract IAxelarGatewayWithToken)
Returns the address of the IAxelarGatewayWithToken contract.
Return Values
Name |
Type |
Description |
[0] |
contract IAxelarGatewayWithToken |
The Axelar Gateway with Token instance. |