From d46e60f83cf06471ceaa233078bf43c8564009ed Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 1 Oct 2025 15:20:02 -0400 Subject: [PATCH] bugfix --- src/PartyPool.sol | 2 +- src/PartyPoolMintImpl.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PartyPool.sol b/src/PartyPool.sol index caf14f6..c0d8832 100644 --- a/src/PartyPool.sol +++ b/src/PartyPool.sol @@ -163,7 +163,7 @@ contract PartyPool is PartyPoolBase, IPartyPool { /// @inheritdoc IPartyPool function mintAmounts(uint256 lpTokenAmount) public view returns (uint256[] memory depositAmounts) { - return MINT_IMPL.mintAmounts(lpTokenAmount, lmsr.nAssets, totalSupply()); + return MINT_IMPL.mintAmounts(lpTokenAmount, lmsr.nAssets, totalSupply(), cachedUintBalances); } /// @notice Proportional mint for existing pool. diff --git a/src/PartyPoolMintImpl.sol b/src/PartyPoolMintImpl.sol index 36dbbcc..a1f414d 100644 --- a/src/PartyPoolMintImpl.sol +++ b/src/PartyPoolMintImpl.sol @@ -43,7 +43,7 @@ contract PartyPoolMintImpl is PartyPoolBase { uint256 oldScaled = ABDKMath64x64.mulu(oldTotal, LP_SCALE); // Calculate required deposit amounts for the desired LP tokens - uint256[] memory depositAmounts = mintAmounts(lpTokenAmount, lmsr.nAssets, totalSupply()); + uint256[] memory depositAmounts = mintAmounts(lpTokenAmount, lmsr.nAssets, totalSupply(), cachedUintBalances); // Transfer in all token amounts for (uint i = 0; i < n; ) { @@ -166,7 +166,7 @@ contract PartyPoolMintImpl is PartyPoolBase { emit Burn(payer, receiver, withdrawAmounts, lpAmount); } - function mintAmounts(uint256 lpTokenAmount, uint256 numAssets, uint256 totalSupply) public view + function mintAmounts(uint256 lpTokenAmount, uint256 numAssets, uint256 totalSupply, uint256[] memory cachedUintBalances) public view returns (uint256[] memory depositAmounts) { depositAmounts = new uint256[](numAssets);