The function freeCollateralBalance and getDollarInCollateral don't check whether the Collateral is enabled.
Summary
The function freeCollateralBalance and getDollarInCollateral don't check whether the Collateral is enabled.
Vulnerability Detail
The function freeCollateralBalance and getDollarInCollateral don't check whether the Collateral is enabled. As function freeCollateralBalance and getDollarInCollateral are external functions, it should prevent queries on disabled collaterals.
Impact
Disabled collaterals’ information (free balance and price) will be leaked.
qmdddd
medium
The function
freeCollateralBalance
andgetDollarInCollateral
don't check whether the Collateral is enabled.Summary
The function
freeCollateralBalance
andgetDollarInCollateral
don't check whether the Collateral is enabled.Vulnerability Detail
The function
freeCollateralBalance
andgetDollarInCollateral
don't check whether the Collateral is enabled. As functionfreeCollateralBalance
andgetDollarInCollateral
are external functions, it should prevent queries on disabled collaterals.Impact
Disabled collaterals’ information (free balance and price) will be leaked.
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L268-L276
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L284-L294
Tool used
Manual Review
Recommendation
Add modifier collateralEnabled.
Duplicate of #23