diff --git a/.gitmodules b/.gitmodules index 888d42dcd90..aaa229f8dd4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std +[submodule "lib/erc4626-tests"] + path = lib/erc4626-tests + url = https://github.com/a16z/erc4626-tests.git diff --git a/foundry.toml b/foundry.toml index 1076ef55bf0..c0da48773f8 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,2 +1,3 @@ [fuzz] runs = 10000 +max_test_rejects = 100000 diff --git a/lib/erc4626-tests b/lib/erc4626-tests new file mode 160000 index 00000000000..8b1d7c2ac24 --- /dev/null +++ b/lib/erc4626-tests @@ -0,0 +1 @@ +Subproject commit 8b1d7c2ac248c33c3506b1bff8321758943c5e11 diff --git a/test/token/ERC20/extensions/ERC4626.t.sol b/test/token/ERC20/extensions/ERC4626.t.sol new file mode 100644 index 00000000000..4863c14d514 --- /dev/null +++ b/test/token/ERC20/extensions/ERC4626.t.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "erc4626-tests/ERC4626.test.sol"; + +import {ERC20Mock} from "../../../../contracts/mocks/ERC20Mock.sol"; +import {ERC4626Mock, IERC20Metadata} from "../../../../contracts/mocks/ERC4626Mock.sol"; + +contract ERC4626StdTest is ERC4626Test { + function setUp() public override { + _underlying_ = address(new ERC20Mock("MockERC20", "MockERC20", address(this), 0)); + _vault_ = address(new ERC4626Mock(IERC20Metadata(_underlying_), "MockERC4626", "MockERC4626")); + _delta_ = 0; + _vaultMayBeEmpty = false; + _unlimitedAmount = true; + } +}