diff --git a/test/integration/BPool.t.sol b/test/integration/BPool.t.sol index 766289d5..b08a4c65 100644 --- a/test/integration/BPool.t.sol +++ b/test/integration/BPool.t.sol @@ -114,11 +114,11 @@ abstract contract BPoolIntegrationTest is Test, GasSnapshot { } function test_extremeCase() public virtual { - uint256 _DAI_WEIGHT = 21095347289582322017; - uint256 _WETH_WEIGHT = 14053292305279328903; - uint256 _DAI_BALANCE = 1000000000000000000; - uint256 _WETH_BALANCE = 839390325460697805479509969833437577; - uint256 _DAI_AMOUNT_OUT = 1000000000000000000; + uint256 _DAI_WEIGHT = 21_095_347_289_582_322_017; + uint256 _WETH_WEIGHT = 14_053_292_305_279_328_903; + uint256 _DAI_BALANCE = 1_000_000_000_000_000_000; + uint256 _WETH_BALANCE = 839_390_325_460_697_805_479_509_969_833_437_577; + uint256 _DAI_AMOUNT_OUT = 1_000_000_000_000_000_000; uint256 _FEE = 1e18 / 10 ** 6; uint256 _WHITNESS_FEE = 0.999999e18; @@ -153,7 +153,6 @@ abstract contract BPoolIntegrationTest is Test, GasSnapshot { pool.finalize(); whitnessPool.finalize(); - vm.startPrank(swapper.addr); dai.approve(address(pool), type(uint256).max); dai.approve(address(whitnessPool), type(uint256).max); diff --git a/test/invariants/fuzz/BMath.t.sol b/test/invariants/fuzz/BMath.t.sol index 5aabbb55..76b20875 100644 --- a/test/invariants/fuzz/BMath.t.sol +++ b/test/invariants/fuzz/BMath.t.sol @@ -23,7 +23,7 @@ contract FuzzBMath is EchidnaTest { MIN_WEIGHT = bmath.MIN_WEIGHT(); MAX_WEIGHT = bmath.MAX_WEIGHT(); MAX_TOTAL_WEIGHT = bmath.MAX_TOTAL_WEIGHT(); - MIN_FEE = bmath.MAX_FEE(); //bmath.MIN_FEE(); + MIN_FEE = 0.1e18; // 10% fee MAX_FEE = bmath.MAX_FEE(); } @@ -151,18 +151,15 @@ contract FuzzBMath is EchidnaTest { uint256 tokenBalanceOut, uint256 tokenWeightOut, uint256 tokenAmountIn, - uint256 poolSupply, - uint256 totalWeight, uint256 swapFee ) public { tokenWeightIn = clamp(tokenWeightIn, MIN_WEIGHT, MAX_WEIGHT - MIN_WEIGHT); tokenWeightOut = clamp(tokenWeightOut, MIN_WEIGHT, MAX_TOTAL_WEIGHT - tokenWeightIn); - totalWeight = clamp(totalWeight, tokenWeightIn + tokenWeightOut, MAX_TOTAL_WEIGHT); - totalWeight = tokenWeightIn + tokenWeightOut; + uint256 totalWeight = tokenWeightIn + tokenWeightOut; tokenBalanceIn = clamp(tokenBalanceIn, 1e6, type(uint256).max); tokenBalanceOut = clamp(tokenBalanceOut, 1e6, type(uint256).max); tokenAmountIn = clamp(tokenAmountIn, 1e6, type(uint256).max); - poolSupply = clamp(poolSupply, 100 * BONE, type(uint256).max); + uint256 poolSupply = 100 * BONE; swapFee = clamp(swapFee, MIN_FEE, MAX_FEE); emit Log('tokenWeightIn', tokenWeightIn); @@ -202,17 +199,14 @@ contract FuzzBMath is EchidnaTest { uint256 tokenBalanceOut, uint256 tokenWeightOut, uint256 tokenAmountOut, - uint256 poolSupply, - uint256 totalWeight, uint256 swapFee ) public { tokenWeightIn = clamp(tokenWeightIn, MIN_WEIGHT, MAX_WEIGHT - MIN_WEIGHT); tokenWeightOut = clamp(tokenWeightOut, MIN_WEIGHT, MAX_TOTAL_WEIGHT - tokenWeightIn); - totalWeight = clamp(totalWeight, tokenWeightIn + tokenWeightOut, MAX_TOTAL_WEIGHT); - totalWeight = tokenWeightIn + tokenWeightOut; + uint256 totalWeight = tokenWeightIn + tokenWeightOut; tokenBalanceIn = clamp(tokenBalanceIn, 1e6, type(uint256).max); tokenBalanceOut = clamp(tokenBalanceOut, 1e6, type(uint256).max); - poolSupply = clamp(poolSupply, 100 * BONE, type(uint256).max); + uint256 poolSupply = 100 * BONE; tokenAmountOut = clamp(tokenAmountOut, 1e6, type(uint256).max); swapFee = clamp(swapFee, MIN_FEE, MAX_FEE);