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

Escrow__FeeExceedsPrice has an incorrect check

Summary

In IEscrow.sol, the Escrow__FeeExceedsPrice error indicates that the Fee exceeds the price. Yet in Escrow.sol, it checks if the fee exceeds or equals the price.

Impact

A user who sets the arbiter fee as equal to the price for whatever reason would not be able to.

Tools Used

Foundry

Recommendations

Replace the following line in Escrow.sol:

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

with:

if (arbiterFee > price) revert Escrow__FeeExceedsPrice(price, arbiterFee);

This will also save 25 gas during deployments.

If the check is intended as is, then this should be considered an INFO level finding, and the Escrow__FeeExceedsPrice error should be renamed to Escrow__FeeExceedsOrIsEqualToPrice.

Support

FAQs

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