axelarnetwork / support

Your source for support with the Axelar Network
3 stars 1 forks source link

Issue deploying remote canonical interchain token from EVM testnet to polygon-amoy chain #118

Closed leopashov closed 5 months ago

leopashov commented 5 months ago

I'm running a script very similar to https://docs.axelar.dev/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-canonical-token.

I am deploying a token on ethereum sepolia, registering it as a canonical interchain token, calculating bridge fee and then trying to deployRemoteCanonicalInterchainToken using:

deployRemoteCanonicalInterchainToken( sourceChain, tokenAddress, destChain, fee, { value: fee } );

At this point it errors with: ProviderError: execution reverted The same script works fine for deploying the same token to base-sepolia, blast-sepolia and arbitrum-sepolia. Is there something fundamentally different with polygon that explains this behaviour?

Many thanks in advance.

leopashov commented 5 months ago

In the failed case I used: interchainTokenFactory.deployRemoteCanonicalInterchainToken( EvmChain.SEPOLIA, "0x1E26B3373B0349d5C3b45e1bbFe66C8581eAecf6", EvmChain.POLYGON_SEPOLIA, fee, { value: fee } );

Where fee was calculated using the AxelarQueryAPI({environment: Environment.TESTNET }) estimateGasFee function

Using polygon-amoy instead of EvmChain.POLYGON_SEPOLIA throws: Error: Invalid chain identifier for polygon-amoy. Did you mean polygon? Is polygon-amoy just not supported?

benjamin852 commented 5 months ago

I've had a similar issue once, which was resolved by passing in a gasLimit to the transaction when calling this. POLYGON_SEPOLIA is polygon amoy, sorry that needs to get fixed I will call it out.

What value are you passing in for the fee?

leopashov commented 5 months ago

I am using the following to calculate the fee:

`export function calculateBridgeFee(
  sourceChain: EvmChain | string,
  destChain: EvmChain | string,
  options: {
    gasLimit?: number;
  } = {}
) {
  const api = new AxelarQueryAPI({ environment: Environment.TESTNET });
  const { gasLimit } = options;

  return api.estimateGasFee(sourceChain, destChain, gasLimit || 700000, "auto");
}`

I have tried calling this with;

const fee = await calculateBridgeFee(sourceChain, destChain, { gasLimit: 30000000, });

ie 30*10^6 gas limit (and have tried higher aswell) but no difference in outcome. Still working fine for the other chain cases.

benjamin852 commented 5 months ago

I mean pass in a gasLimit when you're calling the deployRemoteCanonicalToken(), you pass in a value right now but no gasLimit. Let's not worry about the fee being passed in right now. If you're on testnet feel free to pass in arbitrarily high value (a surplus will be refunded back to you). I just want to see right now if we can get a tx without a revert

deployRemoteCanonicalInterchainToken( sourceChain, tokenAddress, destChain, fee, {value: fee, gasLimit: "10000000" } )

leopashov commented 5 months ago

That also didn't help. For reference, the fee it gave was 113353502617703, The tx reverted again and is here: https://sepolia.etherscan.io/tx/0xd1e5ec54a65afddc7d2301fff40b666814be2a7669ed91408214270169d3c174

It also seems there's a message relating to 'untrustedChain' in the tenderly logs: https://dashboard.tenderly.co/tx/sepolia/0xd1e5ec54a65afddc7d2301fff40b666814be2a7669ed91408214270169d3c174?trace=0.1.5.1.2.2

benjamin852 commented 5 months ago

Hey @leopashov Just confirmed. ITS is not live yet on Amoy (polygon-sepolia) I think the team wants to get it deployed there in the next week or two but that's why you're receiving that error. I suggest going forward just to test on different testnets to make sure your logic is working correctly. And ITS should be working on polygon mainnet

leopashov commented 4 months ago

Understood, many thanks