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);