The checkUpkeep and performUpkeep functions in the CommunityVCS contract have inconsistent conditions for determining whether new vaults should be deployed. This inconsistency can cause the system to fail to deploy new vaults when needed, affecting the functionality of the vault management strategy.
The functions checkUpkeep and performUpkeep are responsible for checking if the conditions are met to deploy a new batch of vaults and performing the deployment, respectively.
Issue in checkUpkeep:
The function checks if the number of non-full vaults is below the deployment threshold:
This condition returns true when the number of non-full vaults is less than the vaultDeploymentThreshold, indicating that a new batch of vaults should be deployed.
Issue in performUpkeep:
The function checks if the number of non-full vaults is greater than or equal to the deployment threshold:
If this condition is met, the function reverts, preventing the deployment of new vaults.
The logic in performUpkeep contradicts the intended condition in checkUpkeep, leading to a situation where even when checkUpkeep indicates that new vaults should be deployed, performUpkeep might revert the transaction, thus failing to deploy the new vaults.
The inconsistency between the checkUpkeep and performUpkeep functions can cause the vault management strategy to malfunction:
New vaults may not be deployed even when they are required, leading to potential operational issues in managing staking deposits and rewards.
The system's ability to scale and accommodate new deposits could be significantly affected, potentially causing missed opportunities for staking or rewards.
The intended automatic upkeep mechanism may fail, requiring manual intervention to deploy vaults.
Manual code review
Align the conditions in checkUpkeep and performUpkeep to ensure consistent logic. For example:
Update the condition in performUpkeep to match the logic in checkUpkeep:
This change will make sure that both functions correctly determine when new vaults should be deployed.
Add unit tests to cover the deployment logic, ensuring that both functions work together to trigger vault deployment as expected.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.