40,000 USDC
View results
Submission Details
Severity: high

Incorrect modifier

Summary

In escrow.sol, the following code will not work as expected

/// @dev Throws if called by any account other than buyer or seller.
modifier onlyBuyerOrSeller() {
if (msg.sender != i_buyer && msg.sender != i_seller) {
revert Escrow__OnlyBuyerOrSeller();
}
_;
}

Vulnerability Details

When for instance a valid seller tries to initiate a dispute, he will not be able to so successfully

Impact

The seller cannot initiate dispute and buyer can refuse to pay for work done.

Tools Used

Manual review

Recommendations

The following can be used

/// @dev Throws if called by any account other than buyer or seller.
modifier onlyBuyerOrSeller() {
if (msg.sender != i_buyer || msg.sender != i_seller) {
revert Escrow__OnlyBuyerOrSeller();
}
_;
}

Support

FAQs

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