56982 sc medium incorrect function selectors used in zeroxswapverifier

Submitted on Oct 22nd 2025 at 11:48:28 UTC by @SOPROBRO for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #56982

  • Report Type: Smart Contract

  • Report severity: Medium

  • Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/utils/ZeroXSwapVerifier.sol

  • Impacts:

    • Smart contract unable to operate due to lack of token funds

    • Loss of functionality due to misconfiguration

Description

Brief/Intro

The ZeroXSwapVerifier has incorrect 0x function selectors, causing all swap verification calls to fail and rendering the contract completely non-functional.

Vulnerability Details

The ZeroXSwaoVerifier is meant to permit 0x swap calldata, however, the constants for the 0x Settler function selectors are wrong, meaning, the entire contract is rendered useless.

For example:

The correct selector for:

is:

These constants are used when constructing calldata for the decodeAndVerifyActions and verifySwapCalldata functions, resulting in failed or misrouted calls when interacting with the ZeroXSwapVerifier, resulting in the following revert revert("Unsupported function selector");. Furthermore, the action selectors for different swap types also have wrong selectors

For example:

The correct selector for:

is:

Impact Details

While this contact is not currently implemented, I have been told in discord by @Ov3rkoalafied that we can treat this contact as if it is correctly implemented. Therefore, the impact of this is complete loss of functionality of the ZeroXSwapVerifier, which is important for atomic withdrawals from strategies.

References

Please refer to the discord server for @Ov3rkoalafied response

Proof of Concept

Proof of Concept

Add the following test to ZeroXSwapVerifier.t.sol, and run in the console forge test --mt testVerifyUniswapV3VIP_fails -vvvv to run the test, and see the test will fail with "IS" due to the function selector not matching.

Was this helpful?