Skip to content

Commit 1982049

Browse files
committed
style: naming fixes
1 parent de96879 commit 1982049

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/morpho-chainlink/MorphoChainlinkOracleV2Factory.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ contract MorphoChainlinkOracleV2Factory is IMorphoChainlinkOracleV2Factory {
1616
/* STORAGE */
1717

1818
/// @inheritdoc IMorphoChainlinkOracleV2Factory
19-
mapping(address => bool) public isChainlinkOracle;
19+
mapping(address => bool) public isMorphoChainlinkOracleV2;
2020

2121
/* EXTERNAL */
2222

2323
/// @inheritdoc IMorphoChainlinkOracleV2Factory
24-
function createChainlinkOracle(
24+
function createMorphoChainlinkOracleV2(
2525
IERC4626 baseVault,
2626
uint256 baseVaultConversionSample,
2727
AggregatorV3Interface baseFeed1,
@@ -47,8 +47,8 @@ contract MorphoChainlinkOracleV2Factory is IMorphoChainlinkOracleV2Factory {
4747
quoteTokenDecimals
4848
);
4949

50-
isChainlinkOracle[address(oracle)] = true;
50+
isMorphoChainlinkOracleV2[address(oracle)] = true;
5151

52-
emit CreateChainlinkOracle(msg.sender, address(oracle));
52+
emit CreateMorphoChainlinkOracleV2(msg.sender, address(oracle));
5353
}
5454
}

src/morpho-chainlink/interfaces/IMorphoChainlinkOracleV2Factory.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ interface IMorphoChainlinkOracleV2Factory {
1313
/// @notice Emitted when a new Chainlink oracle is created.
1414
/// @param oracle The address of the Chainlink oracle.
1515
/// @param caller The caller of the function.
16-
event CreateChainlinkOracle(address caller, address oracle);
16+
event CreateMorphoChainlinkOracleV2(address caller, address oracle);
1717

1818
/// @notice Whether a Chainlink oracle vault was created with the factory.
19-
function isChainlinkOracle(address target) external view returns (bool);
19+
function isMorphoChainlinkOracleV2(address target) external view returns (bool);
2020

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.
@@ -41,7 +41,7 @@ interface IMorphoChainlinkOracleV2Factory {
4141
/// @param baseTokenDecimals Base token decimals.
4242
/// @param quoteTokenDecimals Quote token decimals.
4343
/// @param salt The salt to use for the MetaMorpho vault's CREATE2 address.
44-
function createChainlinkOracle(
44+
function createMorphoChainlinkOracleV2(
4545
IERC4626 baseVault,
4646
uint256 baseVaultConversionSample,
4747
AggregatorV3Interface baseFeed1,

test/MorphoChainlinkOracleV2FactoryTest.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ contract ChainlinkOracleFactoryTest is Test {
2323
);
2424
address expectedAddress = computeCreate2Address(salt, initCodeHash, address(factory));
2525

26-
assertFalse(factory.isChainlinkOracle(expectedAddress), "isChainlinkOracle");
26+
assertFalse(factory.isMorphoChainlinkOracleV2(expectedAddress), "isChainlinkOracle");
2727

2828
// vm.expectEmit(address(factory));
29-
// emit IMorphoChainlinkOracleV2Factory.CreateChainlinkOracle(address(this), expectedAddress);
30-
IMorphoChainlinkOracleV2 oracle = factory.createChainlinkOracle(
29+
// emit IMorphoChainlinkOracleV2Factory.CreateMorphoChainlinkOracleV2(address(this), expectedAddress);
30+
IMorphoChainlinkOracleV2 oracle = factory.createMorphoChainlinkOracleV2(
3131
sDaiVault, 1e18, daiEthFeed, feedZero, 18, vaultZero, 1, usdcEthFeed, feedZero, 6, salt
3232
);
3333

3434
assertEq(expectedAddress, address(oracle), "computeCreate2Address");
3535

36-
assertTrue(factory.isChainlinkOracle(address(oracle)), "isChainlinkOracle");
36+
assertTrue(factory.isMorphoChainlinkOracleV2(address(oracle)), "isChainlinkOracle");
3737

3838
uint256 scaleFactor = 10 ** (36 + 6 + 18 - 18 - 18 - 18);
3939

@@ -55,17 +55,17 @@ contract ChainlinkOracleFactoryTest is Test {
5555
);
5656
address expectedAddress = computeCreate2Address(salt, initCodeHash, address(factory));
5757

58-
assertFalse(factory.isChainlinkOracle(expectedAddress), "isChainlinkOracle");
58+
assertFalse(factory.isMorphoChainlinkOracleV2(expectedAddress), "isChainlinkOracle");
5959

6060
// vm.expectEmit(address(factory));
61-
// emit IMorphoChainlinkOracleV2Factory.CreateChainlinkOracle(address(this), expectedAddress);
62-
IMorphoChainlinkOracleV2 oracle = factory.createChainlinkOracle(
61+
// emit IMorphoChainlinkOracleV2Factory.CreateMorphoChainlinkOracleV2(address(this), expectedAddress);
62+
IMorphoChainlinkOracleV2 oracle = factory.createMorphoChainlinkOracleV2(
6363
vaultZero, 1, usdcEthFeed, feedZero, 6, sDaiVault, 1e18, daiEthFeed, feedZero, 18, salt
6464
);
6565

6666
assertEq(expectedAddress, address(oracle), "computeCreate2Address");
6767

68-
assertTrue(factory.isChainlinkOracle(address(oracle)), "isChainlinkOracle");
68+
assertTrue(factory.isMorphoChainlinkOracleV2(address(oracle)), "isChainlinkOracle");
6969

7070
uint256 scaleFactor = 10 ** (36 + 18 + 18 + 0 - 6 - 18 - 0) * 1e18;
7171

0 commit comments

Comments
 (0)