From 4102ddf0dc5e5b2c443802427d54acf28cdb8ceb Mon Sep 17 00:00:00 2001 From: trizin <25263018+trizin@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:12:43 +0300 Subject: [PATCH] Tiny improvements --- contracts/templates/ERC20Template3.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/templates/ERC20Template3.sol b/contracts/templates/ERC20Template3.sol index 17f00ab2..68456859 100644 --- a/contracts/templates/ERC20Template3.sol +++ b/contracts/templates/ERC20Template3.sol @@ -1002,7 +1002,7 @@ contract ERC20Template3 is bool predictedValue, uint256 stake, uint256 epoch_start - ) external { + ) external nonReentrant { require(toEpochStart(epoch_start) == epoch_start, "invalid epoch"); require(paused == false, "paused"); require(epoch_start >= soonestEpochToPredict(block.timestamp), "too late to submit"); @@ -1145,8 +1145,7 @@ contract ERC20Template3 is require(epoch_start <= curEpoch(), "too early to submit"); require(epochStatus[epoch_start] == Status.Pending, "already settled"); bool opfTimedout = curEpoch() > epoch_start + trueValSubmitTimeout; - bool epochPending = epochStatus[epoch_start] == Status.Pending; - if (cancelRound || (opfTimedout && epochPending)){ + if (cancelRound || opfTimedout){ epochStatus[epoch_start]=Status.Canceled; } else{