Escrow.confirmReciept()
reads token balance of a contract which can just be accessed by reading the immutable variable i_price to save gas.
It is assumed that the escrow contract will have a fixed balance of i_price
, so instead of reading the global variable to get the contract balance we can just use i_price
and save the extra gas cost.
This reads can cost around 800 gas so it is recommended to use i_price.
manual review
change this line
i_tokenContract.safeTransfer(i_seller, i_tokenContract.balanceOf(address(this)));
with this line
i_tokenContract.safeTransfer(i_seller, i_price);
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.