Open code423n4 opened 3 years ago
shw
The watsonsSherxWeight cannot be set to the maximum once it is set to another value since the setWeights function only changes the watsonsSherxWeight variable when _watsons is not the maximum.
watsonsSherxWeight
setWeights
_watsons
Referenced code: SherX.sol#L217-L222
Consider removing the if condition at line 217, or add a new boolean parameter to indicate that whether the watsonsSherxWeight needs to be set or not.
if
The maximum is uint16(-1) not uint256(-1)
uint16(-1)
uint256(-1)
per sponsor comment, invalid
Handle
shw
Vulnerability details
Impact
The
watsonsSherxWeight
cannot be set to the maximum once it is set to another value since thesetWeights
function only changes thewatsonsSherxWeight
variable when_watsons
is not the maximum.Proof of Concept
Referenced code: SherX.sol#L217-L222
Recommended Mitigation Steps
Consider removing the
if
condition at line 217, or add a new boolean parameter to indicate that whether thewatsonsSherxWeight
needs to be set or not.