Skip to content

Commit 3e65407

Browse files
committed
docs: various minor fixes
1 parent af1a0d3 commit 3e65407

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/morpho-chainlink/MorphoChainlinkOracleV2.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ contract MorphoChainlinkOracleV2 is IMorphoChainlinkOracleV2 {
125125
// = 1e36 * (pB1 * 1e(-dB1) * pB2) / (pQ1 * 1e(-dQ1) * pQ2)
126126

127127
// Let fpB1, fpB2, fpQ1, fpQ2 be the feed precision of the respective prices pB1, pB2, pQ1, pQ2.
128-
// Chainlink feeds return pB1 * 1e(fpB1), pB2 * 1e(fpB2), pQ1 * 1e(fpQ1) and pQ2 * 1e(fpQ2).
128+
// Chainlink-compliant feeds return pB1 * 1e(fpB1), pB2 * 1e(fpB2), pQ1 * 1e(fpQ1) and pQ2 * 1e(fpQ2).
129129

130130
// Based on the implementation of `price()` below, the value of `SCALE_FACTOR` should thus satisfy:
131131
// (pB1 * 1e(fpB1)) * (pB2 * 1e(fpB2)) * SCALE_FACTOR / ((pQ1 * 1e(fpQ1)) * (pQ2 * 1e(fpQ2)))

src/morpho-chainlink/interfaces/IMorphoChainlinkOracleV2.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ interface IMorphoChainlinkOracleV2 is IOracle {
2222
/// @notice Returns the quote vault conversion sample.
2323
function QUOTE_VAULT_CONVERSION_SAMPLE() external view returns (uint256);
2424

25-
/// @notice Returns the address of the first Chainlink base feed.
25+
/// @notice Returns the address of the first base feed.
2626
function BASE_FEED_1() external view returns (AggregatorV3Interface);
2727

28-
/// @notice Returns the address of the second Chainlink base feed.
28+
/// @notice Returns the address of the second base feed.
2929
function BASE_FEED_2() external view returns (AggregatorV3Interface);
3030

31-
/// @notice Returns the address of the first Chainlink quote feed.
31+
/// @notice Returns the address of the first quote feed.
3232
function QUOTE_FEED_1() external view returns (AggregatorV3Interface);
3333

34-
/// @notice Returns the address of the second Chainlink quote feed.
34+
/// @notice Returns the address of the second quote feed.
3535
function QUOTE_FEED_2() external view returns (AggregatorV3Interface);
3636

3737
/// @notice Returns the price scale factor, calculated at contract creation.

src/morpho-chainlink/interfaces/IMorphoChainlinkOracleV2Factory.sol

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ interface IMorphoChainlinkOracleV2Factory {
2121
/// @dev Here is the list of assumptions that guarantees the oracle behaves as expected:
2222
/// - Feeds are either Chainlink-compliant or the address zero.
2323
/// - Feeds have the same behavioral assumptions as Chainlink's.
24-
/// - Feeds are set in the correct order.
24+
/// - The vaults, if set, are ERC4626-compliant.
2525
/// - Decimals passed as argument are correct.
26-
/// - The vault's sample shares quoted as assets and the base feed prices don't overflow when multiplied.
27-
/// - The quote feed prices don't overflow when multiplied.
28-
/// - The vault, if set, is ERC4626-compliant.
26+
/// - The base vaults's sample shares quoted as assets and the base feed prices don't overflow when multiplied.
27+
/// - The quote vault's sample shares quoted as assets and the quote feed prices don't overflow when multiplied.
2928
/// @param baseVault Base vault. Pass address zero to omit this parameter.
3029
/// @param baseVaultConversionSample The sample amount of base vault shares used to convert to underlying.
3130
/// Pass 1 if the base asset is not a vault. Should be chosen such that converting `baseVaultConversionSample` to
@@ -40,7 +39,7 @@ interface IMorphoChainlinkOracleV2Factory {
4039
/// @param quoteFeed1 First quote feed. Pass address zero if the price = 1.
4140
/// @param quoteFeed2 Second quote feed. Pass address zero if the price = 1.
4241
/// @param quoteTokenDecimals Quote token decimals.
43-
/// @param salt The salt to use for the MetaMorpho vault's CREATE2 address.
42+
/// @param salt The salt to use for the CREATE2.
4443
function createMorphoChainlinkOracleV2(
4544
IERC4626 baseVault,
4645
uint256 baseVaultConversionSample,

test/MorphoChainlinkOracleV2Test.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ contract MorphoChainlinkOracleV2Test is Test {
100100

101101
function testSDaiEthOracle() public {
102102
MorphoChainlinkOracleV2 oracle = new MorphoChainlinkOracleV2(
103-
sDaiVault, 10 ** 18, daiEthFeed, feedZero, 18, vaultZero, 1, feedZero, feedZero, 18
103+
sDaiVault, 1e18, daiEthFeed, feedZero, 18, vaultZero, 1, feedZero, feedZero, 18
104104
);
105105
(, int256 expectedPrice,,,) = daiEthFeed.latestRoundData();
106106
assertEq(
@@ -111,7 +111,7 @@ contract MorphoChainlinkOracleV2Test is Test {
111111

112112
function testSDaiUsdcOracle() public {
113113
MorphoChainlinkOracleV2 oracle = new MorphoChainlinkOracleV2(
114-
sDaiVault, 10 ** 18, daiEthFeed, feedZero, 18, vaultZero, 1, usdcEthFeed, feedZero, 6
114+
sDaiVault, 1e18, daiEthFeed, feedZero, 18, vaultZero, 1, usdcEthFeed, feedZero, 6
115115
);
116116
(, int256 baseAnswer,,,) = daiEthFeed.latestRoundData();
117117
(, int256 quoteAnswer,,,) = usdcEthFeed.latestRoundData();

0 commit comments

Comments
 (0)