Closed code423n4 closed 2 years ago
WatchPug
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/ActivePool.sol#L132-L142
function getVC() external view override returns (uint totalVC) { for (uint i = 0; i < poolColl.tokens.length; i++) { address collateral = poolColl.tokens[i]; uint amount = poolColl.amounts[i]; uint collateralVC = whitelist.getValueVC(collateral, amount); totalVC = totalVC.add(collateralVC); } return totalVC; }
At L141, returning outstanding is redundant as named returns will be automatically handled.
outstanding
Other examples include:
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/TroveManagerLiquidations.sol#L435-L435
return singleLiquidation;
@LilYeti : Probably severity 0, duplicate #24
Duplicate of issue by the same warden
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/ActivePool.sol#L132-L142
At L141, returning
outstanding
is redundant as named returns will be automatically handled.Other examples include:
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/TroveManagerLiquidations.sol#L435-L435