Repository: hyperlane-xyz/hyperlane-monorepo (language: rust)

Issue:
Hyperlane Warp Deploy not creating file with correct symbol
## Problem

**Is your feature request related to a problem? Please describe.**
When running `hyperlane warp deploy` where the resulting synthetic token symbol is different from the collateral one, it will spit out a `.config-yaml `file that does not contain the correct symbol, but the resulting token is still correct



**Additional context**

Issue happened when trying to do `hyperlane warp deploy` from `base USDC` to `artela USDC.a`:
```typescript
export const getArtelaBaseUSDCWarpConfig = async (
  routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
  const artela: HypTokenRouterConfig = {
    ...routerConfig.artela,
    owner: artelaOwner,
    type: TokenType.synthetic,
    symbol: 'USDC.a',
    interchainSecurityModule: ISM_CONFIG,
  };

  const base: HypTokenRouterConfig = {
    ...routerConfig.base,
    owner: baseOwner,
    type: TokenType.collateral,
    token: tokens.base.USDC,
    interchainSecurityModule: ISM_CONFIG,
  };

  return {
    artela,
    base,
  };
};
```

After running the command it spits the following config.yaml file:
```yaml
tokens:
  - addressOrDenom: "0x8d9Bd7E9ec3cd799a659EE650DfF6C799309fA91"
    chainName: artela
    connections:
      - token: ethereum|base|0x01348F639D6e418A5a9673c08c0dDf6ecCB80F37
    decimals: 6
    name: USD Coin
    standard: EvmHypSynthetic
    symbol: USDC
  - addressOrDenom: "0x01348F639D6e418A5a9673c08c0dDf6ecCB80F37"
    chainName: base
    collateralAddressOrDenom: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
    connections:
      - token: ethereum|artela|0x8d9Bd7E9ec3cd799a659EE650DfF6C799309fA91
    decimals: 6
    name: USD Coin
    standard: EvmHypCollateral
    symbol: USDC
```
But if you check the contract itself, it will show that deploy was done correctly in the correct symbol: https://artscan.artela.network/token/0x8d9Bd7E9ec3cd799a659EE650DfF6C799309fA91


## Solution

**Describe the solution you'd like**
The `hyperlane warp deploy` command should spit a config file with the correct symbols

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

## Nice to Have

**Describe non-essential extensions to the solution**
Additional features which should be implemented if they are easy to accommodate but otherwise can be skipped



Discussion / hints:

Fix patch:
diff --git a/.changeset/proud-waves-camp.md b/.changeset/proud-waves-camp.md
new file mode 100644
index 0000000000..a7cab11392
--- /dev/null
+++ b/.changeset/proud-waves-camp.md
@@ -0,0 +1,5 @@
+---
+'@hyperlane-xyz/cli': minor
+---
+
+Fix issue where warp deploy artifacts did not include correct symbols.
diff --git a/typescript/cli/package.json b/typescript/cli/package.json
index e82cfc5b64..1c9b87d5c6 100644
--- a/typescript/cli/package.json
+++ b/typescript/cli/package.json
@@ -5,7 +5,7 @@
   "dependencies": {
     "@aws-sdk/client-kms": "^3.577.0",
     "@aws-sdk/client-s3": "^3.577.0",
-    "@hyperlane-xyz/registry": "6.6.0",
+    "@hyperlane-xyz/registry": "6.18.0",
     "@hyperlane-xyz/sdk": "8.2.0",
     "@hyperlane-xyz/utils": "8.2.0",
     "@inquirer/core": "9.0.10",
diff --git a/typescript/cli/src/deploy/warp.ts b/typescript/cli/src/deploy/warp.ts
index e94bd709da..eabcf15f90 100644
--- a/typescript/cli/src/deploy/warp.ts
+++ b/typescript/cli/src/deploy/warp.ts
@@ -4,7 +4,7 @@ import { stringify as yamlStringify } from 'yaml';
 
 import { ProxyAdmin__factory } from '@hyperlane-xyz/core';
 import { buildArtifact as coreBuildArtifact } from '@hyperlane-xyz/core/buildArtifact.js';
-import { ChainAddresses } from '@hyperlane-xyz/registry';
+import { AddWarpRouteOptions, ChainAddresses } from '@hyperlane-xyz/registry';
 import {
   AggregationIsmConfig,
   AnnotatedEV5Transaction,
@@ -153,12 +153,12 @@ export async function runWarpRouteDeploy({
 
   const deployedContracts = await executeDeploy(deploymentParams, apiKeys);
 
-  const warpCoreConfig = await getWarpCoreConfig(
+  const { warpCoreConfig, addWarpRouteOptions } = await getWarpCoreConfig(
     deploymentParams,
     deployedContracts,
   );
 
-  await writeDeploymentArtifacts(warpCoreConfig, context);
+  await writeDeploymentArtifacts(warpCoreConfig, context, addWarpRouteOptions);
 
   await completeDeploy(context, 'warp', initialBalances, null, ethereumChains!);
 }
@@ -226,10 +226,11 @@ async function executeDeploy(
 async function writeDeploymentArtifacts(
   warpCoreConfig: WarpCoreConfig,
   context: WriteCommandContext,
+  addWarpRouteOptions?: AddWarpRouteOptions,
 ) {
   if (!context.isDryRun) {
     log('Writing deployment artifacts...');
-    await context.registry.addWarpRoute(warpCoreConfig);
+    await context.registry.addWarpRoute(warpCoreConfig, addWarpRouteOptions);
   }
   log(indentYamlOrJson(yamlStringify(warpCoreConfig, null, 2), 4));
 }
@@ -417,7 +418,10 @@ async function createWarpHook({
 async function getWarpCoreConfig(
   { warpDeployConfig, context }: DeployParams,
   contracts: HyperlaneContractsMap<TokenFactories>,
-): Promise<WarpCoreConfig> {
+): Promise<{
+  warpCoreConfig: WarpCoreConfig;
+  addWarpRouteOptions?: AddWarpRouteOptions;
+}> {
   const warpCoreConfig: WarpCoreConfig = { tokens: [] };
 
   // TODO: replace with warp read
@@ -443,7 +447,7 @@ async function getWarpCoreConfig(
 
   fullyConnectTokens(warpCoreConfig);
 
-  return warpCoreConfig;
+  return { warpCoreConfig, addWarpRouteOptions: { symbol } };
 }
 
 /**
@@ -467,7 +471,7 @@ function generateTokenConfigs(
       chainName,
       standard: TOKEN_TYPE_TO_STANDARD[config.type],
       decimals,
-      symbol,
+      symbol: config.symbol || symbol,
       name,
       addressOrDenom:
         contract[warpDeployConfig[chainName].type as keyof TokenFactories]
@@ -592,9 +596,15 @@ async function extendWarpRoute(
     warpCoreConfigByChain,
   );
 
-  const updatedWarpCoreConfig = await getWarpCoreConfig(params, mergedRouters);
+  const { warpCoreConfig: updatedWarpCoreConfig, addWarpRouteOptions } =
+    await getWarpCoreConfig(params, mergedRouters);
   WarpCoreConfigSchema.parse(updatedWarpCoreConfig);
-  await writeDeploymentArtifacts(updatedWarpCoreConfig, params.context);
+
+  await writeDeploymentArtifacts(
+    updatedWarpCoreConfig,
+    params.context,
+    addWarpRouteOptions,
+  );
 
   return enrollRemoteRouters(params, mergedRouters);
 }
diff --git a/typescript/helloworld/package.json b/typescript/helloworld/package.json
index 8db5c68f1c..f3863608a0 100644
--- a/typescript/helloworld/package.json
+++ b/typescript/helloworld/package.json
@@ -4,7 +4,7 @@
   "version": "8.2.0",
   "dependencies": {
     "@hyperlane-xyz/core": "5.9.2",
-    "@hyperlane-xyz/registry": "6.6.0",
+    "@hyperlane-xyz/registry": "6.18.0",
     "@hyperlane-xyz/sdk": "8.2.0",
     "@openzeppelin/contracts-upgradeable": "^4.9.3",
     "ethers": "^5.7.2"
diff --git a/typescript/infra/package.json b/typescript/infra/package.json
index d101047359..e48a843230 100644
--- a/typescript/infra/package.json
+++ b/typescript/infra/package.json
@@ -14,7 +14,7 @@
     "@ethersproject/providers": "*",
     "@google-cloud/secret-manager": "^5.5.0",
     "@hyperlane-xyz/helloworld": "8.2.0",
-    "@hyperlane-xyz/registry": "6.6.0",
+    "@hyperlane-xyz/registry": "6.18.0",
     "@hyperlane-xyz/sdk": "8.2.0",
     "@hyperlane-xyz/utils": "8.2.0",
     "@inquirer/prompts": "3.3.2",
diff --git a/typescript/widgets/package.json b/typescript/widgets/package.json
index 2db355e56e..ab1c0ed5fd 100644
--- a/typescript/widgets/package.json
+++ b/typescript/widgets/package.json
@@ -27,7 +27,7 @@
     "@emotion/react": "^11.13.3",
     "@emotion/styled": "^11.13.0",
     "@eslint/js": "^9.15.0",
-    "@hyperlane-xyz/registry": "6.6.0",
+    "@hyperlane-xyz/registry": "6.18.0",
     "@storybook/addon-essentials": "^7.6.14",
     "@storybook/addon-interactions": "^7.6.14",
     "@storybook/addon-links": "^7.6.14",
diff --git a/yarn.lock b/yarn.lock
index bef5c6d94d..cf72bf2284 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7320,7 +7320,7 @@ __metadata:
     "@eslint/js": "npm:^9.15.0"
     "@ethersproject/abi": "npm:*"
     "@ethersproject/providers": "npm:*"
-    "@hyperlane-xyz/registry": "npm:6.6.0"
+    "@hyperlane-xyz/registry": "npm:6.18.0"
     "@hyperlane-xyz/sdk": "npm:8.2.0"
     "@hyperlane-xyz/utils": "npm:8.2.0"
     "@inquirer/core": "npm:9.0.10"
@@ -7424,7 +7424,7 @@ __metadata:
   dependencies:
     "@eslint/js": "npm:^9.15.0"
     "@hyperlane-xyz/core": "npm:5.9.2"
-    "@hyperlane-xyz/registry": "npm:6.6.0"
+    "@hyperlane-xyz/registry": "npm:6.18.0"
     "@hyperlane-xyz/sdk": "npm:8.2.0"
     "@nomiclabs/hardhat-ethers": "npm:^2.2.3"
     "@nomiclabs/hardhat-waffle": "npm:^2.0.6"
@@ -7475,7 +7475,7 @@ __metadata:
     "@ethersproject/providers": "npm:*"
     "@google-cloud/secret-manager": "npm:^5.5.0"
     "@hyperlane-xyz/helloworld": "npm:8.2.0"
-    "@hyperlane-xyz/registry": "npm:6.6.0"
+    "@hyperlane-xyz/registry": "npm:6.18.0"
     "@hyperlane-xyz/sdk": "npm:8.2.0"
     "@hyperlane-xyz/utils": "npm:8.2.0"
     "@inquirer/prompts": "npm:3.3.2"
@@ -7537,13 +7537,13 @@ __metadata:
   languageName: unknown
   linkType: soft
 
-"@hyperlane-xyz/registry@npm:6.6.0":
-  version: 6.6.0
-  resolution: "@hyperlane-xyz/registry@npm:6.6.0"
+"@hyperlane-xyz/registry@npm:6.18.0":
+  version: 6.18.0
+  resolution: "@hyperlane-xyz/registry@npm:6.18.0"
   dependencies:
     yaml: "npm:2.4.5"
     zod: "npm:^3.21.2"
-  checksum: 10/4e8c955054a3872439f8a52ba208db848da1e46cdf920d4c0cf42080a147c4185d6fed2b00dec0320dfebeb7287578c8a95d3f2f81c2ba713a83a426a1793525
+  checksum: 10/0090afeffa60cf1891b1c7178d5f91d80db96a85595ba9a4ad7160cdc830737efc54022e11d416da4f4d9f7c032fde6f7aef678ae99e4a1f6142cdc06c50ccbc
   languageName: node
   linkType: hard
 
@@ -7642,7 +7642,7 @@ __metadata:
     "@emotion/styled": "npm:^11.13.0"
     "@eslint/js": "npm:^9.15.0"
     "@headlessui/react": "npm:^2.1.8"
-    "@hyperlane-xyz/registry": "npm:6.6.0"
+    "@hyperlane-xyz/registry": "npm:6.18.0"
     "@hyperlane-xyz/sdk": "npm:8.2.0"
     "@hyperlane-xyz/utils": "npm:8.2.0"
     "@interchain-ui/react": "npm:^1.23.28"


Test patch: