Skip to content

Commit fd65d54

Browse files
committed
refactor: rename ERC4626 interface
1 parent fac4ba1 commit fd65d54

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

lib/morpho-blue

src/ChainlinkOracle.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ pragma solidity 0.8.19;
44
import {IOracle} from "morpho-blue/interfaces/IOracle.sol";
55

66
import {AggregatorV3Interface, ChainlinkDataFeedLib} from "./libraries/ChainlinkDataFeedLib.sol";
7-
import {ERC4626Interface, VaultLib} from "./libraries/VaultLib.sol";
7+
import {IERC4626, VaultLib} from "./libraries/VaultLib.sol";
88

99
/// @title ChainlinkOracle
1010
/// @author Morpho Labs
1111
/// @custom:contact [email protected]
1212
/// @notice Morpho Blue oracle using Chainlink-compliant feeds.
1313
contract ChainlinkOracle is IOracle {
14-
using VaultLib for ERC4626Interface;
14+
using VaultLib for IERC4626;
1515
using ChainlinkDataFeedLib for AggregatorV3Interface;
1616

1717
/* IMMUTABLES */
1818

1919
/// @notice Vault.
20-
ERC4626Interface public immutable VAULT;
20+
IERC4626 public immutable VAULT;
2121
/// @notice Vault decimals.
2222
uint256 public immutable VAULT_DECIMALS;
2323
/// @notice First base feed.
@@ -41,7 +41,7 @@ contract ChainlinkOracle is IOracle {
4141
/// @param baseTokenDecimals Base token decimals.
4242
/// @param quoteTokenDecimals Quote token decimals.
4343
constructor(
44-
ERC4626Interface vault,
44+
IERC4626 vault,
4545
AggregatorV3Interface baseFeed1,
4646
AggregatorV3Interface baseFeed2,
4747
AggregatorV3Interface quoteFeed1,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity ^0.8.0;
33

4-
interface ERC4626Interface {
4+
interface IERC4626 {
55
function convertToAssets(uint256) external view returns (uint256);
66
function decimals() external view returns (uint256);
77
}

src/libraries/VaultLib.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity ^0.8.0;
33

4-
import {ERC4626Interface} from "../interfaces/ERC4626Interface.sol";
4+
import {IERC4626} from "../interfaces/IERC4626.sol";
55

66
/// @title ChainlinkDataFeedLib
77
/// @author Morpho Labs
@@ -10,15 +10,15 @@ import {ERC4626Interface} from "../interfaces/ERC4626Interface.sol";
1010
library VaultLib {
1111
/// @dev Converts `shares` into the corresponding assets on the `vault`.
1212
/// @dev When `vault` is the address zero, returns 1.
13-
function getAssets(ERC4626Interface vault, uint256 shares) internal view returns (uint256) {
13+
function getAssets(IERC4626 vault, uint256 shares) internal view returns (uint256) {
1414
if (address(vault) == address(0)) return 1;
1515

1616
return vault.convertToAssets(shares);
1717
}
1818

1919
/// @dev Returns the number of decimals of a `vault`, seen as an ERC20.
2020
/// @dev When `vault` is the address zero, returns 0.
21-
function getDecimals(ERC4626Interface vault) internal view returns (uint256) {
21+
function getDecimals(IERC4626 vault) internal view returns (uint256) {
2222
if (address(vault) == address(0)) return 0;
2323

2424
return vault.decimals();

test/ChainlinkOracleTest.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ AggregatorV3Interface constant ethUsdFeed = AggregatorV3Interface(0x5f4eC3Df9cbd
2323
// 18 decimals of precision
2424
AggregatorV3Interface constant daiEthFeed = AggregatorV3Interface(0x773616E4d11A78F511299002da57A0a94577F1f4);
2525

26-
ERC4626Interface constant vaultZero = ERC4626Interface(address(0));
27-
ERC4626Interface constant sDaiVault = ERC4626Interface(0x83F20F44975D03b1b09e64809B757c47f942BEeA);
26+
IERC4626 constant vaultZero = IERC4626(address(0));
27+
IERC4626 constant sDaiVault = IERC4626(0x83F20F44975D03b1b09e64809B757c47f942BEeA);
2828

2929
contract FakeAggregator {
3030
int256 public answer;

0 commit comments

Comments
 (0)