From 36b6645fc394a3cc4c3a6d4440ccd10b6a96672b Mon Sep 17 00:00:00 2001 From: Abba073 <168185628+Abba073@users.noreply.github.com> Date: Mon, 29 Jun 2026 23:45:45 +0000 Subject: [PATCH 1/2] fix(stellar): handle void admin ScVal in fetchTokenInfo Return 'N/A' when admin() is void to avoid decode errors. Fixes #129. --- frontend/lib/stellar.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/lib/stellar.ts b/frontend/lib/stellar.ts index c89647d..477b689 100644 --- a/frontend/lib/stellar.ts +++ b/frontend/lib/stellar.ts @@ -530,7 +530,13 @@ async function _fetchTokenInfo( decimals, totalSupply, circulatingSupply, - admin: adminVal ? decodeAddress(adminVal) : "N/A", + admin: + adminVal && + typeof (adminVal as StellarSdk.xdr.ScVal).switch === "function" && + (adminVal as StellarSdk.xdr.ScVal).switch() !== + StellarSdk.xdr.ScValType.scvVoid() + ? decodeAddress(adminVal as StellarSdk.xdr.ScVal) + : "N/A", contractId, maxSupply, contractUri, From 3be99b5ca3cbc4e9ea768d6b3be0905069eecc2a Mon Sep 17 00:00:00 2001 From: Abba073 <168185628+Abba073@users.noreply.github.com> Date: Tue, 30 Jun 2026 00:07:55 +0000 Subject: [PATCH 2/2] chore(pr): add PR notes for fix/admin-handle-void-admin --- PR_NOTES/fix-admin-handle-void-admin.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 PR_NOTES/fix-admin-handle-void-admin.md diff --git a/PR_NOTES/fix-admin-handle-void-admin.md b/PR_NOTES/fix-admin-handle-void-admin.md new file mode 100644 index 0000000..9ce1ffc --- /dev/null +++ b/PR_NOTES/fix-admin-handle-void-admin.md @@ -0,0 +1,20 @@ +Fix admin() void handling in fetchTokenInfo + +Summary: +- Avoid decoding `admin` ScVal when it is `scvVoid()`; return "N/A" instead. +- Prevents dashboard/admin UI from erroring when a token has no on-chain admin (addresses Issue #129). + +Changed files: +- frontend/lib/stellar.ts — detect and handle `scvVoid()` for `admin()` calls. + +Test results (run in this environment): +- Frontend unit tests: 99 passed, 0 failed. +- Rust contract tests: not run here (no `cargo` available). Please run `cargo test` in `contracts/token` and `contracts/vesting` in CI or locally. + +Changelog: +- Fix: handle void `admin` ScVal in `fetchTokenInfo` to avoid decode errors and enable admin UI for tokens without an admin. + +Branch: `fix/admin-handle-void-admin` + +Notes: +- PR created/updated to include test summary and recommended follow-up (run Rust tests in CI).