From ce72f26a1b776c03f5e5318158fa856746c8dd50 Mon Sep 17 00:00:00 2001 From: Pablo Veyrat Date: Mon, 13 Nov 2023 17:50:15 +0100 Subject: [PATCH] fix: reentrancy --- contracts/middleman/MerklFraxIncentivizationHandler.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/middleman/MerklFraxIncentivizationHandler.sol b/contracts/middleman/MerklFraxIncentivizationHandler.sol index 42753bb..c67794d 100644 --- a/contracts/middleman/MerklFraxIncentivizationHandler.sol +++ b/contracts/middleman/MerklFraxIncentivizationHandler.sol @@ -100,9 +100,9 @@ contract MerklFraxIncentivizationHandler is Ownable { params.amount = amount; if (amount > 0) { if (amount > minAmount) { + if (leftover > 0) leftovers[incentiveTokenAddress][poolAddress] = 0; _handleIncentiveTokenAllowance(IERC20(incentiveTokenAddress), address(creator), amount); merklDistributionCreator().createDistribution(params); - if (leftover > 0) leftovers[incentiveTokenAddress][poolAddress] = 0; } else { leftovers[incentiveTokenAddress][poolAddress] = amount; }