You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/dev/general-message-passing/gmp-tokens-with-messages.mdx
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,14 +11,16 @@ import { Callout } from "/src/components/callout";
11
11
allowFullScreen
12
12
></iframe>
13
13
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:
15
15
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).
17
17
- 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).
18
18
- The payload `bytes` to pass to the destination contract.
19
19
- The symbol of the token to transfer, which must be a supported asset ([Mainnet](/resources/contract-addresses/mainnet/) | [Testnet](/resources/contract-addresses/testnet/)).
20
20
- The amount of the token to transfer.
21
21
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
+
22
24
<Calloutemoji="🚨">
23
25
**NOTE:** The security of your contracts, and the tokens passed between them,
24
26
is limited to the security of the chains they integrate with. Since
@@ -38,7 +40,7 @@ function callContractWithToken(
38
40
) external;
39
41
```
40
42
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.
42
44
43
45
The destination contract will be authorized to transfer the ERC-20 identified by the `tokenSymbol`.
44
46
@@ -53,7 +55,7 @@ function _executeWithToken(
53
55
) internal virtual {}
54
56
```
55
57
56
-
### Example
58
+
### Example Payload
57
59
58
60
Suppose our destination contract wants to forward the token it received to a recipient provided in the payload. It could be done this way.
59
61
@@ -80,7 +82,7 @@ function _executeWithToken(
80
82
81
83
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`.
82
84
83
-
Example of payload encoding in JavaScript (using ethers.js):
85
+
### Example of payload encoding in JavaScript (using ethers.js):
0 commit comments