Platform: Code4rena
Start Date: 04/05/2022
Pot Size: $50,000 DAI
Total HM: 24
Participants: 71
Period: 5 days
Judge: Justin Goro
Total Solo HM: 14
Id: 119
League: ETH
Rank: 51/71
Findings: 2
Award: $108.38
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: MaratCerby
Also found by: 0x1337, 0x52, 0xYamiDancho, AuditsAreUS, CertoraInc, Dravee, GimelSec, IllIllI, PPrieditis, Ruhum, TrungOre, VAD37, berndartmueller, cccz, csanuragjain, defsec, hickuphh3, horsefacts, hyh, jayjonah8, kenzo, leastwood, mtz, p4st13r4, reassor, throttle, wuwe1, ych18
3.1753 DAI - $3.18
https://github.com/code-423n4/2022-05-factorydao/blob/main/contracts/MerkleDropFactory.sol#L107
This issue is omnipresented in the project:
Although the ERC20 standard suggests that a transfer should return true on success, many tokens are non-compliant in this regard (including high profile, like USDT) . In that case, the transfer()/transferFrom() call will revert even if the transfer is successful, because solidity will check that the RETURNDATASIZE matches the ERC20 interface.
Recommendation: Consider using OpenZeppelin’s SafeERC20.
#0 - illuzen
2022-05-10T15:31:36Z
#1 - gititGoro
2022-06-14T01:55:38Z
Changing severity due pool isolation, rewards tokens represent leakage not lost funds and because transfer of deposited funds would fail on deposit.
https://github.com/code-423n4/2022-05-factorydao/blob/main/contracts/PermissionlessBasicPoolFactory.sol#L169 https://github.com/code-423n4/2022-05-factorydao/blob/main/contracts/PermissionlessBasicPoolFactory.sol#L282
decimals != 18
(including high profile, like USDC where decimals = 6). getMaximumRewards()
and getRewards()
functions would not calculate the right amount of these tokens because these functions divide the amount of token by 1e18
whereas the tokens with decimals==6
should be divided by 1e6
Recommendation: divide the wei amount of token by 1/e(token.decimals())
to have the correct amount of token.
#0 - illuzen
2022-05-10T15:31:19Z
#1 - gititGoro
2022-06-14T03:16:06Z
#2 - gititGoro
2022-06-14T03:16:37Z
Reducing severity as rewards do not constitute user deposits