Submitted by sseefried, also found by shenwilly
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VeTokenMinter.sol#L36-L38
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VeTokenMinter.sol#L41-L4
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/Booster.sol#L598-L614
The totalWeight state variable of the VeTokenMinter contract is used to work out the amount of veAsset earned when the Booster.rewardClaimed function is called.
However, while totalWeight is modified inside the VeTokenMinter contract when function updateveAssetWeight is called, the totalWeight is not similarly reduced when function removeOperator is called.
The impact is that remaining operators do not receive a fair share of the total rewards and a portion of the rewards are not given out at all.
The totalWeight is now 10.
This means that Operator 1 receives 90% of the amount while Operator 2 receives 10%.
If we then call removeOperator on Operator 1 then 90% of the reward is no longer minted and distributed. This is unfair to the remaining operators.
The can be seen on lines 607 - 608 of the Booster contract. Function rewardClaimed will never be called for (removed) Operator 1. But for Operator 2 they will still receive 10% of the rewards even though Operator 1 is no longer registered in the system.
The totalWeight should be reduced so that the remaining operators receive a fair share of the total rewards.
Using just method calls from VeTokenMinter one could rectify this situation by
However, the removeOperator function should just be rewritten to be as follows:
You might also want to modify addOperator so that a weight can be provided as an extra argument. This saves having to call addOperator and then updateveAssetWeight which could save on gas.
solvetony (veToken Finance) disagreed with severity and commented:
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
