Skip to content

Commit

Permalink
test: enforcing high fee on inverse path
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed Jul 26, 2024
1 parent 486d3c1 commit 08c775d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions test/integration/BPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ pragma solidity 0.8.25;

import {IERC20} from '@cowprotocol/interfaces/IERC20.sol';
import {BFactory} from 'contracts/BFactory.sol';

import {BMath} from 'contracts/BMath.sol';
import {GasSnapshot} from 'forge-gas-snapshot/GasSnapshot.sol';
import {Test, Vm} from 'forge-std/Test.sol';
import {IBFactory} from 'interfaces/IBFactory.sol';
import {IBPool} from 'interfaces/IBPool.sol';
import {BMath} from 'contracts/BMath.sol';

abstract contract BPoolIntegrationTest is Test, GasSnapshot {
IBPool public pool;
Expand Down Expand Up @@ -100,7 +101,7 @@ abstract contract BPoolIntegrationTest is Test, GasSnapshot {
whitnessPool.bind(address(wbtc), WBTC_LP_AMOUNT, WBTC_WEIGHT);

// set swap fee
pool.setSwapFee(SWAP_FEE);
pool.setSwapFee(SWAP_FEE);
whitnessPool.setSwapFee(SWAP_FEE);

// finalize
Expand Down Expand Up @@ -147,7 +148,8 @@ abstract contract BPoolIntegrationTest is Test, GasSnapshot {
vm.startPrank(swapper.addr);
dai.approve(address(pool), type(uint256).max);

(uint256 amountOut,) = pool.swapExactAmountOut(address(dai), type(uint256).max, address(weth), WETH_OUT_AMOUNT, type(uint256).max);
(uint256 amountOut,) =
pool.swapExactAmountOut(address(dai), type(uint256).max, address(weth), WETH_OUT_AMOUNT, type(uint256).max);

dai.approve(address(whitnessPool), type(uint256).max);

Expand Down
2 changes: 1 addition & 1 deletion test/invariants/fuzz/BMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.MIN_FEE();
MIN_FEE = 0.9999e18; // bmath.MIN_FEE();
MAX_FEE = bmath.MAX_FEE();
}

Expand Down

0 comments on commit 08c775d

Please sign in to comment.