fix(frontend): read EVM deposit allowance via source-chain RPC (#133) #153

Merged
PlasticDigits merged 1 commit from fix/gl-133-evm-allowance-source-rpc into main 2026-07-30 05:35:19 +00:00
PlasticDigits commented 2026-07-30 05:30:31 +00:00 (Migrated from gitlab.com)

Summary

  • Fix false “Could not read token allowance — the token contract may not exist on this chain” on EVM deposits (reproduced with BSC vFDUSD → Terra while balance rendered correctly).
  • Read allowance(owner, bridge) through getEvmClient(sourceChainConfig) (same source RPC as balance / code preflight), instead of wallet-bound wagmi useReadContract.
  • Document INV-FE-EVM-ALLOWANCE-1 and cross-link in skills/agent-frontend-bridge-chains.md.

Related to #133 (vFDUSD bridge UI follow-up).

Test plan

  • Pre-commit: frontend typecheck + lint
  • npm run test:run -- src/hooks/useBridgeDeposit.test.ts
  • After deploy: BSC → Terra Classic with vFDUSD (~2.44) from 0xCd4E…F39c to terra1xsec…ydp8l — should proceed to approve/deposit instead of allowance error
  • Confirm approve spender is Bridge 0xb2A22c74…5369 and deposit succeeds
## Summary - Fix false **“Could not read token allowance — the token contract may not exist on this chain”** on EVM deposits (reproduced with BSC **vFDUSD** → Terra while balance rendered correctly). - Read `allowance(owner, bridge)` through **`getEvmClient(sourceChainConfig)`** (same source RPC as balance / code preflight), instead of wallet-bound wagmi `useReadContract`. - Document **INV-FE-EVM-ALLOWANCE-1** and cross-link in `skills/agent-frontend-bridge-chains.md`. Related to #133 (vFDUSD bridge UI follow-up). ## Test plan - [x] Pre-commit: frontend typecheck + lint - [x] `npm run test:run -- src/hooks/useBridgeDeposit.test.ts` - [ ] After deploy: BSC → Terra Classic with vFDUSD (~2.44) from `0xCd4E…F39c` to `terra1xsec…ydp8l` — should proceed to approve/deposit instead of allowance error - [ ] Confirm approve spender is Bridge `0xb2A22c74…5369` and deposit succeeds
PlasticDigits commented 2026-07-30 05:35:20 +00:00 (Migrated from gitlab.com)

mentioned in commit d5f053cb9a

mentioned in commit d5f053cb9a73b7f4af2b3ba0c8f85879ff505dc7
PlasticDigits (Migrated from gitlab.com) merged commit d5f053cb9a into main 2026-07-30 05:35:20 +00:00
PlasticDigits commented 2026-07-30 06:04:14 +00:00 (Migrated from gitlab.com)

mentioned in merge request !154

mentioned in merge request !154
Sign in to join this conversation.
No description provided.