Instead of calling tokenToTransfer.balanceOf(address(this)) within the loop for each token, we can call it once per token, store it in a local variable, and then use the variable for the transfer. This reduces the number of external calls to the token contract.
Also if the balance is zero, we can skip the transfer call altogether, 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.