60592 sc high users are unable to unstake under certain conditions
Description
Brief/Intro
Vulnerability Details
function unstake(
uint256 _tokenId
) external whenNotPaused onlyTokenOwner(_tokenId) nonReentrant {
StargateStorage storage $ = _getStargateStorage();
Delegation memory delegation = _getDelegationDetails($, _tokenId);
DataTypes.Token memory token = $.stargateNFTContract.getToken(_tokenId);
// ...
// if the delegation is pending or the validator is exited or unknown
// decrease the effective stake of the previous validator
if (
currentValidatorStatus == VALIDATOR_STATUS_EXITED ||
delegation.status == DelegationStatus.PENDING
) {
// get the completed periods of the previous validator
(, , , uint32 oldCompletedPeriods) = $
.protocolStakerContract
.getValidationPeriodDetails(delegation.validator);
// decrease the effective stake of the previous validator
_updatePeriodEffectiveStake(
$,
delegation.validator,
_tokenId,
oldCompletedPeriods + 2,
false // decrease
);
}
// ...
}Impact Details
References
Proof of Concept
Proof of Concept
Previous60593 sc low no mechanism to set boostpriceperblock for levels added after initializationNext60586 sc high incorrect double reduction of effective stake in stargate sol
Was this helpful?