Platform: Code4rena
Start Date: 20/01/2022
Pot Size: $80,000 USDC
Total HM: 5
Participants: 37
Period: 7 days
Judge: Jack the Pug
Total Solo HM: 1
Id: 76
League: ETH
Rank: 26/37
Findings: 1
Award: $65.46
🌟 Selected for report: 1
🚀 Solo Findings: 0
11.8662 USDC - $11.87
Funen
used i++ instead ++i just because ++i is more gas efficient.
or even better approach is to use unchecked {++i}
by seen the disscussion here : https://github.com/ethereum/solidity/issues/10695
Manual Review
contracts/Sherlock.sol:106: for (uint256 i; i < _initialstakingPeriods.length; i++) { contracts/SherlockClaimManager.sol:234: for (uint256 i; i < claimCallbacks.length; i++) { contracts/SherlockClaimManager.sol:256: for (uint256 i; i < claimCallbacks.length; i++ { contracts/Sherbuy.sol:186: for (uint256 i; i < _tokens.length; i++) { contracts/Manager.sol:46: for (uint256 i; i < _extraTokens.lengt{h; i++)
change to using unchecked { ++i }
#0 - jack-the-pug
2022-03-26T07:06:59Z
Dup #111
53.5879 USDC - $53.59
Funen
in this case : https://github.com/code-423n4/2022-01-sherlock/blob/main/contracts/managers/SherlockClaimManager.sol#L197-L198, the gas can be optimazed by using claims
instead of claims_[_claimIdentifier]
Manual Review
if (_state == State.NonExistent) { _cleanUpClaim(_claimIdentifier); } else { claims_[_claimIdentifier].state = _state; claims_[_claimIdentifier].updated = block.timestamp; } }
into
if (_state == State.NonExistent) { _cleanUpClaim(_claimIdentifier); } else { claims.state = _state; claims.updated = block.timestamp; } }