Found while adding ESLint in #152 — no-unused-vars flagged it.
src/shared/uniswap.js defines decodeV2SwapExactOut() (line 105), the decoder for Universal Router command 0x09. The command dispatch in decode() handles 0x00 (decodeV3SwapExactIn), 0x08 (decodeV2SwapExactIn), 0x0b, 0x0e and 0x10, but there is no cmdId === 0x09 arm, so decodeV2SwapExactOut is never called.
0x09 is listed in the command-name table at line 23 as "V2 Swap (Exact Out)", so the name is shown but the swap's input token, output token and amounts are not extracted. The approval preview for a Uniswap V2 exact-out swap therefore shows no token or amount detail, which is exactly the detail the preview exists to show.
Not fixed there: wiring a new command arm changes what the approval screen tells the user about a transaction, which is outside a lint-adoption change. The function was left in place with a scoped eslint-disable-next-line no-unused-vars pointing at this issue, so the code the fix needs is still there.
Done when decode() handles 0x09 the way it handles 0x08, a test covers a V2 exact-out calldata sample, and the eslint-disable comment in src/shared/uniswap.js is removed.
Found while adding ESLint in https://git.eeqj.de/sneak/AutistMask/issues/152 — `no-unused-vars` flagged it.
`src/shared/uniswap.js` defines `decodeV2SwapExactOut()` (line 105), the decoder for Universal Router command `0x09`. The command dispatch in `decode()` handles `0x00` (`decodeV3SwapExactIn`), `0x08` (`decodeV2SwapExactIn`), `0x0b`, `0x0e` and `0x10`, but there is no `cmdId === 0x09` arm, so `decodeV2SwapExactOut` is never called.
`0x09` is listed in the command-name table at line 23 as `"V2 Swap (Exact Out)"`, so the name is shown but the swap's input token, output token and amounts are not extracted. The approval preview for a Uniswap V2 exact-out swap therefore shows no token or amount detail, which is exactly the detail the preview exists to show.
Not fixed there: wiring a new command arm changes what the approval screen tells the user about a transaction, which is outside a lint-adoption change. The function was left in place with a scoped `eslint-disable-next-line no-unused-vars` pointing at this issue, so the code the fix needs is still there.
Done when `decode()` handles `0x09` the way it handles `0x08`, a test covers a V2 exact-out calldata sample, and the `eslint-disable` comment in `src/shared/uniswap.js` is removed.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found while adding ESLint in #152 —
no-unused-varsflagged it.src/shared/uniswap.jsdefinesdecodeV2SwapExactOut()(line 105), the decoder for Universal Router command0x09. The command dispatch indecode()handles0x00(decodeV3SwapExactIn),0x08(decodeV2SwapExactIn),0x0b,0x0eand0x10, but there is nocmdId === 0x09arm, sodecodeV2SwapExactOutis never called.0x09is listed in the command-name table at line 23 as"V2 Swap (Exact Out)", so the name is shown but the swap's input token, output token and amounts are not extracted. The approval preview for a Uniswap V2 exact-out swap therefore shows no token or amount detail, which is exactly the detail the preview exists to show.Not fixed there: wiring a new command arm changes what the approval screen tells the user about a transaction, which is outside a lint-adoption change. The function was left in place with a scoped
eslint-disable-next-line no-unused-varspointing at this issue, so the code the fix needs is still there.Done when
decode()handles0x09the way it handles0x08, a test covers a V2 exact-out calldata sample, and theeslint-disablecomment insrc/shared/uniswap.jsis removed.