Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ahramy committed Nov 11, 2024
1 parent fa74b9b commit 0ffd3bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .changeset/hungry-seahorses-tap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@axelar-network/interchain-token-service': patch
---

Prevent the deployment of the token manager on its hub. Now, require registering the trusted address for the self chain if it is connected to the ITS hub, to ensure this check is applied correctly. Note: This deploy token manager restriction is temporary for chains connected via the Hub. Once the ITS hub adds support for it, the restriction will be removed.
Remove support for deploying token manager to chains connected via ITS Hub. When deploying ITS to an EVM chain connected via Amplifier / ITS Hub, a trusted address must be set for it's own chain name to the `'hub'` identifier, to prevent deploying the token manager locally. Note that this restriction is temporary. Once the ITS Hub adds support for deploy token manager msg type, the restriction will be removed. Also note that the token manager deployed as part of registering a canonical ITS token from the ITS Factory is not affected by this.
15 changes: 8 additions & 7 deletions contracts/InterchainTokenService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,11 @@ contract InterchainTokenService is
* @notice Used to deploy remote custom TokenManagers.
* @dev At least the `gasValue` amount of native token must be passed to the function call. `gasValue` exists because this function can be
* part of a multicall involving multiple functions that could make remote contract calls.
* Restricted on ITS contracts deployed to Amplifier chains until ITS Hub adds support. Only the factory contract can call
* `deployTokenManager` for canonical token registration. This should still work fine for consensus deployments.
* This method is temporarily restricted in the following scenarios:
* - Deploying to a remote chain and the destination chain is connected via ITS Hub
* - Deploying to the current chain, if connected as an Amplifier chain, i.e existing ITS contracts on consensus chains aren't affected.
* Once ITS Hub adds support for deploy token manager msg, the restriction will be lifted.
* Note that the factory contract can still call `deployTokenManager` to facilitate canonical token registration.
* @param salt The salt to be used during deployment.
* @param destinationChain The name of the chain to deploy the TokenManager and standardized token to.
* @param tokenManagerType The type of token manager to be deployed. Cannot be NATIVE_INTERCHAIN_TOKEN.
Expand All @@ -306,11 +309,9 @@ contract InterchainTokenService is

if (deployer == interchainTokenFactory) {
deployer = TOKEN_FACTORY_DEPLOYER;
} else if (bytes(destinationChain).length == 0) {
// Restricted on ITS contracts deployed to Amplifier chains until ITS Hub adds support.
if (trustedAddressHash(chainName()) == ITS_HUB_ROUTING_IDENTIFIER_HASH) {
revert NotSupported();
}
} else if (bytes(destinationChain).length == 0 && trustedAddressHash(chainName()) == ITS_HUB_ROUTING_IDENTIFIER_HASH) {
// Restricted on ITS contracts deployed to Amplifier chains until ITS Hub adds support
revert NotSupported();
}

tokenId = interchainTokenId(deployer, salt);
Expand Down

0 comments on commit 0ffd3bb

Please sign in to comment.