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: 26/27
Findings: 1
Award: $18.83
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: hyh
Also found by: MaCree, elprofesor, fatima_naz, gpersoon, gzeon, loop, palina, pauliax, pmerkleplant, xYrYuYx, ye0lde
MaCree
Detailed description of the impact of this finding. when tthere is only one operator in operators array , the removeOperator function not work. If sth is wrong with the last operator, you could not remove it.
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept. https://github.com/code-423n4/2021-11-nested/blob/5d113967cdf7c9ee29802e1ecb176c656386fe9b/contracts/NestedFactory.sol#L79 function removeOperator(bytes32 operator) external override onlyOwner{ uint256 i = 0; while (operators[i] != operator) { i++; } require(i > 0, "NestedFactory::removeOperator: Cant remove non-existent operator"); delete operators[i]; }
eyes and brain, lol.
refactor the code, it is easy.
#0 - maximebrugel
2021-11-16T11:28:14Z
Duplicated : #58
#1 - alcueca
2021-12-03T11:17:43Z
Using #220 instead