49919 sc insight unstake function does not unstake all as mentioned in the natspec
Description
Summary
Vulnerability Details
function unstake(uint16 validatorId, uint256 amount) external returns (uint256 amountUnstaked) {
@> if (amount == 0) {
@> revert InvalidAmount(0);
@> }
return _unstake(validatorId, amount);
}
/**
* @notice Internal logic for unstaking, handles moving stake to cooling or parked.
* @param validatorId ID of the validator to unstake from.
@> * @param amount The amount of PLUME to unstake. If 0, unstakes all.
* @return amountToUnstake The actual amount that was unstaked.
*/
function _unstake(uint16 validatorId, uint256 amount) internal returns (uint256 amountToUnstake) {
...
// Validate unstaking conditions
_validateValidatorForUnstaking(validatorId);
@> if (amount == 0) {
@> revert InvalidAmount(amount);
@> }
...
}Impact
Recommendation
Proof of Concept
1
2
3
Previous50461 sc insight incorrect deposit event receiver logged in bridge functions of dexaggregatorwrapperwithpredicateproxy sol Next50450 sc high logic error in streak validation causes legitimate jackpot wins to be denied violating reward contract expectations
Was this helpful?