From 8ad2e01a74883d68a3e21bd974a72ff09df7af08 Mon Sep 17 00:00:00 2001 From: martbost Date: Thu, 17 Sep 2026 05:03:29 -0500 Subject: [PATCH] Admin: a linked wallet can no longer be misread as an active position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The member card showed the wallet address on its own, directly above "Registered: no (payouts off)". That reads as "he is set up" when he is not, and it caused a real misread today on @mcbit1: wallet linked, memberId 0 on chain, every sale in his line walking up to his sponsor while the row looked healthy. Linking a wallet is a free signature that tells the site which address is theirs. Switching on payouts is a separate transaction that creates the position. Only the second one makes them payable, so the two states now say so: Main wallet 0x30a7…5703 payouts OFF Registered no wallet linked, but payouts were never switched on, so no position exists. Sales in their line walk up to their sponsor and lock there. and the no-wallet case says "no wallet linked yet" instead of the same text. qa/run.sh member: 0 bugs (the 2 warnings are pre-existing and unrelated). Co-Authored-By: Claude Opus 5 (1M context) --- public/admin.html | 2 +- public/assets/admin.js | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/public/admin.html b/public/admin.html index 2f20c0a..cf66dd4 100644 --- a/public/admin.html +++ b/public/admin.html @@ -488,6 +488,6 @@ - + diff --git a/public/assets/admin.js b/public/assets/admin.js index 738e6e5..0612794 100644 --- a/public/assets/admin.js +++ b/public/assets/admin.js @@ -347,7 +347,15 @@ let h = '
'; h += '

Identity

' + kv([ ['Email', esc(a.email)], ['Username', a.username ? '@' + esc(a.username) : 'not set'], ['Share code', esc(a.code || '')], - ['Main wallet', a.address ? '' + esc(a.address) + '' : 'none linked'], + // A linked wallet is NOT an active position: linking is a free signature, switching on + // payouts is a separate transaction that creates the position. The address used to sit here + // on its own, which reads as "he is set up" when he is not (Marty, 2026-09-17, @mcbit1). + ['Main wallet', a.address + ? '' + esc(a.address) + '' + + (ch && !ch.readError + ? ' payouts ON' + : ' payouts OFF') + : 'none linked'], ['Extra positions', d.positions.length ? d.positions.map(p => '' + esc(p.address.slice(0, 8) + '…' + p.address.slice(-6)) + '' + (p.memberId ? ' = #' + p.memberId : ' (unregistered)')).join('
') : 'none'], ['Sponsor (site)', d.upline.length ? memLink(d.upline[0].email, d.upline[0].name) + ' token ' + esc(a.sponsorRef || '') + '' : (a.sponsorRef ? 'unresolved: ' + esc(a.sponsorRef) + '' : 'none (company)')], ['Upline chain', d.upline.length > 1 ? d.upline.map(u => memLink(u.email, u.name)).join(' → ') : '-'], @@ -355,7 +363,13 @@ ['Line banner', a.lineTargetUrl ? '' + esc(a.lineTargetUrl.slice(0, 50)) + '' : 'not set'], ['Chat', a.chatAvailable ? 'available' : 'switched off']]) + '
'; h += '

On-chain and money

' + kv([ - ['Registered', ch ? (ch.readError ? 'read error' : 'yes, #' + ch.memberId + ' under ' + (ch.sponsorId ? '#' + ch.sponsorId + (d.names[ch.sponsorId] ? ' @' + esc(d.names[ch.sponsorId]) : '') : 'nobody')) : 'no (payouts off)'], + // Say WHICH of the two "not registered" states this is, and what it costs them, so the row + // above never gets read as "he is fine". + ['Registered', ch + ? (ch.readError ? 'read error' : 'yes, #' + ch.memberId + ' under ' + (ch.sponsorId ? '#' + ch.sponsorId + (d.names[ch.sponsorId] ? ' @' + esc(d.names[ch.sponsorId]) : '') : 'nobody')) + : (a.address + ? 'no wallet linked, but payouts were never switched on, so no position exists. Sales in their line walk up to their sponsor and lock there.' + : 'no no wallet linked yet.')], ['Qualifying buyers', ch && !ch.readError ? ch.buyerCount + ' · ' + level : '-'], ['Packages bought', t.purchases + (t.purchases ? ' · $' + (t.spentCents / 100).toFixed(0) + ' · ' + polOf(t.spentWei) + ' POL' : '')], ['Payouts received', t.payoutsIn + (t.payoutsIn ? ' · ' + polOf(t.receivedWei) + ' POL' : '')],