withdrawPlatformFees
withdraws fees for generators and validators too, preventing them from claiming the fees in the future.
Even thought withdrawPlatformFees
has onlyOwner
on it, the function is hardcoded to extract too much tokens from the contract, meaning that even under normal use (not malicious) the function would misbehave and extract all of the fee tokens.
That is dangerous as it will transfer always some tokens that have been allocated to generators and validators when they have executed their jobs.
The main issue happens as we only approve feeToken
to be taken away from the validator, but call feeToken.balanceOf(address(this))
inside withdrawPlatformFees
.
Contract will lack the funds to pay it's users - aka. loss of funds
Manual review
Have a variable to track platform fees and transfer only it's amount inside withdrawPlatformFees
.
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.