docs icon indicating copy to clipboard operation
docs copied to clipboard

Discrepancy between the Universal Router technical reference and the `Commands.sol` library

Open igorroncevic opened this issue 11 months ago • 2 comments

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.

igorroncevic avatar Feb 13 '25 12:02 igorroncevic

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.

cqlyj avatar Feb 18 '25 15:02 cqlyj

💯 - 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:

Image

Value in the repo:

Image

https://github.com/Uniswap/universal-router/blob/main/contracts/libraries/Commands.sol#L35

Hugoo avatar Mar 19 '25 17:03 Hugoo

Thanks for creating the issue. It's fixed now!

Dayitva avatar Sep 03 '25 16:09 Dayitva