Lucene search

K
code423n4Code4renaCODE423N4:2022-01-OPENLEVERAGE-FINDINGS-ISSUES-216
HistoryFeb 02, 2022 - 12:00 a.m.

Checks missing while adding rewards

2022-02-0200:00:00
Code4rena
github.com
3

Handle

csanuragjain

Vulnerability details

Impact

Reward amount higher than contract reward balance can bring instability in the contract

Proof of Concept

  1. In FarmingPools.sol contract check notifyRewardAmounts function

  2. Observe there is no check to see if added reward is higher than contract reward balance

Recommended Mitigation Steps

Add below condition in notifyRewardAmounts

uint256 balance = oleToken.balanceOf(address(this)); 
require(rewardRate <= balance.div(rewardsDuration), "Provided reward too high");

The text was updated successfully, but these errors were encountered:

All reactions