Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: medium
Invalid

Wrong check in `OperatorVCS.sol::queueVaultRemoval` lead to break functionality and never gona execute that function.

Summary

https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/linkStaking/OperatorVCS.sol#L276-L298

Vulnerability Details

`Vault.sol::isRemoved` function return constant false value, this function is in `OperatorVCS.ol::queueVaultRemoval` in the following way in if statements `if (!IVault(vault).isRemoved()) revert OperatorNotRemoved();` which mean that if will always be true and revert the function. this will lead to break the function usage.

Impact

break the functionality of contract and function, user will not be able to queue a vault for remove.

Tools Used

VS code

Recommendations

remove the if statements.

```solidity

function queueVaultRemoval(uint256 _index) external {

address vault = address(vaults[_index]);

-- if (!IVault(vault).isRemoved()) revert OperatorNotRemoved();

for (uint256 i = 0; i < vaultsToRemove.length; ++i) {

if (vaultsToRemove[i] == vault) revert VaultRemovalAlreadyQueued();

}

vaultsToRemove.push(address(vaults[_index]));

// update group accounting if vault is part of a group

if (_index < globalVaultState.depositIndex) {

uint256 group = _index % globalVaultState.numVaultGroups;

uint256[] memory groups = new uint256[](1);

groups[0] = group;

fundFlowController.updateOperatorVaultGroupAccounting(groups);

// if possiible, remove vault right away

if (vaults[_index].claimPeriodActive()) {

removeVault(vaultsToRemove.length - 1);

}

}

}

```

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

aua_oo7 Submitter
10 months ago
inallhonesty Lead Judge
10 months ago
inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.