Skip to content

Commit 0063cb0

Browse files
committed
style: rename feeds
1 parent a5fdad8 commit 0063cb0

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/chainlink/OracleFourFeeds.sol

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,48 @@ contract OracleFourFeeds is IOracle {
1111
/* CONSTANT */
1212

1313
/// @notice First base feed.
14-
AggregatorV3Interface public immutable FIRST_BASE_FEED;
14+
AggregatorV3Interface public immutable BASE_FEED_1;
1515
/// @notice Second base feed.
16-
AggregatorV3Interface public immutable SECOND_BASE_FEED;
16+
AggregatorV3Interface public immutable BASE_FEED_2;
1717
/// @notice First quote feed.
18-
AggregatorV3Interface public immutable FIRST_QUOTE_FEED;
18+
AggregatorV3Interface public immutable QUOTE_FEED_1;
1919
/// @notice Second quote feed.
20-
AggregatorV3Interface public immutable SECOND_QUOTE_FEED;
20+
AggregatorV3Interface public immutable QUOTE_FEED_2;
2121
/// @notice Price scale factor, computed at contract creation.
2222
uint256 public immutable SCALE_FACTOR;
2323

2424
/* CONSTRUCTOR */
2525

26-
/// @param firstBaseFeed First base feed. Pass address zero if the price = 1.
27-
/// @param secondBaseFeed Second base feed. Pass address zero if the price = 1.
28-
/// @param firstQuoteFeed Quote feed. Pass address zero if the price = 1.
29-
/// @param secondQuoteFeed Quote feed. Pass address zero if the price = 1.
26+
/// @param baseFeed1 First base feed. Pass address zero if the price = 1.
27+
/// @param baseFeed2 Second base feed. Pass address zero if the price = 1.
28+
/// @param quoteFeed1 First quote feed. Pass address zero if the price = 1.
29+
/// @param quoteFeed2 Second quote feed. Pass address zero if the price = 1.
3030
/// @param baseTokenDecimals Base token decimals.
3131
/// @param quoteTokenDecimals Quote token decimals.
3232
constructor(
33-
AggregatorV3Interface firstBaseFeed,
34-
AggregatorV3Interface secondBaseFeed,
35-
AggregatorV3Interface firstQuoteFeed,
36-
AggregatorV3Interface secondQuoteFeed,
33+
AggregatorV3Interface baseFeed1,
34+
AggregatorV3Interface baseFeed2,
35+
AggregatorV3Interface quoteFeed1,
36+
AggregatorV3Interface quoteFeed2,
3737
uint256 baseTokenDecimals,
3838
uint256 quoteTokenDecimals
3939
) {
40-
FIRST_BASE_FEED = firstBaseFeed;
41-
SECOND_BASE_FEED = secondBaseFeed;
42-
FIRST_QUOTE_FEED = firstQuoteFeed;
43-
SECOND_QUOTE_FEED = secondQuoteFeed;
40+
BASE_FEED_1 = baseFeed1;
41+
BASE_FEED_2 = baseFeed2;
42+
QUOTE_FEED_1 = quoteFeed1;
43+
QUOTE_FEED_2 = quoteFeed2;
4444
SCALE_FACTOR = 10
4545
** (
46-
36 + quoteTokenDecimals + firstQuoteFeed.getDecimals() + secondQuoteFeed.getDecimals()
47-
- firstBaseFeed.getDecimals() - secondBaseFeed.getDecimals() - baseTokenDecimals
46+
36 + quoteTokenDecimals + quoteFeed1.getDecimals() + quoteFeed2.getDecimals()
47+
- baseFeed1.getDecimals() - baseFeed2.getDecimals() - baseTokenDecimals
4848
);
4949
}
5050

5151
/* PRICE */
5252

5353
/// @inheritdoc IOracle
5454
function price() external view returns (uint256) {
55-
return (FIRST_BASE_FEED.getPrice() * SECOND_BASE_FEED.getPrice() * SCALE_FACTOR)
56-
/ (FIRST_QUOTE_FEED.getPrice() * SECOND_QUOTE_FEED.getPrice());
55+
return (BASE_FEED_1.getPrice() * BASE_FEED_2.getPrice() * SCALE_FACTOR)
56+
/ (QUOTE_FEED_1.getPrice() * QUOTE_FEED_2.getPrice());
5757
}
5858
}

test/chainlink/OracleFourFeedsTest.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AggregatorV3Interface constant wBtcBtcFeed = AggregatorV3Interface(0xfdFD9C85aD2
1616

1717
contract OracleFourFeedsTest is Test {
1818
function setUp() public {
19-
vm.selectFork(vm.createFork(vm.envString("ETH_RPC_URL")));
19+
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
2020
}
2121

2222
function testOracleWbtcUsdc() public {

test/chainlink/OracleTwoFeedsTest.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ contract FakeAggregator {
3232

3333
contract OracleTwoFeedsTest is Test {
3434
function setUp() public {
35-
vm.selectFork(vm.createFork(vm.envString("ETH_RPC_URL")));
35+
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
3636
}
3737

3838
function testOracleStEthUsdc() public {

0 commit comments

Comments
 (0)