From 0254f933be8879978c1fbbee1d68e2619d1b6cc0 Mon Sep 17 00:00:00 2001 From: martbost Date: Sat, 14 Nov 2026 12:53:19 -0600 Subject: [PATCH] Find a Member: public lookup at /lookup (Marty 2026-11-14) One box: member ID or wallet address -> member ID, wallet (short, full on hover + Copy), level and tier, join date, sponsor ID (clickable), direct referral count, Polygonscan link, public dashboard link. Chain facts only, never names or emails. RM Circle only; nothing from any other site. - chain.lookupPublic: served from the indexed state (zero RPC); only a position or wallet the index has not seen yet falls back to one eth_call (memberId(address) 0x39106821, verified live: 0x7c7D...d3c2 -> 7230) - /api/public/lookup: own 12/min per-IP limiter, 3-minute answer cache (negative answers too), global budget of 60 RPC fallbacks per minute - page lookup.html + lookup.js (no inline script), ?q= deep links, /find alias - "Find a Member" in every site footer; chat.js?v=20261114a - chatbot: canned answer in chat.js + FACT line and Site pages entry in the AI system prompt - tests: qa/lookup-unit.mjs (25), qa/lookup-e2e.mjs (51, desktop + phone, CSP, no-email, rate limit) against qa/harness-server.js LOOKUP_SEED Co-Authored-By: Claude Opus 5.5 --- chain.js | 58 +++++++++++++++++- private/who-gets-paid.html | 2 +- public/chat.js | 2 + public/contract.html | 4 +- public/disclaimer.html | 4 +- public/fast-start.html | 2 +- public/flyers.html | 2 +- public/generation-pay.html | 2 +- public/how-pay-works.html | 4 +- public/index.html | 4 +- public/join.html | 4 +- public/lookup.html | 60 +++++++++++++++++++ public/lookup.js | 83 ++++++++++++++++++++++++++ public/my.html | 4 +- public/privacy.html | 4 +- public/refunds.html | 4 +- public/replays.html | 4 +- public/start.html | 4 +- public/suite-brand.html | 2 +- public/suite-copy.html | 2 +- public/suite-email.html | 2 +- public/suite-founder.html | 2 +- public/suite-funnel.html | 2 +- public/suite-grants.html | 2 +- public/suite-intel.html | 2 +- public/suite-leader.html | 2 +- public/suite-page.html | 2 +- public/suite-split.html | 2 +- public/suite-traffic.html | 2 +- public/suite-video.html | 2 +- public/suite-voice.html | 2 +- public/suite.html | 2 +- public/tools.html | 2 +- public/training.html | 4 +- public/weekly-rhythm.html | 2 +- qa/fixtures/lookup-index.json | 7 +++ qa/harness-server.js | 11 ++++ qa/lookup-e2e.mjs | 108 ++++++++++++++++++++++++++++++++++ qa/lookup-unit.mjs | 62 +++++++++++++++++++ server.js | 48 ++++++++++++++- 40 files changed, 478 insertions(+), 45 deletions(-) create mode 100644 public/lookup.html create mode 100644 public/lookup.js create mode 100644 qa/fixtures/lookup-index.json create mode 100644 qa/lookup-e2e.mjs create mode 100644 qa/lookup-unit.mjs diff --git a/chain.js b/chain.js index 4c43969..1aaabc9 100644 --- a/chain.js +++ b/chain.js @@ -792,6 +792,60 @@ function memberIdByAccount(address) { return null; } +// --- Public "Find a member" lookup (/lookup). Index first, RPC only on a miss. +// The indexed state already holds every position's account, sponsor, tier, level, +// direct count and join time (daily snapshot + the one-minute log tail), so a normal +// lookup costs ZERO RPC calls. Only a position or wallet the index has not seen yet +// (joined since the last tick, or index still cold) falls back to one eth_call. +// Returns chain facts only: never emails, names or any other off-chain data. +const SEL_MEMBER_ID = '0x39106821'; // memberId(address) -> uint48 (keccak-256 of the signature) +let acctMap = null, acctMapN = -1, acctMapAt = 0; +function idForAccountIndexed(a) { + if (!state || !state.members) return null; + const n = Object.keys(state.members).length; + if (!acctMap || n !== acctMapN || Date.now() - acctMapAt > 300000) { + acctMap = new Map(); + for (const [id, m] of Object.entries(state.members)) if (m && m.account) acctMap.set(String(m.account).toLowerCase(), Number(id)); + acctMapN = n; acctMapAt = Date.now(); + } + return acctMap.get(a) || null; +} +function lookupShape(id, m, source) { + const lvl = m.level || 1, tier = m.tier === 2 ? 2 : (m.tier || 1); + return { + found: true, id: Number(id), account: String(m.account).toLowerCase(), + level: lvl, levelName: levelName(lvl), tier, tierName: tierName(tier), + joinedAt: m.joinedAt || null, + sponsorId: m.referrerId && Number(m.referrerId) !== Number(id) ? Number(m.referrerId) : null, + directCount: m.directCount || 0, + source, indexedAt: state && state.updatedAt ? state.updatedAt : null + }; +} +function parseLookupQuery(raw) { + const s = String(raw == null ? '' : raw).trim().replace(/^#/, ''); + if (/^\d{1,15}$/.test(s)) { const id = Number(s); if (id >= 1 && id <= 281474976710655) return { kind: 'id', id }; return { error: 'That member ID is out of range.' }; } + if (/^0x[0-9a-fA-F]{40}$/.test(s)) return { kind: 'address', address: s.toLowerCase() }; + return { error: 'Enter a member ID (like 21) or a full wallet address (0x followed by 40 characters).' }; +} +async function lookupPublic(raw, opts = {}) { + const q = parseLookupQuery(raw); + if (q.error) return { error: q.error }; + const allowRpc = opts.allowRpc !== false; + let id = q.kind === 'id' ? q.id : idForAccountIndexed(q.address); + if (!id && q.kind === 'address') { + if (!allowRpc) return { found: false, query: q.address, busy: true }; + const r = await ethCall(SEL_MEMBER_ID + q.address.slice(2).padStart(64, '0')); + id = wInt(r, 0) || 0; + if (!id) return { found: false, query: q.address }; + } + const m = state && state.members ? state.members[id] : null; + if (m && m.account && !m.preIndexed) return lookupShape(id, m, 'index'); + if (!allowRpc) return { found: false, query: String(id), busy: true }; + const live = await fetchMember(id); + if (!live) return { found: false, query: String(id) }; + return lookupShape(id, live, 'chain'); +} + // Company-rotation pick: breadth-first (matrix order, left→right) first // position under `rootId` that still needs directs — the "next open team // position" for the public rotation when publicRotationMode==='chain'. @@ -902,4 +956,6 @@ async function paymentPath(id) { return { found: true, buyer, uplines, stopped, costs: costs ? { up: costs.up } : null, at: Date.now() }; } -module.exports = { paymentPath, startIndexer, getPayoutsPublic, verifyMember, memberLookup, memberPublic, getIncome, getOwnerUpgradeNeeds, getOrgRouting, getOrgShare, getCoachingScan, getMatrixTree, isInTeam, nextOpenPosition, depthFrom, memberIdByAccount, liveDirects, balanceOf, CONTRACT }; +// QA only: seed the in-memory index without starting the RPC indexer (qa/lookup-*.mjs, harness). +const __test = { setState(s) { state = s; acctMap = null; } }; +module.exports = { __test, lookupPublic, parseLookupQuery, paymentPath, startIndexer, getPayoutsPublic, verifyMember, memberLookup, memberPublic, getIncome, getOwnerUpgradeNeeds, getOrgRouting, getOrgShare, getCoachingScan, getMatrixTree, isInTeam, nextOpenPosition, depthFrom, memberIdByAccount, liveDirects, balanceOf, CONTRACT }; diff --git a/private/who-gets-paid.html b/private/who-gets-paid.html index e0a4d9f..aa70daf 100644 --- a/private/who-gets-paid.html +++ b/private/who-gets-paid.html @@ -105,7 +105,7 @@ if (u.level > levelIndex && u.directCount >= 2) { Every row also needs 2 directs. The amount is set by the buyer's tier; Standard is exactly half of Premium. The search follows the matrix (where each member was placed), not the sponsor line. Can the contract change? See the security review →

- + diff --git a/public/chat.js b/public/chat.js index 4dcc6e3..fb1021d 100644 --- a/public/chat.js +++ b/public/chat.js @@ -17,6 +17,8 @@ a:()=>`This site is education and tools only. It never holds, pools, or moves anyone's money, and we do not organize, promote, or take part in any crowdfunding, pooling, group-buy, or investment scheme around the contract, whoever runs it. Every join and upgrade is between your own wallet and the public contract. If anyone asks you to send money to them or to a shared pot, that is not part of anything we built. Details: our disclaimer.`}, {k:['what is','rm circle','about','this site','this project','crypto team build','who are you','network'], a:()=>`We enter the RM Circle dApp at the Premium tier (${pol()} POL on Polygon) and build as one team: each member gets exactly 2 directs, then helps those 2 get their 2 — building depth instead of width. Start with the training videos.`}, + {k:['find a member','find member','member lookup','look up a member','lookup a member','look up member','look someone up','lookup','look up a wallet','wallet lookup','check a wallet','which member','whose wallet','find someone','search member','find a position','look up a position','who sponsored','find my sponsor','look up my sponsor'], + a:()=>`Use Find a Member (rmcircle.team/lookup): type a member ID or paste a wallet address and it shows that position's member ID, wallet, current level and tier, join date, sponsor's member ID (tap it to look the sponsor up), number of direct referrals and a Polygonscan link. Everything comes from the public smart contract, so it never shows names or emails.`}, {k:['how does it work','strategy','how it works','plan','roadmap','system','duplicate','duplication'], a:()=>`The core strategy: get your 2, help your 2 get their 2, upgrade with profits, repeat — one link, forever. Once a position has 2 directs it's qualified, and its invite link automatically starts routing new people to the next position in the leg that needs directs — nobody stops promoting; the link moves the effort down for you. The full picture is in Video 1 of the training, and the roadmap poster is on the home page.`}, {k:['cost','price','entry','how much','362','fee','pol needed','expensive'], diff --git a/public/contract.html b/public/contract.html index 62aa02e..90bf7f2 100644 --- a/public/contract.html +++ b/public/contract.html @@ -29,6 +29,6 @@

Review method: complete verified source (Sourcify exact-match, creation + runtime bytecode) read against the deployed contract on 2026-08-13; payout math cross-checked against live on-chain transactions. Reviewed independently by this team's tooling — not by the contract's developers.

- - + + diff --git a/public/disclaimer.html b/public/disclaimer.html index 29b067f..e71c239 100644 --- a/public/disclaimer.html +++ b/public/disclaimer.html @@ -26,5 +26,5 @@

By continuing to use this website you accept these disclaimers. If you do not agree, please do not use the site. Questions can go to the team's Telegram group linked on the site.

- - + + diff --git a/public/fast-start.html b/public/fast-start.html index c78de7e..ca83033 100644 --- a/public/fast-start.html +++ b/public/fast-start.html @@ -111,6 +111,6 @@ - + diff --git a/public/flyers.html b/public/flyers.html index 314608e..a9af1ed 100644 --- a/public/flyers.html +++ b/public/flyers.html @@ -47,6 +47,6 @@ - + diff --git a/public/generation-pay.html b/public/generation-pay.html index 5954f44..23912a7 100644 --- a/public/generation-pay.html +++ b/public/generation-pay.html @@ -107,6 +107,6 @@ table.gp td:first-child{white-space:nowrap} - + diff --git a/public/how-pay-works.html b/public/how-pay-works.html index 98df404..e99f4f1 100644 --- a/public/how-pay-works.html +++ b/public/how-pay-works.html @@ -146,6 +146,6 @@

Every figure is a contract rule, verifiable on-chain, not a promise of income. Most participants may not profit. Full disclaimers → · How the contract works →

- - + + diff --git a/public/index.html b/public/index.html index da9e59a..c9efedf 100644 --- a/public/index.html +++ b/public/index.html @@ -22,6 +22,6 @@
Ready to start?

See the current team placement.

The onboarding page automatically shows the sponsor position the team is currently helping. Always use the sponsor shown there instead of an old screenshot or saved link.

Open Getting Started Instructions →
- - + + diff --git a/public/join.html b/public/join.html index 8958888..41de6a6 100644 --- a/public/join.html +++ b/public/join.html @@ -28,6 +28,6 @@
What happens next: get your 2 directs to qualify, then keep sharing your link — it automatically starts helping the next person in your leg — while you coach your 2 to get their 2. That's the whole system. You'll get your own invite page just like this one the moment you're in.
Risk reminder: participation involves cryptocurrency and smart-contract risk. No income is guaranteed. Use only funds you can afford to lose.
-
This independent team page is educational and is not an earnings guarantee or investment advice. Cryptocurrency and smart-contract participation involve risk, including possible loss of funds. Never use funds you cannot afford to lose. Results depend on actual participation, qualification, upgrades, smart-contract behavior, and the market value of POL. This site never holds or moves anyone's funds and does not endorse any crowdfunding or pooling built around the contract (details).
- +
This independent team page is educational and is not an earnings guarantee or investment advice. Cryptocurrency and smart-contract participation involve risk, including possible loss of funds. Never use funds you cannot afford to lose. Results depend on actual participation, qualification, upgrades, smart-contract behavior, and the market value of POL. This site never holds or moves anyone's funds and does not endorse any crowdfunding or pooling built around the contract (details).
+ diff --git a/public/lookup.html b/public/lookup.html new file mode 100644 index 0000000..c301d0a --- /dev/null +++ b/public/lookup.html @@ -0,0 +1,60 @@ +Find a Member | RM Circle Team Build + + + + +
+
Public blockchain lookup
+

Find a member

+

Paste a wallet address or type a member ID. You'll see that position's member ID, wallet, level, tier, join date, sponsor and direct referrals, straight from the public RM Circle smart contract on Polygon. Nothing private is ever shown here: no names, no emails.

+ +
+ + +
+
+ + + +

Every fact on this page comes from the public smart contract 0x33Bd...2DAF and anyone can check it on Polygonscan. Answers can be up to a few minutes behind the blockchain. Level is the level the position holds right now (every position starts at Scintilla, level 1); a position is qualified once it has 2 direct referrals.

+
+ + + + diff --git a/public/lookup.js b/public/lookup.js new file mode 100644 index 0000000..c1e5c2f --- /dev/null +++ b/public/lookup.js @@ -0,0 +1,83 @@ +// Find a member (/lookup): one box, member ID or wallet address -> public chain facts. +// Talks only to /api/public/lookup (same origin; CSP connect-src 'self'). +(function(){ + 'use strict'; + var $=function(id){return document.getElementById(id)}; + var form=$('lkForm'),input=$('lkQ'),msg=$('lkMsg'),res=$('lkRes'),go=$('lkGo'); + var busy=false,current=null; + + function setMsg(t,err){msg.textContent=t||'';msg.className='lk-msg'+(err?' err':'');} + function short(a){return a.slice(0,6)+'...'+a.slice(-4);} + function fmtDate(ts){ + if(!ts)return 'Unknown'; + try{return new Date(ts*1000).toLocaleDateString(undefined,{year:'numeric',month:'short',day:'numeric'});} + catch(e){return new Date(ts*1000).toISOString().slice(0,10);} + } + function clean(v){ + v=String(v||'').trim().replace(/\s+/g,''); + if(/^#\d+$/.test(v))v=v.slice(1); + return v; + } + function valid(v){return /^\d{1,15}$/.test(v)&&Number(v)>=1||/^0x[0-9a-fA-F]{40}$/.test(v);} + + function show(d){ + current=d; + $('rId').textContent='#'+d.id; + var q=(d.directCount||0)>=2; + var b=$('rQual');b.textContent=q?'Qualified':'Building ('+(d.directCount||0)+'/2)';b.className='lk-badge '+(q?'q':'w'); + var w=$('rWallet');w.textContent=short(d.account);w.title=d.account; + $('rLevel').textContent=d.levelName+' (Level '+d.level+' of 8)'; + $('rTier').textContent=d.tierName; + $('rJoined').textContent=fmtDate(d.joinedAt); + var s=$('rSponsor');s.textContent=''; + if(d.sponsorId){ + var a=document.createElement('button');a.type='button';a.className='lk-link';a.textContent='#'+d.sponsorId; + a.title='Look up member #'+d.sponsorId; + a.addEventListener('click',function(){input.value=String(d.sponsorId);lookup(String(d.sponsorId),true);}); + s.appendChild(a); + }else s.textContent='None (contract root)'; + $('rDirects').textContent=String(d.directCount||0); + $('rScan').href='https://polygonscan.com/address/'+d.account; + $('rDash').href='/my/'+d.id; + $('rCopy').textContent='Copy'; + res.classList.remove('hidden'); + } + + function lookup(v,push){ + v=clean(v); + if(!v){setMsg('Type a member ID or paste a wallet address.',true);return;} + if(!valid(v)){setMsg('That does not look right. Use a member ID (like 21) or a full wallet address (0x followed by 40 characters).',true);return;} + if(busy)return; + busy=true;go.disabled=true;setMsg('Looking it up on the blockchain...'); + fetch('/api/public/lookup?q='+encodeURIComponent(v),{headers:{Accept:'application/json'}}) + .then(function(r){return r.json().catch(function(){return {error:'Lookup failed. Try again.'};}).then(function(j){return {status:r.status,j:j};});}) + .then(function(x){ + var j=x.j||{}; + if(x.status!==200){res.classList.add('hidden');setMsg(j.error||'Lookup failed. Try again.',true);return;} + if(!j.found){ + res.classList.add('hidden'); + setMsg(/^0x/i.test(v)?'No RM Circle position is registered to that wallet.':'There is no member #'+v+' yet.',true); + return; + } + setMsg('');show(j); + if(push){try{history.pushState({q:v},'','/lookup?q='+encodeURIComponent(v));}catch(e){}} + }) + .catch(function(){res.classList.add('hidden');setMsg('Could not reach the site. Check your connection and try again.',true);}) + .then(function(){busy=false;go.disabled=false;}); + } + + form.addEventListener('submit',function(e){e.preventDefault();lookup(input.value,true);}); + $('rCopy').addEventListener('click',function(){ + if(!current)return; + var btn=this,done=function(){btn.textContent='Copied';setTimeout(function(){btn.textContent='Copy';},1500);}; + var legacy=function(){var t=document.createElement('textarea');t.value=current.account;document.body.appendChild(t);t.select();try{document.execCommand('copy');}catch(e){}t.remove();done();}; + if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(current.account).then(done,legacy);} + else legacy(); + }); + window.addEventListener('popstate',function(){ + var q=new URLSearchParams(location.search).get('q'); + if(q){input.value=q;lookup(q,false);}else{res.classList.add('hidden');setMsg('');input.value='';} + }); + var q0=new URLSearchParams(location.search).get('q'); + if(q0){input.value=q0;lookup(q0,false);} +})(); diff --git a/public/my.html b/public/my.html index ef46f88..8219f8b 100644 --- a/public/my.html +++ b/public/my.html @@ -30,6 +30,6 @@ -
All figures are read live from the RM Circle smart contract on Polygon and are historical facts, not a promise of future results. Participation involves cryptocurrency and smart-contract risk. Never use funds you cannot afford to lose. This site never holds or moves anyone's funds and does not endorse any crowdfunding or pooling built around the contract (details).
- +
All figures are read live from the RM Circle smart contract on Polygon and are historical facts, not a promise of future results. Participation involves cryptocurrency and smart-contract risk. Never use funds you cannot afford to lose. This site never holds or moves anyone's funds and does not endorse any crowdfunding or pooling built around the contract (details).
+ diff --git a/public/privacy.html b/public/privacy.html index e9c3a48..535dc9c 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -81,5 +81,5 @@

This page describes our actual practices in plain language. It is not legal advice.

-
Independent, unaffiliated team resource. Informational and educational only. No income is guaranteed. Cryptocurrency participation carries risk of total loss. This site never holds or moves anyone's funds and does not endorse any crowdfunding or pooling built around the contract (details).
- + + diff --git a/public/refunds.html b/public/refunds.html index cf61624..15cff6d 100644 --- a/public/refunds.html +++ b/public/refunds.html @@ -59,5 +59,5 @@

This page explains how payments work on this independent team resource. It is not legal, financial, tax, or investment advice.

-
Independent, unaffiliated team resource. Informational and educational only. No income is guaranteed. Cryptocurrency participation carries risk of total loss. This site never holds or moves anyone's funds and does not endorse any crowdfunding or pooling built around the contract (details).
- + + diff --git a/public/replays.html b/public/replays.html index a036eaa..8767adc 100644 --- a/public/replays.html +++ b/public/replays.html @@ -13,6 +13,6 @@
Risk reminder: webinars discuss a cryptocurrency team build. Nothing in them is an income promise or financial advice. Participation involves real risk — use only funds you can afford to lose.
- - + + diff --git a/public/start.html b/public/start.html index b045da1..bb1a9c4 100644 --- a/public/start.html +++ b/public/start.html @@ -15,6 +15,6 @@
What happens next: get your 2 directs to qualify, then keep sharing the very same link — once you're qualified it automatically credits whoever in your leg needs a direct next, while you help your 2 get their 2 (their own directs are what qualify them). If a referral lands straight on your qualified position anyway, it's a bonus: it still pays you and spills down your leg. Upgrade with earned POL when practical, and stay ahead of your team's levels so payments never pass you by.
Risk reminder: participation involves cryptocurrency and smart-contract risk. No income is guaranteed. Use only funds you can afford to lose.
RM Circle Premium Team Build Roadmap — core strategy, step-by-step guide, premium levels, and duplication formula
This roadmap is the plan every member follows — tap to view full size.
- - + + diff --git a/public/suite-brand.html b/public/suite-brand.html index f200f05..fc7710c 100644 --- a/public/suite-brand.html +++ b/public/suite-brand.html @@ -73,5 +73,5 @@

What branding does not change: the disclaimers at the foot of every page — independent team resource, no income guaranteed, cryptocurrency involves risk — are ours and stay exactly as they are. This is co-branding, not white-labelling; anyone reading your page can still see what they're looking at.

There's no logo upload on purpose: your monogram is generated from your brand name, so there's no image to moderate and nothing of yours hosted on our domain.

- + diff --git a/public/suite-copy.html b/public/suite-copy.html index 73861b4..e256f76 100644 --- a/public/suite-copy.html +++ b/public/suite-copy.html @@ -59,5 +59,5 @@ - + diff --git a/public/suite-email.html b/public/suite-email.html index 59da38c..19dc34c 100644 --- a/public/suite-email.html +++ b/public/suite-email.html @@ -59,5 +59,5 @@ - + diff --git a/public/suite-founder.html b/public/suite-founder.html index 71d313c..92472dc 100644 --- a/public/suite-founder.html +++ b/public/suite-founder.html @@ -74,5 +74,5 @@ curl -H "Authorization: Bearer YOUR_KEY" \ - + diff --git a/public/suite-funnel.html b/public/suite-funnel.html index 17ebb91..03542dc 100644 --- a/public/suite-funnel.html +++ b/public/suite-funnel.html @@ -73,5 +73,5 @@ - + diff --git a/public/suite-grants.html b/public/suite-grants.html index 954f86f..2d6322c 100644 --- a/public/suite-grants.html +++ b/public/suite-grants.html @@ -65,5 +65,5 @@ - + diff --git a/public/suite-intel.html b/public/suite-intel.html index db823cb..f1c745b 100644 --- a/public/suite-intel.html +++ b/public/suite-intel.html @@ -47,5 +47,5 @@ - + diff --git a/public/suite-leader.html b/public/suite-leader.html index df52d84..71a2e3d 100644 --- a/public/suite-leader.html +++ b/public/suite-leader.html @@ -53,5 +53,5 @@ - + diff --git a/public/suite-page.html b/public/suite-page.html index d95d1f2..d2b9a25 100644 --- a/public/suite-page.html +++ b/public/suite-page.html @@ -86,5 +86,5 @@ - + diff --git a/public/suite-split.html b/public/suite-split.html index 63ab8a8..af329a1 100644 --- a/public/suite-split.html +++ b/public/suite-split.html @@ -84,5 +84,5 @@ - + diff --git a/public/suite-traffic.html b/public/suite-traffic.html index 5d5ac2d..1fdbbdd 100644 --- a/public/suite-traffic.html +++ b/public/suite-traffic.html @@ -99,5 +99,5 @@ - + diff --git a/public/suite-video.html b/public/suite-video.html index 923d738..2a497dd 100644 --- a/public/suite-video.html +++ b/public/suite-video.html @@ -57,5 +57,5 @@ - + diff --git a/public/suite-voice.html b/public/suite-voice.html index 13e6936..eedeaae 100644 --- a/public/suite-voice.html +++ b/public/suite-voice.html @@ -43,5 +43,5 @@ - + diff --git a/public/suite.html b/public/suite.html index 3529931..c16c737 100644 --- a/public/suite.html +++ b/public/suite.html @@ -51,5 +51,5 @@ - + diff --git a/public/tools.html b/public/tools.html index f104682..5e0a9be 100644 --- a/public/tools.html +++ b/public/tools.html @@ -534,5 +534,5 @@ Poke around first: the how-it-works videos, the payment breakdown, and the full
Leader guardrails: never guarantee income or returns; lead with a real, on-chain example over any claim; and if a leg genuinely has no activity, say so honestly and offer to help build it — don't pretend it fills itself. Every honest answer protects the whole team.
- + diff --git a/public/training.html b/public/training.html index 29ddc09..7654700 100644 --- a/public/training.html +++ b/public/training.html @@ -108,6 +108,6 @@
Risk reminder: participation involves cryptocurrency and smart-contract risk. No income is guaranteed. Use only funds you can afford to lose.
- - + + diff --git a/public/weekly-rhythm.html b/public/weekly-rhythm.html index 8f39119..cae8a0d 100644 --- a/public/weekly-rhythm.html +++ b/public/weekly-rhythm.html @@ -97,5 +97,5 @@ - + diff --git a/qa/fixtures/lookup-index.json b/qa/fixtures/lookup-index.json new file mode 100644 index 0000000..1e9e615 --- /dev/null +++ b/qa/fixtures/lookup-index.json @@ -0,0 +1,7 @@ +{"v":2,"lastBlock":1,"snapshotAt":1,"updatedAt":"2026-11-14T12:00:00.000Z","payouts":[],"totals":{"count":0,"pol":0}, + "members":{ + "1":{"account":"0x95f38dc55efe1c0f9aab6218e7bf42cb18235a45","referrerId":0,"uplineId":1,"tier":2,"level":8,"directCount":2,"joinedAt":1754000000}, + "21":{"account":"0x1111111111111111111111111111111111111121","referrerId":1,"uplineId":1,"tier":2,"level":5,"directCount":2,"joinedAt":1754500000,"email":"never-shown@example.com"}, + "7230":{"account":"0x7c7d9f0f11bbc66a700245795c374971bfbed3c2","referrerId":21,"uplineId":21,"tier":2,"level":1,"directCount":1,"joinedAt":1762900000}, + "7231":{"account":"0x2222222222222222222222222222222222227231","referrerId":7230,"uplineId":7230,"tier":1,"level":1,"directCount":0,"joinedAt":1762990000,"preIndexed":true} + }} diff --git a/qa/harness-server.js b/qa/harness-server.js index 903baca..d714c8d 100644 --- a/qa/harness-server.js +++ b/qa/harness-server.js @@ -38,5 +38,16 @@ chain.getOrgRouting = async function () { return null; }; chain.getOrgShare = async function () { return null; }; chain.nextOpenPosition = function () { return 21; }; +// LOOKUP_SEED=: seed the in-memory index for the /lookup suite, and keep the +// lookup offline (a miss reports not-found instead of reaching a real Polygon RPC). +if (process.env.LOOKUP_SEED) { + chain.__test.setState(JSON.parse(require('fs').readFileSync(process.env.LOOKUP_SEED, 'utf8'))); + const realLookup = chain.lookupPublic; + chain.lookupPublic = async function (raw) { + const r = await realLookup(raw, { allowRpc: false }); + if (r && r.busy) { global.__lookupRpcFallbacks = (global.__lookupRpcFallbacks || 0) + 1; return { found: false, query: r.query }; } + return r; + }; +} console.log('harness: addr=' + ADDR + ' id=' + ID + ' coldIndex=' + COLD); require('../server.js'); diff --git a/qa/lookup-e2e.mjs b/qa/lookup-e2e.mjs new file mode 100644 index 0000000..912e7c9 --- /dev/null +++ b/qa/lookup-e2e.mjs @@ -0,0 +1,108 @@ +// Find a member (/lookup) end to end: the real server + the real page, index seeded, +// no RPC. Start the harness first, in its own throwaway data dir (seed config only, +// never the live config): +// +// L=/d/tmp/rmc-lookup-e2e && rm -rf $L && mkdir -p $L && echo '[]' > $L/sponsors.json +// LOOKUP_SEED=qa/fixtures/lookup-index.json PORT=3405 DATA_DIR=$L ADMIN_PASSWORD=localtest node qa/harness-server.js & +// LOCAL=http://127.0.0.1:3405 node qa/lookup-e2e.mjs +// +// The rate-limit check runs last because it uses up this IP's lookups for a minute. +import { pathToFileURL } from 'node:url'; +const PW = 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright'; +const { chromium } = (await import(pathToFileURL(PW + '/index.js').href)).default; +const B = process.env.LOCAL || 'http://127.0.0.1:3405'; +const ok = [], bad = []; +const t = (n, c, extra) => { (c ? ok : bad).push(n + (c || !extra ? '' : ' -> ' + extra)); }; +let ipN = Math.floor(Math.random() * 150 + 20); +const freshIp = () => ({ 'x-forwarded-for': '203.0.113.' + (ipN++) }); // each context its own IP, so the 12/min limiter only bites in its own test +const XFF = freshIp(); +const api = async (q, h = XFF) => { const r = await fetch(B + '/api/public/lookup?q=' + encodeURIComponent(q), { headers: h }); return { s: r.status, j: await r.json().catch(() => ({})) }; }; + +// --- API +let r = await api('7230'); +t('API: #7230 found', r.s === 200 && r.j.found && r.j.id === 7230, JSON.stringify(r)); +t('API: only chain fields come back', Object.keys(r.j).sort().join(',') === 'account,directCount,found,id,joinedAt,level,levelName,source,sponsorId,tier,tierName', Object.keys(r.j).join(',')); +r = await api('0x7c7D9F0F11bbc66a700245795c374971BfBed3c2'); +t('API: wallet resolves to #7230', r.s === 200 && r.j.id === 7230); +r = await api('21'); +t('API: #21 never leaks an email from the index', r.s === 200 && !JSON.stringify(r.j).includes('example.com')); +r = await api('banana'); +t('API: free text is a 400 with a clear message', r.s === 400 && /member ID/.test(r.j.error || '')); +r = await api('0x123'); +t('API: short wallet is a 400', r.s === 400); +r = await api('99999'); +t('API: unknown id is found:false', r.s === 200 && r.j.found === false); + +// --- page +const browser = await chromium.launch(); +for (const mobile of [false, true]) { + const tag = mobile ? '[phone] ' : ''; + const ctx = await browser.newContext(mobile ? { viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true, extraHTTPHeaders: freshIp() } : { viewport: { width: 1280, height: 900 }, extraHTTPHeaders: freshIp() }); + await ctx.addInitScript(() => { + const g = Storage.prototype.getItem; + Storage.prototype.getItem = function (k) { if (/^rmc-promo-/.test(k)) return 'seen'; if (/^rmc-announce-/.test(k)) return 'done'; return g.call(this, k); }; + }); + const page = await ctx.newPage(); + const csp = []; + page.on('console', m => { if (/Refused to|Content Security Policy/i.test(m.text())) csp.push(m.text()); }); + page.on('pageerror', e => csp.push('pageerror: ' + e.message)); + const resp = await page.goto(B + '/lookup', { waitUntil: 'networkidle' }); + t(tag + '/lookup is 200', resp.status() === 200); + await page.fill('#lkQ', '0x7c7D9F0F11bbc66a700245795c374971BfBed3c2'); + await page.click('#lkGo'); + await page.waitForSelector('#lkRes:not(.hidden)', { timeout: 8000 }); + t(tag + 'wallet search shows #7230', (await page.textContent('#rId')) === '#7230'); + t(tag + 'wallet is shortened', (await page.textContent('#rWallet')) === '0x7c7d...d3c2', await page.textContent('#rWallet')); + t(tag + 'full wallet on hover', (await page.getAttribute('#rWallet', 'title')) === '0x7c7d9f0f11bbc66a700245795c374971bfbed3c2'); + t(tag + 'level + tier', /Scintilla/.test(await page.textContent('#rLevel')) && (await page.textContent('#rTier')) === 'Premium'); + t(tag + 'join date shown', /2025/.test(await page.textContent('#rJoined')), await page.textContent('#rJoined')); + t(tag + 'direct referrals', (await page.textContent('#rDirects')) === '1'); + t(tag + 'building badge', /1\/2/.test(await page.textContent('#rQual'))); + t(tag + 'Polygonscan link', (await page.getAttribute('#rScan', 'href')) === 'https://polygonscan.com/address/0x7c7d9f0f11bbc66a700245795c374971bfbed3c2'); + t(tag + 'URL carries the query', /\/lookup\?q=0x7c7D/i.test(page.url())); + await page.click('#rSponsor button'); + await page.waitForFunction(() => document.getElementById('rId').textContent === '#21', null, { timeout: 8000 }); + t(tag + 'clicking the sponsor looks up #21', true); + t(tag + '#21 shows Qualified', (await page.textContent('#rQual')) === 'Qualified'); + t(tag + '#21 sponsor is #1', (await page.textContent('#rSponsor')) === '#1'); + await page.goBack(); + await page.waitForFunction(() => document.getElementById('rId').textContent === '#7230', null, { timeout: 8000 }); + t(tag + 'Back returns to #7230', true); + await page.fill('#lkQ', 'not a wallet'); + await page.click('#lkGo'); + t(tag + 'bad input shows an inline error', /does not look right/.test(await page.textContent('#lkMsg'))); + await page.fill('#lkQ', '99999'); + await page.click('#lkGo'); + await page.waitForFunction(() => /no member #99999/.test(document.getElementById('lkMsg').textContent), null, { timeout: 8000 }); + t(tag + 'unknown id says so and hides the card', await page.isHidden('#lkRes')); + const body = await page.textContent('body'); + t(tag + 'no email anywhere on the page', !/@example\.com/.test(body)); + t(tag + 'no InstantAdPay/LinkSpin mention', !/InstantAdPay|LinkSpin|Downline Banners|Viral Banner/i.test(body)); + const overflow = await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 1); + t(tag + 'no horizontal scroll', !overflow); + t(tag + 'no CSP refusals or page errors', csp.length === 0, csp.join(' | ')); + await ctx.close(); +} +// deep link +{ + const ctx = await browser.newContext({ extraHTTPHeaders: freshIp() }); const page = await ctx.newPage(); + await page.goto(B + '/lookup?q=21', { waitUntil: 'networkidle' }); + await page.waitForSelector('#lkRes:not(.hidden)', { timeout: 8000 }); + t('deep link /lookup?q=21 opens #21', (await page.textContent('#rId')) === '#21'); + const f = await (await fetch(B + '/find')).status; + t('/find alias is 200', f === 200); + const foot = await (await fetch(B + '/contract')).text(); + t('footer on other pages links /lookup', foot.includes('href="/lookup"')); + await ctx.close(); +} +await browser.close(); + +// --- rate limit (last) +const H = { 'x-forwarded-for': '198.51.100.77' }; +let codes = []; +for (let i = 0; i < 14; i++) codes.push((await api('21', H)).s); +t('rate limit: 12 per minute then 429', codes.slice(0, 12).every(c => c === 200) && codes[12] === 429 && codes[13] === 429, codes.join(',')); + +console.log(ok.map(x => 'ok ' + x).join('\n')); +if (bad.length) { console.log(bad.map(x => 'FAIL ' + x).join('\n')); process.exit(1); } +console.log(`\n${ok.length} passed`); diff --git a/qa/lookup-unit.mjs b/qa/lookup-unit.mjs new file mode 100644 index 0000000..660323b --- /dev/null +++ b/qa/lookup-unit.mjs @@ -0,0 +1,62 @@ +// Find a member (/lookup): chain.lookupPublic against a seeded index, no RPC. +// node qa/lookup-unit.mjs +import { createRequire } from 'node:module'; +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +const require = createRequire(import.meta.url); +const here = path.dirname(fileURLToPath(import.meta.url)); +const chain = require('../chain.js'); +chain.__test.setState(JSON.parse(fs.readFileSync(path.join(here, 'fixtures', 'lookup-index.json'), 'utf8'))); + +const ok = [], bad = []; +const t = (n, c, extra) => { (c ? ok : bad).push(n + (c || !extra ? '' : ' -> ' + extra)); }; +const off = { allowRpc: false }; + +// input validation +const P = chain.parseLookupQuery; +t('a plain number is an id', P('21').kind === 'id' && P('21').id === 21); +t('a #-prefixed number is an id', P('#7230').id === 7230); +t('whitespace is trimmed', P(' 21 ').id === 21); +t('zero is refused', !!P('0').error); +t('a 16-digit number is refused', !!P('1234567890123456').error); +t('a full address is an address, lowercased', P('0x7c7D9F0F11bbc66a700245795c374971BfBed3c2').address === '0x7c7d9f0f11bbc66a700245795c374971bfbed3c2'); +t('a short address is refused', !!P('0x7c7D9F0F11bbc66a').error); +t('non-hex address is refused', !!P('0xZZ7D9F0F11bbc66a700245795c374971BfBed3c2').error); +t('free text is refused', !!P('marty').error); +t('script text is refused', !!P('').error); +t('empty is refused', !!P('').error); + +// by id, from the index +const a = await chain.lookupPublic('7230', off); +t('#7230 is found from the index', a.found && a.source === 'index', JSON.stringify(a)); +t('#7230 wallet is lowercased', a.account === '0x7c7d9f0f11bbc66a700245795c374971bfbed3c2'); +t('#7230 sponsor is #21', a.sponsorId === 21); +t('#7230 level/tier names', a.levelName === 'Scintilla' && a.tierName === 'Premium' && a.level === 1); +t('#7230 direct count', a.directCount === 1); +t('#7230 join time', a.joinedAt === 1762900000); + +// by wallet, mixed case, from the index +const b = await chain.lookupPublic('0x7C7D9F0F11BBC66A700245795C374971BFBED3C2', off); +t('wallet lookup resolves to #7230 with no RPC', b.found && b.id === 7230 && b.source === 'index', JSON.stringify(b)); + +const c = await chain.lookupPublic('21', off); +t('#21 is Apex, qualified, sponsored by root', c.levelName === 'Apex' && c.directCount === 2 && c.sponsorId === 1); +t('never copies unknown index fields (no email)', !('email' in c) && !JSON.stringify(c).includes('example.com')); + +const r = await chain.lookupPublic('1', off); +t('the root shows no sponsor', r.found && r.sponsorId === null); + +// misses never call RPC when RPC is not allowed +const m1 = await chain.lookupPublic('99999', off); +t('an unknown id reports busy (needs a chain read)', m1.busy === true && !m1.found); +const m2 = await chain.lookupPublic('0x3333333333333333333333333333333333333333', off); +t('an unknown wallet reports busy (needs a chain read)', m2.busy === true && !m2.found); +const m3 = await chain.lookupPublic('7231', off); +t('a provisional (preIndexed) entry is re-read from the chain, not trusted', m3.busy === true); +const e = await chain.lookupPublic('hello', off); +t('bad input returns an error, not a lookup', !!e.error); + +console.log(ok.map(x => 'ok ' + x).join('\n')); +if (bad.length) { console.log(bad.map(x => 'FAIL ' + x).join('\n')); process.exit(1); } +console.log(`\n${ok.length} passed`); diff --git a/server.js b/server.js index 8bd8ed9..a935cec 100644 --- a/server.js +++ b/server.js @@ -79,10 +79,11 @@ FACTS: - THE TRIPLE PLAY (optional fast-start; people ask "should I get one position or three?"): Most start with ONE position — get 2 directs, help them, duplicate (the standard path, all anyone needs). OPTIONAL alternative: buy a top position PLUS its own 2 directs at the same time. Those two count as the top's directs, so the TOP is instantly qualified (2/2) and catching upgrade pass-ups from day one; then you promote only the top position's moving link, which auto-routes new joiners to fill/qualify the positions beneath. Because ONE WALLET ADDRESS CAN ONLY HOLD ONE POSITION (blockchain rule), this needs THREE separate addresses. Foolproof = a separate wallet (or browser profile) per position. You CAN use "Add account" in one MetaMask (Account 1/2/3 are separate addresses), BUT MetaMask's account switch doesn't always follow into a connected site — if the join page still shows the old address the join reverts with "already registered", so you must confirm the NEW address is shown before signing each (or disconnect+reconnect the site with the new account). Separate wallets avoid this. HARD framing to always include: costs ~3x a single entry; ONLY money you can comfortably afford to lose; NEVER borrowed; NEVER front/fund it for someone else (it puts one person in control of positions on another's wallet); it's a faster START, not an income guarantee; and one position is perfectly fine. FOUR-PERSON REALITY (Marty 2026-10-14, always mention): the top's first two directs are the member's OWN wallets, so the real recruiting starts one level down: Wallets 2 and 3 each need two directs of their own, so the member is recruiting FOUR people (not two) and teaching each of them to get their two. The Triple Play is a faster start, it does not skip the team building. TRAINING VIDEO: https://rmcircle.team/training#triple-play (about 2.5 min, subtitles in 6 languages). Never push it — present it and let them choose. UPGRADE STRATEGY for a Triple Play: most members (including the top team builder holding #21) CONCENTRATE UPGRADES ON THE TOP position and leave wallets 2 & 3 lower — because pass-ups the lower positions aren't leveled to catch bubble UP to the first eligible position (the catcher-of-last-resort mechanic), so keeping the TOP most-leveled funnels the deep catches into the top wallet, and since you own all three the money stays in your family; upgrading all three works too but costs 3x the upgrades, so concentrating on the top is leaner. Upgrades always optional/self-paced/funded by earnings, never out of pocket. THE CORONA CATCH (2026-09-16, highlight this): a Corona purchase pays the buyer's 7th upline, so a member's Generation 8 (256 positions) pays its Corona buys (39,770 POL each) to that member's Generation 1, normally two other people; with the Triple Play Generation 1 = the member's own Wallets 2 and 3, so those payments stay in the family — caught directly if those wallets hold Vertex and are qualified (up to 256 × 39,769.75 = 10,181,056 POL at full fill), else passed over to Wallet 1 if it holds Vertex and is qualified. It is the only scenario in which a position collects on the top-level buys of a tree 8 deep beneath it; always caption as mechanical maximum. Full steps: https://rmcircle.team/how-pay-works#triple-play. - LEVEL CAP / "does it stop at 8 levels?": there are 8 levels (Scintilla..Corona); Corona is the max LEVEL — you can't upgrade past it. But EARNING is not capped. (1) You catch an upgrade pass-up from every person in your first seven generations as they level up, and those generations hold up to 254 positions that keep filling via recruiting + spillover — one payment per person, but people keep arriving. (2) Pass-ups travel UP past anyone who can't catch them: an upgrade payment rises to the first upline who is qualified (2 directs) AND leveled high enough (level >= the level the buyer is leaving), searching up to the 16-layer MAX_MATRIX_DEPTH; if nobody qualifies in range it goes to the project fee wallet. So a Corona member is the "catcher of last resort" — at max level they're eligible for every pass-up, never the bottleneck, and they catch the ones under-leveled members below them let slip. That's the mechanical reason to keep leveling up. Full explainer: https://rmcircle.team/how-pay-works#cap. Still contract mechanics, never an income promise. - TIERS: Premium (the tier the whole team builds at, ${c.premiumEntryPol || 362} POL entry) pays and earns FULL amounts; Standard costs about half and pays/earns HALF at every level. A smaller-than-expected payment almost always came from a Standard-tier position below. Tier is fixed at registration and CANNOT be changed later (upgrading advances your LEVEL, not your tier). Always recommend joining Premium and having recruits do the same. Amount comparison at /how-pay-works. +- FIND A MEMBER (https://rmcircle.team/lookup, public): anyone can type a member ID or paste a wallet address and see that position's member ID, wallet, current level and tier, join date, sponsor's member ID (clickable to look the sponsor up), direct-referral count and a Polygonscan link. It reads only the public contract, so it never shows names, emails or any personal data. Use it to answer 'what member number is this wallet', 'who sponsored #N', 'is this wallet registered'. - MEMBER DASHBOARD & ALERTS: each member has a live dashboard at https://rmcircle.team/my (enter your ID) showing position, team, payments, pipeline (incoming money forming below), a team-depth summary (members per generation below you and which level's upgrade each generation pays you at), a "Coach Your Team" panel (who in YOUR leg needs a nudge — qualified-but-not-upgraded members sitting on entry rewards, members about to miss forming payments, members one direct from qualifying — each recommendation has a one-tap "Send this nudge" button that sends a ready-written teach-forward message over the wallet-verified Messages system, delivered on-site and to Telegram if the member linked it), spillover tags, and qualification badges. Members can turn on opt-in EMAIL ALERTS there (notified when paid, and when they need to upgrade to catch incoming pay). A member's personal invite page to share is https://rmcircle.team/join/. - RESILIENCE ("what if the creators disappear / owner loses keys / it falls apart over time"): the contract code is autonomous and cannot be upgraded — NO admin action, heartbeat, or living operator is required for joins, upgrades, matrix placement, or payouts; there is no pause switch and no expiry. Verified on-chain that the founder, development, and fee-receiver wallets are ordinary wallets (EOAs), NOT smart contracts — an ordinary wallet always accepts incoming POL even if its key is lost forever, so a dead or abandoned admin wallet cannot block any member payment (only the project's OWN uncollected fee would sit idle). The contract stores no balance (every payment is delivered in the same transaction). If the owner's key were lost, only the four limited admin powers freeze in place; members are unaffected. Details in section 6 of https://rmcircle.team/contract. - Current company-rotation sponsor: ${a ? `ID ${a.id}, ${a.directCount}/2 directs` : 'shown on the start page'} — the next open position in the company tree, read live from the chain. It moves the moment that position fills, so always verify on https://rmcircle.team/start right before joining. A member's own invite link is different: it places people inside that member's own team. -- Site pages: https://rmcircle.team/ (strategy overview + roadmap + live team stats), https://rmcircle.team/start (current sponsor + join steps), https://rmcircle.team/training (THE CIRCLE METHOD — the team's 10-lesson course in 3 modules; it is the MEMBERS-AREA product: Lesson 1 is the free public preview, Lessons 2-10 unlock by signing in with the wallet that owns a position (one free signature, right on the training page) or automatically inside the Telegram Mini App; every lesson's title and description stays visible so prospects can see what's included. M1 Get Your Two: L1 mindset, L2 warm list, L3 the conversation, L4 objections. M2 Help Your Two: L5 dashboard-as-coaching-desk, L6 first 48 hours, L7 stalled people & pass-ups, L8 timing upgrades to catches. M3 Teach the Teachers: L9 run the same play, L10 the 20-minute weekly rhythm. ROUTING RULE — for MEMBERS answer with the lesson: how do I find people→L2 (/training#lesson-2); what do I say→L3; pyramid objection→L4; new member just joined→L6; someone stalled→L7; should I upgrade→L8; overwhelmed→L10. For someone NOT yet a member, answer the substance directly yourself and mention that the full lesson is included with their position (never send a prospect a locked link as the answer). Deep links: /training#lesson-N — plus 10 how-to videos (incl. "The Textbook Play" — 111s: a top team builder's own position (#21, one of the builders near the top — NOT a program founder) shown as a ledger, every upgrade funded by a prior catch, this week's Apex catch arriving and funding his Apex the same hour; route "does this actually work / has anyone done this" questions here at /training#textbook-play, always with the no-income-promise framing; and Video 7 "Your level is your reach" — 97s on catch eligibility: qualified members catch their two's first upgrades without owning the level, each owned level extends reach one generation deeper, uncatchable payments pass over) — team overview, wallet setup, funding, the new connect-wallet join flow on the site, the dApp backup method, how payments work, a full 14-min Member Dashboard walkthrough, and an 8-min REAL e-gift-card cash-out walkthrough (/training#egift-video, MEMBERS-ONLY like the Method lessons: POL → CWallet → dollar swap → gift card, ending with the virtual card in a mobile wallet ready to tap-to-pay) — + spillover article; the join-funnel and transparency videos are always public), https://rmcircle.team/how-pay-works (the two income streams shown as a pay-flow diagram + Premium/Standard tier comparison + a "What each level opens up" scaling table at /how-pay-works#level-scale showing how each level lets you catch a deeper, wider, higher-paying generation of pass-ups — explicitly framed as the contract's mechanical maximum at full fill, NOT a prediction or income promise; READING THE TABLE (2026-09-16, a leader read it one rung off): each row names the LEVEL YOU HOLD (your reach) and, since the update, also the LEVEL THAT GENERATION BUYS, which is one rung higher — holding Fabrica catches your 3rd generation (8 people) when they buy Culmen at 2,486 each; if someone labels rows by the level being bought their rows shift down one but every number still matches; the right-hand column is one generation only, never a running total: through the Fastigium row the sum is 1,696,429 POL, the Vertex row alone is generation 7 (128 people buying Corona) = 5,090,529 POL; plus a "Does it cap out at 8 levels?" explainer at /how-pay-works#cap, and a contract-exact price table at /how-pay-works#exact-costs read live from getAllCosts(): Premium entry base 343.41 POL — member sends 360.58 incl the 5% admin charge on entries only (public charts round to ~362 as a send buffer), sponsor receives 326.24 (95% of base); upgrades are a separate ladder paid 100% member-to-member up the matrix with zero admin fee — 621.40 to reach level 2, doubling EXACTLY each level (2×621.40=1,242.80 to the penny) so two same-level pass-ups always fund the member's own next upgrade. USE THIS to answer "why is entry a different price than upgrade / is the income chart inflated": they are two different purchases paid to two different people (entry→sponsor, upgrade→upline), income illustrations are built only from the upgrade stream, and every price is a fixed contract constant verifiable on Polygonscan. IMPORTANT: levels can NEVER be skipped — register() has no level parameter (every position enters at Scintilla) and upgrade() takes no target (exactly one rung per call); company charts listing an "entry price" for levels 2-8 show vestigial contract data rows that no function sells — total to hold Culmen = 360.58+621.40+1,242.80+2,485.61 = 4,710.39 POL, climbed one level at a time. CATCH-ELIGIBILITY NUANCE (verified in source): the payout loop pays the first non-skipped upline with directCount≥2 AND level GREATER THAN the buyer's pre-upgrade level minus one — i.e. the catcher's level must be AT OR ABOVE the level the buyer is LEAVING, not the level being bought. So a qualified member still at Scintilla DOES catch their two matrix children's Ascensus purchases in full; owning higher levels extends REACH (Fabrica catch from 2 generations down needs Ascensus, etc. — one structural upline skip per level of depth). Depth pays fixed counts (2/4/8… one payment per person) but per-person size doubles with width (full-generation value quadruples per level), generations keep filling over time, and pass-ups add catches), https://rmcircle.team/contract (plain-language security review of the verified smart contract — code can't change, no pooled funds, locked rules, honest list of operator powers), https://rmcircle.team/weekly-rhythm (printable 20-minute Weekly Rhythm routine + 4-week habit tracker from Method Lesson 10, personalized like the Fast Start sheet), https://rmcircle.team/suite (THE CIRCLE SUITE — LIVE AND OPEN TO EVERY POSITION. Promote it freely, and lead with it whenever anyone asks "what is the actual product" or "what do I actually get" — it is the strongest answer we have: most programs hand you a referral link, this one hands you working software too. The team's marketing-toolkit portal: every paid position is a LICENSE to the toolkit; members connect their position's wallet (one free signature, same sign-in as the training gate and Mini App bridge) and their live contract level lights up their tools on a visible tool wall — Level 1 today includes the Promo Center, Printable Handouts, Fast Start + Weekly Rhythm, Generation Pay chart, Circle Method, Live Dashboard, and the AI coach; higher-level tiles (Copy Engine L2, Page Builder L2, Email Engine + Video Maker L3, Voice Profile + Funnels L4, Traffic Desk L5 (syndicated network display advertising — banner/text placements on the team's own ad network, monthly ad credits, rotator priority, AI campaign packs), Funnel Factory L6 (hosted funnels + Replay Funnels — an evergreen registration page around a recorded team webinar with a timed CTA, NOT live video conferencing/Zoom — + lead CRM), Leader Ops L7, Founder Desk L8) are shown honestly as IN DEVELOPMENT and unlock automatically as members upgrade once shipped; the Suite is included with membership, never sold), https://rmcircle.team/generation-pay (printable Generation Pay chart — the full when-does-each-generation-pay-me table with exact per-person POL amounts; enter a member ID and it personalizes from the live chain: shows the member's tier/level/qualification and marks each generation "catching now" vs "needs Level N"; Gen 8 pays the member's Gen 1, pass-overs only; Standard positions pay half; ROUTE members here for any generation-pay / who-pays-me-when question), https://rmcircle.team/fast-start (printable 48-Hour Fast Start checklist — personalized with the member's invite link and a scannable QR code when opened from their dashboard; prints clean black-on-white, and prints in whatever language the member selected with the 🌐 button), REQUIRED MEMBER PROFILE (2026-09-16): the first time someone proves they own a position (wallet personal_sign, or automatically in the Telegram Mini App) they must set a USERNAME and confirm an EMAIL with a 6-digit code before the member area opens; it cannot be skipped. Reason given to members: their leader can reach them, and they get an email the moment a payout lands. The email is never shown to other members and never sold, is changeable, and the 40 positions that already gave an email for payout alerts have it pre-filled to confirm. One email may hold several positions (Triple Play). The PUBLIC page rmcircle.team/my/ is unchanged and never asks for anything, and no profile can be written from it. https://rmcircle.team/my (member dashboard — its "Your team" panel opens with an organization bar: total members in your org, generations deep, qualified count below you, POL earned below you, and its approximate USD value at an hourly-cached POL price; the matrix under it drills leg by leg), https://rmcircle.team/tools (for existing team members who want to promote — share-ready promo videos (including the “Pocket Change” curiosity hook video — 25 ways people flush pocket change weekly with nothing to show for it, then the side-hustle flip; it deliberately shows no URL so the poster's invite link in the caption/description carries the credit, and matching pocket-change post copy sits in the Social posts section), copy-paste social posts, short/long email swipes, a downloadable banner kit in every standard size (incl. a 1280×720 Telegram group-ad image with a tap-the-link-below CTA — members pair it with their own Telegram-native invite link in the caption), a Printable Handouts maker at /flyers (linked from /tools#flyers and the dashboard) — five bold full-color half-sheet handout designs with detailed artwork (one per angle: pocket change, two people, phone, side-hustle graveyard, stop waiting) that print two copies per letter page with a cut line so members can print, cut, and hand out stacks, for offline/belly-to-belly promotion (coffee shops, gyms, community & church bulletin boards, laundromats); enter the member ID once and every handout personalizes with the member's own QR code and invite link overlaid on the artwork (angle-matched ?v= links so the landing page continues the hook); print in color for impact and the QR scans in black-and-white too, and an Official RM Circle Media library (13 vertical social videos + 15 graphics from the creators — pair them with your own invite link in the caption; each curiosity video also has a MATCHED invite link (adds ?v= to the member's /join link) that makes the landing page continue that video's hook — recommend it when members ask which link to use with a video); open it from the gold Promo Tools button on your dashboard and every post/swipe arrives pre-personalized with YOUR invite link; NEW Promote-on-Telegram section at /tools#telegram — the member's Telegram-native Mini App invite links (t.me links that open the whole tour INSIDE Telegram; tapping your own link previews the prospect view), paste-ready Telegram group posts + DMs, and the setup message to forward to their team; Text-a-friend section at /tools#text-a-friend — 5 SMS-sized messages (general + one per angle video, matched to that video's landing page) with one-tap share buttons: Text it (opens the phone's messaging app pre-filled), WhatsApp (wa.me pre-fill), Telegram (shares the member's Mini App invite), Copy for Messenger/Instagram DMs; to write promos in their own voice, mybrandedvoice.com; plus an Objection Handling bank at the bottom — truth + ready-to-send reply per objection, incl. the what's-the-product / members-area answer), https://rmcircle.team/disclaimer (affiliate/earnings/risk disclosures). +- Site pages: https://rmcircle.team/ (strategy overview + roadmap + live team stats), https://rmcircle.team/start (current sponsor + join steps), https://rmcircle.team/training (THE CIRCLE METHOD — the team's 10-lesson course in 3 modules; it is the MEMBERS-AREA product: Lesson 1 is the free public preview, Lessons 2-10 unlock by signing in with the wallet that owns a position (one free signature, right on the training page) or automatically inside the Telegram Mini App; every lesson's title and description stays visible so prospects can see what's included. M1 Get Your Two: L1 mindset, L2 warm list, L3 the conversation, L4 objections. M2 Help Your Two: L5 dashboard-as-coaching-desk, L6 first 48 hours, L7 stalled people & pass-ups, L8 timing upgrades to catches. M3 Teach the Teachers: L9 run the same play, L10 the 20-minute weekly rhythm. ROUTING RULE — for MEMBERS answer with the lesson: how do I find people→L2 (/training#lesson-2); what do I say→L3; pyramid objection→L4; new member just joined→L6; someone stalled→L7; should I upgrade→L8; overwhelmed→L10. For someone NOT yet a member, answer the substance directly yourself and mention that the full lesson is included with their position (never send a prospect a locked link as the answer). Deep links: /training#lesson-N — plus 10 how-to videos (incl. "The Textbook Play" — 111s: a top team builder's own position (#21, one of the builders near the top — NOT a program founder) shown as a ledger, every upgrade funded by a prior catch, this week's Apex catch arriving and funding his Apex the same hour; route "does this actually work / has anyone done this" questions here at /training#textbook-play, always with the no-income-promise framing; and Video 7 "Your level is your reach" — 97s on catch eligibility: qualified members catch their two's first upgrades without owning the level, each owned level extends reach one generation deeper, uncatchable payments pass over) — team overview, wallet setup, funding, the new connect-wallet join flow on the site, the dApp backup method, how payments work, a full 14-min Member Dashboard walkthrough, and an 8-min REAL e-gift-card cash-out walkthrough (/training#egift-video, MEMBERS-ONLY like the Method lessons: POL → CWallet → dollar swap → gift card, ending with the virtual card in a mobile wallet ready to tap-to-pay) — + spillover article; the join-funnel and transparency videos are always public), https://rmcircle.team/how-pay-works (the two income streams shown as a pay-flow diagram + Premium/Standard tier comparison + a "What each level opens up" scaling table at /how-pay-works#level-scale showing how each level lets you catch a deeper, wider, higher-paying generation of pass-ups — explicitly framed as the contract's mechanical maximum at full fill, NOT a prediction or income promise; READING THE TABLE (2026-09-16, a leader read it one rung off): each row names the LEVEL YOU HOLD (your reach) and, since the update, also the LEVEL THAT GENERATION BUYS, which is one rung higher — holding Fabrica catches your 3rd generation (8 people) when they buy Culmen at 2,486 each; if someone labels rows by the level being bought their rows shift down one but every number still matches; the right-hand column is one generation only, never a running total: through the Fastigium row the sum is 1,696,429 POL, the Vertex row alone is generation 7 (128 people buying Corona) = 5,090,529 POL; plus a "Does it cap out at 8 levels?" explainer at /how-pay-works#cap, and a contract-exact price table at /how-pay-works#exact-costs read live from getAllCosts(): Premium entry base 343.41 POL — member sends 360.58 incl the 5% admin charge on entries only (public charts round to ~362 as a send buffer), sponsor receives 326.24 (95% of base); upgrades are a separate ladder paid 100% member-to-member up the matrix with zero admin fee — 621.40 to reach level 2, doubling EXACTLY each level (2×621.40=1,242.80 to the penny) so two same-level pass-ups always fund the member's own next upgrade. USE THIS to answer "why is entry a different price than upgrade / is the income chart inflated": they are two different purchases paid to two different people (entry→sponsor, upgrade→upline), income illustrations are built only from the upgrade stream, and every price is a fixed contract constant verifiable on Polygonscan. IMPORTANT: levels can NEVER be skipped — register() has no level parameter (every position enters at Scintilla) and upgrade() takes no target (exactly one rung per call); company charts listing an "entry price" for levels 2-8 show vestigial contract data rows that no function sells — total to hold Culmen = 360.58+621.40+1,242.80+2,485.61 = 4,710.39 POL, climbed one level at a time. CATCH-ELIGIBILITY NUANCE (verified in source): the payout loop pays the first non-skipped upline with directCount≥2 AND level GREATER THAN the buyer's pre-upgrade level minus one — i.e. the catcher's level must be AT OR ABOVE the level the buyer is LEAVING, not the level being bought. So a qualified member still at Scintilla DOES catch their two matrix children's Ascensus purchases in full; owning higher levels extends REACH (Fabrica catch from 2 generations down needs Ascensus, etc. — one structural upline skip per level of depth). Depth pays fixed counts (2/4/8… one payment per person) but per-person size doubles with width (full-generation value quadruples per level), generations keep filling over time, and pass-ups add catches), https://rmcircle.team/contract (plain-language security review of the verified smart contract — code can't change, no pooled funds, locked rules, honest list of operator powers), https://rmcircle.team/weekly-rhythm (printable 20-minute Weekly Rhythm routine + 4-week habit tracker from Method Lesson 10, personalized like the Fast Start sheet), https://rmcircle.team/suite (THE CIRCLE SUITE — LIVE AND OPEN TO EVERY POSITION. Promote it freely, and lead with it whenever anyone asks "what is the actual product" or "what do I actually get" — it is the strongest answer we have: most programs hand you a referral link, this one hands you working software too. The team's marketing-toolkit portal: every paid position is a LICENSE to the toolkit; members connect their position's wallet (one free signature, same sign-in as the training gate and Mini App bridge) and their live contract level lights up their tools on a visible tool wall — Level 1 today includes the Promo Center, Printable Handouts, Fast Start + Weekly Rhythm, Generation Pay chart, Circle Method, Live Dashboard, and the AI coach; higher-level tiles (Copy Engine L2, Page Builder L2, Email Engine + Video Maker L3, Voice Profile + Funnels L4, Traffic Desk L5 (syndicated network display advertising — banner/text placements on the team's own ad network, monthly ad credits, rotator priority, AI campaign packs), Funnel Factory L6 (hosted funnels + Replay Funnels — an evergreen registration page around a recorded team webinar with a timed CTA, NOT live video conferencing/Zoom — + lead CRM), Leader Ops L7, Founder Desk L8) are shown honestly as IN DEVELOPMENT and unlock automatically as members upgrade once shipped; the Suite is included with membership, never sold), https://rmcircle.team/generation-pay (printable Generation Pay chart — the full when-does-each-generation-pay-me table with exact per-person POL amounts; enter a member ID and it personalizes from the live chain: shows the member's tier/level/qualification and marks each generation "catching now" vs "needs Level N"; Gen 8 pays the member's Gen 1, pass-overs only; Standard positions pay half; ROUTE members here for any generation-pay / who-pays-me-when question), https://rmcircle.team/fast-start (printable 48-Hour Fast Start checklist — personalized with the member's invite link and a scannable QR code when opened from their dashboard; prints clean black-on-white, and prints in whatever language the member selected with the 🌐 button), REQUIRED MEMBER PROFILE (2026-09-16): the first time someone proves they own a position (wallet personal_sign, or automatically in the Telegram Mini App) they must set a USERNAME and confirm an EMAIL with a 6-digit code before the member area opens; it cannot be skipped. Reason given to members: their leader can reach them, and they get an email the moment a payout lands. The email is never shown to other members and never sold, is changeable, and the 40 positions that already gave an email for payout alerts have it pre-filled to confirm. One email may hold several positions (Triple Play). The PUBLIC page rmcircle.team/my/ is unchanged and never asks for anything, and no profile can be written from it. https://rmcircle.team/my (member dashboard — its "Your team" panel opens with an organization bar: total members in your org, generations deep, qualified count below you, POL earned below you, and its approximate USD value at an hourly-cached POL price; the matrix under it drills leg by leg), https://rmcircle.team/tools (for existing team members who want to promote — share-ready promo videos (including the “Pocket Change” curiosity hook video — 25 ways people flush pocket change weekly with nothing to show for it, then the side-hustle flip; it deliberately shows no URL so the poster's invite link in the caption/description carries the credit, and matching pocket-change post copy sits in the Social posts section), copy-paste social posts, short/long email swipes, a downloadable banner kit in every standard size (incl. a 1280×720 Telegram group-ad image with a tap-the-link-below CTA — members pair it with their own Telegram-native invite link in the caption), a Printable Handouts maker at /flyers (linked from /tools#flyers and the dashboard) — five bold full-color half-sheet handout designs with detailed artwork (one per angle: pocket change, two people, phone, side-hustle graveyard, stop waiting) that print two copies per letter page with a cut line so members can print, cut, and hand out stacks, for offline/belly-to-belly promotion (coffee shops, gyms, community & church bulletin boards, laundromats); enter the member ID once and every handout personalizes with the member's own QR code and invite link overlaid on the artwork (angle-matched ?v= links so the landing page continues the hook); print in color for impact and the QR scans in black-and-white too, and an Official RM Circle Media library (13 vertical social videos + 15 graphics from the creators — pair them with your own invite link in the caption; each curiosity video also has a MATCHED invite link (adds ?v= to the member's /join link) that makes the landing page continue that video's hook — recommend it when members ask which link to use with a video); open it from the gold Promo Tools button on your dashboard and every post/swipe arrives pre-personalized with YOUR invite link; NEW Promote-on-Telegram section at /tools#telegram — the member's Telegram-native Mini App invite links (t.me links that open the whole tour INSIDE Telegram; tapping your own link previews the prospect view), paste-ready Telegram group posts + DMs, and the setup message to forward to their team; Text-a-friend section at /tools#text-a-friend — 5 SMS-sized messages (general + one per angle video, matched to that video's landing page) with one-tap share buttons: Text it (opens the phone's messaging app pre-filled), WhatsApp (wa.me pre-fill), Telegram (shares the member's Mini App invite), Copy for Messenger/Instagram DMs; to write promos in their own voice, mybrandedvoice.com; plus an Objection Handling bank at the bottom — truth + ready-to-send reply per objection, incl. the what's-the-product / members-area answer), https://rmcircle.team/disclaimer (affiliate/earnings/risk disclosures), https://rmcircle.team/lookup (FIND A MEMBER, public, added 2026-11-14: one box, type a member ID or paste a wallet address; shows that position's member ID, wallet (shortened, full address on hover plus a Copy button), current level and tier, join date, the sponsor's member ID (click it to look the sponsor up), number of direct referrals, a Polygonscan link and a link to their public dashboard /my/. Chain data only, read from the public contract: it never shows names, emails or anything off-chain, and answers can be a few minutes behind the chain. Route 'who is member #N / whose wallet is this / who sponsored X / is this wallet registered / how many directs does N have' questions here; also reachable at /find). - UPGRADING FROM THE DASHBOARD: a qualified member can upgrade their level directly on their dashboard (rmcircle.team/my/) — an "Upgrade" card appears with the exact next-level cost read live from the contract; they connect the wallet that OWNS the position, confirm one transaction, done. The site never touches the funds (wallet pays the contract directly). If the wallet doesn't cover the cost, they top it up by sending POL to that wallet from any exchange or on-ramp. On phones, open the page inside the wallet app's browser. - TELEGRAM COMPANION BOT: members can link their position (dashboard → Messages → "Connect Telegram", wallet-verified) to get instant payout DMs, native Telegram delivery of team messages (reply in Telegram to answer — matrix-line rules still apply), joined-on-your-link pings, and their invite/angle links via the "links" command. This finally lets members reach their downline as real people instead of just IDs — while handles stay private (the bot relays). Linked members can also tap the bot's ☰ menu button to open the MINI APP — the full live dashboard, promo tools, and Circle Method training right inside Telegram with zero login (Telegram itself proves who they are). Prospects can JOIN from the Mini App too: a member's Telegram-native invite link (the "links" command in the bot shows it) opens the sponsor's invite page right inside Telegram, and the join itself finishes in the prospect's own wallet app's secure browser — same zero-custody flow as the website. The website stays fully available too; the Mini App is a convenience door, not a replacement. - MESSAGES (on-site, wallet-verified): every member dashboard has a Messages panel — sign in once with the wallet that owns your position (a free signature, cannot move funds), then message your upline or anyone in your own team, or broadcast to your whole team. Spam-proof by design: messaging only works along your own matrix lines, so strangers can't message you. Unread messages show as a bell on your dashboard. Members are told the team admin can review messages for abuse. No email address needed. @@ -134,6 +135,24 @@ function memberLookupLimited(ip) { if (!rec || now > rec.reset) { lookupHits.set(ip, { count: 1, reset: now + 60000 }); return false; } rec.count++; return rec.count > 20; } +// Public "Find a member" (/lookup): its own per-IP limiter (12 per minute, separate from +// the dashboard's), a 3-minute answer cache keyed by the normalized query, and a global +// budget on cache misses that would need an RPC call, so a scripted sweep of random +// wallets can never turn into an RPC storm (2026-09-24 lesson). +const findHits = new Map(); +function findLimited(ip) { + const now = Date.now(), rec = findHits.get(ip); + if (!rec || now > rec.reset) { if (findHits.size > 5000) findHits.clear(); findHits.set(ip, { count: 1, reset: now + 60000 }); return false; } + rec.count++; return rec.count > 12; +} +const findCache = new Map(); +const FIND_TTL_MS = 180000; +const findRpcBudget = { n: 0, reset: 0 }; +function findRpcAllowed() { + const now = Date.now(); + if (now > findRpcBudget.reset) { findRpcBudget.n = 0; findRpcBudget.reset = now + 60000; } + findRpcBudget.n++; return findRpcBudget.n <= 60; +} // Admin login brute-force gate: after 8 failures from an IP, lock it out for // 15 minutes (escalating). Timing-safe password compare above. In-memory — // a restart clears it, which is fine (attacker loses their progress too). @@ -741,6 +760,31 @@ async function handleApi(req,res,pathname){ return json(res,200,r,{'Cache-Control':'public, max-age=30'}); }catch(e){return json(res,502,{error:e.message||'Lookup failed.'});} } + if(req.method==='GET'&&pathname==='/api/public/lookup'){ + const ip=String(req.headers['x-forwarded-for']||req.socket.remoteAddress||'').split(',')[0].trim(); + if(findLimited(ip))return json(res,429,{error:'Too many lookups. Give it a minute.'}); + const raw=String(new URL(req.url,'http://x').searchParams.get('q')||'').slice(0,80); + const pq=chain.parseLookupQuery(raw); + if(pq.error)return json(res,400,{error:pq.error}); + const key=pq.kind==='id'?'id:'+pq.id:'a:'+pq.address; + const hit=findCache.get(key); + if(hit&&Date.now()-hit.tssetTimeout(()=>rej(new Error('Lookup timed out. Try again.')),15000))]); + if(r&&r.busy){ + if(!findRpcAllowed())return json(res,503,{error:'The lookup is busy right now. Try again in a minute.'}); + r=await Promise.race([chain.lookupPublic(raw),new Promise((_,rej)=>setTimeout(()=>rej(new Error('Blockchain lookup timed out. Try again.')),15000))]); + } + if(r&&r.error)return json(res,400,{error:r.error}); + const out=r&&r.found + ? {found:true,id:r.id,account:r.account,level:r.level,levelName:r.levelName,tier:r.tier,tierName:r.tierName,joinedAt:r.joinedAt,sponsorId:r.sponsorId,directCount:r.directCount,source:r.source} + : {found:false,query:pq.kind==='id'?String(pq.id):pq.address}; + findCache.set(key,{ts:Date.now(),data:out}); + if(out.found&&pq.kind==='address')findCache.set('id:'+out.id,{ts:Date.now(),data:out}); + if(findCache.size>2000)findCache.delete(findCache.keys().next().value); + return json(res,200,out,{'Cache-Control':'public, max-age=60'}); + }catch(e){return json(res,502,{error:'Could not reach the blockchain just now. Try again in a minute.'});} + } if(req.method==='GET'&&pathname==='/api/public/member'){ const ip=String(req.headers['x-forwarded-for']||req.socket.remoteAddress||'').split(',')[0].trim(); if(memberLookupLimited(ip))return json(res,429,{error:'Too many lookups — give it a minute.'}); @@ -1922,7 +1966,7 @@ const server=http.createServer(async(req,res)=>{ return staticFile(req,res,path.join(__dirname,'private',PRIVATE_PAGES[pp])); } } let file; - if(pathname==='/')file=path.join(PUBLIC_DIR,'index.html');else if(pathname==='/app'||pathname==='/app/')file=path.join(PUBLIC_DIR,'app.html');else if(pathname==='/start'||pathname==='/start/')file=path.join(PUBLIC_DIR,'start.html');else if(pathname==='/training'||pathname==='/training/')file=path.join(PUBLIC_DIR,'training.html');else if(pathname==='/presentation'||pathname==='/presentation/'||pathname==='/webinar'||pathname==='/webinar/')file=path.join(PUBLIC_DIR,'presentation.html');else if(pathname==='/admin'||pathname==='/admin/')file=path.join(PUBLIC_DIR,'admin.html');else if(pathname==='/my'||pathname==='/my/'||/^\/my\/\d{1,15}$/.test(pathname))file=path.join(PUBLIC_DIR,'my.html');else if(pathname==='/contract'||pathname==='/contract/')file=path.join(PUBLIC_DIR,'contract.html');else if(pathname==='/disclaimer'||pathname==='/disclaimer/')file=path.join(PUBLIC_DIR,'disclaimer.html');else if(pathname==='/privacy'||pathname==='/privacy/')file=path.join(PUBLIC_DIR,'privacy.html');else if(pathname==='/refunds'||pathname==='/refunds/')file=path.join(PUBLIC_DIR,'refunds.html');else if(pathname==='/how-pay-works'||pathname==='/how-pay-works/')file=path.join(PUBLIC_DIR,'how-pay-works.html');else if(false)file=null;else if(pathname==='/tools'||pathname==='/tools/')file=path.join(PUBLIC_DIR,'tools.html');else if(pathname==='/fast-start'||pathname==='/fast-start/')file=path.join(PUBLIC_DIR,'fast-start.html');else if(pathname==='/flyers'||pathname==='/flyers/')file=path.join(PUBLIC_DIR,'flyers.html');else if(pathname==='/weekly-rhythm'||pathname==='/weekly-rhythm/')file=path.join(PUBLIC_DIR,'weekly-rhythm.html');else if(pathname==='/generation-pay'||pathname==='/generation-pay/')file=path.join(PUBLIC_DIR,'generation-pay.html');else if(pathname==='/replays'||pathname==='/replays/')file=path.join(PUBLIC_DIR,'replays.html');else if(pathname==='/suite'||pathname==='/suite/')file=path.join(PUBLIC_DIR,'suite.html');else if(pathname==='/suite/copy'||pathname==='/suite/copy/')file=path.join(PUBLIC_DIR,'suite-copy.html');else if(pathname==='/suite/page'||pathname==='/suite/page/')file=path.join(PUBLIC_DIR,'suite-page.html');else if(pathname==='/suite/email'||pathname==='/suite/email/')file=path.join(PUBLIC_DIR,'suite-email.html');else if(pathname==='/suite/video'||pathname==='/suite/video/')file=path.join(PUBLIC_DIR,'suite-video.html');else if(pathname==='/suite/traffic'||pathname==='/suite/traffic/')file=path.join(PUBLIC_DIR,'suite-traffic.html');else if(pathname==='/suite/voice'||pathname==='/suite/voice/')file=path.join(PUBLIC_DIR,'suite-voice.html');else if(pathname==='/suite/split'||pathname==='/suite/split/')file=path.join(PUBLIC_DIR,'suite-split.html');else if(pathname==='/suite/funnel'||pathname==='/suite/funnel/')file=path.join(PUBLIC_DIR,'suite-funnel.html');else if(pathname==='/suite/leader'||pathname==='/suite/leader/')file=path.join(PUBLIC_DIR,'suite-leader.html');else if(pathname==='/suite/founder'||pathname==='/suite/founder/')file=path.join(PUBLIC_DIR,'suite-founder.html');else if(pathname==='/wallet-check'||pathname==='/wallet-check/')file=path.join(PUBLIC_DIR,'wallet-check.html');else if(pathname==='/suite/brand'||pathname==='/suite/brand/')file=path.join(PUBLIC_DIR,'suite-brand.html');else if(pathname==='/suite/grants'||pathname==='/suite/grants/')file=path.join(PUBLIC_DIR,'suite-grants.html');else if(pathname==='/suite/intel'||pathname==='/suite/intel/')file=path.join(PUBLIC_DIR,'suite-intel.html');else if(pathname==='/direct-join'||pathname==='/direct-join/'){if(!getSession(req)){res.writeHead(302,{Location:'/admin'});return res.end();}file=path.join(ROOT,'private','direct-join.html');}else if(pathname==='/join-now'||pathname==='/join-now/'){if(!getConfig().dappFallbackPublic){res.writeHead(302,{Location:'/start'});return res.end();}file=path.join(ROOT,'private','join-now.html');}else if(/^\/join\/\d{1,15}$/.test(pathname))file=path.join(PUBLIC_DIR,'join.html');else if(pathname==='/join'||pathname==='/join/'){res.writeHead(302,{Location:'/join-now'});return res.end();}else{ + if(pathname==='/')file=path.join(PUBLIC_DIR,'index.html');else if(pathname==='/app'||pathname==='/app/')file=path.join(PUBLIC_DIR,'app.html');else if(pathname==='/start'||pathname==='/start/')file=path.join(PUBLIC_DIR,'start.html');else if(pathname==='/training'||pathname==='/training/')file=path.join(PUBLIC_DIR,'training.html');else if(pathname==='/presentation'||pathname==='/presentation/'||pathname==='/webinar'||pathname==='/webinar/')file=path.join(PUBLIC_DIR,'presentation.html');else if(pathname==='/admin'||pathname==='/admin/')file=path.join(PUBLIC_DIR,'admin.html');else if(pathname==='/my'||pathname==='/my/'||/^\/my\/\d{1,15}$/.test(pathname))file=path.join(PUBLIC_DIR,'my.html');else if(pathname==='/contract'||pathname==='/contract/')file=path.join(PUBLIC_DIR,'contract.html');else if(pathname==='/disclaimer'||pathname==='/disclaimer/')file=path.join(PUBLIC_DIR,'disclaimer.html');else if(pathname==='/privacy'||pathname==='/privacy/')file=path.join(PUBLIC_DIR,'privacy.html');else if(pathname==='/refunds'||pathname==='/refunds/')file=path.join(PUBLIC_DIR,'refunds.html');else if(pathname==='/how-pay-works'||pathname==='/how-pay-works/')file=path.join(PUBLIC_DIR,'how-pay-works.html');else if(false)file=null;else if(pathname==='/tools'||pathname==='/tools/')file=path.join(PUBLIC_DIR,'tools.html');else if(pathname==='/fast-start'||pathname==='/fast-start/')file=path.join(PUBLIC_DIR,'fast-start.html');else if(pathname==='/flyers'||pathname==='/flyers/')file=path.join(PUBLIC_DIR,'flyers.html');else if(pathname==='/weekly-rhythm'||pathname==='/weekly-rhythm/')file=path.join(PUBLIC_DIR,'weekly-rhythm.html');else if(pathname==='/generation-pay'||pathname==='/generation-pay/')file=path.join(PUBLIC_DIR,'generation-pay.html');else if(pathname==='/replays'||pathname==='/replays/')file=path.join(PUBLIC_DIR,'replays.html');else if(pathname==='/suite'||pathname==='/suite/')file=path.join(PUBLIC_DIR,'suite.html');else if(pathname==='/suite/copy'||pathname==='/suite/copy/')file=path.join(PUBLIC_DIR,'suite-copy.html');else if(pathname==='/suite/page'||pathname==='/suite/page/')file=path.join(PUBLIC_DIR,'suite-page.html');else if(pathname==='/suite/email'||pathname==='/suite/email/')file=path.join(PUBLIC_DIR,'suite-email.html');else if(pathname==='/suite/video'||pathname==='/suite/video/')file=path.join(PUBLIC_DIR,'suite-video.html');else if(pathname==='/suite/traffic'||pathname==='/suite/traffic/')file=path.join(PUBLIC_DIR,'suite-traffic.html');else if(pathname==='/suite/voice'||pathname==='/suite/voice/')file=path.join(PUBLIC_DIR,'suite-voice.html');else if(pathname==='/suite/split'||pathname==='/suite/split/')file=path.join(PUBLIC_DIR,'suite-split.html');else if(pathname==='/suite/funnel'||pathname==='/suite/funnel/')file=path.join(PUBLIC_DIR,'suite-funnel.html');else if(pathname==='/suite/leader'||pathname==='/suite/leader/')file=path.join(PUBLIC_DIR,'suite-leader.html');else if(pathname==='/suite/founder'||pathname==='/suite/founder/')file=path.join(PUBLIC_DIR,'suite-founder.html');else if(pathname==='/wallet-check'||pathname==='/wallet-check/')file=path.join(PUBLIC_DIR,'wallet-check.html');else if(pathname==='/lookup'||pathname==='/lookup/'||pathname==='/find'||pathname==='/find/')file=path.join(PUBLIC_DIR,'lookup.html');else if(pathname==='/suite/brand'||pathname==='/suite/brand/')file=path.join(PUBLIC_DIR,'suite-brand.html');else if(pathname==='/suite/grants'||pathname==='/suite/grants/')file=path.join(PUBLIC_DIR,'suite-grants.html');else if(pathname==='/suite/intel'||pathname==='/suite/intel/')file=path.join(PUBLIC_DIR,'suite-intel.html');else if(pathname==='/direct-join'||pathname==='/direct-join/'){if(!getSession(req)){res.writeHead(302,{Location:'/admin'});return res.end();}file=path.join(ROOT,'private','direct-join.html');}else if(pathname==='/join-now'||pathname==='/join-now/'){if(!getConfig().dappFallbackPublic){res.writeHead(302,{Location:'/start'});return res.end();}file=path.join(ROOT,'private','join-now.html');}else if(/^\/join\/\d{1,15}$/.test(pathname))file=path.join(PUBLIC_DIR,'join.html');else if(pathname==='/join'||pathname==='/join/'){res.writeHead(302,{Location:'/join-now'});return res.end();}else{ const safe=path.normalize(pathname).replace(/^([.][.][/\\])+/, '').replace(/^[/\\]+/,'');file=path.join(PUBLIC_DIR,safe);if(!file.startsWith(PUBLIC_DIR))file=''; } if(file&&staticFile(req,res,file))return;return staticFile(req,res,path.join(PUBLIC_DIR,'404.html'),404);