Contract, live ledger, terms, privacy and disclaimer on the Instrument scheme; contract page shows chain totals and never falls back to another contract's source; terms and privacy updated for links, pages, zones and leads; share images point at the LinkSpin image; toolkit banners use the LinkSpin house set

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-07 09:15:03 -05:00
parent a50640c890
commit 3c52e2704a
11 changed files with 351 additions and 275 deletions
+16 -19
View File
@@ -1,21 +1,18 @@
// Contract page: inject live address, chain, explorer + verified-source links.
// Contract page: live address, chain, explorer + verified-source links, the chain totals. No shared nav (2026-10-07).
(async function () {
await IAP.renderNav('contract');
const c = await IAP.getConfig();
const $ = IAP.$;
$('cAddr').textContent = c.contract.slice(0, 10) + '…' + c.contract.slice(-6);
$('cChain').textContent = c.chainName;
$('mockAddr').textContent = c.contract.slice(0, 18) + '…';
if (c.explorer) {
$('lnkExplorer').href = c.explorer + '/address/' + c.contract + '#code';
const src = 'https://repo.sourcify.dev/contracts/full_match/' + c.chainId + '/' + c.contract + '/';
$('lnkSource').href = src;
$('lnkSource2').href = src;
} else {
// fallback if explorer unset: point straight at the Sourcify-verified source
const src = 'https://repo.sourcify.dev/contracts/full_match/137/0xBE1ECA72AFF47d13D8E907e523F55eB9e2d365E0/';
$('lnkExplorer').href = src;
$('lnkSource').href = src;
$('lnkSource2').href = src;
}
const $ = id => document.getElementById(id);
let c = {}; try { c = await (await fetch('/api/config')).json(); } catch (e) {}
const addr = String(c.contract || '');
$('cAddr').textContent = addr || 'not deployed yet';
$('cChain').textContent = c.chainName || '';
const src = 'https://repo.sourcify.dev/contracts/full_match/' + (c.chainId || 137) + '/' + addr + '/';
$('lnkExplorer').href = c.explorer ? c.explorer + '/address/' + addr + '#code' : src;
$('lnkSource').href = src; $('lnkSource2').href = src;
try {
const s = await (await fetch('/api/stats')).json();
$('stMembers').textContent = Number(s.onchainMembers || 0).toLocaleString();
$('stPackages').textContent = Number(s.purchases || 0).toLocaleString();
const pol = Number(BigInt(String(s.payoutWei || s.paidInWei || '0')) / 10000000000000000n) / 100;
$('stPol').textContent = pol.toLocaleString(undefined, { maximumFractionDigits: 2 });
} catch (e) {}
})();