Open code423n4 opened 2 years ago
GreyArt
It is possible for duplicate shareholders to be added. These shareholders will get more than intended when _sendFee() is called.
_sendFee()
Ensure that the _accounts array is sorted in setShareholders().
_accounts
setShareholders()
for (uint256 i = 0; i < _accounts.length; i++) { if (i > 0) { require(_accounts[i - 1] < _accounts[i], "FeeSplitter: ACCOUNTS_NOT_SORTED"); } _addShareholder(_accounts[i], _weights[i]); }
Duplicate #231
Indeed there is a fix to do here, we'll prevent adding the same shareholders instead as suggested in #231
Taking this issue as the principal, and raising #231 to medium severity.
Handle
GreyArt
Vulnerability details
Impact
It is possible for duplicate shareholders to be added. These shareholders will get more than intended when
_sendFee()
is called.Recommended Mitigation Steps
Ensure that the
_accounts
array is sorted insetShareholders()
.