From 30bd7d91584d44a21af72f4abf240e8063cdf058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Fri, 8 Mar 2024 16:29:34 +0100 Subject: [PATCH] chore: fixed minor typo --- contracts/EncryptedDEXPair.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/EncryptedDEXPair.sol b/contracts/EncryptedDEXPair.sol index 206695f..92bbaed 100644 --- a/contracts/EncryptedDEXPair.sol +++ b/contracts/EncryptedDEXPair.sol @@ -315,8 +315,8 @@ contract EncryptedDEXPair is EncryptedERC20 { uint32 amount0Out; uint32 amount1Out; if (priceToken1Increasing) { - // in this case, first sell all amount1In at current fixed token1 price to get amount0Out, then swap remaining (amount0In-amount0Out) - // to get amount1out_remaining according to AMM formula + // in this case, first sell all amount1In at current fixed token1 price to get amount0Out, then swap remaining (amount0InMinusFee-amount0Out) + // to get amount1Out_remaining according to AMM formula amount0Out = uint32((uint64(amount1InMinusFee) * uint64(reserve0)) / uint64(reserve1)); // NOTE : reserve1 should never be 0 after first liquidity minting event -see assert at the end- if first batchSettlement // is called without minting, tx will fail anyways