Platform: Code4rena
Start Date: 10/03/2022
Pot Size: $75,000 USDT
Total HM: 25
Participants: 54
Period: 7 days
Judge: pauliax
Total Solo HM: 10
Id: 97
League: ETH
Rank: 44/54
Findings: 2
Award: $178.67
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: hickuphh3
Also found by: 0v3rf10w, 0x1f8b, 0xDjango, 0xNazgul, 0xngndev, 0xwags, Cantor_Dust, CertoraInc, Dravee, IllIllI, PPrieditis, Ruhum, TerrierLover, WatchPug, XDms, benk10, berndartmueller, bitbopper, catchup, cmichel, cryptphi, csanuragjain, danb, defsec, gzeon, hagrid, hubble, jayjonah8, kenta, kyliek, minhquanym, rfa, robee, saian, samruna, throttle, ye0lde, z3s
118.9444 USDT - $118.94
missing zero checks in initialize
for liquidityFarming.sol but present in initialize
for LiquidityPool.sol
missing zero checks in for baseToken
in function _sendRewardsForNft
in LiquidityFarming.sol
spelling error in calculate
below
whiteListPeriodManager.beforeLiquidityRemoval(_msgSender(), _tokenAddress, _amount) // Claculate how much shares represent input amount uint256 lpSharesForInputAmount = _amount * getTokenPriceInLPShares(_tokenAddress);
LiqduidityProviders.sol #L357
🌟 Selected for report: Dravee
Also found by: 0v3rf10w, 0x1f8b, 0xDjango, 0xNazgul, 0xngndev, 0xwags, Cantor_Dust, CertoraInc, IllIllI, Jujic, Kenshin, Kiep, PPrieditis, TerrierLover, Tomio, WatchPug, antonttc, benk10, berndartmueller, bitbopper, csanuragjain, defsec, gzeon, hagrid, hickuphh3, kenta, minhquanym, oyc_109, pedroais, peritoflores, rfa, robee, saian, samruna, sirhashalot, throttle, wuwe1, z3s
59.7296 USDT - $59.73
change solidity version to a better version 0.8.10 to get various improvements available in the compiler
declare functions external to save gas
use custom strings or errors, instead of long revert strings
instead of conditional statements && in single require() in liquiditpool.sol L#156, using double require check can save more gas
replace > with != for unsigned integers e.g. LiquidityFarming.sol #L322, LiquidityProviders.sol #L182,#L239, #L283, #L410
prefer uint256 for gas savings instead of uint8, uint128 below LiquidityPool.sol #L32 and #L119
use of unchecked similar to ( Liquidityfarming.sol ,LiquidityProviders.sol #L217 ) in LiquidityPool.sol and others It not only checks for potential overflow but also saves gas.
Booleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot's contents, replace the bits taken up by the boolean, and then write back. This is the compiler's defense against contract upgrades and pointer aliasing, and it cannot be disabled
#0 - pauliax
2022-05-09T08:37:24Z
Very abstract recommendations, no exact improvements mentioned.