33// (c) Gearbox Foundation, 2024.
44pragma solidity ^ 0.8.23 ;
55
6- import {ILPPriceFeed } from "../interfaces/ILPPriceFeed .sol " ;
6+ import {Ownable } from "@openzeppelin/contracts/access/Ownable .sol " ;
77import {ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol " ;
8- import {SanityCheckTrait} from "@gearbox-protocol/core-v3/contracts/traits/SanityCheckTrait.sol " ;
8+
9+ import {IUpdatablePriceFeed} from "@gearbox-protocol/core-v3/contracts/interfaces/base/IPriceFeed.sol " ;
910import {PERCENTAGE_FACTOR} from "@gearbox-protocol/core-v3/contracts/libraries/Constants.sol " ;
10- import {ACLTrait} from "@gearbox-protocol/core-v3/contracts/traits/ACLTrait.sol " ;
1111import {PriceFeedValidationTrait} from "@gearbox-protocol/core-v3/contracts/traits/PriceFeedValidationTrait.sol " ;
12- import {IUpdatablePriceFeed} from "@gearbox-protocol/core-v3/contracts/interfaces/base/IPriceFeed.sol " ;
12+ import {SanityCheckTrait} from "@gearbox-protocol/core-v3/contracts/traits/SanityCheckTrait.sol " ;
13+
14+ import {ILPPriceFeed} from "../interfaces/ILPPriceFeed.sol " ;
1315
1416/// @dev Window size in bps, used to compute upper bound given lower bound
1517uint256 constant WINDOW_SIZE = 200 ;
@@ -25,7 +27,7 @@ uint256 constant UPDATE_BOUNDS_COOLDOWN = 1 days;
2527/// It is assumed that the price of an LP token is the product of its exchange rate and some aggregate function
2628/// of underlying tokens prices. This contract simplifies creation of such price feeds and provides standard
2729/// validation of the LP token exchange rate that protects against price manipulation.
28- abstract contract LPPriceFeed is ILPPriceFeed , ACLTrait , SanityCheckTrait , PriceFeedValidationTrait {
30+ abstract contract LPPriceFeed is ILPPriceFeed , Ownable , SanityCheckTrait , PriceFeedValidationTrait {
2931 /// @notice Answer precision (always 8 decimals for USD price feeds)
3032 uint8 public constant override decimals = 8 ; // U:[LPPF-2]
3133
@@ -42,16 +44,16 @@ abstract contract LPPriceFeed is ILPPriceFeed, ACLTrait, SanityCheckTrait, Price
4244 uint256 public override lowerBound;
4345
4446 /// @notice Constructor
45- /// @param _acl Address of the ACL contract
47+ /// @param _owner Owner of the price feed that can update exchange rate bounds
4648 /// @param _lpToken LP token for which the prices are computed
4749 /// @param _lpContract LP contract (can be different from LP token)
4850 /// @dev Derived price feeds must call `_setLimiter` in their constructor after
4951 /// initializing all state variables needed for exchange rate calculation
50- constructor (address _acl , address _lpToken , address _lpContract )
51- ACLTrait (_acl) // U:[LPPF-1]
52+ constructor (address _owner , address _lpToken , address _lpContract )
5253 nonZeroAddress (_lpToken) // U:[LPPF-1]
5354 nonZeroAddress (_lpContract) // U:[LPPF-1]
5455 {
56+ transferOwnership (_owner); // U:[LPPF-1]
5557 lpToken = _lpToken; // U:[LPPF-1]
5658 lpContract = _lpContract; // U:[LPPF-1]
5759 }
@@ -106,7 +108,7 @@ abstract contract LPPriceFeed is ILPPriceFeed, ACLTrait, SanityCheckTrait, Price
106108 function setLimiter (uint256 newLowerBound )
107109 external
108110 override
109- configuratorOnly // U:[LPPF-6]
111+ onlyOwner // U:[LPPF-6]
110112 {
111113 _setLimiter (newLowerBound); // U:[LPPF-6]
112114 }
0 commit comments