In FeeSplitter.sol by doing a small refactory gas can be saved in case of a revert in the functions: getAmountDue and _releaseToken . We can swap the order of two lines so we return earlier in case of a bad input, this way we save some gas because the evm would execute less opcodes before reverting.
Mitigation steps
getAmountDue: Swap line 83 with 84 to avoid computing unnecessary logic. Remove the "else" and combine it with line 83. Something like this:
Handle
0xngndev
Vulnerability details
Impact
In
FeeSplitter.sol
by doing a small refactory gas can be saved in case of a revert in the functions:getAmountDue
and_releaseToken
. We can swap the order of two lines so we return earlier in case of a bad input, this way we save some gas because the evm would execute less opcodes before reverting.Mitigation steps
getAmountDue: Swap line 83 with 84 to avoid computing unnecessary logic. Remove the "else" and combine it with line 83. Something like this:
_releaseToken: move line 252 after the require in line 254. Like this: