From 1994aca031dd7cc99be2c8e7e8b09c4d9d7dcd9d Mon Sep 17 00:00:00 2001 From: MathisGD Date: Tue, 3 Oct 2023 11:30:43 +0200 Subject: [PATCH] docs: comments improvements --- src/chainlink/Oracle2.sol | 4 ++-- src/chainlink/Oracle4.sol | 4 ++-- src/chainlink/libraries/DataFeedLib.sol | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chainlink/Oracle2.sol b/src/chainlink/Oracle2.sol index 1befa31..9d413c5 100644 --- a/src/chainlink/Oracle2.sol +++ b/src/chainlink/Oracle2.sol @@ -14,7 +14,7 @@ contract Oracle2 is IOracle { AggregatorV3Interface public immutable BASE_FEED; /// @notice Quote feed. AggregatorV3Interface public immutable QUOTE_FEED; - /// @notice Price scale factor. Automatically computed at contract creation. + /// @notice Price scale factor, computed at contract creation. uint256 public immutable SCALE_FACTOR; /* CONSTRUCTOR */ @@ -25,8 +25,8 @@ contract Oracle2 is IOracle { /// @param quoteTokenDecimals Quote token decimals. Pass 0 if the price = 1. constructor( AggregatorV3Interface baseFeed, - uint256 baseTokenDecimals, AggregatorV3Interface quoteFeed, + uint256 baseTokenDecimals, uint256 quoteTokenDecimals ) { BASE_FEED = baseFeed; diff --git a/src/chainlink/Oracle4.sol b/src/chainlink/Oracle4.sol index eed2e6f..5d34d8a 100644 --- a/src/chainlink/Oracle4.sol +++ b/src/chainlink/Oracle4.sol @@ -18,7 +18,7 @@ contract Oracle4 is IOracle { AggregatorV3Interface public immutable FIRST_QUOTE_FEED; /// @notice Second quote feed. AggregatorV3Interface public immutable SECOND_QUOTE_FEED; - /// @notice Price scale factor. Automatically computed at contract creation. + /// @notice Price scale factor, computed at contract creation. uint256 public immutable SCALE_FACTOR; /* CONSTRUCTOR */ @@ -27,7 +27,7 @@ contract Oracle4 is IOracle { /// @param secondBaseFeed Second base feed. Pass address zero if the price = 1. /// @param firstQuoteFeed Quote feed. Pass address zero if the price = 1. /// @param secondQuoteFeed Quote feed. Pass address zero if the price = 1. - /// @param baseTokenDecimals Base token decimals. + /// @param baseTokenDecimals Base token decimals. Pass 0 if the price = 1. /// @param quoteTokenDecimals Quote token decimals. Pass 0 if the price = 1. constructor( AggregatorV3Interface firstBaseFeed, diff --git a/src/chainlink/libraries/DataFeedLib.sol b/src/chainlink/libraries/DataFeedLib.sol index bb6882d..c3b5086 100644 --- a/src/chainlink/libraries/DataFeedLib.sol +++ b/src/chainlink/libraries/DataFeedLib.sol @@ -5,8 +5,8 @@ import {ErrorsLib} from "./ErrorsLib.sol"; import {AggregatorV3Interface} from "chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; library DataFeedLib { - /// @dev Performing some security checks and returns the lateste price of a feed. - /// @dev When feed is the address zero, returns 1. + /// @dev Performing some security checks and returns the latest price of a feed. + /// @dev When `feed` is the address zero, returns 1. function getPrice(AggregatorV3Interface feed) internal view returns (uint256) { if (address(feed) == address(0)) return 1; (, int256 answer,,,) = feed.latestRoundData(); @@ -14,7 +14,7 @@ library DataFeedLib { return uint256(answer); } - /// @dev Returns feed.decimals() if feed != address(0), else returns 0. + /// @dev Returns `feed.decimals()` when `feed` is not the address zero, else returns 0. function getDecimals(AggregatorV3Interface feed) internal view returns (uint256) { if (address(feed) == address(0)) return 0; return feed.decimals();