Multiple calls of token balance wastes gas
Calling the token balance function multiple times in the code is not advised as it wastes gas used for external calls. This could also be more severe if a transfer to the buyer or arbiter fails without the checks, all the remaining token balance will be sent to the seller, making the buyer/arbiter lose funds completely and irreversibly.
External calls should be as minimum as possible to avoid gas wastage and calculations should be done for remaining value instead of external calls
Remix, VsCode
Instead of calling the balance again, subtract the totalFee from the initial tokenBalance as the remainingBalance and replace the second tokenBalance with the new remainingBalance.
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.