Proposal 7 New comptroller ClaimStrike gas inefficiency

Please refer to line 1326-1328 and 1331-1333 of Comptroller.sol in the new comptroller implementation.

function claimStrike(address memory holders, SToken memory sTokens, bool borrowers, bool suppliers) public {

for (uint j = 0; j < holders.length; j++) {
    strikeAccrued[holders[j]] = grantSTRKInternal(holders[j], strikeAccrued[holders[j]]);
}

is repeated within the inner loop when it shouldn’t be. This will cause unnecessary gas costs!

Proposed fix: To remove L1326-L1328 in Comptroller.sol

Correct implementation reference can be referred from the Compound code: https://github.com/compound-finance/compound-protocol/blob/master/contracts/Comptroller.sol

you found good point and it can reduce more gas fee :+1: :+1: :+1:

1 Like

Reviewed new proposed implementation 0xC25992C4CBA1310543D3FBC144745053479D4A3E vs old proposed implementation 0xE0EBDB1CA3330219A603AFC68E79115D47E95692.

Can confirm L1326-L1328 is removed.

Thanks for the update!