Contract fails to deliver promised returns, but doesn't lose value
Description
Description
The ZeroXSwapVerifier.sol contract contains hardcoded function selectors that do not match the deployed 0x Settler contract. When legitimate 0x swap calldata is passed for verification, the library immediately reverts because none of the selector checks match the real function signatures.
Although the team stated the verifier is not currently active, it is part of the intended future 0x integration path (for atomic deallocation or direct quote flows). Once integrated, the issue would immediately render the system unable to perform swaps.
Root Cause:
All 9 function selectors are incorrect and do not match the actual deployed contract.
The library does not use the canonical 0x deployer (0x00000000000004533Fe15556B1E086BB1A72cEae) to dynamically resolve the latest Settler contract.
The design hardcodes both selectors and function formats, which are version-specific and subject to change.
Impact:
Wrong selectors: All valid calldata rejected Static Settler assumptions: Breaks on next 0x upgrade No deployer query: Cannot adapt to protocol changes Architectural incompatibility: Future 0x swaps impossible to verify
Recommendation
Update all function selectors to match the deployed 0x Settler contracts. The correct selectors can be obtained by:
Query the 0x deployer for current Settler address
Calculate selectors from the actual contract interface
Verify selectors exist in deployed bytecode
Additional Context (from 0x documentation)
According to the official 0x Settler documentation: https://github.com/0xProject/0x-settler?tab=readme-ov-file#actions
“See ISettlerActions for a list of actions and their parameters. The list of actions, their names, the type and number of arguments, and the availability by chain is NOT STABLE. Do not rely on ABI encoding/decoding of actions directly.”
This means that any implementation hardcoding function selectors or assuming a fixed ABI (as in ZeroXSwapVerifier) is inherently brittle and will break with future Settler updates.