Skip to content

[A02-2] [LOW] Six unused errors declared in ErrFlow.sol #274

@thedavidmeister

Description

@thedavidmeister

Description

The following errors are declared in src/error/ErrFlow.sol but never reverted or referenced anywhere in src/ or test/:

  • L10 UnsupportedNativeFlow()
  • L24 BurnerNotOwner() (also separately declared in src/interface/deprecated/v4/IFlowERC721V4.sol:40, see below)
  • L26 UnsupportedHandleTransferInputs()
  • L27 InsufficientHandleTransferOutputs()
  • L28 UnsupportedTokenURIInputs()
  • L29 InsufficientTokenURIOutputs()

grep -rn across src/ and test/ shows zero revert sites for any of these. They are declared but unreachable from any code path — dead surface that integrators may import expecting them to be thrown.

BurnerNotOwner is additionally redeclared in the deprecated v4 interface (IFlowERC721V4.sol:40). That redeclaration is itself unused, so both copies are dead.

Location

  • src/error/ErrFlow.sol:10
  • src/error/ErrFlow.sol:24
  • src/error/ErrFlow.sol:26-29

Proposed fix

Delete the unused error declarations from ErrFlow.sol:

-/// Thrown for unsupported native transfers.
-error UnsupportedNativeFlow();
-
 /// Thrown for unsupported erc20 transfers.
 error UnsupportedERC20Flow();
-/// Thrown when burner of tokens is not the owner of tokens.
-error BurnerNotOwner();
-
-error UnsupportedHandleTransferInputs();
-error InsufficientHandleTransferOutputs();
-error UnsupportedTokenURIInputs();
-error InsufficientTokenURIOutputs();
 error UnsupportedFlowInputs();
 error InsufficientFlowOutputs();

If any of these are intended to be thrown by a current code path that is currently missing the revert, that path should be added in the same change. Otherwise drop them. Also remove the duplicate BurnerNotOwner in src/interface/deprecated/v4/IFlowERC721V4.sol:40 if BurnerNotOwner is dropped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit findinglowSeverity: lowpass1Audit Pass 1: Security

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions