Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit 649af7a

Browse files
committed
Fix: getPriceFull forwarded pricing type
This fix is from Kasper's #172 pull request. This removes an if condition that will never be true. if given asset has PRICINGTYPE__FORWARDED, the resolvePricingConfig function returns the pricingType of the asset the pricing is forwarded to. hence, the pricingType must never be equal to PRICINGTYPE__FORWARDED after the pricing config is resolved.
1 parent 50196a1 commit 649af7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/modules/RiskManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ contract RiskManager is IRiskManager, BaseLogic {
185185

186186
if (pricingType == PRICINGTYPE__PEGGED) {
187187
currPrice = 1e18;
188-
} else if (pricingType == PRICINGTYPE__UNISWAP3_TWAP || pricingType == PRICINGTYPE__FORWARDED) {
188+
} else if (pricingType == PRICINGTYPE__UNISWAP3_TWAP) {
189189
address pool = UniswapV3Lib.computeUniswapPoolAddress(uniswapFactory, uniswapPoolInitCodeHash, underlying, referenceAsset, uint24(pricingParameters));
190190
(uint160 sqrtPriceX96,,,,,,) = IUniswapV3Pool(pool).slot0();
191191
currPrice = decodeSqrtPriceX96(newUnderlying, underlyingDecimalsScaler, sqrtPriceX96);

0 commit comments

Comments
 (0)