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.