Platform: Code4rena
Start Date: 15/06/2022
Pot Size: $30,000 USDC
Total HM: 5
Participants: 55
Period: 3 days
Judge: Jack the Pug
Id: 138
League: ETH
Rank: 50/55
Findings: 1
Award: $50.21
🌟 Selected for report: 0
🚀 Solo Findings: 0
50.2119 USDC - $50.21
MyStrategy.sol
L118/300/317 - It is not necessary to initialize variables to their default value, this generates an extra gas expense (-2246 gas cost/ within a cycle for -19500 gas cost).
L118/300/317 - use a for loop with i++ instead of ++i unchecked = (in 10 iterations -21,136, in 100 iterations -32,656 gas).
L299/300/317 - Create a variable in memory of the value of _claims.length, instead of constantly calling it in the claimBribesFromHiddenHand() function.
L230/279/323/330/387 - Instead of validating x > 0 it is better to validate x != 0 check this tweet https://twitter.com/gzeon/status/1485428085885640706.
L186 - Reduce the size of error messages (Long revert Strings) (more than 32 letters).
L184/205/290/341/342/437 - It uses require but using Errors in solidity can reduce the deployment gas cost.
L143/144 - LOCKER.balances(address(this)).locked could be returned directly.
L161/165 - In the getProtectedTokens() function, the following could be set directly in the signature: returns (address[] memory protectedTokens) and not generate a return on line 165
L381/382 - Directly execute _transferToVault(balanceOfWant());