Trust pack (Marty 2026-11-14): legal pages, network footer, Telegram image + week stats.

- /terms, /disclaimer (Earnings Disclaimer), /privacy: TrustClickz, 615 Green Valley Drive, Moody, AL 35004; written from the real mechanics: a $5 spot buys advertising (300 guaranteed views + a place in the line), same-transaction split 30/55/10/5, the contract holds only the momentum fund, paid only when later spots sell, nothing held or withdrawn, no refunds on-chain, one-time purchases, crypto risk, data (wallet, username from the hub, hashed visit checks, cookies, no email stored) and one account across the network through the hub. No earnings cap shown. Sitemap.
- Footer: Terms, Earnings Disclaimer, Privacy, Contract, Ledger, Support, company line, 'Part of the network' from the hub (netsites.js, GET /api/network-sites, 10 min cache, fallback list), Downline Banners marked current.
- tgproof.js: each sale message adds this week's spot numbers (Central-time week, bought vs gifted) and shows a large kit image above the text via link_preview_options (rotated, no caption length limit); TG_API for the test stand-in.
common.js?v=20261114t, line.css?v=8. Smoke 122/122 (stand-in Telegram: one message per sale, never two per tx; stand-in hub serves the list; legal pages; footer on phone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 10:50:37 -06:00
parent 920efd72d6
commit da16bfaf4d
18 changed files with 266 additions and 26 deletions
+35 -3
View File
@@ -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();
}