Trust pack (Marty 2026-11-14): contract proof, live ledger, proof toasts, Telegram sale cards, legal pages, network footer.
- proof.js: /api/ledger (each VBBShop purchase with its split read from the receipt's Paid/PaymentFailed events, else the contract's fixed 30/10/60 math; weekly prize transfers with their transactions), /api/contract (owner, prize wallet, company, keeper, paused, orders, balance and owed, read live and cached 5 min; Sourcify exact match, Polygonscan pending).
- Telegram (CTB Rewards bot, payments topic, TG_TOKEN/TG_CHAT/TG_PAY_TOPIC same as Downline Banners): one photo card per purchase (prebuilt VBB proof image rotated, buyer, sponsor/prize/company split in POL, this week's purchases + prize pot, Polygonscan + ledger links) and one line per confirmed prize payout. Hooks: shop.setHook (newly credited purchases only) and prize.setHook (confirmed transfers); once per tx via an in-process guard plus docstore.claim; nothing older than 2 hours.
- Pages /contract, /ledger, /terms, /disclaimer (Earnings Disclaimer), /privacy (TrustClickz, real mechanics: advertising not income, same-transaction split, prize wallet holds the 10% until Monday, no refunds on-chain, one-time purchases, crypto risk, data incl. hashed visit checks and the network hub); sitemap.
- Footer: Terms, Earnings Disclaimer, Privacy, Contract, Ledger, Support, company line, 'Part of the network' from the hub (netsites.js, /api/network-sites, fallback list), VBB marked current. Toasts add purchases and prize payouts.
- tools/proof-art.mjs renders public/art/proof/vbb-proof-{pink,blue,yellow}.png. common.js?v=5, vbb.css?v=6.
chain.mjs 49/49 (real contract on anvil + stand-in Telegram: exact split, 2 cards, no repost on rescans, 6 prize lines). smoke 241/241.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+36
-6
@@ -47,25 +47,55 @@ window.VBB = (function () {
|
||||
const f = document.createElement('footer'); f.className = 'foot';
|
||||
f.innerHTML = '<div class="wrap"><p><b>Viral Banner Blitz</b>, part of the Crypto Team Build Network</p>'
|
||||
+ '<p>A banner that cycles earns advertising across the network, not cash. Nothing here is an income opportunity.</p>'
|
||||
+ '<p><a href="/">The loop</a> · <a href="/leaders">Leaderboards</a> · <a href="/how">How it works</a> · <a href="/packages">Packages</a> · <a href="/promote">Promote</a> · <a href="/my">My Banners</a></p></div>';
|
||||
+ '<p><a href="/">The loop</a> · <a href="/leaders">Leaderboards</a> · <a href="/how">How it works</a> · <a href="/packages">Packages</a> · <a href="/promote">Promote</a> · <a href="/my">My Banners</a></p>'
|
||||
// trust pack (Marty 2026-11-14): legal + proof links, company line, and the network line served by the hub
|
||||
+ '<p class="legal-links"><a href="/terms">Terms</a> · <a href="/disclaimer">Earnings Disclaimer</a> · <a href="/privacy">Privacy</a> · <a href="/contract">Contract</a> · <a href="/ledger">Ledger</a> · <a href="https://instantadpay.com/support" target="_blank" rel="noopener">Support</a></p>'
|
||||
+ '<p class="co">TrustClickz · 615 Green Valley Drive, Moody, AL 35004</p><p class="netline"></p></div>';
|
||||
document.body.appendChild(f);
|
||||
netLine(f.querySelector('.netline'));
|
||||
toasts();
|
||||
}
|
||||
// live cycle toasts: real cycles from the ledger only, bottom-left, one at a time, never older than 30 minutes
|
||||
// "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 = '<b>Part of the network</b> · One account across the network: ' + list.map(s => (s.id === 'vbb' || /viralbannerblitz\.com/.test(s.url))
|
||||
? '<span class="here" aria-current="page">' + esc(s.name) + '</span>' : '<a href="' + esc(s.url) + '" target="_blank" rel="noopener">' + esc(s.name) + '</a>').join(' · '); };
|
||||
paint(NET);
|
||||
fetch('/api/network-sites').then(r => r.json()).then(l => { if (Array.isArray(l) && l.length) paint(l); }).catch(() => {});
|
||||
}
|
||||
// live toasts: real cycles, purchases and prize payouts only, bottom-left, one at a time, never older than 30 minutes
|
||||
let toastsOn = false;
|
||||
function toasts() {
|
||||
if (toastsOn) return; toastsOn = true;
|
||||
const seen = new Set(); let first = true;
|
||||
const box = document.createElement('div'); box.className = 'toasts'; box.setAttribute('aria-live', 'polite'); document.body.appendChild(box);
|
||||
const polOf = w => { try { const v = Number(BigInt(w || 0) / 10n ** 14n) / 1e4; return v.toFixed(v >= 100 ? 2 : 4); } catch (e) { return '0'; } };
|
||||
const whoOf = (a, nm) => nm ? '@' + esc(nm) : esc(short(String(a || '')));
|
||||
const show = c => {
|
||||
const el = document.createElement('a'); el.className = 'toast'; el.href = '/how';
|
||||
el.innerHTML = '<b>' + (c.name ? esc(c.name) + '\'s banner' : 'A banner') + ' just cycled</b><br><span>' + n(c.views) + ' network ad views earned for its owner</span>';
|
||||
const el = document.createElement('a'); el.className = 'toast';
|
||||
if (c.kind === 'purchase') { // trust pack 2026-11-14: real purchases from the ledger, with the sponsor paid in the same transaction
|
||||
const sp = (c.pays || []).find(p => p.role === 'sponsor' && !p.failed);
|
||||
el.href = '/ledger'; el.className = 'toast buy';
|
||||
el.innerHTML = '<b>' + whoOf(c.buyer, c.buyerName) + ' bought ' + esc(c.what) + '</b><br><span>' + (sp ? whoOf(sp.to, sp.name) + ' got ' + polOf(sp.wei) + ' POL, same transaction' : 'paid on-chain, split by the contract') + '</span>';
|
||||
} else if (c.kind === 'prize') {
|
||||
el.href = '/ledger'; el.className = 'toast prize';
|
||||
el.innerHTML = '<b>' + esc(c.name) + ' won a weekly prize</b><br><span>' + esc(c.pol) + ' POL paid on-chain</span>';
|
||||
} else {
|
||||
el.href = '/how';
|
||||
el.innerHTML = '<b>' + (c.name ? esc(c.name) + '\'s banner' : 'A banner') + ' just cycled</b><br><span>' + n(c.views) + ' network ad views earned for its owner</span>';
|
||||
}
|
||||
box.appendChild(el); requestAnimationFrame(() => el.classList.add('in'));
|
||||
setTimeout(() => { el.classList.remove('in'); setTimeout(() => el.remove(), 400); }, 7000);
|
||||
};
|
||||
const tick = async () => {
|
||||
let d; try { d = await getJSON('/api/recent'); } catch (e) { return; } if (!d || !d.cycles) return;
|
||||
const fresh = d.cycles.filter(c => !seen.has(c.id)); d.cycles.forEach(c => seen.add(c.id));
|
||||
const [d, l] = await Promise.all([getJSON('/api/recent').catch(() => null), getJSON('/api/ledger?n=6').catch(() => null)]);
|
||||
const all = [];
|
||||
((d && d.cycles) || []).forEach(c => all.push(Object.assign({ key: 'c' + c.id }, c)));
|
||||
((l && l.items) || []).filter(x => x.at && Date.now() - x.at < 30 * 60000).forEach(x => all.push(Object.assign({ key: x.kind + x.tx + (x.place || '') + (x.board || '') }, x)));
|
||||
all.sort((a, b) => (b.at || 0) - (a.at || 0));
|
||||
const fresh = all.filter(c => !seen.has(c.key)); all.forEach(c => seen.add(c.key));
|
||||
const list = first ? fresh.slice(0, 1) : fresh.reverse(); first = false;
|
||||
list.slice(0, 3).forEach((c, i) => setTimeout(() => show(c), 1500 + i * 8000));
|
||||
};
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// Contract proof page (trust pack 2026-11-14): live facts from /api/contract (read from Polygon, cached 5 minutes on the server).
|
||||
(async function () {
|
||||
VBB.renderNav('/contract'); VBB.renderFooter();
|
||||
const el = document.getElementById('facts'); const esc = VBB.esc;
|
||||
let d; try { d = await VBB.getJSON('/api/contract'); } catch (e) { d = {}; }
|
||||
const ex = d.explorer || 'https://polygonscan.com';
|
||||
const addr = (a, note) => a ? '<a class="mono" href="' + esc(ex) + '/address/' + esc(a) + '" target="_blank" rel="noopener">' + esc(VBB.short(a)) + '</a>' + (note ? '<br><span class="muted small">' + note + '</span>' : '') : '<span class="muted">not read yet</span>';
|
||||
const pol = w => { try { const v = BigInt(w || 0); return (Number(v / 10n ** 14n) / 1e4).toFixed(4) + ' POL'; } catch (e) { return '0 POL'; } };
|
||||
if (!d.address) { el.innerHTML = '<tr><td class="muted">The contract address is not set on this copy of the site.</td></tr>'; return; }
|
||||
const rows = [
|
||||
['Contract', addr(d.address, 'VBBShop on ' + (d.chainId === 137 ? 'Polygon' : 'chain ' + d.chainId))],
|
||||
['Source code', 'Verified on <a href="' + esc(d.verified && d.verified.sourcifyUrl || '#') + '" target="_blank" rel="noopener">Sourcify</a> (exact match). Polygonscan verification: ' + esc(d.verified && d.verified.polygonscan === 'pending' ? 'pending' : 'done')],
|
||||
['Owner', addr(d.owner, 'A Tangem hardware wallet. It can pause new sales, set package prices, and change the keeper and the prize wallet. It cannot move anyone\'s money or change the split.')],
|
||||
['Prize wallet', addr(d.prizeWallet, 'Receives the 10% prize share of each purchase and pays the weekly leaderboard winners.')],
|
||||
['Company', addr(d.company, 'Viral Banner Blitz. Fixed in the contract when it was deployed.')],
|
||||
['Keeper', addr(d.keeper, 'The site\'s signing key. It only signs which sponsor a buyer has, once, on their first purchase.')],
|
||||
['Sales', d.live ? (d.paused ? '<b>Paused</b>' : 'Open') + ' · ' + VBB.n(d.orderCount) + ' purchases so far' : '<span class="muted">' + esc(d.error || 'not read yet') + '</span>'],
|
||||
['Held by the contract', d.live ? pol(d.balanceWei) + (BigInt(d.totalOwedWei || 0) > 0n ? ' (all of it owed to wallets whose payment bounced, waiting for them to claim)' : ' (nothing is kept: every purchase is paid out in the same transaction)') : '<span class="muted">not read yet</span>']
|
||||
];
|
||||
el.innerHTML = '<tbody>' + rows.map(r => '<tr><th style="width:30%">' + r[0] + '</th><td>' + r[1] + '</td></tr>').join('') + '</tbody>';
|
||||
})();
|
||||
@@ -0,0 +1,31 @@
|
||||
// Live ledger (trust pack 2026-11-14): purchases with their split and weekly prize payouts from /api/ledger, refreshed every 30 s.
|
||||
(function () {
|
||||
VBB.renderNav('/ledger'); VBB.renderFooter();
|
||||
const esc = VBB.esc;
|
||||
const pol = w => { try { const v = BigInt(w || 0); const n = Number(v / 10n ** 12n) / 1e6; return (n >= 100 ? n.toFixed(2) : n.toFixed(4)) + ' POL'; } catch (e) { return '0 POL'; } };
|
||||
const usd = c => '$' + (Number(c || 0) / 100).toFixed(2);
|
||||
const when = t => t ? new Date(t).toLocaleString('en-US', { timeZone: 'America/Chicago', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) + ' CT' : '';
|
||||
const who = (a, n) => n ? '@' + esc(n) : '<span class="mono">' + esc(VBB.short(a || '')) + '</span>';
|
||||
const ROLE = { sponsor: 'Sponsor 30%', prize: 'Prize pot 10%', company: 'Viral Banner Blitz' };
|
||||
async function load() {
|
||||
let d; try { d = await VBB.getJSON('/api/ledger?n=100'); } catch (e) { return; } if (!d || !d.items) return;
|
||||
const ex = d.explorer || 'https://polygonscan.com'; const t = d.totals || {};
|
||||
document.getElementById('totals').innerHTML = '<div class="stat"><b>' + VBB.n(t.purchases) + '</b><span>purchases on-chain</span></div>'
|
||||
+ '<div class="stat"><b>' + pol(t.sponsorWei) + '</b><span>paid to sponsors, same transaction</span></div>'
|
||||
+ '<div class="stat"><b>' + VBB.n(t.prizePayouts) + '</b><span>weekly prize payouts</span></div>'
|
||||
+ '<div class="stat"><b>0</b><span>withdrawals needed: every purchase pays out in the same transaction</span></div>';
|
||||
const body = document.querySelector('#rows tbody');
|
||||
if (!d.items.length) { body.innerHTML = '<tr><td colspan="4" class="muted">No purchases yet. The first one will show here within a minute of its transaction.</td></tr>'; return; }
|
||||
body.innerHTML = d.items.map(r => {
|
||||
const link = '<a href="' + esc(ex) + '/tx/' + esc(r.tx) + '" target="_blank" rel="noopener">Polygonscan</a>';
|
||||
if (r.kind === 'prize') {
|
||||
const place = ['1st', '2nd', '3rd'][r.place - 1] || '#' + r.place;
|
||||
return '<tr><td class="small">' + when(r.at) + '</td><td><span class="pill cycled">Prize</span><br>' + esc(r.name) + ', ' + place + ' place, ' + (r.board === 'sources' ? 'most traffic sources' : 'most verified visitors') + ' (week of ' + esc(r.week) + ')</td>'
|
||||
+ '<td class="small">' + esc(r.pol) + ' POL ($' + Number(r.usd).toFixed(2) + ') from the prize wallet' + (r.confirmed ? '' : ' <span class="muted">(confirming)</span>') + '</td><td>' + link + '</td></tr>';
|
||||
}
|
||||
const pays = (r.pays || []).map(p => esc(ROLE[p.role] || p.role) + ': ' + pol(p.wei) + (p.role === 'sponsor' ? ' to ' + who(p.to, p.name) : '') + (p.failed ? ' <span class="muted">(bounced, waiting in the contract for them to claim)</span>' : '')).join('<br>');
|
||||
return '<tr><td class="small">' + when(r.at) + '</td><td><span class="pill loop">Purchase</span><br>' + who(r.buyer, r.buyerName) + ' bought ' + esc(r.what) + ' for ' + usd(r.usdCents) + '</td><td class="small">' + pays + '</td><td>' + link + '</td></tr>';
|
||||
}).join('');
|
||||
}
|
||||
load(); setInterval(load, 30000);
|
||||
})();
|
||||
@@ -178,3 +178,10 @@ footer.foot a{color:var(--amber)} footer.foot p{margin:6px 0}
|
||||
.fill-note{margin-top:6px}
|
||||
.ls-box{margin-top:16px;padding-top:12px;border-top:1.5px dashed var(--muted)}
|
||||
.pill.spin{background:var(--sky-soft);color:var(--ink)}
|
||||
/* trust pack (2026-11-14): footer legal + network line, proof toasts, legal pages */
|
||||
footer.foot .legal-links{margin-top:14px} footer.foot .co{opacity:.8;font-size:12.5px}
|
||||
footer.foot .netline{margin-top:12px;padding-top:12px;border-top:1px dashed rgba(217,212,234,.3);font-size:13px;line-height:1.9}
|
||||
footer.foot .netline b{color:#fff} footer.foot .netline .here{color:#fff;font-weight:700;background:var(--hot);border:1.5px solid #fff;border-radius:999px;padding:1px 8px}
|
||||
.toast.buy{background:var(--amber-soft)} .toast.prize{background:var(--ok-soft)}
|
||||
.legal .card h2{font-size:21px} .legal .card p,.legal .card li{max-width:760px} .legal .card ul{padding-left:20px} .legal .card li{margin:6px 0}
|
||||
#facts th{font:700 11.5px var(--mono);letter-spacing:.06em;text-transform:uppercase;vertical-align:top}
|
||||
|
||||
Reference in New Issue
Block a user