Skip to content

Commit

Permalink
SOP-1 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbvictor0x committed May 26, 2024
1 parent 04fdeda commit f0b82fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/farm/SophonFarming.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ contract SophonFarming is Upgradeable2Step, SophonFarmingState {
error InvalidEndBlock();
error InvalidDeposit();
error InvalidBooster();
error InvalidPointsPerBlock();
error WithdrawNotAllowed();
error WithdrawTooHigh(uint256 maxAllowed);
error WithdrawIsZero();
Expand Down Expand Up @@ -110,6 +111,9 @@ contract SophonFarming is Upgradeable2Step, SophonFarmingState {
revert AlreadyInitialized();
}

if (_pointsPerBlock < 1e18) {
revert InvalidPointsPerBlock();
}
pointsPerBlock = _pointsPerBlock;

if (_startBlock == 0) {
Expand Down Expand Up @@ -311,6 +315,10 @@ contract SophonFarming is Upgradeable2Step, SophonFarmingState {
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
if (_pointsPerBlock < 1e18) {
revert InvalidPointsPerBlock();
}

massUpdatePools();
pointsPerBlock = _pointsPerBlock;
}
Expand Down

0 comments on commit f0b82fd

Please sign in to comment.