Commit Graph
5 Commits
Author SHA1 Message Date
sneak a93eba3f46 fix: decode Uniswap V2 exact-out swaps, input amount shown as a maximum (closes #283)
check / check (push) Successful in 2m32s
e2e / e2e-chrome (push) Successful in 3m28s
e2e / e2e-firefox (push) Successful in 31s
decode() had no arm for Universal Router command 0x09, so the approval
screen named the step and showed no token or amount. It now takes the
path's first token with amountInMax as the input side and the last token
with amountOut as the output side, like 0x08. When the transaction has
such a step, the Amount figure reads "Up to <amount>" whichever step set
it, a WRAP_ETH or a permit included, and so does the value the wait,
success and error screens show. In such a swap paid in ETH, the
UNWRAP_WETH step that returns the ETH not spent does not make the output
ETH. The eslint-disable comment on decodeV2SwapExactOut() is gone.

Model: opus-5-5
2026-10-04 09:10:00 +00:00
clawbot 75a5fa9891 harden: gate swap amounts on presence, not truthiness, so a figure always matches its token (closes #359)
check / check (push) Successful in 32s
e2e / e2e-chrome (push) Successful in 1m45s
e2e / e2e-firefox (push) Successful in 29s
Token and amount were gated on truthiness and gated independently. An address is never falsy once set but 0n is, so a hop supplying a zero amount fixed the token permanently while leaving the amount open, and the next hop's figure was rendered against the first hop's token at that token's scale -- 0.5 WETH shown as 500000000000.0000 USDT. Nine defective gates are now presence checks, and fourteen address gates were converted defensively so a sixth instance of this class cannot grow.

Zero is not one thing. Established from v4-periphery: OPEN_DELTA is 0 and V4Router substitutes the full credit unconditionally, so a zero V4 exact-in amount means "swap the whole balance" and now reads "All available (V4 open delta)" rather than 0.0000, which would assert the exact inverse. amountOutMinimum gets no such mapping and universal-router special-cases only CONTRACT_BALANCE, so a zero minimum and a zero V2/V3 amount stay literal -- a zero floor reads "None (no minimum guaranteed)".

closes #364
2026-08-23 20:45:58 +02:00
clawbot 47bf38644d build: add ESLint to script/lint and containerize linting (closes #152)
check / check (push) Successful in 39s
e2e / e2e-chrome (push) Successful in 48s
e2e / e2e-firefox (push) Successful in 24s
2026-08-17 09:10:03 +02:00
clawbot 3c2d553070 test: add V4 swap ERC20→ERC20 decoder regression test
check / check (push) Successful in 37s
Adds a test that constructs a Uniswap V4 USDT→USDC swap using
SETTLE/SWAP_EXACT_IN_SINGLE/TAKE sub-actions inside a V4_SWAP command.
Without decodeV4Swap(), the output token would be unresolvable and the
swap name would not show 'USDT → USDC'. This test fails on the old code
and passes with the decodeV4Swap() fix.

Refs: #59
2026-02-28 11:22:14 -08:00
sneak 9e45c75d29 Implement personal_sign and eth_signTypedData_v4 message signing
check / check (push) Successful in 4s
Replace stub error handlers with full approval flow for personal_sign,
eth_sign, eth_signTypedData_v4, and eth_signTypedData. Uses toolbar
popup only (no fallback window) and keeps sign approvals pending across
popup close/reopen cycles so the user can respond via the toolbar icon.
2026-02-27 15:27:14 +07:00