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

Modifiers used only once can be inlined

Summary

Modifiers used only once and not inherited can be inlined to save gas.

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

The above modifier is only being called on Line 94

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

The above modifier is only being called on Line 102

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

The above modifier is only being called on Line 109

Support

FAQs

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