Don't try bonding zero liquidity in RewardReinvestor
#101
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
pmerkleplant
Vulnerability details
Impact
Function
RewardReinvestor::_bondAccount
tries to bond liquidity to an account,even though it is known whether the liquidity is zero.
Proof of Concept
The return value
liquidityCreated
in line 105 can be zero.The following function call,
bondToAccount()
, then reverts with "Cannot bond 0".Recommended Mitigation Steps
Gas could be saved if the function would revert earlier, i.e. in line 106,
if the
liquidityCreated
is zero.The text was updated successfully, but these errors were encountered: