Component: ghost-dao-interface @ a911859, src/containers/Dex/SwapContainer.jsx:164, src/containers/Dex/PoolContainer.jsx:168, src/containers/Dex/Dex.jsx:62, src/hooks/uniswapv2/UniswapV2Router.js.
Description: The deadline is computed as Math.floor(Date.now() / 1000) + secondsToWait, but secondsToWait is always a string. It is initialized from useState(() => getStorageValue(chainId, address, "dex-deadline", "60")) where the default is the string "60", it is bound to a text input (Dex.jsx:301), and the localStorage hook round-trips through JSON.stringify/JSON.parse, which preserves stringiness. In JavaScript, number + string concatenates: 1791197110 + "60" yields the string "179119711060". This string flows unconverted into the viem call args (UniswapV2Router.js places deadline directly in args for swapExactETHForTokens, swapExactTokensForETH, swapExactTokensForTokens, and the add-liquidity paths). viem ABI-encodes a decimal string literally as uint256, so the on-chain deadline becomes 179119711060, approximately the year 7646. Meanwhile the UI displays ~{prettifySecondsInDays(secondsToWait)} (SwapContainer.jsx:272), i.e. “~1 minute”. The user-facing safety control is broken on 100 percent of DEX transactions while the interface states the opposite.
Impact: A transaction delayed in the mempool (congestion, low gas price, builder holding) can execute at any future time instead of expiring after about a minute. Per-transaction loss is still bounded by the user’s slippage setting; no funds are stolen outright. A core MEV/stale-execution protection is silently absent.
Reproduction: Read SwapContainer.jsx:160-196 and Dex.jsx:62,301; in node, evaluate Math.floor(Date.now()/1000) + "60" and observe a 12-digit string; pass that string as the deadline arg through viem 2.31 (the repo’s pinned version) ABI encoding and observe uint256 179119711060.
Severity: Medium. Reason: a user-facing safety control is broken on every DEX transaction and the UI misstates it. Not High because execution still respects amountBMin/amountAMin slippage bounds and there is no direct theft path.
Recommendation: Coerce with Number(secondsToWait) at the computation site and validate the input (reject non-numeric, zero, and negative values) in the settings UI.
Verification: VERIFIED (code read plus local node/viem reproduction).