Discrepancy between the Universal Router technical reference and the `Commands.sol` library
I've noticed that there is a large discrepancy between the commands that are noted down in the Universal Router technical docs and the Commands.sol library in the uniswap/universal-router repo.
Notably, V4_SWAP is not even mentioned, which is a big deal given the fact that it has actions encoded within it, so detailed guide on what those do would be useful to have in the Technical Reference page.
I've faced the same issue and resolved it by specifying the latest commit hash when installing the dependency. You can try installing it like this if you are using foundry:
forge install uniswap/universal-router@8bd498a --no-commit
And if you also facing issues like incorrect import paths, my solution is install the v2 and v3 core contracts as below:
forge install uniswap/v2-core --no-commit
forge install uniswap/v3-core --no-commit
And update the remapping for them.
This ensures you're using a version that includes V4_SWAP.
However, I agree that the documentation should be updated to reflect this command properly, especially given its importance.
💯 - the article here: https://docs.uniswap.org/contracts/v4/quickstart/swap#32-encoding-the-swap-command
mentions the command, but the command is not on the Command page:
https://docs.uniswap.org/contracts/universal-router/technical-reference#command
Current Commands page on the docs:
Value in the repo:
https://github.com/Uniswap/universal-router/blob/main/contracts/libraries/Commands.sol#L35
Thanks for creating the issue. It's fixed now!