Cyfrin / 2023-07-escrow

16 stars 12 forks source link

Custom error has no parameters #864

Closed codehawks-bot closed 1 year ago

codehawks-bot commented 1 year ago

Custom error has no parameters

Severity

Gas Optimization / Informational

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-escrow/tree/main/src/IEscrow.sol

https://github.com/Cyfrin/2023-07-escrow/tree/main/src/IEscrowFactory.sol

Summary

Custom error has no parameters

Vulnerability Details

Consider adding some parameters to the error describing the cause of the error

Instances (9):

File: src/IEscrow.sol

9:     error Escrow__OnlyBuyer();

10:     error Escrow__OnlyBuyerOrSeller();

11:     error Escrow__OnlyArbiter();

13:     error Escrow__MustDeployWithTokenBalance();

15:     error Escrow__DisputeRequiresArbiter();

16:     error Escrow__TokenZeroAddress();

17:     error Escrow__BuyerZeroAddress();

18:     error Escrow__SellerZeroAddress();

Link to code - https://github.com/Cyfrin/2023-07-escrow/tree/main/src/IEscrow.sol

File: src/IEscrowFactory.sol

8:     error EscrowFactory__AddressesDiffer();

Link to code - https://github.com/Cyfrin/2023-07-escrow/tree/main/src/IEscrowFactory.sol

Tools Used

Manual Code Review

Recommendations

Add parameters to the error which describe the cause

PatrickAlphaC commented 1 year ago

Intended