873a9e5e4a
- chain.js: derive the chain tip as the MAX height across the RPC pool and scan getLogs against that same synced node. Load-balanced public RPCs (publicnode) intermittently answer eth_blockNumber from a replica lagging thousands of blocks behind, which stalled the mainnet scan (latest < lastBlock, 0 events) and could skip freshly-mined events. This unblocks the live ledger + the purchase-confirmation email (both driven by the event scan). - disclaimer: replace the "rehearsal/testnet" section with a live-on-Polygon real-money notice (it's live now). - Point the dead Amoy fallbacks (purchase email tx link, contract-page source link) at Polygon mainnet / the verified mainnet contract. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
954 B
JavaScript
22 lines
954 B
JavaScript
// Contract page: inject live address, chain, explorer + verified-source links.
|
|
(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;
|
|
}
|
|
})();
|