Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
forge test -vvv
id: test
env:
ETH_RPC_URL: "https://eth-mainnet.g.alchemy.com/v2/${{ secrets.PROTOCOL_ALCHEMY_KEY }}"
ALCHEMY_KEY: ${{ secrets.PROTOCOL_ALCHEMY_KEY }}
9 changes: 7 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ evm_version = "paris"
wrap_comments = true

[lint]
exclude_lints = ["unsafe-typecast", "unaliased-plain-import", "screaming-snake-case-const"]
exclude_lints = [
"unsafe-typecast",
"unaliased-plain-import",
"screaming-snake-case-const",
]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
[rpc_endpoints]
ethereum = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
1 change: 1 addition & 0 deletions src/morpho-chainlink/MorphoChainlinkOracleV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ contract MorphoChainlinkOracleV2 is IMorphoChainlinkOracleV2 {
/// - Decimals passed as argument are correct.
/// - The base vaults's sample shares quoted as assets and the base feed prices don't overflow when multiplied.
/// - The quote vault's sample shares quoted as assets and the quote feed prices don't overflow when multiplied.
/// - The scale factor is not zero.
/// @param baseVault Base vault. Pass address zero to omit this parameter.
/// @param baseVaultConversionSample The sample amount of base vault shares used to convert to underlying.
/// Pass 1 if the base asset is not a vault. Should be chosen such that converting `baseVaultConversionSample` to
Expand Down
2 changes: 1 addition & 1 deletion src/morpho-chainlink/libraries/ChainlinkDataFeedLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ library ChainlinkDataFeedLib {
/// @dev Performs safety checks and returns the latest price of a `feed`.
/// @dev When `feed` is the address zero, returns 1.
/// @dev Notes on safety checks:
/// - L2s are not supported.
/// - Using oracles on L2s assumes that the liveness risks are acceptable, there is no additional safety check.
/// - Staleness is not checked because it's assumed that the Chainlink feed keeps its promises on this.
/// - The price is not checked to be in the min/max bounds because it's assumed that the Chainlink feed keeps its
/// promises on this.
Expand Down
3 changes: 1 addition & 2 deletions test/MorphoChainlinkOracleV2FactoryTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ contract ChainlinkOracleFactoryTest is Test {
MorphoChainlinkOracleV2Factory factory;

function setUp() public {
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
require(block.chainid == 1, "chain isn't Ethereum");
vm.createSelectFork("ethereum");
factory = new MorphoChainlinkOracleV2Factory();
}

Expand Down
3 changes: 1 addition & 2 deletions test/MorphoChainlinkOracleV2Test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ contract MorphoChainlinkOracleV2Test is Test {
using Math for uint256;

function setUp() public {
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
require(block.chainid == 1, "chain isn't Ethereum");
vm.createSelectFork("ethereum");
}

function testOracleWbtcUsdc() public {
Expand Down
3 changes: 1 addition & 2 deletions test/WstEthStEthExchangeRateChainlinkAdapterTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ contract WstEthStEthExchangeRateChainlinkAdapterTest is Test {
MorphoChainlinkOracleV2 internal morphoOracle;

function setUp() public {
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
require(block.chainid == 1, "chain isn't Ethereum");
vm.createSelectFork("ethereum");
adapter = new WstEthStEthExchangeRateChainlinkAdapter();
morphoOracle = new MorphoChainlinkOracleV2(
vaultZero, 1, AggregatorV3Interface(address(adapter)), feedZero, 18, vaultZero, 1, feedZero, feedZero, 18
Expand Down