This commit is contained in:
tim
2025-09-30 15:42:52 -04:00
parent 91e6a916ac
commit 5ce14ab2e1
10 changed files with 100 additions and 86 deletions

View File

@@ -1,5 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.30;
/* solhint-disable erc20-unchecked-transfer */
import "forge-std/Test.sol";
import "@abdk/ABDKMath64x64.sol";
@@ -129,22 +130,23 @@ contract TestERC20 is ERC20 {
/// @notice Gas testing contract for PartyPool - contains all gas measurement tests
contract GasTest is Test {
using ABDKMath64x64 for int128;
using SafeERC20 for TestERC20;
PartyPlanner planner;
PartyPool pool2;
PartyPool pool10;
PartyPool pool20;
PartyPool pool50;
PartyPlanner internal planner;
PartyPool internal pool2;
PartyPool internal pool10;
PartyPool internal pool20;
PartyPool internal pool50;
address alice;
address bob;
address internal alice;
address internal bob;
// Common parameters
int128 tradeFrac;
int128 targetSlippage;
int128 internal tradeFrac;
int128 internal targetSlippage;
uint256 constant INIT_BAL = 1_000_000; // initial token units for each token (internal==amount when base==1)
uint256 constant BASE = 1; // use base=1 so internal amounts correspond to raw integers (Q64.64 units)
uint256 constant internal INIT_BAL = 1_000_000; // initial token units for each token (internal==amount when base==1)
uint256 constant internal BASE = 1; // use base=1 so internal amounts correspond to raw integers (Q64.64 units)
/// @notice Helper function to create a pool with the specified number of tokens
function createPool(uint256 numTokens) internal returns (PartyPool) {