It is not possible to collect platform fees without inadvertently stealing token capital owed to protocol users.
The LLMOracleCoordinator exports a function which enables the protocol owner to collect due revenue accrued from request fees and failed consensus outliers:
First, note that this function will unconditionally withdraw all feeTokens from the contract.
This implementation is problematic, since alongside withdrawing the owner's due feeTokens, this will also withdraw all tokens on the contract which are reserved for users:
Notice that
_increaseAllowance(used for issuing rewards and refunds to protocol participants) also deals infeeToken.
As shown via the calls to _increaseAllowance, the LLMOracleCoordinator works explicitly using token approvals to protocol users when distributing rewards. These users are given the right to spend their due token allowance from the contract, but the tokens themselves are not actually pushed; this is done at the user's convenience.
Consequently, it is unavoidable that any tokens approved for protocols users thaat remain on the contract will be inadvertently withdrawn during a call to withdrawPlatformFees. It is not possible for the owner to collect their due revenue in any capacity without risking interference with user distribution.
Either the protocol is left unable to accrue their due fees (to avoid service disruption), or the inadvertent theft of user rewards (which would need to be manually indxed and redistributed by the protocol owner).
Manual Review
There are two possible remediations:
The least invasive fix would be to allow the owner to specify an amount to withdraw when calling withdrawPlatformFees. This would at least allow the contract owner to specify the correct number of tokens to withdraw from the contract without inadvertently collecting user tokens.
Use internal accounting for accrued protocol fees and only withdraw these.
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.