Aperture-Finance / uniswap-v3-automation-sdk

14 stars 7 forks source link

implement estimateTotalGasCostForOptimismLikeL2Tx in viem version #273

Closed lanceaper closed 3 weeks ago

lanceaper commented 3 weeks ago

seems viem.estimateTotalFee not support manta ~& scroll~

lanceaper commented 3 weeks ago

Can we use https://viem.sh/op-stack/actions/estimateTotalGas for this? If a chain isn't supported by that function out of the box, you can try specifying https://viem.sh/op-stack/actions/estimateTotalGas#gaspriceoracleaddress-optional with ovmGasPriceOracleAddress.

I see, let me try, is manta also using 0x420000000000000000000000000000000000000F as gas oracle address?

gnarlycow commented 3 weeks ago

Can we use https://viem.sh/op-stack/actions/estimateTotalGas for this? If a chain isn't supported by that function out of the box, you can try specifying https://viem.sh/op-stack/actions/estimateTotalGas#gaspriceoracleaddress-optional with ovmGasPriceOracleAddress.

I see, let me try, is manta also using 0x420000000000000000000000000000000000000F as gas oracle address?

At the time I wasn't able to find a gas oracle address for Manta Pacific actually. But Scroll definitely uses 0x5300000000000000000000000000000000000002 and OP/Base use 0x420000000000000000000000000000000000000F.

  // The following three chains are known to be supported:
   // 1. SCROLL_MAINNET_CHAIN_ID (534352);
   // 2. OPTIMISM_MAINNET_CHAIN_ID (10);
   // 3. BASE_MAINNET_CHAIN_ID (8453).
   const ovmGasPriceOracleAddress =
     chainId === ApertureSupportedChainId.SCROLL_MAINNET_CHAIN_ID
       ? '0x5300000000000000000000000000000000000002'
       : '0x420000000000000000000000000000000000000F';
lanceaper commented 3 weeks ago

Can we use https://viem.sh/op-stack/actions/estimateTotalGas for this? If a chain isn't supported by that function out of the box, you can try specifying https://viem.sh/op-stack/actions/estimateTotalGas#gaspriceoracleaddress-optional with ovmGasPriceOracleAddress.

I see, let me try, is manta also using 0x420000000000000000000000000000000000000F as gas oracle address?

At the time I wasn't able to find a gas oracle address for Manta Pacific actually. But Scroll definitely uses 0x5300000000000000000000000000000000000002 and OP/Base use 0x420000000000000000000000000000000000000F.

  // The following three chains are known to be supported:
   // 1. SCROLL_MAINNET_CHAIN_ID (534352);
   // 2. OPTIMISM_MAINNET_CHAIN_ID (10);
   // 3. BASE_MAINNET_CHAIN_ID (8453).
   const ovmGasPriceOracleAddress =
     chainId === ApertureSupportedChainId.SCROLL_MAINNET_CHAIN_ID
       ? '0x5300000000000000000000000000000000000002'
       : '0x420000000000000000000000000000000000000F';

it works for Scroll, but estimateTotalGas seems still not support Manta

image

lanceaper commented 3 weeks ago

create an issue to track and will investigate later https://github.com/Aperture-Finance/uniswap-v3-automation-sdk/issues/274