code-423n4 / 2022-06-badger-findings

0 stars 0 forks source link

QA Report #96

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

L: EVENT LACKS OF INDEXED PARAMETERS

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L51

The MyStrategy.RewardsCollected event lacks of indexed parameter that help offchain event filtering for better analysis. It is avisable to index a relevant parameter within that event to help with offchain services event filtering.

GAS: SAVE GAS WHILE FOR LOOPING

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L299 https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L317

Calculating the _claim.length once before looping instead of performing the calculation once each loop is done & using ++i, helps saving gas while looping.