Open vm06007 opened 1 year ago
Here WISE team aknowledged that auditor does not understand the system well:
Auditors suggestions are not necessary:
We believe auditor do not understand the payback functionality and the other functions too well.
We believe that you think that once user accumulated badDebt
in an NFT position user can only use payBackBadDebtForToken
function but that is not the case and its just an additional extra function. There's many other options.
paybackBadDebtForToken
aswell. So auditors statement is wrong. And then if condition auditor suggests doesnt add anything sice it would fail in _decreaseFeeTokens anyway.
Also suggestion basically negates the fix percentage incentive and would need a complete rewrite with no additional benefit.
Team understands that maybe auditor thinks about capital efficiency is better this way, say if users also would do it for less. But this is solved by fees slowly accumulating anyway making it an effective auction.
Proposed improvement from auditor side does not make things better. Instead it even tricks users when letting the function pass with the minimal existing amount of fees inside fee manager.
FMR-01M: Inexistent Accommodation of Inexistent Incentives
Description:
The
FeeManager::payBackBadDebtForToken
function does not account for a scenario whereby the Wise system has not acquired sufficient fees and thus cannot fulfil the payback incentive.Impact:
The system will presently prevent payback operations entirely when it has not acquired sufficient fees to provide incentives to its users, a trait that can be exacerbated in extreme market conditions.
Example:
Recommendation:
We advise the
FeeManagerHelper::_decreaseFeeTokens
as well asTransferHelper::_safeTransfer
statements in theFeeManager::payBackBadDebtForToken
function to be wrapped in anif
conditional that ensures there are sufficientfeeTokens
in the system. Alternatively, we advise thereceivingAmount
to be set as the minimum betweenreceivingAmount
andfeeTokens
as well as for the function to execute theTransferHelper::_safeTransfer
solely when the minimum is non-zero.We consider either of the two proposed solutions as adequate in alleviating this exhibit.