Skip to content

Commit 540d173

Browse files
authored
fix(beefy): withdraw shortcut decimals (#817)
### Description Get decimals for the withdraw shortcut from the main token instead of the earned token, since the earned token decimals doesn't match the main token ones. For instance: Morpho "Seamless USDC" token -- doesn't match USDC decimals: https://basescan.org/address/0xf3c4db91f380963e00caa4ac1f0508259c9a3d3a#readContract#F6 Compound USDC token -- doesn't match USDC decimals: https://basescan.org/address/0xeF6ED674486E54507d0f711C0d388BD8a1552E6F#readContract#F6 However, the balance is stored in main token decimals. Using earned token decimals leads to inability to withdraw funds using shortcut, throwing the error: > Fail with error 'ERC20: burn amount exceeds balance' ([example transaction](https://basescan.org/tx/0x427a181c5f63e41797f34520dc6b60615be406a1dfc8cf63dd1a1472d4338341) trying to withdraw 0.5 USDC) Context: https://valora-app.slack.com/archives/C08HSR018CA/p1756464724011109 ### Related issues Related to ENG-623
1 parent 20cb673 commit 540d173

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/apps/beefy/positions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const beefyAppTokenDefinition = ({
157157
tokenDecimals:
158158
tokensByTokenId[
159159
getTokenId({
160-
address: vault.earnedTokenAddress,
160+
address: vault.tokenAddress, // use tokenAddress instead of earnedTokenAddress to avoid unmatching decimals
161161
networkId,
162162
})
163163
].decimals,

0 commit comments

Comments
 (0)