Skip to content

fix(dapp): let phantom's lighthouse guards through the cash-out deposit check - #158

Merged
Depo-dev merged 1 commit into
mainfrom
fix/wallet-guards-everywhere
Nov 6, 2026
Merged

Depo-dev merged 1 commit into
mainfrom
fix/wallet-guards-everywhere

Conversation

@0xDeon

@0xDeon 0xDeon commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What happened

After #157, a Phantom user's "swap SOL then cash out to NGN" sent the Raydium swap (step 1) and then refused the USDC deposit (step 2) with "This transaction calls a program a USDC deposit does not need."

#157 fixed the chain submit route only. The cash-out deposit has its own submit in lib/weave/deposit/solana.ts. That submit checked the signed bytes exactly as they came back from the wallet, including the Lighthouse guards Phantom adds before signing.

Those are the only two server routes that receive signed Solana bytes: the chain submit route and app/api/cashout/orders/[id]/submit.

Fix

The deposit check reads the same guard-free copy (withoutWalletGuards). What gets sent is exactly what the wallet signed. Any other program added beside the guard is still refused.

So a third route can't miss it

solana-signed-checks-guarded.test.ts scans app/ and lib/. It fails on any check that is handed raw signed Solana bytes (transaction: …signedTransaction) rather than the guard-free copy. Its pattern matches both the old chain route and the deposit code now on main.

Checks

  • Two new deposit tests: a Phantom-guarded deposit is sent byte for byte, and any other added program is refused with nothing sent. The first failed with the exact message from the report before the fix.
  • typecheck, lint and prettier pass.
  • 352 unit test files, 8,199 tests, all pass.

…it check

#157 fixed the chain submit route only. The cash-out deposit has its own submit, which checked
the signed bytes as they came from the wallet, so a Phantom user's swap-then-cash-out sent the
swap and then refused the deposit: "calls a program a USDC deposit does not need".

The deposit check now reads the same guard-free copy, and sends what the wallet signed. A test
now fails on any check that reads raw signed Solana bytes, so a third route can't miss it.
@netlify

netlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for useintent ready!

Name Link
🔨 Latest commit a25e14c
🔍 Latest deploy log https://app.netlify.com/projects/useintent/deploys/6aede05a80b8a9f62f9e3b18
😎 Deploy Preview https://deploy-preview-158--useintent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for useintentadapp ready!

Name Link
🔨 Latest commit a25e14c
🔍 Latest deploy log https://app.netlify.com/projects/useintentadapp/deploys/6aede05af6b22589280009fd
😎 Deploy Preview https://deploy-preview-158--useintentadapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Depo-dev
Depo-dev self-requested a review November 6, 2026 14:14
@Depo-dev
Depo-dev merged commit 0deb8ab into main Nov 6, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants