The current implementation of user Token input of the AaveDivaWrapperCore contract in some of the functions sets _positionTokenAmountToRemove, _positionTokenAmountToRedeem and _wTokenAmountToRedeem to the user's balance only when the user inputs the maximum value of type(uint256).max. This approach limits the protocol's ability to gracefully handle cases where users mistakenly input a value greater than their actual balance.
Instead of restricting the balance check to only the type(uint256).max value, the contract should set _positionTokenAmountToRedeem to the user's balance when the input value exceeds the user's available balance. This change would enhance the user experience by preventing unnecessary reverts and improving interaction with the protocol. see example code below.
this above code should be applied to all affected seneros accordingly.
\
Implementing this improvement will make the protocol more user-friendly and provide a more resilient interaction experience for users.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.