The claimRewards function in the CommunityVCS contract is not correctly handling the _minRewards parameter, leading to incorrect reward claims. This results in a discrepancy between the expected and actual token balances after claiming rewards.
The claimRewards function is designed to claim rewards from specified vaults if the rewards meet or exceed a minimum threshold (_minRewards). However, the function does not correctly check the actual rewards claimed from each vault, leading to incorrect reward claims. Specifically, rewards from vaults that do not meet the _minRewards threshold are still being included in the total claimed rewards.
Copy this POC to the exciting test: test/linkStaking/community-vcs.test.ts
Output
The test case demonstrates that the claimRewards function incorrectly includes rewards from vaults that do not meet the _minRewards threshold. Specifically, the balance after claiming rewards greater than _minRewards is expected to be 25, but the actual balance is 35, indicating that rewards from vault 7 (which should not be included) are being incorrectly claimed.
The incorrect handling of the _minRewards parameter in the claimRewards function can lead to over-claiming of rewards, resulting in discrepancies in the expected and actual token balances. This can affect the integrity of the reward distribution mechanism and potentially lead to financial losses. Given the potential for financial discrepancies and the impact on the reward distribution mechanism, the severity of this finding is medium.
Hardhat
Check Actual Rewards Claimed: Update the claimRewards function to correctly check the actual rewards claimed from each vault. Ensure that only rewards meeting or exceeding the _minRewards threshold are claimed.
Access Control: Consider adding access control to the claimRewards function to restrict who can call this function. This can prevent unauthorized users from attempting to claim rewards.
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.