Platform: Code4rena
Start Date: 27/01/2022
Pot Size: $75,000 USDT
Total HM: 6
Participants: 29
Period: 7 days
Judge: leastwood
Total Solo HM: 6
Id: 72
League: ETH
Rank: 20/29
Findings: 1
Award: $63.00
🌟 Selected for report: 1
🚀 Solo Findings: 0
Tomio
Expensive gas
https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/farming/FarmingPools.sol#L125 // gas cost 26406
Remix
Change to:
function getRewards(address[] calldata stakeTokens) external { uint256 tesstakeTokens = stakeTokens.length; for (uint256 i = 0; i < tesstakeTokens; i++) { getReward(stakeTokens[i]); } } // gas cost 26247
#0 - ColaM12
2022-02-03T06:49:00Z
Duplicate to #137 #29
Tomio
Expensive gas
https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L326 // gas cost 26049
Remix
Change to:
LockedBalance storage _locked = locked[msg.sender]; // gas cost 25954
and remove https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L333, not needed if use storage
#0 - ColaM12
2022-02-03T06:00:18Z
Duplicate to #137
47.0985 USDT - $47.10
Tomio
Expensive gas
require(beneficiaries.length == amounts.length && beneficiaries.length == startTimes.length && beneficiaries.length == endTimes.length, "Array length must be same"); //gas cost 90411
Remix
Change to:
require(beneficiaries.length == amounts.length); require (beneficiaries.length == startTimes.length); require (beneficiaries.length == endTimes.length, "Array length must be same"); //gas cost 90403