Open vm06007 opened 11 months ago
Team disagrees on this suggestion. It is absoltely okay to have slightly different payback flow, because ETH amount is payable it cannot be represented with share similar to paybackWithShares where this amount can be converted and charged through safeTranferFrom
.
In this case when working with Native currency (ETH) and Tokens (ERC20) the approach is slightly different so that we can invoke transfer with slightly higher amount to cover functionality similar to paybackWithShares to close the position fully and expect user to have slight refund. While with ERC20 user can use function paybackExactShares when trying to close the position completely or paybackExactAmount when closing position partially.
No changes intended here as it makes no sense or benefit to be this strict for no reason and limit user to only single possible flow. Not to complex code there is no reason to introduce refund in the paybackExactAmount, user can rely on paybackExactShares when closing position fully.
AHB-01M: Discrepant Behaviour of Paybacks
Description:
An
AaveHub::paybackExactAmountETH
invocation will properly handle "overpays" by refunding any superfluous amount transmitted in the call to the caller, however, anAaveHub::paybackExactAmount
invocation will simply fail due to a nestedWiseLowLevelHelper::_decreasePositionMappingValue
call.Example:
Recommendation:
We advise the code to either properly handle overpays in both functions or to allow the code to fail in both cases, ensuring uniformity in the codebase.