Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Valid

Risk of Insufficient Rewards for Oracles and Validators Due to Unrestricted Withdrawals

Summary

In the LLMOracleCoordinator contract, calling withdrawPlatformFees allows the owner to withdraw all of the contract’s balance, including funds that may be needed to cover the allowances promised to oracles and validators. This unrestricted withdrawal function could deplete the contract's balance, preventing oracles and validators from accessing their rewards despite their allowances. Given the importance of reward distribution to incentivize participation, this could lead to dissatisfaction among oracles and validators and a loss of trust in the platform.

Vulnerability Details

The LLMOracleCoordinator contract allows oracles and validators to earn rewards in ERC20 tokens by completing and validating tasks. Upon task completion, _increaseAllowance sets an allowance for each oracle and validator, allowing them to withdraw their respective rewards. However, the withdrawPlatformFees function does not account for these outstanding allowances and permits the owner to withdraw the full contract balance, including funds intended for oracle and validator rewards. This lack of control over available funds could result in a scenario where the contract is left with insufficient funds to honor oracle and validator allowances.

Example Scenario:

Initial Setup:
An oracle completes a task and earns a reward, with _increaseAllowance granting them an allowance to withdraw the reward from the contract.

Execution:
The owner calls withdrawPlatformFees, withdrawing all funds in the contract without considering the oracle's allowance.

Outcome:
The contract has insufficient funds, preventing the oracle from withdrawing their reward despite their allowance.

Impact

Unpaid Rewards for Oracles and Validators: The lack of funds due to the full withdrawal depletes the rewards, which are critical for incentivizing oracle and validator participation.

Tools Used

Manual Review

Recommendations

To ensure that funds allocated for oracle and validator rewards remain available, modify the withdrawPlatformFees function to not allow accidental depletion of funds earmarked for task rewards, ensuring that oracles and validators can reliably access their earned compensation.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

`withdrawPlatformFees` withdraws the entire balance

Support

FAQs

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