Gas: Reorder conditions in claimGovernanceTribute
#76
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
cmichel
Vulnerability details
The
FSD.claimGovernanceTribute
function first performs the expensivegetPriorConvictionScore
instead of the cheapisGovernance[msg.sender]
check.Reordering the conditions to first do the cheap governance check would allow this function to short-circuit if the user is not a governor, which will save gas on average.
The last assignment
membership[msg.sender] = user;
is not required.The text was updated successfully, but these errors were encountered: