Skip to content

Commit

Permalink
disallow duration 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Mar 30, 2022
1 parent d39a260 commit 7123306
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contracts/accounting/FarmAccounting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ library FarmAccounting {
}

updateCheckpoint();
require(period > 0, "FA: duration can not be 0");
require(period <= type(uint32).max, "FA: duration too large");
require(amount <= _MAX_REWARD_AMOUNT, "FA: amount too large");
(info.finished, info.duration, info.reward) = (uint40(block.timestamp + period), uint32(period), uint184(amount));
Expand Down

0 comments on commit 7123306

Please sign in to comment.