harden: state an undetermined swap input token as undetermined, not as ETH (closes #357)
tokenInfo(null) yielded "ETH (native)", so a swap whose input token the calldata never named was asserted to the user as ETH. The determination established for the output side in #353 applies unchanged: Currency is a value type over address, so native ETH arrives as the truthy zero-address string and WRAP_ETH sets it explicitly -- null can only mean undetermined. The rule now lives in tokenInfo() itself rather than at each call site, so the redundant output-side guard added by #356 is removed; both sides read one UNNAMED_CURRENCY constant and cannot drift. Verified by execution that a genuine native-ETH input still renders as ETH, including via WRAP_ETH and a V4 zero-address PoolKey, and that the real mainnet output-side fixture is unchanged.
This commit was merged in pull request #365.
This commit is contained in:
10
TODO.md
10
TODO.md
@@ -45,6 +45,16 @@ but the review is broader than any of them.
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-08-23: A swap whose input token the calldata never named is said to be
|
||||
unknown instead of being called ETH
|
||||
([#357](https://git.eeqj.de/sneak/AutistMask/issues/357)), the twin on the
|
||||
input side of [#353](https://git.eeqj.de/sneak/AutistMask/issues/353). A null
|
||||
`inputToken` rendered as `Token In: ETH (native)` and titled the swap
|
||||
`Swap ETH -> X`, asserting the user was paying native ETH when nothing in the
|
||||
calldata said so. The null-means-ETH collapse is now gone from `tokenInfo()`
|
||||
itself rather than guarded at each call site: null is refused, and native ETH
|
||||
keeps arriving as the explicit zero address that `WRAP_ETH` and V4's
|
||||
`Currency.wrap(address(0))` both use.
|
||||
- 2026-08-23: A swap whose output token the calldata never named is said to be
|
||||
unknown instead of being called ETH
|
||||
([#353](https://git.eeqj.de/sneak/AutistMask/issues/353)). `tokenInfo(null)`
|
||||
|
||||
Reference in New Issue
Block a user