Skip to content

Commit 42f9559

Browse files
committed
audit report improvements
1 parent 1b97baa commit 42f9559

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/morpho-pyth/libraries/PythFeedLib.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ pragma solidity ^0.8.0;
33

44
import {IPyth} from "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
55
import {PythStructs} from "@pythnetwork/pyth-sdk-solidity/PythStructs.sol";
6-
76
import {PythErrorsLib} from "./PythErrorsLib.sol";
8-
97
/// @title PythFeedLib
108
/// @author Pyth Data Association
119
/// @notice Library exposing functions to interact with a Pyth feed.
@@ -17,6 +15,7 @@ library PythFeedLib {
1715
if (priceId == bytes32(0)) return 1;
1816

1917
PythStructs.Price memory price = pyth.getPriceNoOlderThan(priceId, maxAge);
18+
require(int256(price.price) >= 0, PythErrorsLib.NEGATIVE_ANSWER);
2019
return uint256(int256(price.price));
2120
}
2221
/// @dev Returns the number of decimals of a `priceId`.

0 commit comments

Comments
 (0)