|
1 | 1 | # Token Managers |
2 | 2 |
|
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. |
4 | 4 |
|
5 | 5 | ## Token Manager Types |
6 | 6 |
|
7 | 7 | 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`. |
8 | 8 |
|
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. |
10 | 10 |
|
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` |
16 | 16 |
|
17 | 17 | ### Native Interchain Token |
18 | 18 |
|
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. |
20 | 20 |
|
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). |
22 | 22 |
|
23 | 23 | ### Mint/Burn From |
24 | 24 |
|
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. |
26 | 26 |
|
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). |
28 | 30 |
|
29 | 31 | ### Lock/Unlock |
30 | 32 |
|
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. |
32 | 36 |
|
33 | 37 | 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. |
34 | 38 |
|
35 | 39 | ### Lock/Unlock Fee |
36 | 40 |
|
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()`. |
38 | 42 |
|
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). |
40 | 44 |
|
41 | 45 | ### Mint/Burn |
42 | 46 |
|
43 | 47 | 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. |
44 | 48 |
|
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). |
46 | 50 |
|
47 | 51 | ## Flow Limits |
48 | 52 |
|
49 | 53 | 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. |
50 | 54 |
|
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). |
52 | 56 |
|
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