cccz
medium
If overdueBlocks or maxOverdueBlocks suddenly decrease, the user may be immediately written out of the debt
If overdueBlocks or maxOverdueBlocks suddenly decrease, the user may be immediately written out of the debt
If overdueBlocks or maxOverdueBlocks suddenly decrease, the user may be immediately written out of the debt
In the UserManager.debtWriteOff function, if block.number > lastRepay + overdueBlocks + maxOverdueBlocks, anyone can call UserManager.debtWriteOff to write off the debts of other users. overdueBlocks and maxOverdueBlocks can be set by the admin and if overdueBlocks or maxOverdueBlocks suddenly decrease, the user may be written off immediately
if overdueBlocks or maxOverdueBlocks suddenly decrease, the user may be written off immediately
https://github.com/sherlock-audit/2022-10-union-finance/blob/main/union-v2-contracts/contracts/user/UserManager.sol#L352-L356 https://github.com/sherlock-audit/2022-10-union-finance/blob/main/union-v2-contracts/contracts/market/UToken.sol#L325-L327 https://github.com/sherlock-audit/2022-10-union-finance/blob/main/union-v2-contracts/contracts/user/UserManager.sol#L726-L740
Manual Review
Consider caching the current overdueBlocks and maxOverdueBlocks in vouchers when debts are created