Refactor FeeSplitter::getAmountDue
to save one variable slot
#68
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
getAmountDue
inFeeSplitter.sol
defines the variabletotalReceived
in line 83 eventhough it is already known if the variable iseven necessary.
The variable is uneccessary if
_tokenRecords.totalShares == 0
.Not declaring it, if not necessary, saves gas.
Recommended Mitigation Steps
Rewrite the function to something like:
The text was updated successfully, but these errors were encountered: