Skip to content

fix(stake): reward box & positions read the EOA, not the Smart Account - #234

Merged
sktbrd merged 1 commit into
mainfrom
fix/reward-read-eoa
Aug 3, 2026
Merged

fix(stake): reward box & positions read the EOA, not the Smart Account#234
sktbrd merged 1 commit into
mainfrom
fix/reward-read-eoa

Conversation

@sktbrd

@sktbrd sktbrd commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The bug

The reward lootbox never appeared for external-wallet users (and the new positions panel showed "no positions").

Root cause: with account-abstraction, thirdweb's useActiveAccount() returns the Smart Account wrap address — but stakes/rewards live on the user's EOA (which is exactly why the app defaults external wallets to view-mode "eoa" and provides useUserAddress() as the single source of truth for read hooks). MorLootbox and StakePositions keyed their position reads off the SA (empty) → hasAction was false → the box never rendered.

Fix

Both components now read from useUserAddress().address (the effective address — the EOA for external wallets, the SA for in-app wallets). Writes are unchanged — claim/distribute still sign through the active account inside the morpheus/distribute hooks, per useUserAddress's documented contract ("reads key off this; writes use the active account directly").

Verification

  • tsc --noEmit clean · eslint clean.
  • No behavior change for in-app-wallet users (there useUserAddress().address === useActiveAccount().address).

🤖 Generated with Claude Code

…rt Account

Com carteira externa + account-abstraction, thirdweb's useActiveAccount()
retorna o endereço do Smart Account wrap — mas os stakes/rewards vivem no
EOA do usuário (por isso o app usa view-mode "eoa" por padrão). A MorLootbox
e o StakePositions liam a posição a partir do SA (vazio), então hasAction
ficava false e a lootbox nunca aparecia / o painel mostrava "sem posições".

Passa os dois a ler de useUserAddress().address (o endereço efetivo, EOA pra
carteiras externas). Writes seguem assinando pela active account dentro dos
hooks morpheus/distribute — só a LEITURA muda.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
gnars-shadcn Ignored Ignored Aug 3, 2026 10:28pm
hackertestdao Ignored Ignored Aug 3, 2026 10:28pm

@sktbrd
sktbrd merged commit c2ec511 into main Aug 3, 2026
4 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.

1 participant