Balance should be checked to avoid unnecessary safeTransfer() calls
This vulnerability is related to the unnecessary transfer of tokens when there is no balance left in the contract. In lines 163 to 164, the _commissionTransfer()
function is called to transfer the remaining balance (if any) to the STADIUM_ADDRESS
. However, there is no check to ensure that the contract actually has a balance before making this transfer. This could lead to unnecessary safeTransfer()
calls when the balance is zero, wasting gas in the process. It's recommended to add a balance check before calling the _commissionTransfer()
function to avoid this unnecessary operation.
Manual
To resolve this issue, you should add a balance check before calling the _commissionTransfer()
function. This will ensure that the safeTransfer()
function is only called when there is a balance to transfer, thus saving gas.
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.