Skip to content

Commit b1c44a1

Browse files
hivtushokcodenutt
authored andcommittedDec 10, 2024·
feat(custom-redstone): Use constant ref
1 parent b41224b commit b1c44a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/oracles/providers/CustomRedStoneOracleAdapter.sol

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ contract CustomRedStoneOracleAdapter is PrimaryProdDataServiceConsumerBase, Syst
3030

3131
error TokenNotRegistered(bytes32 feedId, address tokenAddress);
3232

33+
/// @dev Constant referenced from BaseOracleDenominations contract
34+
address public constant ETH_IN_USD = address(bytes20("ETH_IN_USD"));
35+
3336
ICustomSetOracle public immutable customOracle;
3437
uint8 public uniqueSignersThreshold;
3538

@@ -111,7 +114,7 @@ contract CustomRedStoneOracleAdapter is PrimaryProdDataServiceConsumerBase, Syst
111114

112115
// Convert to ETH if the data feed price is not quoted in ETH
113116
if (!feedId.ethQuoted) {
114-
uint256 ethInUsd = systemRegistry.rootPriceOracle().getPriceInEth(address(bytes20("ETH_IN_USD")));
117+
uint256 ethInUsd = systemRegistry.rootPriceOracle().getPriceInEth(ETH_IN_USD);
115118
values[i] = (values[i] * 1e18) / ethInUsd;
116119
}
117120

0 commit comments

Comments
 (0)
Please sign in to comment.