Platform: Code4rena
Start Date: 11/11/2021
Pot Size: $50,000 USDC
Total HM: 9
Participants: 27
Period: 7 days
Judge: alcueca
Total Solo HM: 5
Id: 53
League: ETH
Rank: 22/27
Findings: 2
Award: $152.67
🌟 Selected for report: 2
🚀 Solo Findings: 0
🌟 Selected for report: hyh
Also found by: MaCree, elprofesor, fatima_naz, gpersoon, gzeon, loop, palina, pauliax, pmerkleplant, xYrYuYx, ye0lde
pmerkleplant
The function removeOperator
in NestedFacotry.sol
requires that the operator
to remove has an index greater than 0, see line 84.
This disabled the functionality of removing the operator at index 0, i.e. the first added operator.
Remove the require
statement.
#0 - maximebrugel
2021-11-16T11:28:46Z
Duplicated : #58
#1 - alcueca
2021-12-03T11:17:12Z
Using #220 instead
🌟 Selected for report: pmerkleplant
106.015 USDC - $106.02
pmerkleplant
Function getAmountDue
in FeeSplitter.sol
defines the variable
totalReceived
in line 83 eventhough it is already known if the variable is
even necessary.
The variable is uneccessary if _tokenRecords.totalShares == 0
.
Not declaring it, if not necessary, saves gas.
Rewrite the function to something like:
TokenRecords storage _tokenRecords = tokenRecords[address(_token)]; if (_tokenRecords.totalShares == 0) return 0; uint256 totalReceived = _tokenRecords.totalReleased + _token.balanceOf(address(this)); // Rest same as before
🌟 Selected for report: pmerkleplant
13.9113 USDC - $13.91
pmerkleplant
Function triggerForToken
in NestedBuybacker.sol
makes a balanceOf
call on
the _sellToken
, see line 100.
However, the result of the call is never used.
It would save gas to remove the unnecessary call and variable declaration.
🌟 Selected for report: ye0lde
Also found by: PierrickGT, WatchPug, hack3r-0m, pmerkleplant
13.9113 USDC - $13.91
pmerkleplant
Function _submitOrder
in NestedFactory.sol
saves two return values of a
call in variables, see line 379.
However, the variable tokens
is never used, and removing it would save gas.
#0 - alcueca
2021-12-03T09:56:52Z
Duplicate of #195