40,000 USDC
View results
Submission Details
Severity: gas
Valid

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

Summary

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

In the extremely unlikely scenario where the total funds that arrived in the Escrow contract's address when transferred by the buyer, is LESS than what the buyer sent, i.e. tokenContract.balanceOf(address(this)) < price, for whatever reason, then the above if statement will revert and no Escrow contract will be created, as intended.

All good, but see my recommendation.

Vulnerability Details

n/a

Impact

Frustration.

Tools Used

VSC, manual.

Recommendations

However, maybe just my noobness but it's my suggestion to have some solution implemented that would eliminate this highly unlikely potential risk of reverting and temporarily DoS-ing buyer's attempt to create escrow contract, by ensuring that the price amount of tokens the buyer transfers to the Escrow contract's address is exactly what will arrive there, always.

Additionally, which tokens/token contracts may contribute to this potential "risk" of causing less tokens to arrive than what was sent?

Support

FAQs

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