Skip to content

Commit

Permalink
remove extra assumption in the foundry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Jan 25, 2023
1 parent 3d20786 commit 82403e1
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions test/token/ERC20/extensions/ERC4626.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,4 @@ contract ERC4626StdTest is ERC4626Test {
_vaultMayBeEmpty = false;
_unlimitedAmount = true;
}

// solhint-disable-next-line func-name-mixedcase
function test_RT_mint_withdraw(ERC4626Test.Init memory init, uint256 shares) public override {
// There is an edge case where we currently behave different than the property tests,
// when all assets are lost to negative yield.

// Sum all initially deposited assets.
int256 initAssets = 0;
for (uint256 i = 0; i < init.share.length; i++) {
vm.assume(init.share[i] <= uint256(type(int256).max - initAssets));
initAssets += SafeCast.toInt256(init.share[i]);
}

// Reject tests where the yield loses all assets from the vault.
vm.assume(init.yield > -initAssets);

super.test_RT_mint_withdraw(init, shares);
}
}

0 comments on commit 82403e1

Please sign in to comment.