40,000 USDC
View results
Submission Details
Severity: gas

[GAS-01]Use getPrice() instead of balanceOf()

Summary

In the resolveDispute() you can prevent do a external call for get de balance token of the contract.

Vulnerability Details

How the buyer sets the price and is the one who pays when it is created. The value does not change. So, you can get the value of tokenBalance using the local function getPrice().

Impact

Optimization gas, impact is low.

Tools Used

Manual code review

Recommendations

Change the code:

Line 110/ Escrow.sol

-uint256 tokenBalance = i_tokenContract.balanceOf(address(this));
+uint256 tokenBalance = getPrice();

Support

FAQs

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