Use i_price
instead of i_tokenContract.balanceOf(address(this)
In Escrow.sol::confirmReceipt()
method, the seller is sent tokens, and the amount of tokens is i_tokenContract.balanceOf(address(this))
.
The seller is only supposed to receive i_price
at most, and by using i_tokenContract.balanceOf(address(this)
, the amount of tokens being sent could exceed i_price
. This could happen if multiple attempts were made to create the Escrow contract using the same salt which could have pre-funded the account with tokens.
The seller might get overpaid if the contract has more token balance than i_price
Marking this as medium as both the following medium criteria satisfy:
Funds are indirectly at risk
Disruption of protocol functionality or availability
Source: https://docs.codehawks.com/rewards-and-judging
Manual inspection
Use i_price
instead of i_tokenContract.balanceOf(address(this)
when transferring funds to the seller
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.