2fe3d9e4c0
- 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>
22 lines
2.5 KiB
JavaScript
22 lines
2.5 KiB
JavaScript
// 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>';
|
|
})();
|