Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(erc4626): add ERC4626 a16z tests #144

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading