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

A modifier used only once and not being inherited should be inlined to save gas

Vulnerability Details

File: src/Escrow.sol
58 modifier onlyBuyer() {
59 if (msg.sender != i_buyer) {
60 revert Escrow__OnlyBuyer();
61 }
62 _;
63: }

Escrow.sol#L58-L63
The above modifier is only being called on Line 94.

66 modifier onlyBuyerOrSeller() {
67 if (msg.sender != i_buyer && msg.sender != i_seller) {
68 revert Escrow__OnlyBuyerOrSeller();
69 }
70 _;
71: }

Escrow.sol#L66-L71
The above modifier is only being called on Line 102.

74 modifier onlyArbiter() {
75 if (msg.sender != i_arbiter) {
76 revert Escrow__OnlyArbiter();
77 }
78 _;
79: }

Escrow.sol#L74-L79
The above modifier is only being called on Line 109

Tools Used

VSCode

Support

FAQs

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

Give us feedback!