Platform: Code4rena
Start Date: 16/11/2021
Pot Size: $50,000 ETH
Total HM: 11
Participants: 17
Period: 7 days
Judge: LSDan
Total Solo HM: 8
Id: 49
League: ETH
Rank: 14/17
Findings: 2
Award: $341.63
🌟 Selected for report: 3
🚀 Solo Findings: 0
🌟 Selected for report: pauliax
Also found by: Meta0xNull, pants, ye0lde
pants
These files has open TODOs:
OverlayV1OVLCollateral.sol
OverlayV1OI.sol
Open TODOs can hint at programming or architectural errors that still need to be fixed.
Manual code review.
Resolve these TODOs and bubble up the errors.
#0 - mikeyrf
2021-12-07T00:07:53Z
duplicate #116
🌟 Selected for report: pants
0.0161 ETH - $74.28
pants
The function OverlayV1UniswapV3Market.fetchPricePoint()
line 120/121 performs unnecessary castings from uint
to uint256
whice are the same.
These castings increase gas costs.
Manual code review.
Remove these unnecessary castings.
🌟 Selected for report: pants
Also found by: harleythedog
0.0072 ETH - $33.42
pants
These state variables can be immutable
s since they are only set once, at the constructor:
OverlayV1OI.compoundingPeriod
OverlayV1OI.compounded
Reading from immutable state variables is much cheaper than from regular state variables.
https://blog.soliditylang.org/2020/05/13/immutable-keyword/
Manual code review.
Define these state variables as immutable
s.
#0 - mikeyrf
2021-12-08T21:28:32Z
sponsor disputed reason - compounded
is used in L159 of OverlayV1Market.sol
when funding is paid, so shouldn't be immutable.
#1 - dmvt
2021-12-20T20:46:56Z
This report is still valid for OverlayV1OI.compoundingPeriod
pants
These functions contain require statement with messages longer than 32 bytes, meaning they cant get into bytes32 which will save gas:
OverlayTokenNew._approve()
line 403, 404When transactions revert, the require will be forced to use bytes instead of bytes32 and will waste more gas.
Manual code review.
Reduce the message by a few letters to fit it into 32 chars.
#0 - mikeyrf
2021-12-07T15:28:58Z
duplicate #65
🌟 Selected for report: pants
0.0161 ETH - $74.28
pants
OverlayToken.sol line 131/180/254: the require comes after the _transfer function, there is no reason for it to be after the function. If the require is placed before the _transfer it will save gas if the require will fail.
Manual code review.
place the _transfer after the require