audit
This commit is contained in:
@@ -24,11 +24,11 @@ contract YTPriceFeed is Initializable, UUPSUpgradeable {
|
||||
|
||||
uint256 public constant PRICE_PRECISION = 10 ** 30;
|
||||
uint256 public constant BASIS_POINTS_DIVISOR = 10000;
|
||||
uint256 public constant MAX_SPREAD_BASIS_POINTS = 200; // 最大2%价差
|
||||
uint256 public constant MAX_SPREAD_BASIS_POINTS = 200;
|
||||
|
||||
address public usdcAddress;
|
||||
|
||||
uint256 public maxPriceChangeBps; // 5% 最大价格变动
|
||||
uint256 public maxPriceChangeBps;
|
||||
|
||||
AggregatorV3Interface internal usdcPriceFeed;
|
||||
|
||||
@@ -58,7 +58,7 @@ contract YTPriceFeed is Initializable, UUPSUpgradeable {
|
||||
usdcAddress = _usdcAddress;
|
||||
usdcPriceFeed = AggregatorV3Interface(_usdcPriceFeed);
|
||||
gov = msg.sender;
|
||||
maxPriceChangeBps = 500; // 5% 最大价格变动
|
||||
maxPriceChangeBps = 500;
|
||||
}
|
||||
|
||||
function setUSDCAddress(address _usdcAddress) external onlyGov {
|
||||
@@ -78,7 +78,7 @@ contract YTPriceFeed is Initializable, UUPSUpgradeable {
|
||||
}
|
||||
|
||||
function setMaxPriceChangeBps(uint256 _maxPriceChangeBps) external onlyGov {
|
||||
if (_maxPriceChangeBps > 2000) revert MaxChangeTooHigh(); // 最大20%
|
||||
if (_maxPriceChangeBps > 2000) revert MaxChangeTooHigh();
|
||||
maxPriceChangeBps = _maxPriceChangeBps;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user