40,000 USDC
View results
Submission Details
Severity: gas

Additional tokens sent to the Escrow contract are sent to buyer

Summary

The Escrow.sol smart contract does not prevent the receipt of more tokens than the established price for a given transaction, which can cause the seller to receive the exceeding funds from the Escrow.

Vulnerability Details

In Escrow.sol:44, the smart contract does not prevent overpayment, allowing the contract to receive more tokens than the agreed-upon price. In case the confirmReceipt function is called by the buyer, it will transfer the entire balance of the contract to the seller. Therefore, if the contract's balance at this point is greater than the established transaction price, the seller will receive more than they should.

if (tokenContract.balanceOf(address(this)) < price)
revert Escrow__MustDeployWithTokenBalance();
i_price = price;

Impact

Informational. In case the Escrow contract receives more tokens than the agreed-upon price, the seller will receive more tokens than was originally agreed upon.

Tools Used

Manual Review

Recommendations

To mitigate this vulnerability, it is suggested to enforce stricter checks on the escrow contract's balance. The exceeding funds can be sent to the arbiter. Alternatively, proper documentation should be included on the contract to alert users of the current behavior.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.