Skip to content

Commit c7e7cc2

Browse files
authored
docs(gas-service): update introduction and links in documentation (#1360)
1 parent b9366dc commit c7e7cc2

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

src/content/docs/dev/gas-service/intro.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Introduction to the `AxelarGasService` contract
1+
# Introduction to Axelar Gas Service contract
22

3-
[`AxelarGasService`](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/contracts/interfaces/IAxelarGasService.sol) is a smart contract that manages gas payments and refunds for cross-chain communication on the Axelar network. It allows an application to prepay gas fees on the source chain and increase the gas paid for a transaction. If too much gas is paid for a transaction, it can calculate and refund the sender.
3+
[`AxelarGasService`](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/contracts/interfaces/IAxelarGasService.sol) is a smart contract that manages gas payments and refunds for cross-chain communication on the Axelar network. It allows an application to [prepay gas fees](https://github.com/axelarnetwork/axelar-cgp-solidity/blob/83012e6f6fb721d7ffaaec9426fdac3c02fced2e/contracts/gas-service/AxelarGasService.sol#L163C14-L163C41) on the source chain and increase the gas paid for a transaction. If too much gas is paid for a transaction, it can calculate and refund the sender.
44

55
## Prepay gas on the source chain
66

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,58 @@
11
# Token Managers
22

3-
[Token Managers](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/token-manager/TokenManager.sol#L22) are contracts that facilitate the connection between your interchain token to the Interchain Token Service (ITS). For certain manager types, such as `mint/burn` Token Manager, the manager is the `msg.sender` of the transaction being executed on the destination chain for the token when it is bridged in.
3+
[Token Managers](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/token-manager/TokenManager.sol#L22) are contracts that facilitate connection between your interchain token to the [Interchain Token Service (ITS)](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/InterchainTokenService.sol). For certain manager types, such as `mint/burn` Token Manager, the manager is the `msg.sender` of the transaction being executed on the destination chain for the token when it is bridged in.
44

55
## Token Manager Types
66

77
There are different [types](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/interfaces/ITokenManagerType.sol#L10) of token managers available for developers to offer different types of integrations to ITS. These are; `nativeInterchain`, `mintBurnFrom`, `lockUnlock`, `lockUnlockFee`, and `mintBurn`.
88

9-
Each of these types correspond to an `enum` value. When [deploying a token manager](https://github.com/axelarnetwork/interchain-token-service/blob/7df851d8a4ec4df819961d704bf3067ee8d37521/contracts/InterchainTokenService.sol#L286) developers must pass in the [corresponding value](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/InterchainTokenService.sol#L289) for their desired token manager type.
9+
Each of these types correspond to an `enum` value. When [deploying a token manager](https://github.com/axelarnetwork/interchain-token-service/blob/7df851d8a4ec4df819961d704bf3067ee8d37521/contracts/InterchainTokenService.sol#L286) developers must pass in the [corresponding value](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/interfaces/ITokenManagerType.sol) for their desired token manager type.
1010

11-
`NativeInterchainToken`: `0`
12-
`Mint/BurnFrom`: `1`
13-
`Lock/Unlock`: `2`
14-
`Lock/UnlockFee`: `3`
15-
`Mint/Burn`: `4`
11+
- `NativeInterchainToken`: `0`
12+
- `Mint/BurnFrom`: `1`
13+
- `Lock/Unlock`: `2`
14+
- `Lock/UnlockFee`: `3`
15+
- `Mint/Burn`: `4`
1616

1717
### Native Interchain Token
1818

19-
For tokens that are deployed [directly from ITS itself](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/InterchainTokenFactory.sol#L127) they use a native interchain token manager. Tokens that are deployed via the frontend portal also use this type of manager.
19+
For tokens that are deployed [directly from ITS itself](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/InterchainTokenFactory.sol#L127) they use a native interchain token manager. Tokens that are deployed via the [frontend portal](/dev/send-tokens/interchain-tokens/no-code/) also use this type of manager.
2020

21-
For more details checkout this [native interchain token example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-interchain-token)
21+
For more details checkout this [native interchain token example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-interchain-token).
2222

2323
### Mint/Burn From
2424

25-
The `mint/burnFrom` token manager type, allows tokens to be burnt on the source chain when they are transferred out of that chain and minted they are transferred back into the source chain. As the name suggests when the token is burnt on the source chain the manager is looking to trigger the `burnFrom()` function on the token rather than the `burn()` function. The main implication is that ITS must be approved to call `burnFrom()` by the token. The manager must be granted the role to be able to `mint()` the token on the destination chain.
25+
The `mint/burnFrom` token manager type, allows tokens to be burnt on the source chain when they are transferred out of that chain and minted when they are transferred back into the source chain. As the name suggests when the token is burnt on the source chain the manager is looking to trigger the `burnFrom()` function on the token rather than the `burn()` function.
2626

27-
For more details checkout this [Mint/BurnFrom example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-mint-burn-from)
27+
The main implication is that ITS must be approved to call `burnFrom()` by the token. The manager must be granted the role to be able to `mint()` the token on the destination chain.
28+
29+
For more details checkout this [Mint/BurnFrom example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-mint-burn-from).
2830

2931
### Lock/Unlock
3032

31-
Token integrations using the `lock/unlock` token manager will have their token locked with their token's manager. Only a single `lock/unlock` manager can exist for a token as having multiple `lock/unlock` managers would make it substantially more difficult to manage liquidity across many different blockchains. These token managers are best used in the case where a token has a "home chain" where a token can be locked. On the remote chains users can then use a wrapped version of that token which derives it's value from a locked token back on the home chain. Canonical tokens for example [deployed via ITS](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/InterchainTokenFactory.sol#L255) are examples where a `lock/unlock` token manager type is useful. When bridging tokens out of the destination chain (locking them at the manager) ITS [will call](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/TokenHandler.sol#L109) the `transferTokenFrom()` function, which in turn will call the `safeTranferFrom()` function. For this transaction to be successful, ITS must be `approved()` to call the `safeTransferFrom()` function, otherwise the call will revert.
33+
Token integrations using the `lock/unlock` token manager will have their token locked with their token's manager. Only a single `lock/unlock` manager can exist for a token as having multiple `lock/unlock` managers would make it substantially more difficult to manage liquidity across many different blockchains. These token managers are best used in the case where a token has a "home chain" where a token can be locked. On the remote chains users can then use a wrapped version of that token which derives it's value from a locked token back on the home chain.
34+
35+
Canonical tokens for example [deployed via ITS](https://github.com/axelarnetwork/interchain-token-service/blob/0dad750abe866ec8e77ea43a2d1563335d14bd32/contracts/InterchainTokenFactory.sol#L402) are examples where a `lock/unlock` token manager type is useful. When bridging tokens out of the destination chain (locking them at the manager) ITS [will call](https://github.com/axelarnetwork/interchain-token-service/blob/0dad750abe866ec8e77ea43a2d1563335d14bd32/contracts/TokenHandler.sol#L102) the `transferTokenFrom()` function, which in turn will call the `safeTranferFrom()` function. For this transaction to be successful, ITS must be `approved()` to call the `safeTransferFrom()` function, otherwise the call will revert.
3236

3337
For more details checkout this [Canonical token example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-canonical-token). Canonical tokens [use](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/InterchainTokenFactory.sol#L255) `lock/unlock` token managers on their home chain.
3438

3539
### Lock/Unlock Fee
3640

37-
This manager type is similar to the `lock/unlock` token manager, where the manager locks the token on it's "home chain" when it is bridged out and unlocks it when it is bridged back. The key feature with this token manager is that you have the option to set a fee that will be [deducted](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/TokenHandler.sol#L197) when executing an `interchainTransfer()`.
41+
This manager type is similar to the `lock/unlock` token manager, where the manager locks the token on it's "home chain" when it is bridged out and unlocks it when it is bridged back. The key feature with this token manager is that you have the option to set a fee that will be [deducted](https://github.com/axelarnetwork/interchain-token-service/blob/0dad750abe866ec8e77ea43a2d1563335d14bd32/contracts/TokenHandler.sol#L148) when executing an `interchainTransfer()`.
3842

39-
For more details checkout this [Lock/UnlockFee example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-lock-unlock-fee)
43+
For more details checkout this [Lock/UnlockFee example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-lock-unlock-fee).
4044

4145
### Mint/Burn
4246

4347
The `mint/burn` token manager type is the most common token manager type used for integrating tokens to ITS. This token manager type is used when there is no home chain for your token and allows you to `burn()` tokens from the source chain and `mint()` tokens on the destination chain. The manager will need to be granted the role to be able to execute the `mint()` and `burn()` function on the token.
4448

45-
For more details checkout this [Mint/Burn example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-custom-token)
49+
For more details checkout this [Mint/Burn example](https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/its-custom-token).
4650

4751
## Flow Limits
4852

4953
Token Managers handle the flow limits for a token's ITS integration. A `flowLimit` is a set amount that controls the amount in which a token can be sent in/out of a given blockchain. This can have a variety of different usecases including for security emergencies on a given chain where you want to restrict the flow of your token for that particular blockchain.
5054

51-
For each cross-chain transaction that goes through ITS the `flowIn` & `flowAmount` amount are increased to track the [inflow](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/TokenHandler.sol#L51) and [outflow](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/TokenHandler.sol#L120) of tokens. To [set](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/token-manager/TokenManager.sol#L167) the `flowLimit` of a given token the caller must be a registered [flowLimiter](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/utils/RolesConstants.sol#L13).
55+
For each cross-chain transaction that goes through ITS the `flowIn` & `flowAmount` amount are increased to track the [inflow](https://github.com/axelarnetwork/interchain-token-service/blob/0dad750abe866ec8e77ea43a2d1563335d14bd32/contracts/TokenHandler.sol#L33) and [outflow](https://github.com/axelarnetwork/interchain-token-service/blob/0dad750abe866ec8e77ea43a2d1563335d14bd32/contracts/TokenHandler.sol#L67) of tokens. To [set](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/token-manager/TokenManager.sol#L167) the `flowLimit` of a given token the caller must be a registered [flowLimiter](https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/utils/RolesConstants.sol#L13).
5256

53-
For more information on `flowLimit`s, see [Flow Limit in Interchain Token Service
54-
](/dev/send-tokens/interchain-tokens/flow-limit/)
57+
For more information on `flowLimit`, see [Flow Limit in Interchain Token Service
58+
](/dev/send-tokens/interchain-tokens/flow-limit/).

0 commit comments

Comments
 (0)