`getTokenBalance` returns 0 on RPC errors, showing a false "0 USDC"

オープン
#60 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
66/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
frontend, payments

調査の方向性

Start with getTokenBalance in web/lib/contract.ts, where the isSimulationError || !retval branch returns 0n, then find its callers in web/app/pay/[id]/page.tsx, web/app/dashboard/page.tsx and web/app/withdraw/page.tsx. Decide whether to throw or return null, and make callers show a placeholder with a retry instead of 0. Done when a simulated RPC failure never displays 0, the insufficient-balance prompt appears only for a real balance, and the withdraw page change is coordinated with #26.

索引モデルが issue の本文から書いたものです。

説明

bug difficulty: beginner help wanted web

Difficulty: Beginner

Problem

getTokenBalance does if (isSimulationError || !retval) return 0n;, hiding failures. The pay page then concludes the balance is insufficient and nudges the client to the faucet, and Withdraw shows a balance of 0.

Why it matters

Showing wrong money information on a payment screen erodes trust and causes confusing prompts.

Scope of work

Throw (or return null) on error. Callers show "—" with a retry, and keep 0 for a genuine zero balance.

Acceptance criteria

  • A simulated RPC failure shows an error or placeholder, never 0.
  • The insufficient-balance prompt only appears for a real balance.

Relevant files

  • web/lib/contract.ts, web/app/pay/[id]/page.tsx, web/app/dashboard/page.tsx, web/app/withdraw/page.tsx

Dependencies

None. Note that #26 also edits the Withdraw page.

Maintainer discussion needed?

No.

主要言語
TypeScript
スター
0
フォーク
4
平均マージ
54分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Yormee-103/PayLoop のほかの issue

Yormee-103/PayLoop の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。