Judge has assessed an item in Issue #712 as 2 risk. The relevant finding follows:
[L-05] In SurplusGuildMinter, Staking and Unstaking Might be Bricked at a Point
Currently, SurplusGuildMinter::stake function calls getRewards() function, this function does some computation then calls ProfitManager::claimRewards on the SurplusGuildMinter, the claimRewards function then loops through all the available terms users have staked on in the SurplusGuildMinter, since these terms aren't whitelisted and the number of terms a user can stake on isn't limited this number will only grow exponentially, at a point both staking and unstaking will revert due to long computation which eventually results in an OOG revert.
RECOMMENDATION
Consider whitelisting some selected terms, to avoid this number growing too large
Judge has assessed an item in Issue #712 as 2 risk. The relevant finding follows:
[L-05] In SurplusGuildMinter, Staking and Unstaking Might be Bricked at a Point
Currently, SurplusGuildMinter::stake function calls getRewards() function, this function does some computation then calls ProfitManager::claimRewards on the
SurplusGuildMinter
, theclaimRewards
function then loops through all the available terms users have staked on in theSurplusGuildMinter
, since these terms aren't whitelisted and the number of terms a user can stake on isn't limited this number will only grow exponentially, at a point both staking and unstaking will revert due to long computation which eventually results in an OOG revert.RECOMMENDATION
Consider whitelisting some selected terms, to avoid this number growing too large