Platform: Code4rena
Start Date: 10/02/2022
Pot Size: $100,000 USDC
Total HM: 13
Participants: 21
Period: 7 days
Judge: leastwood
Total Solo HM: 10
Id: 85
League: ETH
Rank: 20/21
Findings: 1
Award: $217.22
🌟 Selected for report: 0
🚀 Solo Findings: 0
Loading the array length here isn't needed as this is already the initial value, which in turn costs extra gas: LensHub.sol::541 - for (uint256 i = 0; i < vars.datas.length; ++i) { PublishingLogic.sol::400 - if (byteHandle.length == 0 || byteHandle.length > Constants.MAX_HANDLE_LENGTH) PublishingLogic.sol::403 - for (uint256 i = 0; i < byteHandle.length; ++i) { InteractionLogic.sol::46 - if (profileIds.length != followModuleDatas.length) revert Errors.ArrayMismatch(); InteractionLogic.sol::47 - for (uint256 i = 0; i < profileIds.length; ++i) {
Initializing variables that have the same default value is unnecessary and costs extra gas. FollowNFT.sol::120 - uint256 lower = 0; FollowNFT.sol::162 - uint256 lower = 0;
SHR opcode uses less gas compared to DIV opcode FollowNFT.sol::134 - uint256 center = upper - (upper - lower) / 2; FollowNFT.sol::176 - uint256 center = upper - (upper - lower) / 2;
#0 - Zer0dot
2022-03-25T18:11:12Z
These are valid (except the 2nd point which appears to be handled by the optimizer) and are already addressed in https://github.com/aave/lens-protocol/pull/80