Wrong computation of the amountToSellUnit variable
The variable `amountToSellUnits` is computed wrongly in the code which will lead to an incorrect amount of collateral to be sold.\\nThe `BuyUSSDSellCollateral()` function is used to sell collateral during a peg-down recovery event. The computation of the amount to sell is computed using the following formula:\\n```\\n// @audit-issue Wrong computation\\nuint256 amountToSellUnits = IERC20Upgradeable(collateral[i].token).balanceOf(USSD) * ((amountToBuyLeftUSD * 1e18 / collateralval) / 1e18) / 1e18;\\n```\\n\\nThe idea is to sell an amount which is equivalent (in USD) to the ratio of `amountToBuyLeftUSD / collateralval`. Flattening the equation it ends up as:\\n```\\nuint256 amountToSellUnits = (collateralBalance * amountToBuyLeftUSD * 1e18) / (collateralval * 1e18 * 1e18);\\n\\n// Reducing the equation\\nuint256 amountToSellUnits = (collateralBalance * amountToBuyLeftUSD) / (collateralval * 1e18);\\n```\\n\\n`amountToBuyLeftUSD` and `collateralval` already have 18 decimals so their decimals get cancelled together which will lead the last 1e18 factor as not necessary.
Issue Wrong computation of the amountToSellUnit variable\\nDelete the last 1e18 factor
The contract will sell an incorrect amount of collateral during a peg-down recovery event.
```\\n// @audit-issue Wrong computation\\nuint256 amountToSellUnits = IERC20Upgradeable(collateral[i].token).balanceOf(USSD) * ((amountToBuyLeftUSD * 1e18 / collateralval) / 1e18) / 1e18;\\n```\\n