Skip to content

Commit

Permalink
Add first wave of morpho base vaults (#14)
Browse files Browse the repository at this point in the history
* add first wave of morpho base vaults

* troubleshoot block numbers and underlyingDonors

* fix failing tests

* Fix CI variables

---------

Co-authored-by: João Bruno <[email protected]>
  • Loading branch information
MattPereira and joaobrunoah authored Jan 27, 2025
1 parent c1bd94c commit b2e180f
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ env:
GNOSIS_RPC_URL: ${{ secrets.GNOSIS_RPC_URL }}
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
SONIC_RPC_URL: ${{ secrets.SONIC_RPC_URL }}
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }}
ARBITRUM_RPC_URL: ${{ secrets.ARBITRUM_RPC_URL }}

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ evm_version = 'cancun'
ignored_error_codes = [2394, 5574, 3860] # Transient storage, code size

[fuzz]
runs = 100
runs = 1000
max_test_rejects = 60000

[rpc_endpoints]
Expand Down
5 changes: 5 additions & 0 deletions test/ERC4626WrapperBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ abstract contract ERC4626WrapperBaseTest is Test {
permit2 = IPermit2(0x000000000022D473030F116dDEE9F6B43aC78BA3);
bufferRouter = IBufferRouter(0x532dA919D3EB5606b5867A6f505969c57F3A721b);
vault = IVault(0xbA1333333333a1BA1108E8412f11850A5C319bA9);
} else if (_compareStrings(network, "base")) {
blockNumber = overrideBlockNumber != 0 ? overrideBlockNumber : 25458827;
permit2 = IPermit2(0x000000000022D473030F116dDEE9F6B43aC78BA3);
bufferRouter = IBufferRouter(0x4132f7AcC9dB7A6cF7BE2Dd3A9DC8b30C7E6E6c8);
vault = IVault(0xbA1333333333a1BA1108E8412f11850A5C319bA9);
} else {
revert("Network not registered in ERC4626WrapperBase.sol");
}
Expand Down
25 changes: 25 additions & 0 deletions test/base/ERC4626BaseMorphSparkUSDC.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.8.24;

import "forge-std/Test.sol";

import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol";

import { ERC4626WrapperBaseTest } from "../ERC4626WrapperBase.t.sol";

contract ERC4626BaseMorphSparkUSDCTest is ERC4626WrapperBaseTest {
function setUp() public override {
ERC4626WrapperBaseTest.setUp();
}

function setUpForkTestVariables() internal override {
network = "base";

// Morpho Spark USDC
wrapper = IERC4626(0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A);
// Donor of USDC tokens
underlyingDonor = 0xee81B5Afc73Cf528778E0ED98622e434E5eFADb4;
amountToDonate = 1e6 * 1e6;
}
}
25 changes: 25 additions & 0 deletions test/base/ERC4626BaseMorphoIonicUSDC.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.8.24;

import "forge-std/Test.sol";

import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol";

import { ERC4626WrapperBaseTest } from "../ERC4626WrapperBase.t.sol";

contract ERC4626BaseMorphoIonicUSDCTest is ERC4626WrapperBaseTest {
function setUp() public override {
ERC4626WrapperBaseTest.setUp();
}

function setUpForkTestVariables() internal override {
network = "base";

// Morpho Ionic USDC
wrapper = IERC4626(0x23479229e52Ab6aaD312D0B03DF9F33B46753B5e);
// Donor of USDC tokens
underlyingDonor = 0x425fc782110110e2aFD2677e3C91EA77Fd7e0A47;
amountToDonate = 1e6 * 1e6;
}
}
25 changes: 25 additions & 0 deletions test/base/ERC4626BaseMorphoIonicWETH.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.8.24;

import "forge-std/Test.sol";

import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol";

import { ERC4626WrapperBaseTest } from "../ERC4626WrapperBase.t.sol";

contract ERC4626BaseMorphoIonicWETHTest is ERC4626WrapperBaseTest {
function setUp() public override {
ERC4626WrapperBaseTest.setUp();
}

function setUpForkTestVariables() internal override {
network = "base";

// Morpho Ionic Ecosystem WETH
wrapper = IERC4626(0x5A32099837D89E3a794a44fb131CBbAD41f87a8C);
// Donor of WETH tokens
underlyingDonor = 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb;
amountToDonate = 1e3 * 1e18;
}
}
25 changes: 25 additions & 0 deletions test/base/ERC4626BaseMorphoSeamlessUSDC.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.8.24;

import "forge-std/Test.sol";

import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol";

import { ERC4626WrapperBaseTest } from "../ERC4626WrapperBase.t.sol";

contract ERC4626BaseMorphoSeamlessUSDCTest is ERC4626WrapperBaseTest {
function setUp() public override {
ERC4626WrapperBaseTest.setUp();
}

function setUpForkTestVariables() internal override {
network = "base";

// Morpho Seamless USDC
wrapper = IERC4626(0x616a4E1db48e22028f6bbf20444Cd3b8e3273738);
// Donor of USDC tokens
underlyingDonor = 0xee81B5Afc73Cf528778E0ED98622e434E5eFADb4;
amountToDonate = 1e6 * 1e6;
}
}

0 comments on commit b2e180f

Please sign in to comment.