From 13bd041af77ef5efa00d24d0f8bdcff82b525356 Mon Sep 17 00:00:00 2001 From: owen05 Date: Thu, 21 Jan 2021 17:56:49 +0800 Subject: [PATCH] fix incentive --- contracts/SmartRoute/DODOIncentive.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/SmartRoute/DODOIncentive.sol b/contracts/SmartRoute/DODOIncentive.sol index 6fecbf8..4a0b59d 100644 --- a/contracts/SmartRoute/DODOIncentive.sol +++ b/contracts/SmartRoute/DODOIncentive.sol @@ -113,15 +113,15 @@ contract DODOIncentive is InitializableOwnable { uint256 _totalReward = _getTotalReward(); require(_totalReward < uint112(-1), "OVERFLOW"); totalReward = uint112(_totalReward); - lastRewardBlock = uint32(block.timestamp % 2**32); + lastRewardBlock = uint32(block.number); } function _update(uint256 _totalReward, uint256 _totalDistribution) internal { require( - _totalReward < uint112(-1) && _totalDistribution < uint112(-1), + _totalReward < uint112(-1) && _totalDistribution < uint112(-1) && block.number < uint32(-1), "OVERFLOW" ); - lastRewardBlock = uint32(block.timestamp % 2**32); + lastRewardBlock = uint32(block.number); totalReward = uint112(_totalReward); totalDistribution = uint112(_totalDistribution); }