One additional (SLOAD
operation = 100 gas) + (staticcall = minimum 100 gas) = Minimum 200 gas can be saved in resolveDispute
In resolveDispute
function token balance is fetched twice on line 110 and 125.
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L110
On line 125, it's fetched to get the remaining token balance of the contract and then transfer it to the seller. The same can be achieved via uint tokenToTransfer = tokenBalance - (buyerAward + i_arbiterFee)
without invoking staticcall or sload
Minimum of 200 gas can be saved
Manual Review
Use uint tokenToTransfer = tokenBalance - (buyerAward + i_arbiterFee)
to get the remaining balance
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.