Skip to content

Commit

Permalink
Add ERC4626 standard property tests (#3792)
Browse files Browse the repository at this point in the history
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
  • Loading branch information
daejunpark and Amxx committed Nov 4, 2022
1 parent 0b6becd commit c7315e8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[fuzz]
runs = 10000
max_test_rejects = 100000
1 change: 1 addition & 0 deletions lib/erc4626-tests
Submodule erc4626-tests added at 8b1d7c
17 changes: 17 additions & 0 deletions test/token/ERC20/extensions/ERC4626.t.sol
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit c7315e8

Please sign in to comment.