Open code423n4 opened 3 years ago
Agree with the warden, specifically you would want to cache this in memory, doing a STATICCALL (view method) is 40 gas plus the cost for reading storage (2100 after first time iirc)
Would cost just 3 gas to store and 3 gas for each subsequent memory read
Handle
pauliax
Vulnerability details
Impact
function handleFees calls factory.ownerSplit() twice. To save some gas and reduce the number of external calls, you should save the value after the first call and re-use it later.
Recommended Mitigation Steps
Cache factory.ownerSplit() in a local variable and re-use it.