Skip to content

Commit

Permalink
Merge pull request #144 from morpho-labs/test/erc4626-a16z
Browse files Browse the repository at this point in the history
test(erc4626): add ERC4626 a16z tests
  • Loading branch information
Rubilmax committed Oct 5, 2023
2 parents 0afb8df + 56e8412 commit 09cd121
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
type: ["slow", "fast"]
include:
- type: "slow"
fuzz-runs: 100000
max-test-rejects: 500000
fuzz-runs: 32768
max-test-rejects: 1048576
invariant-runs: 64
invariant-depth: 1024
- type: "fast"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
[submodule "lib/morpho-blue-irm"]
path = lib/morpho-blue-irm
url = https://github.com/morpho-labs/morpho-blue-irm
[submodule "lib/erc4626-tests"]
path = lib/erc4626-tests
url = https://github.com/a16z/erc4626-tests
1 change: 1 addition & 0 deletions lib/erc4626-tests
Submodule erc4626-tests added at 8b1d7c
8 changes: 8 additions & 0 deletions src/mocks/ERC20Mock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import {ERC20} from "@openzeppelin/token/ERC20/ERC20.sol";
contract ERC20Mock is ERC20 {
constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {}

function mint(address account, uint256 amount) external {
_mint(account, amount);
}

function burn(address account, uint256 amount) external {
_burn(account, amount);
}

function setBalance(address account, uint256 amount) external {
_burn(account, balanceOf(account));
_mint(account, amount);
Expand Down
18 changes: 18 additions & 0 deletions test/forge/ERC4626Test-a16z.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import "erc4626-tests/ERC4626.test.sol";

import {BaseTest} from "./helpers/BaseTest.sol";

contract ERC4626StdTest is BaseTest, ERC4626Test {
function setUp() public override(BaseTest, ERC4626Test) {
super.setUp();

_underlying_ = address(loanToken);
_vault_ = address(vault);
_delta_ = 0;
_vaultMayBeEmpty = true;
_unlimitedAmount = true;
}
}

0 comments on commit 09cd121

Please sign in to comment.