spartan-protocol / spartanswap-contracts

📃 Spartan Protocol Smart Contracts V1 - V2
20 stars 6 forks source link

DAO.calcCurrentReward() | Underflow #79

Closed SamusElderg closed 3 years ago

SamusElderg commented 3 years ago

DAO.calcCurrentReward() will result in an underflow if the harvest() function is called straight after a deposit or bond.

As the mapMember_lastTime is shifted 60 seconds forward; we will be doing:

This will revert so i assume its not an issue; but we might want to look at adding a require in harvest or calcCurrentReward for block.timestamp > mapMember_lastTime ?