Skip to content

Commit 646e06d

Browse files
docs(gmp-tokens): improve clarity of message passing instructions (#1366)
Co-authored-by: ben-weinberg <[email protected]>
1 parent 59d695d commit 646e06d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/content/docs/dev/general-message-passing/gmp-tokens-with-messages.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ import { Callout } from "/src/components/callout";
1111
allowFullScreen
1212
></iframe>
1313

14-
To call chain B from chain A and send some tokens along the way, the user needs to call `callContractWithToken` on the gateway of chain A, specifying:
14+
To call chain B from chain A and send some tokens supported by the gateway along the way, the user needs to call `callContractWithToken` on the gateway of chain A, specifying:
1515

16-
- The destination chain, which must be an EVM chain from [Chain names](/dev/reference/mainnet-chain-names/).
16+
- The destination chain, which must be an EVM chain from [Chain names](https://axelarscan.io/resources/chains).
1717
- The destination contract address, which must inherit from `AxelarExecutableWithToken` defined in [AxelarExecutableWithToken.sol](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/contracts/executable/AxelarExecutableWithToken.sol).
1818
- The payload `bytes` to pass to the destination contract.
1919
- The symbol of the token to transfer, which must be a supported asset ([Mainnet](/resources/contract-addresses/mainnet/) | [Testnet](/resources/contract-addresses/testnet/)).
2020
- The amount of the token to transfer.
2121

22+
Gateway tokens, as the name implies, are tokens supported at the [Axelar core gateway](https://github.com/axelarnetwork/axelar-cgp-solidity/blob/main/contracts/AxelarGateway.sol) layer. You can find the list of tokens supported [here](https://axelarscan.io/resources/assets?type=gateway).
23+
2224
<Callout emoji="🚨">
2325
**NOTE:** The security of your contracts, and the tokens passed between them,
2426
is limited to the security of the chains they integrate with. Since
@@ -38,7 +40,7 @@ function callContractWithToken(
3840
) external;
3941
```
4042

41-
`AxelarExecutableWithToken` has an `executeWithToken` function that will be triggered by the Axelar network on the destination chain after the `callContractWithToken` function has been executed on the source chain. This will validate the contract call and then invoke _your_ `_executeWithToken` method, where you should write any custom logic.
43+
The `AxelarExecutableWithToken` has an `executeWithToken` function that will be triggered by the Axelar network on the destination chain after the `callContractWithToken` function has been executed on the source chain. This will validate the contract call and then invoke _your_ `_executeWithToken` method, where you should write any custom logic.
4244

4345
The destination contract will be authorized to transfer the ERC-20 identified by the `tokenSymbol`.
4446

@@ -53,7 +55,7 @@ function _executeWithToken(
5355
) internal virtual {}
5456
```
5557

56-
### Example
58+
### Example Payload
5759

5860
Suppose our destination contract wants to forward the token it received to a recipient provided in the payload. It could be done this way.
5961

@@ -80,7 +82,7 @@ function _executeWithToken(
8082

8183
The `payload` passed to `callContract` (and ultimately to the `_execute` and `_executeWithToken`) has type `bytes`. Use the ABI encoder/decoder convert your data to `bytes`.
8284

83-
Example of payload encoding in JavaScript (using ethers.js):
85+
### Example of payload encoding in JavaScript (using ethers.js):
8486

8587
```jsx
8688
const { ethers } = require("ethers");
@@ -92,7 +94,7 @@ const payload = ethers.utils.defaultAbiCoder.encode(
9294
);
9395
```
9496

95-
Example of payload decoding in Solidity:
97+
### Example of payload decoding in Solidity:
9698

9799
```solidity
98100
function _execute(

0 commit comments

Comments
 (0)