Skip to content

Commit

Permalink
feat: remove reference to PayGasForContractCall (#622)
Browse files Browse the repository at this point in the history
Remove gas references for non native gas call
  • Loading branch information
benjamin852 authored Nov 8, 2023
1 parent 28e515e commit e6ad52a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
25 changes: 2 additions & 23 deletions src/pages/dev/general-message-passing/gas-services/pay-gas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,7 @@ function payNativeGasForContractCall(
```

## Alternative gas payment methods for `callContractWithToken`
Similar to the available gas payment methods for `callContract`, there are two available methods to pay gas for relaying the `callContractWithToken`.

### payGasForContractCallWithToken
This method receives any tokens for the relayer fee. The paid gas for this method must be in tokens Axelar supports. See the list of supported assets: [Mainnet](../../reference/mainnet-contract-addresses) | [Testnet](../../reference/testnet-contract-addresses).

```solidity
// This is called on the source chain before calling the gateway to execute a remote contract.
function payGasForContractCallWithToken(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
) external;
```

### payNativeGasForContractCallWithToken
This method accepts the native tokens of the source chain.
Expand All @@ -125,19 +107,16 @@ The function names are prety self-explanatory. The following is true for the arg

- For all functions:
- `sender` needs to match the address that calls `callContract` or `callContractWithToken` on the `AxelarGateway`. If the `AxelarGasReceiver` is called by the same contract that will call the Gateway, then simply specify `address(this)` as `sender`.
- For `payGasForContractCall` and `payNativeGasForContractCall`, the following need to match the arguments of a `contractCall` on the `AxelarGateway`:
- For `payNativeGasForContractCall`, the following need to match the arguments of a `contractCall` on the `AxelarGateway`:
- `destinationChain`
- `destinationAddress`
- `payload`
- For `payGasForContractCallWtihToken` and `payNativeGasForContractCallWithToken`, the following need to match the arguments of a `contractCallWithToken` on the `AxelarGateway`:
- For `payNativeGasForContractCallWithToken`, the following need to match the arguments of a `contractCallWithToken` on the `AxelarGateway`:
- `destinationChain`
- `destinationAddress`
- `payload`
- `symbol`
- `amount`
- For `payGasForContractCall` and `payGasForContractCallWtihToken`:
- `gasToken` is the address of the token that gas will be paid in. Ensure this token is supported by the network, using the Axelar API.
- `gasFeeAmount` is the amount of `gasToken` to transfer from the sender. The sender needs to have approved the `AxelarGasReceiver` with the appropriate amount to `gasToken` first.
- For `payNativeGasForContractCall` and `payNativeGasForContractCallWithToken`, the amount of funds received is specified by `msg.value`.
- For all functions, `refundAddress` is the address that will eventually be able to receive excess amount paid for gas.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Refund the prepaid gas

The prepaid gas to `payGasForContractCall` or `payGasForContractCallWithToken` could exceed the actual amount needed for relaying a message to the destination contract.
The prepaid gas to `payNativeGasForContractCall` or `payNativeGasForContractCallWithToken` could exceed the actual amount needed for relaying a message to the destination contract.


The Executor Service automatically tracks the excess gas amount and refund it to the payer's wallet address by calling `Refund` in the Gas Service contract.

Expand Down

1 comment on commit e6ad52a

@vercel
Copy link

@vercel vercel bot commented on e6ad52a Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.