Skip to content

Commit

Permalink
Merge pull request #25 from morpho-labs/docs/add-safety-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD authored Oct 16, 2023
2 parents 081af65 + efbc65e commit 9ed1932
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libraries/ChainlinkDataFeedLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import {ErrorsLib} from "./ErrorsLib.sol";
library ChainlinkDataFeedLib {
/// @dev Performs safety checks and returns the latest price of a `feed`.
/// @dev When `feed` is the address zero, returns 1.
/// @dev Notes on safety checks:
/// - Staleness is not checked because it's assumed that the Chainlink feed keeps its promises on this.
/// - The price is not checked to be in the min/max bounds because it's assumed that the Chainlink feed keeps its
/// promises on this.
function getPrice(AggregatorV3Interface feed) internal view returns (uint256) {
if (address(feed) == address(0)) return 1;

Expand Down

0 comments on commit 9ed1932

Please sign in to comment.