sherlock-audit / 2023-06-real-wagmi-judging

3 stars 2 forks source link

tnquanghuy0512 - Factory.estimateWithdrawalAmounts ouputs can lead to confusion #151

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

tnquanghuy0512

medium

Factory.estimateWithdrawalAmounts ouputs can lead to confusion

Summary

Factory.estimateWithdrawalAmounts ouputs can lead to confusion

Vulnerability Detail

Factory.estimateWithdrawalAmounts inputs are tokenA, tokenB, lpAmount and the outputs are amount0, amount1. In the case that tokenA > tokenB, amount0 will be from tokenB and amount1 will be from tokenA

Impact

This can lead to confusion to users

Code Snippet

https://github.com/sherlock-audit/2023-06-real-wagmi/blob/82a234a5c2c1fc1921c63265a9349b71d84675c4/concentrator/contracts/Factory.sol#L195

Tool used

Manual Review

Recommendation

Change the output to amountA and amountB