The collectProtocolRevenue
function in the provided Solidity code does not check the amount of tokens left in the contract before making a withdrawal. This oversight can lead to failed transactions and potential loss of funds.
Function: collectProtocolRevenue
Issue: The function does not verify the contract’s token balance before attempting to transfer the protocol revenue. If the contract’s balance is insufficient, the transfer will fail.
}
Failed Transactions: If the contract does not have enough tokens to cover the revenue
amount, the transfer will fail, leading to failed transactions.
manual review
Add a check to verify that the contract has sufficient tokens to cover the revenue
amount before attempting the transfer.
}
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.