Docs
Security
What the router holds, and what the tests covered.
Contract design
- Ownable2Step. Ownership moves only after the new owner accepts.
- pause and unpause. The owner can stop new swaps. rescueToken and rescueNative still run while swaps are paused.
- ReentrancyGuard on swap, rescueToken, and rescueNative.
- The router does not custody funds. swap pulls the input with transferFrom, pays the fee, swaps, and sends the output to the recipient. Native HYPE is wrapped and unwrapped through WHYPE.
- The caller approves this router. Permit2 is not used.
- receive accepts HYPE only from WHYPE or the Uniswap V4 pool manager.
Tests
On 13 Nov 2026, forge test on test/KnitxRouter.t.sol and test/KnitxFork.t.sol passed 20 tests and failed 0. Twelve tests run against local mocks. Eight run against the live Elysium RPC and cover Uniswap V2, Uniswap V3, Uniswap V4, Aero Slipstream, Aero Basic, Ramses V3, Ramses DLMM, Ramses Legacy, ElysiumSwap V2, a split, a two-hop route, and native HYPE out. The ElysiumSwap V3 test reaches an empty pool and expects a revert.