Skip to content

Commit

Permalink
fix: add weight require (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximebrugel committed Feb 16, 2022
1 parent 720b450 commit e82319e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contracts/FeeSplitter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ contract FeeSplitter is Ownable, ReentrancyGuard {
/// @param _accountIndex Account to change the weight of
/// @param _weight The new weight
function updateShareholder(uint256 _accountIndex, uint96 _weight) external onlyOwner {
require(_weight != 0, "FS: INVALID_WEIGHT");
require(_accountIndex < shareholders.length, "FS: INVALID_ACCOUNT_INDEX");
totalWeights = totalWeights + _weight - shareholders[_accountIndex].weight;
require(totalWeights != 0, "FS: TOTAL_WEIGHTS_ZERO");
Expand Down

0 comments on commit e82319e

Please sign in to comment.