code-423n4 / 2021-11-nested-findings

1 stars 1 forks source link

Cant remove the first operator #200

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

function removeOperator has this check:

  (i > 0, "NestedFactory::removeOperator: Cant remove non-existent operator");

However, 0 is actually a valid index of the array. It represents the first operator.

Recommended Mitigation Steps

A potential solution is to use the EnumerableSet to manage the operators: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol

maximebrugel commented 2 years ago

Duplicated : #58

alcueca commented 2 years ago

Duplicate of #220