cached pair fees

This commit is contained in:
tim
2025-10-31 12:32:05 -04:00
parent dd9b7474a6
commit 89e67ba69b
3 changed files with 31 additions and 17 deletions

View File

@@ -237,10 +237,10 @@ contract GasTest is Test {
vm.prank(alice);
TestERC20(address(tokens[1])).approve(address(testPool), type(uint256).max);
uint256 maxIn = 1_000;
uint256 maxIn = 10_000;
// Perform 10 swaps alternating directions to avoid large imbalance
for (uint256 i = 0; i < 10; i++) {
// Perform swaps alternating directions to avoid large imbalance
for (uint256 i = 0; i < 20; i++) {
vm.prank(alice);
if (i % 2 == 0) {
// swap token0 -> token1
@@ -249,6 +249,9 @@ contract GasTest is Test {
// swap token1 -> token0
testPool.swap(alice, alice, 1, 0, maxIn, 0, 0, false);
}
// shake up the bits
maxIn *= 787;
maxIn /= 1000;
}
}