You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are encountering a precision error in the Wormhole SDK when executing TokenTransfer.from. The issue arises for USDC transactions where the token transfer amount is nearly identical to the relayer fee.
The function that was failing:
exportasyncfunctiongetWhTokenTransferByTxID(){consttxId='0xd26c5b36d1125f031f44eee7a98989aae10e9df39809d5124a1dc6f43bfbf1ce';constwh=newWormhole('Mainnet',[EvmPlatform]);try{constvaa=awaitTokenTransfer.getTransferVaa(wh,txId);if(!vaa){thrownewError(`VAA not found for txId ${txId}`);}consttokenTransfer=awaitTokenTransfer.from(wh,{chain: vaa.emitterChain,txid: txId,});// THIS IS FALING}catch(e){console.error(e);thrownewError((easError).message);}}
The error happens during the execution of TokenTransfer.from
Error message:
scaleAmount({"amount":"1423266","decimals":8}, 6) would result in altered amount. Use truncateAmount first if you intended to truncate it.
After inspection of the VAA we saw the token amount (1423266) and the relayer fee (1423265) are almost identical, this could be causing a precision or scaling issue within the SDK
We are encountering a precision error in the Wormhole SDK when executing
TokenTransfer.from
. The issue arises for USDC transactions where the token transfer amount is nearly identical to the relayer fee.The function that was failing:
The error happens during the execution of
TokenTransfer.from
Error message:
After inspection of the VAA we saw the token amount (
1423266
) and the relayer fee (1423265
) are almost identical, this could be causing a precision or scaling issue within the SDKAfter increasing the amount sent the transaction went through: https://wormholescan.io/#/tx/0xe82f5a9aaf54935dd74ae9e6a29554ebeec0cbbb3adebc79753dd4f395c48345?network=Mainnet
The text was updated successfully, but these errors were encountered: