diff --git a/.github/workflows/foundry.yml b/.github/workflows/foundry.yml index 741fee08..464d86aa 100644 --- a/.github/workflows/foundry.yml +++ b/.github/workflows/foundry.yml @@ -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" diff --git a/.gitmodules b/.gitmodules index 00b468f2..ebb7eee5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/lib/erc4626-tests b/lib/erc4626-tests new file mode 160000 index 00000000..8b1d7c2a --- /dev/null +++ b/lib/erc4626-tests @@ -0,0 +1 @@ +Subproject commit 8b1d7c2ac248c33c3506b1bff8321758943c5e11 diff --git a/src/mocks/ERC20Mock.sol b/src/mocks/ERC20Mock.sol index a580886c..b5165ff9 100644 --- a/src/mocks/ERC20Mock.sol +++ b/src/mocks/ERC20Mock.sol @@ -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); diff --git a/test/forge/ERC4626Test-a16z.sol b/test/forge/ERC4626Test-a16z.sol new file mode 100644 index 00000000..ba58c4fb --- /dev/null +++ b/test/forge/ERC4626Test-a16z.sol @@ -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; + } +}