40,000 USDC
View results
Submission Details
Severity: gas

Ordering Check's Gas Consumption

Summary

Ordering the checks in low to high gas cost and probability of fail we can save some gas

Recommendations

if (buyer == address(0)) revert Escrow__BuyerZeroAddress(); (12 gas)

if (seller == address(0)) revert Escrow__SellerZeroAddress(); (12 gas)

if (address(tokenContract) == address(0)) revert Escrow__TokenZeroAddress(); (16 gas)

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

if (arbiterFee >= price) revert Escrow__FeeExceedsPrice(price, arbiterFee); (40 gas)

Tools Used

Foudnry test suit

Support

FAQs

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