From e47c988327ff5d2bffcf32a08bf49e8f14c8483d Mon Sep 17 00:00:00 2001 From: Jiri Malek Date: Thu, 2 Dec 2021 11:53:54 +0100 Subject: [PATCH 1/2] Check global lock time variable for bid withdrawal. A bid can not be withdrawn before a pre-configured lock time expires. The default 12 hours delay is controlled by a global update-able variable instead of a hardcoded constant. --- contracts/FantomAuction.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/FantomAuction.sol b/contracts/FantomAuction.sol index fff1ec1..b446bcf 100644 --- a/contracts/FantomAuction.sol +++ b/contracts/FantomAuction.sol @@ -149,7 +149,7 @@ contract FantomAuction is uint256 public minBidIncrement = 1; /// @notice global bid withdrawal lock time - uint256 public bidWithdrawalLockTime = 20 minutes; + uint256 public bidWithdrawalLockTime = 12 hours; /// @notice global platform fee, assumed to always be to 1 decimal place i.e. 25 = 2.5% uint256 public platformFee = 25; @@ -394,8 +394,8 @@ contract FantomAuction is require( _getNow() > _endTime && - (_getNow() - _endTime >= 43200), - "can withdraw only after 12 hours (after auction ended)" + (_getNow() - _endTime >= bidWithdrawalLockTime), + "can now withdraw before auction lock time" ); uint256 previousBid = highestBid.bid; From ec86991b27babd170d46f7487208d0a851cef3a2 Mon Sep 17 00:00:00 2001 From: Jiri Malek Date: Thu, 2 Dec 2021 11:56:51 +0100 Subject: [PATCH 2/2] Fix error response typo in auction bid withdraw. --- contracts/FantomAuction.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/FantomAuction.sol b/contracts/FantomAuction.sol index b446bcf..5b21c5c 100644 --- a/contracts/FantomAuction.sol +++ b/contracts/FantomAuction.sol @@ -395,7 +395,7 @@ contract FantomAuction is require( _getNow() > _endTime && (_getNow() - _endTime >= bidWithdrawalLockTime), - "can now withdraw before auction lock time" + "can not withdraw before auction lock time" ); uint256 previousBid = highestBid.bid;