Platform: Code4rena
Start Date: 09/09/2021
Pot Size: $100,000 SUSHI
Total HM: 4
Participants: 11
Period: 7 days
Judge: ghoulsol
Total Solo HM: 3
Id: 28
League: ETH
Rank: 10/11
Findings: 2
Award: $821.53
🌟 Selected for report: 3
🚀 Solo Findings: 0
itsmeSTYJ
If numerator is less than denominator when calculating priceDrop, it will return 0 since Solidity cannot express decimals i.e. the price drop intervals are too small.
If numerator is < denominator, the division will round down to 0.
A simple example:
In order for this to go to 0, I just need to have auction duration longer than 500000 seconds or 5.8 days.
#0 - Clearwood
2021-09-23T03:46:41Z
Duplicate of #108
🌟 Selected for report: itsmeSTYJ
13.8408 SUSHI - $138.82
itsmeSTYJ
No impact, just gas optimization.
launcherInfo.liquidityAdded
is only assigned in the finalize()
function. On line 258, there is no need to add liquidity
to the original value of liquidityAdded
because liquidityAdded
will always be 0 since you can only call finalize()
once.
You can save a bit of gas simply by assigning it instead of adding first then assigning it i.e.
... launcherInfo.liquidityAdded = BoringMath.to128(liquidity); ...
🌟 Selected for report: itsmeSTYJ
13.8408 SUSHI - $138.82
itsmeSTYJ
No impact, just a redundant parameter which might lead to wasted gas if the function is accidentally called wrongly.
deprecateFactory()
accepts a _newAddress
parameter that has to be the zero address or the function call will fail. This parameter is redundant.
🌟 Selected for report: itsmeSTYJ
13.8408 SUSHI - $138.82
itsmeSTYJ
Gas optimization
The require statement on line 201 in the PostAuctionLauncher.sol contract is redundant because: