wormhole-foundation / wormhole-connect

Wormhole Connect brings all the functionality and utility of Wormhole right into your application and removes all of the complexity.
https://connect-in-style.wormhole.com/
Other
78 stars 56 forks source link

[QA] Warning is not displayed to the user: Console Error - "Amount: invalid input, Decimals too low" #2335

Open tsadovska opened 1 month ago

tsadovska commented 1 month ago

Describe the current behavior in detail

Checked on wormhole-connect-mainnet with macOS Sonoma 14.5 and Google Chrome Version 127.0.6533.89 (Official Build) (arm64).

Steps:

  1. Select Optimism network and W asset in From section (in my case, MetaMask wallet was connected automatically)
  2. Select Solana network and W asset in To section (in my case, Phantom wallet was connected automatically)
  3. Enter Amount 0.0000121
  4. Select Automatic route

Actual result: Routes are no longer displayed. Warning is not shown to the user.

Error thrown in isRouteAvailable Error: Amount: invalid input. Decimals too low.
    at parse$3 (main-B_vQ2Uks.js:240:22654)
    at $.quote (main-B_vQ2Uks.js:274:23959)
    at async SDKv2Route.getQuote (main-B_vQ2Uks.js:276:201534)
    at async SDKv2Route.isRouteAvailable (main-B_vQ2Uks.js:276:200532)
    at async Operator.isRouteAvailable (main-B_vQ2Uks.js:276:206319)
    at async main-B_vQ2Uks.js:308:12820

https://github.com/user-attachments/assets/313afa5b-84c5-44c1-9087-5c8e2073c9a2

Expected result: Warning or Routes are shown to the user.

Custom config

{
  env: 'mainnet',
  useRedesign: true,
  tokensConfig: {
    Wsolana: {
      key: 'Wsolana',
      symbol: 'W',
      nativeChain: 'solana',
      tokenId: {
        chain: 'solana',
        address: '85VBFQZC9TZkfaptBWjvUw7YbZjy52A6mjtPGjstQAmQ',
      },
      icon: 'https://assets.coingecko.com/coins/images/35087/standard/womrhole_logo_full_color_rgb_2000px_72ppi_fb766ac85a.png?1708688954',
      coinGeckoId: 'wormhole',
      decimals: {
        default: 6,
      },
    },
    Wethereum: {
      key: 'Wethereum',
      symbol: 'W',
      nativeChain: 'ethereum',
      tokenId: {
        chain: 'ethereum',
        address: '0xB0fFa8000886e57F86dd5264b9582b2Ad87b2b91',
      },
      icon: 'https://assets.coingecko.com/coins/images/35087/standard/womrhole_logo_full_color_rgb_2000px_72ppi_fb766ac85a.png?1708688954',
      coinGeckoId: 'wormhole',
      decimals: {
        default: 18,
      },
    },
    Warbitrum: {
      key: 'Warbitrum',
      symbol: 'W',
      nativeChain: 'arbitrum',
      tokenId: {
        chain: 'arbitrum',
        address: '0xB0fFa8000886e57F86dd5264b9582b2Ad87b2b91',
      },
      icon: 'https://assets.coingecko.com/coins/images/35087/standard/womrhole_logo_full_color_rgb_2000px_72ppi_fb766ac85a.png?1708688954',
      coinGeckoId: 'wormhole',
      decimals: {
        default: 18,
      },
    },
    Woptimism: {
      key: 'Woptimism',
      symbol: 'W',
      nativeChain: 'optimism',
      tokenId: {
        chain: 'optimism',
        address: '0xB0fFa8000886e57F86dd5264b9582b2Ad87b2b91',
      },
      icon: 'https://assets.coingecko.com/coins/images/35087/standard/womrhole_logo_full_color_rgb_2000px_72ppi_fb766ac85a.png?1708688954',
      coinGeckoId: 'wormhole',
      decimals: {
        default: 18,
      },
    },
    Wbase: {
      key: 'Wbase',
      symbol: 'W',
      nativeChain: 'base',
      tokenId: {
        chain: 'base',
        address: '0xB0fFa8000886e57F86dd5264b9582b2Ad87b2b91',
      },
      icon: 'https://assets.coingecko.com/coins/images/35087/standard/womrhole_logo_full_color_rgb_2000px_72ppi_fb766ac85a.png?1708688954',
      coinGeckoId: 'wormhole',
      decimals: {
        default: 18,
      },
    },
  },
  nttGroups: {
    W: {
      nttManagers: [
        {
          chainName: 'solana',
          address: 'NTtAaoDJhkeHeaVUHnyhwbPNAN6WgBpHkHBTc6d7vLK',
          tokenKey: 'Wsolana',
          transceivers: [
            {
              address: 'NTtAaoDJhkeHeaVUHnyhwbPNAN6WgBpHkHBTc6d7vLK',
              type: 'wormhole',
            },
          ],
          solanaQuoter: 'Nqd6XqA8LbsCuG8MLWWuP865NV6jR1MbXeKxD4HLKDJ',
        },
        {
          chainName: 'ethereum',
          address: '0xc072B1AEf336eDde59A049699Ef4e8Fa9D594A48',
          tokenKey: 'Wethereum',
          transceivers: [
            {
              address: '0xDb55492d7190D1baE8ACbE03911C4E3E7426870c',
              type: 'wormhole',
            },
          ],
        },
        {
          chainName: 'arbitrum',
          address: '0x5333d0AcA64a450Add6FeF76D6D1375F726CB484',
          tokenKey: 'Warbitrum',
          transceivers: [
            {
              address: '0xD1a8AB69e00266e8B791a15BC47514153A5045a6',
              type: 'wormhole',
            },
          ],
        },
        {
          chainName: 'optimism',
          address: '0x1a4F1a790f23Ffb9772966cB6F36dCd658033e13',
          tokenKey: 'Woptimism',
          transceivers: [
            {
              address: '0x9bD8b7b527CA4e6738cBDaBdF51C22466756073d',
              type: 'wormhole',
            },
          ],
        },
        {
          chainName: 'base',
          address: '0x5333d0AcA64a450Add6FeF76D6D1375F726CB484',
          tokenKey: 'Wbase',
          transceivers: [
            {
              address: '0xD1a8AB69e00266e8B791a15BC47514153A5045a6',
              type: 'wormhole',
            },
          ],
        },
      ],
    },
  },
}
agodlevska commented 3 weeks ago

Issue reproducible on wormhole-connect-testnet when sending WAVAX from BSC to Alfajores.

Attachment:

Screenshot 2024-08-19 at 15 28 36