When buyer calls confirmReceipt
function, he transfer all of the token inside the contract to the Seller.
There are two instances of it:
No checks are done to make sure that Seller would get only price that is set inside i_price
variable.
In resolveDispute
function
If some tokens are transferred to the contract mistakenly, then the seller would get all of the amount inside the contract.
Here is the link to test that proofs it:
test 1
: test 1 for confirmReceipt
test 2
: test 2 for resolveDispute
foundry tests
Instead of sending all tokens to the seller, send only i_price
amount. Rest of the token should be transferred back to the buyer or any other address that fits the situation.
Here is the example:
Here is the test:
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.