From caf554e8a04760cf3ed4996fa041663904725020 Mon Sep 17 00:00:00 2001 From: Jiatu Date: Tue, 31 Dec 2024 11:49:56 +0800 Subject: [PATCH] Make code more robust --- contracts/liquidity/TrancheVault.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/liquidity/TrancheVault.sol b/contracts/liquidity/TrancheVault.sol index effff029..583ce806 100644 --- a/contracts/liquidity/TrancheVault.sol +++ b/contracts/liquidity/TrancheVault.sol @@ -538,8 +538,8 @@ contract TrancheVault is // Mint LP tokens to existing lenders. uint256 oldBalance = oldTrancheVault.balanceOf(lender); - if (balanceOf(lender) == 0) { - _mint(lender, oldBalance); + if (oldBalance != balanceOf(lender)) { + _mint(lender, oldBalance - balanceOf(lender)); } } }