From 0ffd3bbff3735325675871aceb8a4d0b54864d6b Mon Sep 17 00:00:00 2001 From: ahramy Date: Sun, 10 Nov 2024 22:54:38 -0800 Subject: [PATCH] updated --- .changeset/hungry-seahorses-tap.md | 2 +- contracts/InterchainTokenService.sol | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.changeset/hungry-seahorses-tap.md b/.changeset/hungry-seahorses-tap.md index 97bba477..0a361a6c 100644 --- a/.changeset/hungry-seahorses-tap.md +++ b/.changeset/hungry-seahorses-tap.md @@ -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. diff --git a/contracts/InterchainTokenService.sol b/contracts/InterchainTokenService.sol index aed216a7..ef1423a8 100644 --- a/contracts/InterchainTokenService.sol +++ b/contracts/InterchainTokenService.sol @@ -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. @@ -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);