From 5bb865218f02a01d0521c9d9a947cdf4bd32e74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 18 Oct 2018 18:42:57 -0300 Subject: [PATCH] Now setting the finalized flag before doing finalization to prevent possbile reentrancy issues. (#1447) --- contracts/crowdsale/distribution/FinalizableCrowdsale.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol index bcdfa4563..8add165da 100644 --- a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol +++ b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol @@ -34,10 +34,10 @@ contract FinalizableCrowdsale is TimedCrowdsale { require(!_finalized); require(hasClosed()); + _finalized = true; + _finalization(); emit CrowdsaleFinalized(); - - _finalized = true; } /** @@ -47,5 +47,4 @@ contract FinalizableCrowdsale is TimedCrowdsale { */ function _finalization() internal { } - }