Skip to content

Commit 5aaaf58

Browse files
committed
fix(oracle): require vault conversion not zero
1 parent a3ff55c commit 5aaaf58

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/ChainlinkOracle.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ contract ChainlinkOracle is IOracle {
5959
require(
6060
address(vault) != address(0) || vaultConversionSample == 1, ErrorsLib.VAULT_CONVERSION_SAMPLE_IS_NOT_ONE
6161
);
62+
require(vaultConversionSample != 0, ErrorsLib.VAULT_CONVERSION_IS_ZERO);
6263

6364
VAULT = vault;
6465
VAULT_CONVERSION_SAMPLE = vaultConversionSample;

src/libraries/ErrorsLib.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ library ErrorsLib {
99
/// @notice Thrown when the answer returned by a Chainlink feed is negative.
1010
string constant NEGATIVE_ANSWER = "negative answer";
1111

12+
/// @notice Thrown when the vault conversion sample is 0.
13+
string constant VAULT_CONVERSION_SAMPLE_IS_ZERO = "vault conversion sample is zero";
14+
1215
/// @notice Thrown when the vault conversion sample is not 1 while vault = address(0).
1316
string constant VAULT_CONVERSION_SAMPLE_IS_NOT_ONE = "vault conversion sample is not one";
1417
}

0 commit comments

Comments
 (0)