diff --git a/netsites.js b/netsites.js new file mode 100644 index 0000000..2536f92 --- /dev/null +++ b/netsites.js @@ -0,0 +1,40 @@ +// The network sites list for the footer's "Part of the network" line (Marty 2026-11-14 trust pack). +// One source: the hub's public GET /v1/network-sites (HUB_URL). Cached 10 minutes, refreshed in the background, never waits on a +// slow hub (2.5 s timeout), and falls back to the same built-in list. Never RM Circle, never the games. +// The same file lives in every network site (InstantAdPay, LinkSpin, Downline Banners, VBB, Stack POL). +const FALLBACK = [ + { id: 'iap', name: 'InstantAdPay', url: 'https://instantadpay.com' }, + { id: 'linkspin', name: 'LinkSpin', url: 'https://linkspin.app' }, + { id: 'dlb', name: 'Downline Banners', url: 'https://downlinebanners.com' }, + { id: 'vbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com' }, + { id: 'stackpol', name: 'Stack POL', url: 'https://stackpol.com' }, + { id: 'earnerscorner', name: 'Earners Corner', url: 'https://earnerscorner.com' } +]; +const TTL = 10 * 60 * 1000; +let cache = { at: 0, list: FALLBACK, from: 'fallback' }; +let inflight = null; + +const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, ''); +function clean(list) { + if (!Array.isArray(list)) return null; + const ok = list.filter(s => s && typeof s.name === 'string' && /^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(s.url || ''))) + .slice(0, 30).map(s => ({ id: String(s.id || s.name).toLowerCase().replace(/[^a-z0-9]+/g, '').slice(0, 30), name: String(s.name).slice(0, 60), url: String(s.url).replace(/\/+$/, '') })); + return ok.length ? ok : null; +} +function refresh() { + if (inflight || process.env.NETWORK_SITES_HUB === '0') return inflight; + const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500); + inflight = fetch(hubUrl() + '/v1/network-sites', { signal: ac.signal }) + .then(r => (r.ok ? r.json() : null)) + .then(j => { const l = clean(j); if (l) cache = { at: Date.now(), list: l, from: 'hub' }; else cache.at = Date.now(); }) + .catch(() => { cache.at = Date.now() - TTL + 60 * 1000; }) // hub down: try again in a minute, keep the last good list + .finally(() => { clearTimeout(t); inflight = null; }); + return inflight; +} +function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list; } +// GET /api/network-sites: public, cacheable, the same answer on every page +function handle(req, res) { + res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=300', 'X-Content-Type-Options': 'nosniff' }); + res.end(JSON.stringify(list())); +} +module.exports = { list, handle, refresh, FALLBACK, _state: () => cache }; diff --git a/public/assets/common.js b/public/assets/common.js index 7f912b2..71ee3a2 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -37,10 +37,24 @@ window.BL = (function () { f.className = 'bl-foot'; f.innerHTML = '

Part of the Crypto Team Build Network

' + '

A spot buys 300 guaranteed views on the board and a place in the line. Nothing is promised: you are paid only when spots sell after yours, and a spot can earn back less than it cost.

' - + '

How it works · Board · Live ledger · Contract proof · Promote · My Spots

'; + + '

How it works · Board · Live ledger · Contract proof · Promote · My Spots

' + // trust pack (Marty 2026-11-14): legal + proof links, company line, and the network line served by the hub + + '' + + '

TrustClickz · 615 Green Valley Drive, Moody, AL 35004

'; document.body.appendChild(f); + netLine(f.querySelector('.netline')); toasts(); } + // "Part of the network": the list comes from the hub through /api/network-sites, the built-in copy if it does not answer + const NET = [['iap', 'InstantAdPay', 'https://instantadpay.com'], ['linkspin', 'LinkSpin', 'https://linkspin.app'], ['dlb', 'Downline Banners', 'https://downlinebanners.com'], + ['vbb', 'Viral Banner Blitz', 'https://viralbannerblitz.com'], ['stackpol', 'Stack POL', 'https://stackpol.com'], ['earnerscorner', 'Earners Corner', 'https://earnerscorner.com']].map(a => ({ id: a[0], name: a[1], url: a[2] })); + function netLine(el) { + if (!el) return; + const paint = list => { el.innerHTML = 'Part of the network · One account across the network: ' + list.map(s => (s.id === 'dlb' || /downlinebanners\.com/.test(s.url)) + ? '' + esc(s.name) + '' : '' + esc(s.name) + '').join(' · '); }; + paint(NET); + fetch('/api/network-sites').then(r => r.json()).then(l => { if (Array.isArray(l) && l.length) paint(l); }).catch(() => {}); + } // one spot tile; href goes through the /go relay, which counts the click function tile(t, opts) { const a = document.createElement('a'); diff --git a/public/assets/legal.js b/public/assets/legal.js new file mode 100644 index 0000000..8819b02 --- /dev/null +++ b/public/assets/legal.js @@ -0,0 +1,2 @@ +// Terms, Earnings Disclaimer, Privacy (trust pack 2026-11-14): nav + footer only. +(async function () { await BL.renderNav(location.pathname); BL.renderFooter(); })(); diff --git a/public/assets/line.css b/public/assets/line.css index 7f68f7a..a3ceb5e 100644 --- a/public/assets/line.css +++ b/public/assets/line.css @@ -63,3 +63,8 @@ nav .links a.active{color:var(--mint-ink);background:var(--mint)} .bl-zone{display:flex;flex-direction:column;align-items:center;gap:3px;margin:16px auto;max-width:100%;overflow:hidden} .bl-zone-label{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);opacity:.7} .bl-zone-foot{margin-top:28px} +/* trust pack (2026-11-14): footer legal links, network line, legal pages */ +.bl-foot .legal-links{margin-top:12px} +.bl-foot .netline{margin-top:12px;padding-top:12px;border-top:1px solid var(--line);line-height:1.9} +.bl-foot .netline .here{color:var(--mint-ink);background:var(--mint);font-weight:700;border-radius:999px;padding:1px 9px} +.legal .card h2{font-size:21px} .legal .card p,.legal .card li{max-width:760px;color:var(--ink)} .legal .card ul{padding-left:20px} .legal .card li{margin:6px 0} diff --git a/public/board.html b/public/board.html index 20c6351..c676fb6 100644 --- a/public/board.html +++ b/public/board.html @@ -21,7 +21,7 @@ - +
@@ -31,7 +31,7 @@

The line so far

- + diff --git a/public/contract.html b/public/contract.html index 989d3e4..5458b76 100644 --- a/public/contract.html +++ b/public/contract.html @@ -21,7 +21,7 @@ - +
@@ -35,7 +35,7 @@
  • Open any sale in the live ledger and look at its Logs: one SpotBought event, then one Paid event per payment.
  • - + diff --git a/public/disclaimer.html b/public/disclaimer.html new file mode 100644 index 0000000..482aef5 --- /dev/null +++ b/public/disclaimer.html @@ -0,0 +1,39 @@ + + + + +Earnings Disclaimer | Downline Banners + + + + + + + + + + + + + + + + + + + + + +
    +

    Earnings Disclaimer

    Please read this before you buy anything.

    Last updated November 14, 2026

    +

    Advertising, not an investment

    Downline Banners sells advertising. It is not an investment, a security, a savings plan or an income opportunity, and nothing you buy here is a promise of money back.

    +

    No earnings promised

    The only money a spot can bring back is its share of spots bought after it (and the sponsor share when someone you introduced buys). That depends entirely on other people choosing to buy later. If nobody buys after you, you receive nothing.

    Most members who do not introduce anyone should expect to get back less than they paid, and possibly nothing. Members who introduce others are paid only when those people actually buy.

    We do not promise, project or guarantee any earnings. Any numbers in examples, posts, banners or videos are illustrations or one member's results, not what you should expect.

    +

    How any payment happens

    Any payment to you happens only on the blockchain, when a later purchase happens, and is paid by the smart contract in that same transaction. Nothing is held for you and there is nothing to withdraw. If no later purchase happens, no payment happens.

    +

    Crypto risk

    +

    Your decision

    Only spend what you can afford to lose completely. This is not financial, legal or tax advice. You are responsible for any taxes on what you receive.

    +

    Contact

    Questions, problems or a request about your data: network support, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.

    +
    + + + + diff --git a/public/how.html b/public/how.html index 0c9fc70..07cf282 100644 --- a/public/how.html +++ b/public/how.html @@ -21,7 +21,7 @@ - +
    @@ -39,7 +39,7 @@

    The momentum fund

    When no spot has sold for 4 hours, the fund buys one (at most 12 a day). It gifts the spot to an active member who owns a paid spot and has not had a gift in 7 days, members who referred someone recently first. If nobody qualifies, the fund keeps the spot and its line money goes back into the fund.

    The rest of the network

    Open board slots show network sites such as InstantAdPay and LinkSpin. On InstantAdPay, ad credits buy advertising, not income.

    - + diff --git a/public/index.html b/public/index.html index 2096162..2cb761b 100644 --- a/public/index.html +++ b/public/index.html @@ -22,7 +22,7 @@ - +
    @@ -52,7 +52,7 @@
    - + diff --git a/public/join.html b/public/join.html index 5630228..e38b6ba 100644 --- a/public/join.html +++ b/public/join.html @@ -21,7 +21,7 @@ - +
    @@ -48,7 +48,7 @@
    - + diff --git a/public/ledger.html b/public/ledger.html index 0d327dc..785c63b 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -21,7 +21,7 @@ - +
    @@ -30,7 +30,7 @@

    Spot sales

    Loading the ledger...

    - + diff --git a/public/my.html b/public/my.html index 21392f3..7fc3db0 100644 --- a/public/my.html +++ b/public/my.html @@ -22,7 +22,7 @@ - +
    @@ -41,7 +41,7 @@
    - + diff --git a/public/privacy.html b/public/privacy.html new file mode 100644 index 0000000..50048a3 --- /dev/null +++ b/public/privacy.html @@ -0,0 +1,40 @@ + + + + +Privacy Policy | Downline Banners + + + + + + + + + + + + + + + + + + + + + +
    +

    Privacy Policy

    What we collect, why, and who sees it.

    Last updated November 14, 2026

    +

    Who we are

    Downline Banners is run by TrustClickz, 615 Green Valley Drive, Moody, AL 35004. This policy says what we collect, why, and who sees it.

    +

    What we collect

    +

    One account across the network

    The Crypto Team Build Network shares one account across its sites through the network hub. The hub keeps your email address, username, wallet and sponsor, and each network site (InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, Stack POL, Earners Corner) asks it who you are, so you have one identity and one sponsor everywhere. Sites only see what they need.

    +

    What is public

    Purchases and payments on the blockchain are public and permanent: anyone can see the wallet addresses and amounts, and nobody can delete them. Our live ledger, leaderboards and toasts show your network username or a shortened wallet. When a spot sells, a payment message with the buyer's username (or a shortened wallet) and the amounts paid is posted to the network's Telegram payments topic.

    +

    Who else sees it

    We do not sell your data. We use service providers to run the site (hosting, databases, blockchain connections, and Telegram for the payment messages), and we share data if the law requires it.

    +

    Your choices

    You can ask us to delete your account data on this site or on the network hub. Records on the blockchain cannot be deleted by anyone. You can clear the cookies in your browser at any time; you will need to sign in again.

    +

    Contact

    Questions, problems or a request about your data: network support, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.

    +
    + + + + diff --git a/public/promote.html b/public/promote.html index 1b9f0a0..2c2be01 100644 --- a/public/promote.html +++ b/public/promote.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@

    Loading the kit...

    - + diff --git a/public/terms.html b/public/terms.html new file mode 100644 index 0000000..8b2612b --- /dev/null +++ b/public/terms.html @@ -0,0 +1,45 @@ + + + + +Terms and Conditions | Downline Banners + + + + + + + + + + + + + + + + + + + + + +
    +

    Terms and Conditions

    The rules for using Downline Banners, in plain English.

    Last updated November 14, 2026

    +

    Who we are

    Downline Banners (downlinebanners.com) is run by TrustClickz, 615 Green Valley Drive, Moody, AL 35004. It is part of the Crypto Team Build Network: one network account works across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, Stack POL and Earners Corner. By using Downline Banners you agree to these terms.

    +

    What Downline Banners is

    Downline Banners is one global line of 468x60 banner spots on the Polygon blockchain.

    +

    What you buy

    A spot costs $5, paid in POL at the Chainlink POL/USD price the contract reads at the moment you buy. Anything you send above the price comes back to you in the same transaction.

    A spot buys advertising: 300 guaranteed views of your banner and link on the board, delivered within 30 days, and a place in the line. It does not buy income, a share of a business or an investment.

    Every spot is a single, one-time purchase. Nothing renews and nothing is ever billed again. There are no subscriptions.

    +

    How a payment is split

    The Downline Banners contract splits each $5 in the same transaction it is paid: 30% to the buyer's sponsor (no sponsor: the momentum fund), 55% to the owners of the 10 spots bought just before it (5.5% each), 10% to the company and 5% to the momentum fund.

    The contract holds nothing except the momentum fund, which can only buy spots. When no spot has sold for a while, the fund buys one and gifts it to an active member, following the rules on the How it works page. The split is fixed in the contract code and there is no owner withdraw.

    You are paid only when spots sell after yours. A payment goes straight to your wallet in the transaction of the later purchase. Nothing is held for you and there is nothing to withdraw.

    The sponsor paid for a spot is decided when you buy: the network sponsor the network hub knows for the wallet that will own the spot, else the welcome link or referral link you arrived through. It is recorded on the contract with the purchase.

    +

    Nothing is promised

    We do not promise or guarantee any income, payout, prize or result. Read the Earnings Disclaimer.

    +

    No refunds

    Payments are made on the blockchain and are final once confirmed. We cannot reverse, cancel or refund them. Check the amount and what you are buying before you confirm in your wallet.

    +

    Crypto risk

    +

    Fair use

    Board views are counted for real browsers only. Bots, crawlers and repeated views from the same visitor do not count. We decide what counts as a view so the count stays honest for every advertiser.

    Your banner must be your own or one you have the right to use, and its link must lead to a lawful page. No adult content, malware, phishing, deceptive offers, hate, or anything illegal where you or your visitors live. We may take a banner off the board and close an account that breaks these rules. A spot already bought stays on the blockchain; its views may stop if its banner breaks the rules.

    Do not try to break, overload or game the site, and do not use more than one account to get extra free credits, views or prizes.

    +

    Your account

    You sign in with your wallet or through InstantAdPay or LinkSpin. Your network account, username and sponsor are shared across the network through the network hub, as described in the Privacy Policy. You must be old enough to make a binding agreement where you live, and using crypto must be legal there.

    +

    The service

    The site is provided as it is. We work to keep it running but cannot promise it will always be available or free of errors. The smart contract runs on Polygon on its own; its rules are public and can be checked on the contract page. We may change features, prices of future purchases or these terms; changes apply from the date they are posted here.

    +

    Limits

    As far as the law allows, we are not responsible for losses caused by the blockchain, your wallet, the price of POL, third-party websites in banners, or events outside our control, and our total responsibility to you is limited to what you paid for the purchase in question. These terms are governed by the laws of the State of Alabama, USA.

    +

    Contact

    Questions, problems or a request about your data: network support, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.

    +
    + + + + diff --git a/qa/smoke.mjs b/qa/smoke.mjs index 5091a04..1d2e19e 100644 --- a/qa/smoke.mjs +++ b/qa/smoke.mjs @@ -29,11 +29,19 @@ const ok = (cond, what, extra) => { if (cond) { pass++; console.log(' ok ' + // hub is unreachable). HUB.people: {id, username, wallet, sponsorId}; HUB.down makes every hub call fail with 503. const HUB = { people: [], down: false, calls: 0, badSig: 0 }; const HUB_PORT = APP_PORT + 7, HUB_SECRET = 'b'.repeat(40); const IAPNET = new Map(); const IAP_PORT = APP_PORT + 8; +const TG = []; const TG_PORT = APP_PORT + 9; // stand-in Telegram Bot API (trust pack 2026-11-14): never the real group const hubView = p => p ? { id: p.id, username: p.username, wallet: p.wallet, sponsor: (x => x ? { id: x.id, username: x.username } : null)(HUB.people.find(y => y.id === p.sponsorId)), blocked: false, locked: false } : null; function startStandIns() { const http = require('node:http'); const crypto = require('node:crypto'); - http.createServer(async (q, r) => { let b = ''; for await (const c of q) b += c; HUB.calls++; + http.createServer((q, r) => { let b = ''; q.on('data', c => { b += c; }); q.on('end', () => { let j = {}; try { j = JSON.parse(b || '{}'); } catch (e) {} + TG.push({ method: q.url.split('/').pop(), token: q.url.split('/')[1], body: j }); r.setHeader('Content-Type', 'application/json'); r.end('{"ok":true,"result":{}}'); }); }).listen(TG_PORT, '127.0.0.1'); + http.createServer(async (q, r) => { let b = ''; for await (const c of q) b += c; r.setHeader('Content-Type', 'application/json'); + // the real hub serves the footer's network list publicly, unsigned (GET /v1/network-sites) + if (q.method === 'GET' && q.url === '/v1/network-sites') return r.end(JSON.stringify([{ id: 'iap', name: 'InstantAdPay', url: 'https://instantadpay.com' }, { id: 'linkspin', name: 'LinkSpin', url: 'https://linkspin.app' }, + { id: 'dlb', name: 'Downline Banners', url: 'https://downlinebanners.com' }, { id: 'vbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com' }, { id: 'stackpol', name: 'Stack POL', url: 'https://stackpol.com' }, + { id: 'earnerscorner', name: 'Earners Corner', url: 'https://earnerscorner.com' }, { id: 'newsite', name: 'Hub Test Site', url: 'https://example.org' }])); + HUB.calls++; if (HUB.down) { r.statusCode = 503; return r.end('{"error":"superseded"}'); } const want = crypto.createHmac('sha256', HUB_SECRET).update(q.headers['x-hub-ts'] + '\n' + b).digest('hex'); if (q.headers['x-hub-sig'] !== want || q.headers['x-hub-site'] !== 'bannerline') { HUB.badSig++; r.statusCode = 401; return r.end('{"error":"unauthorized"}'); } @@ -107,7 +115,8 @@ async function main() { fs.writeFileSync(path.join(DATA, 'house.json'), JSON.stringify([{ key: 'one', title: 'Test house 1', img: '/art/house-iap.svg', link: 'https://example.com/' }, { key: 'two', title: 'Test house 2', img: '/art/house-linkspin.svg', link: 'https://example.net/' }])); const env = Object.assign({}, process.env, { PORT: String(APP_PORT), DATA_DIR: DATA, CHAIN_ID: '31337', RPC_URLS: 'http://127.0.0.1:' + RPC_PORT, CONTRACT_ADDRESS: CA, DEPLOY_BLOCK: String(deployBlock), POLL_MS: '1000', ADMIN_TOKEN: ADMIN, KEEPER_ENABLED: '1', KEEPER_KEY: W[7].signer.privateKey, KEEPER_STALL_HOURS: '0.01', KEEPER_EVERY_MIN: '0.25', NODE_ENV: 'development', - HUB_URL: 'http://127.0.0.1:' + HUB_PORT, HUB_SECRET, HUB_SITE: 'bannerline', HUB_ENABLED: '0', HUB_DOWN_MS: '400', NETWORK_LOOKUP_URL: 'http://127.0.0.1:' + IAP_PORT + '/api/network/member' }); + HUB_URL: 'http://127.0.0.1:' + HUB_PORT, HUB_SECRET, HUB_SITE: 'bannerline', HUB_ENABLED: '0', HUB_DOWN_MS: '400', NETWORK_LOOKUP_URL: 'http://127.0.0.1:' + IAP_PORT + '/api/network/member', + TG_TOKEN: 'standin-token', TG_CHAT: '-100123', TG_PAY_TOPIC: '632242', TG_API: 'http://127.0.0.1:' + TG_PORT }); startStandIns(); const hid = n => 'h_' + String(n).padStart(16, '0'); const ZW = ethers.Wallet.createRandom().address.toLowerCase(); // a network member with no spot here @@ -126,6 +135,13 @@ async function main() { const qq = await u.json('/api/quote'); ok(qq.wei === q.toString() && qq.source === 'contract.quoteWei', '/api/quote reads quoteWei()', qq); for (const p of ['/', '/board', '/join', '/my', '/how', '/assets/site.css', '/art/house-line.svg']) { const r = await u.req(p); ok(r.status === 200, 'GET ' + p + ' 200'); } const r404 = await u.req('/nope'); ok(r404.status === 404, 'unknown path 404'); + // trust pack (2026-11-14): legal pages + the network list from the hub + for (const p of ['/terms', '/disclaimer', '/privacy']) { const r = await u.req(p); const h = await r.text(); + ok(r.status === 200 && h.includes('TrustClickz, 615 Green Valley Drive, Moody, AL 35004') && !h.includes('—') && !/at most 10 times|\$2\.75/.test(h), 'GET ' + p + ' 200 (TrustClickz, no em dash, no cap)'); } + { const legal = (await (await u.req('/terms')).text()) + (await (await u.req('/disclaimer')).text()) + (await (await u.req('/privacy')).text()); + ok(/300 guaranteed views/.test(legal) && /ever billed again/.test(legal) && /final once confirmed/.test(legal) && /momentum fund/.test(legal) && /network hub/.test(legal) && /not an investment/.test(legal), 'legal pages state the real mechanics (advertising, one-time, no refunds on-chain, momentum fund, the hub)'); } + { let ns; for (let i = 0; i < 20; i++) { ns = await (await u.req('/api/network-sites')).json(); if (Array.isArray(ns) && ns.length === 7) break; await sleep(150); } + ok(Array.isArray(ns) && ns.length === 7 && ns[6].name === 'Hub Test Site', '/api/network-sites serves the hub list (a site added on the hub shows up)', ns && ns.map(x => x.name)); } // promo kit (2026-11-14): one public feed read by /promote and by InstantAdPay's promo center { const kr = await u.req('/api/promo-kit?u=alpha'); const k = await kr.json(); @@ -240,6 +256,14 @@ async function main() { const wv = client(); await wv.req('/w/' + wc); sp = await wv.json('/api/sponsor'); ok(sp.address === addr[B].toLowerCase() && sp.via === 'line', '/w/ welcome line: usernames resolved through the hub, first one with a spot here', sp); ok(HUB.badSig === 0 && HUB.calls > 0, 'every hub call is signed as bannerline with HUB_SECRET', HUB); + // Telegram payment proof (stand-in API): one message per sale, with this week's numbers and an image above the text + { const stt = await u.json('/api/stats'); let msgs = []; for (let i = 0; i < 40; i++) { msgs = TG.filter(c => c.method === 'sendMessage'); if (msgs.length >= stt.totals.spots) break; await sleep(250); } + const txs = msgs.map(c => (String(c.body.text).match(/\/tx\/(0x[0-9a-f]{64})/) || [])[1]); + ok(msgs.length === stt.totals.spots && new Set(txs).size === msgs.length && txs.every(Boolean), 'one Telegram message per spot sale, never two for the same tx', { msgs: msgs.length, spots: stt.totals.spots }); + ok(msgs.every(c => c.token === 'botstandin-token' && c.body.chat_id === '-100123' && c.body.message_thread_id === 632242 && /This week: \d+ spots? .*\d+ spots in the line/.test(c.body.text) + && c.body.link_preview_options && /^https:\/\/[^/]+\/art\/kit\/dlb-(spot|line|instant)-social\.png$/.test(c.body.link_preview_options.url) && c.body.link_preview_options.show_above_text === true && !c.body.text.includes('—')), + 'each message: payments topic, this week\'s spot numbers, a large kit image above the text', msgs[0] && msgs[0].body); + ok(new Set(msgs.map(c => c.body.link_preview_options && c.body.link_preview_options.url)).size > 1, 'the image rotates between messages'); } HUB.down = true; sp = await u.json('/api/sponsor?ref=iapfallback'); ok(sp.address === addr[D].toLowerCase(), 'hub unreachable: InstantAdPay answers the username lookup', sp); const t0 = Date.now(); sp = await rv.json('/api/sponsor?for=' + ethers.Wallet.createRandom().address); ok(sp.via === 'ref' && Date.now() - t0 < 2000, 'hub unreachable: the sponsor pick falls back at once (no wait on the hub)', [sp, Date.now() - t0]); @@ -270,7 +294,7 @@ async function main() { const watch = (pg, name) => { pg.on('console', msg => { if (msg.type() === 'error') errors.push(name + ': ' + msg.text() + ' @ ' + ((msg.location() || {}).url || '')); }); pg.on('pageerror', e => errors.push(name + ': ' + e.message)); }; // member context: signed in, gate skipped const ctxM = await browser.newContext(); await ctxM.addCookies([{ name: 'bl.sid', value: m.jar['bl.sid'], url: BASE }]); - for (const p of ['/', '/board', '/how', '/join', '/my', '/promote']) { + for (const p of ['/', '/board', '/how', '/join', '/my', '/promote', '/terms', '/disclaimer', '/privacy']) { const pg = await ctxM.newPage(); watch(pg, 'member ' + p); await pg.goto(BASE + p, { waitUntil: 'networkidle' }); await pg.screenshot({ path: path.join(OUT, 'member' + (p === '/' ? '-home' : p.replace('/', '-')) + '.png'), fullPage: true }); @@ -281,6 +305,14 @@ async function main() { await pg.waitForTimeout(500); await pg.screenshot({ path: path.join(OUT, 'member-promote.png'), fullPage: true }); await pg.setViewportSize({ width: 390, height: 844 }); await pg.waitForTimeout(300); await pg.screenshot({ path: path.join(OUT, 'member-promote-phone.png'), fullPage: true }); } if (p === '/join') { await pg.waitForSelector('#buyCard:not([hidden])', { timeout: 8000 }).catch(() => {}); const price = await pg.textContent('#price'); ok(/^0\.0025/.test(price), '/join shows price ' + price); } + if (p === '/how') { await pg.waitForFunction(() => /Hub Test Site/.test((document.querySelector('footer .netline') || {}).textContent || ''), null, { timeout: 6000 }).catch(() => {}); + const ft = (await pg.textContent('footer')).replace(/\s+/g, ' '); const hrefs = await pg.$$eval('footer a', as => as.map(a => a.getAttribute('href'))); + ok(['/terms', '/disclaimer', '/privacy', '/contract', '/ledger'].every(h => hrefs.includes(h)) && /Support/.test(ft) && /TrustClickz · 615 Green Valley Drive, Moody, AL 35004/.test(ft) + && /Part of the network · One account across the network: InstantAdPay · LinkSpin · Downline Banners · Viral Banner Blitz · Stack POL · Earners Corner · Hub Test Site/.test(ft) && !/RM Circle|rmcircle/i.test(ft) + && (await pg.textContent('footer .netline .here')) === 'Downline Banners', 'footer: legal + proof links, company line, the hub network list with DLB as current, never RM Circle', ft.slice(-420)); + await pg.locator('footer').screenshot({ path: path.join(OUT, 'footer-desktop.png') }); + await pg.setViewportSize({ width: 390, height: 844 }); await pg.waitForTimeout(200); + ok(await pg.evaluate(() => document.documentElement.scrollWidth <= 390), 'footer fits a phone (no sideways scroll)'); await pg.locator('footer').screenshot({ path: path.join(OUT, 'footer-phone.png') }); } const em = await pg.evaluate(() => document.body.innerText.includes('\u2014')); ok(!em, p + ' has no em dash'); await pg.close(); } diff --git a/server.js b/server.js index b649d6b..aaf8fe4 100644 --- a/server.js +++ b/server.js @@ -15,6 +15,7 @@ const keeper = require('./keeper'); const { iface } = require('./abi'); const dlbnas = require('./dlbnas'); // Network Ad Space: standing house banner + finishing spots still owed views after 30 days (2026-11-13) const refuelspots = require('./refuelspots'); // refuel spots: $50+ Monthly Refuels earn a spot, engine wallet pays (2026-11-13) +const netsites = require('./netsites'); // footer network list from the hub (trust pack 2026-11-14) const tgproof = require('./tgproof'); // payment proof in the Telegram payments topic, one message per spot sale (2026-11-13) const hubreport = require('./hubreport'); // network hub, shadow mode: members reported by wallet (2026-11-13), off unless HUB_ENABLED const promokit = require('./promokit'); // promo kit feed /api/promo-kit, the /promote page, /art/kit/* creatives (2026-11-14) @@ -286,7 +287,8 @@ const server = http.createServer(async (req, res) => { let OR = {}; try { OR = JSON.parse(fs.readFileSync(path.join(C.dataDir, 'oldrefs.json'), 'utf8')); } catch (e) {} const net = old && OR[old]; res.writeHead(301, { Location: net ? '/?ref=' + encodeURIComponent(net) : '/', 'Cache-Control': 'no-store' }); return res.end(); } - const PAGES = { '/': 'index.html', '/board': 'board.html', '/join': 'join.html', '/my': 'my.html', '/how': 'how.html', '/ledger': 'ledger.html', '/contract': 'contract.html' }; + const PAGES = { '/': 'index.html', '/board': 'board.html', '/join': 'join.html', '/my': 'my.html', '/how': 'how.html', '/ledger': 'ledger.html', '/contract': 'contract.html', + '/terms': 'terms.html', '/disclaimer': 'disclaimer.html', '/privacy': 'privacy.html' }; // legal pages: trust pack 2026-11-14 if (PAGES[p]) { const set = []; if (setVid) set.push(setVid); @@ -299,7 +301,7 @@ const server = http.createServer(async (req, res) => { // sitemap (2026-11-13, SEO): the public pages only if (p === '/sitemap.xml') { const day = new Date().toISOString().slice(0, 10); - const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join', '/promote'].map(u => 'https://' + C.site + u + '' + day + '').join(''); + const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join', '/promote', '/terms', '/disclaimer', '/privacy'].map(u => 'https://' + C.site + u + '' + day + '').join(''); res.writeHead(200, headers({ 'Content-Type': 'application/xml; charset=utf-8', 'Cache-Control': 'public, max-age=3600' })); return res.end('' + urls + ''); } @@ -341,6 +343,7 @@ const server = http.createServer(async (req, res) => { } // -- public API + if (p === '/api/network-sites' && req.method === 'GET') return netsites.handle(req, res); if (p === '/api/config' && req.method === 'GET') { return json(res, 200, { site: C.site, chainId: C.chainId, chainName: C.chainName, contract: C.contract, rpc: C.publicRpc, explorer: C.explorer, walletConnectProjectId: C.walletConnectProjectId, viewsOwed: C.viewsOwed, spotDays: C.spotDays, priceUsd: 5, ready: !!C.contract, sel: SEL }, extra); @@ -537,12 +540,26 @@ const server = http.createServer(async (req, res) => { } }); +// this Central-time week (from Monday 12:00 AM CT): spots taken, bought vs gifted by the momentum fund, plus the all-time count +function ctWeekStart(now) { + const p = Object.fromEntries(new Intl.DateTimeFormat('en-US', { timeZone: 'America/Chicago', weekday: 'short', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }) + .formatToParts(new Date(now)).map(x => [x.type, x.value])); + const back = { Mon: 0, Tue: 1, Wed: 2, Thu: 3, Fri: 4, Sat: 5, Sun: 6 }[p.weekday] || 0; + return now - back * 86400000 - ((Number(p.hour) % 24) * 3600 + Number(p.minute) * 60 + Number(p.second)) * 1000; +} +function weekLine() { + const from = ctWeekStart(Date.now()); const all = chain.spots(); const wk = all.filter(s => s.boughtAt >= from); + const gifted = wk.filter(s => s.kind === 2).length; + return '\u{1F4CA} This week: ' + wk.length + ' spot' + (wk.length === 1 ? '' : 's') + (gifted ? ' (' + (wk.length - gifted) + ' bought, ' + gifted + ' gifted by the momentum fund)' : '') + ' · ' + all.length + ' spots in the line'; +} + (async () => { await docstore.init({}); // before anything reads its data process.on('SIGTERM', () => { docstore.drain(8000).finally(() => process.exit(0)); }); store.load(); tgproof.init({ nameOf, contract: C.contract, explorer: C.explorer || 'https://polygonscan.com', site: C.site, - feeWallets: ['0x7627fc78876948ac9d95c1c9eb061e7d6d647b70', '0x8b7d33849a2c4d92c985be31e46dc564ba901ad2'] }); // contract feeA / feeB + feeWallets: ['0x7627fc78876948ac9d95c1c9eb061e7d6d647b70', '0x8b7d33849a2c4d92c985be31e46dc564ba901ad2'], // contract feeA / feeB + weekLine }); // this week's spot numbers on every sale message (trust pack 2026-11-14) chain.init({ onEvent: tgproof.onEvent }); // every spot sale -> one payment-proof message in the payments topic hubreport.init({ dataDir: C.dataDir, members: () => chain.allMembers() }); refuelspots.init({ lock: () => keeper.busy() }); keeper.setOtherBusy(() => refuelspots.busy()); diff --git a/tgproof.js b/tgproof.js index c554c16..c42e449 100644 --- a/tgproof.js +++ b/tgproof.js @@ -4,16 +4,20 @@ // dollar value at the contract's own price, then one line for the company + momentum fund share, then the Polygonscan link. // Built from the chain events of the transaction (SpotBought first, then Paid / PaymentFailed in contract order). Sent once across // app copies (docstore.claim). Never posts events older than 2 hours (a re-index after downtime must not flood the topic). +// Trust pack (Marty 2026-11-14, "post a Telegram with some kind of image and stats"): the message also carries this week's spot +// numbers (weekLine from server.js) and shows a large image above the text (Downline Banners' own kit art, rotated) through +// Telegram's link preview, so the full payout list never hits a photo caption's length limit. TG_API (tests only) = a stand-in. 'use strict'; const docstore = require('./docstore'); const ROLE = { SPONSOR: 0, LEVEL: 1, FEE_A: 2, FEE_B: 3, FUND: 4 }; let X = null; const buf = new Map(); +const CARDS = ['/art/kit/dlb-spot-social.png', '/art/kit/dlb-line-social.png', '/art/kit/dlb-instant-social.png']; let card = 0; const on = () => !!(process.env.TG_TOKEN && process.env.TG_CHAT); const esc = s => String(s == null ? '' : s).replace(/[&<>]/g, c => ({ '&': '&', '<': '<', '>': '>' }[c])); const pol = wei => { const v = Number(BigInt(wei) / 10n ** 12n) / 1e6; return v >= 100 ? v.toFixed(2) : v.toFixed(4); }; -function init(deps) { X = deps; } // { nameOf(addr) -> username|null, contract, explorer, site } +function init(deps) { X = deps; } // { nameOf(addr) -> username|null, contract, explorer, site, feeWallets, weekLine() -> text|null } function onEvent(ev) { if (!on() || !ev || !ev.tx || !['SpotBought', 'Paid', 'PaymentFailed'].includes(ev.type)) return; if (ev.ts && Date.now() - ev.ts > 2 * 3600000) return; @@ -30,9 +34,10 @@ async function who(addr) { async function send(tx, evs) { const text = await compose(tx, evs); if (!text) return; if (!(await docstore.claim('tgproof:' + tx))) return; // another app copy already posted this sale - const body = { chat_id: process.env.TG_CHAT, text, parse_mode: 'HTML', disable_web_page_preview: true }; + const img = 'https://' + X.site + CARDS[card++ % CARDS.length]; + const body = { chat_id: process.env.TG_CHAT, text, parse_mode: 'HTML', link_preview_options: { url: img, prefer_large_media: true, show_above_text: true } }; if (process.env.TG_PAY_TOPIC) body.message_thread_id = Number(process.env.TG_PAY_TOPIC); - const r = await fetch('https://api.telegram.org/bot' + process.env.TG_TOKEN + '/sendMessage', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), signal: AbortSignal.timeout(15000) }); + const r = await fetch(String(process.env.TG_API || 'https://api.telegram.org').replace(/\/+$/, '') + '/bot' + process.env.TG_TOKEN + '/sendMessage', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), signal: AbortSignal.timeout(15000) }); const j = await r.json().catch(() => ({})); if (!j.ok) console.error('tgproof send failed', r.status, String(j.description || '').slice(0, 120)); else console.log('tgproof posted', String(tx).slice(0, 12)); @@ -59,6 +64,7 @@ async function compose(tx, evs) { else if (e.role === ROLE.LEVEL) lines.push('\u{1F4B8} Line ' + level + ' (spot #' + (sb.id - level) + '): ' + pol(e.amount) + ' POL' + usd(e.amount) + ' → ' + await who(e.to)); } if (house > 0n) lines.push('\u{1F3E6} Company + momentum fund: ' + pol(house.toString()) + ' POL' + usd(house.toString())); + if (X.weekLine) { try { const w = X.weekLine(); if (w) lines.push(w); } catch (e) {} } lines.push('· Verify on Polygonscan · Live ledger'); return lines.join('\n'); }