@@ -10,9 +10,6 @@ import {ACLNonReentrantTrait} from "@gearbox-protocol/core-v3/contracts/traits/A
1010import {PriceFeedValidationTrait} from "@gearbox-protocol/core-v3/contracts/traits/PriceFeedValidationTrait.sol " ;
1111import {IPriceOracleV3} from "@gearbox-protocol/core-v3/contracts/interfaces/IPriceOracleV3.sol " ;
1212import {IUpdatablePriceFeed} from "@gearbox-protocol/core-v2/contracts/interfaces/IPriceFeed.sol " ;
13- import {
14- IAddressProviderV3, AP_PRICE_ORACLE
15- } from "@gearbox-protocol/core-v3/contracts/interfaces/IAddressProviderV3.sol " ;
1613
1714/// @dev Window size in bps, used to compute upper bound given lower bound
1815uint256 constant WINDOW_SIZE = 200 ;
@@ -54,17 +51,19 @@ abstract contract LPPriceFeed is ILPPriceFeed, ACLNonReentrantTrait, PriceFeedVa
5451 uint40 public override lastBoundsUpdate;
5552
5653 /// @notice Constructor
57- /// @param _addressProvider Address provider contract address
54+ /// @param _acl Address of the ACL contract
55+ /// @param _priceOracle Address of the price oracle
5856 /// @param _lpToken LP token for which the prices are computed
5957 /// @param _lpContract LP contract (can be different from LP token)
6058 /// @dev Derived price feeds must call `_setLimiter` in their constructor after
6159 /// initializing all state variables needed for exchange rate calculation
62- constructor (address _addressProvider , address _lpToken , address _lpContract )
63- ACLNonReentrantTrait (_addressProvider) // U:[LPPF-1]
60+ constructor (address _acl , address _priceOracle , address _lpToken , address _lpContract )
61+ ACLNonReentrantTrait (_acl) // U:[LPPF-1]
62+ nonZeroAddress (_priceOracle) // U:[LPPF-1]
6463 nonZeroAddress (_lpToken) // U:[LPPF-1]
6564 nonZeroAddress (_lpContract) // U:[LPPF-1]
6665 {
67- priceOracle = IAddressProviderV3 (_addressProvider). getAddressOrRevert (AP_PRICE_ORACLE, 3_00 ) ; // U:[LPPF-1]
66+ priceOracle = _priceOracle ; // U:[LPPF-1]
6867 lpToken = _lpToken; // U:[LPPF-1]
6968 lpContract = _lpContract; // U:[LPPF-1]
7069 }
@@ -149,13 +148,13 @@ abstract contract LPPriceFeed is ILPPriceFeed, ACLNonReentrantTrait, PriceFeedVa
149148 if (block .timestamp < lastBoundsUpdate + UPDATE_BOUNDS_COOLDOWN) revert UpdateBoundsBeforeCooldownException (); // U:[LPPF-7]
150149 lastBoundsUpdate = uint40 (block .timestamp ); // U:[LPPF-7]
151150
152- address reserveFeed = IPriceOracleV3 (priceOracle).priceFeedsRaw ({token: lpToken, reserve: true }); // U:[LPPF-7]
151+ address reserveFeed = IPriceOracleV3 (priceOracle).reservePriceFeeds ({token: lpToken}); // U:[LPPF-7]
153152 if (reserveFeed == address (this )) revert ReserveFeedMustNotBeSelfException (); // U:[LPPF-7]
154153 try IUpdatablePriceFeed (reserveFeed).updatable () returns (bool updatable ) {
155154 if (updatable) IUpdatablePriceFeed (reserveFeed).updatePrice (updateData); // U:[LPPF-7]
156155 } catch {}
157156
158- uint256 reserveAnswer = IPriceOracleV3 (priceOracle).getPriceRaw ({token: lpToken, reserve: true }); // U:[LPPF-7]
157+ uint256 reserveAnswer = IPriceOracleV3 (priceOracle).getReservePrice ({token: lpToken}); // U:[LPPF-7]
159158 uint256 reserveExchangeRate = uint256 (reserveAnswer * getScale () / uint256 (getAggregatePrice ())); // U:[LPPF-7]
160159
161160 _ensureValueInBounds (reserveExchangeRate, lowerBound); // U:[LPPF-7]
0 commit comments