Contract page: verification state from env CONTRACT_VERIFIED (sourcify,polygonscan), shown per verifier; contract.js?v=3. unit 62/62, smoke 156/156

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-15 08:02:59 -06:00
parent 20e980a3c4
commit 1112a8c589
4 changed files with 5 additions and 3 deletions
+1
View File
@@ -17,6 +17,7 @@ services:
SHOP_START_BLOCK: ${SHOP_START_BLOCK:-}
KEEPER_KEY: ${KEEPER_KEY:-}
PRIZE_WALLET: ${PRIZE_WALLET:-}
CONTRACT_VERIFIED: ${CONTRACT_VERIFIED:-}
HUB_URL: ${HUB_URL:-}
HUB_SECRET: ${HUB_SECRET:-}
TANK_MODE: ${TANK_MODE:-}
+2 -1
View File
@@ -83,7 +83,8 @@ let cCache = null;
async function contract() {
if (cCache && Date.now() - cCache.at < 300000) return cCache.v;
const v = { address: C.contractAddress || null, chainId: C.chainId, explorer: C.explorer, split: C.split, position: { usd: C.position.usd },
verified: { sourcify: false, polygonscan: 'pending', sourcifyUrl: C.contractAddress ? 'https://repo.sourcify.dev/' + C.chainId + '/' + C.contractAddress : null },
verified: { sourcify: /sourcify/i.test(process.env.CONTRACT_VERIFIED || ''), polygonscan: /polygonscan/i.test(process.env.CONTRACT_VERIFIED || '') ? 'done' : 'pending', // CONTRACT_VERIFIED=sourcify,polygonscan once each match is confirmed
sourcifyUrl: C.contractAddress ? 'https://repo.sourcify.dev/' + C.chainId + '/' + C.contractAddress : null },
ownerNote: "Marty's Tangem hardware wallet", prizeWallet: C.prizeWallet || null, live: false };
if (shop && shop.watching()) {
const { Interface } = require('ethers');
+1 -1
View File
@@ -10,7 +10,7 @@
if (!d.address) { el.innerHTML = '<tbody><tr><th>Status</th><td class="muted">The contract is not live yet. Its address, owner, prize pot wallet and every position will show here, read straight from Polygon.</td></tr><tr><th>' + splitRow[0] + '</th><td>' + splitRow[1] + '</td></tr></tbody>'; return; }
const rows = [
['Contract', addr(d.address, 'DraftPosition on ' + (d.chainId === 137 ? 'Polygon' : 'chain ' + d.chainId))],
['Source code', 'Verified source on Polygonscan and Sourcify: ' + esc(d.verified && d.verified.polygonscan === 'pending' ? 'pending' : 'done')],
['Source code', 'Verified source: Sourcify ' + esc(d.verified && d.verified.sourcify ? 'done' : 'pending') + ', Polygonscan ' + esc(d.verified && d.verified.polygonscan === 'done' ? 'done' : 'pending')],
['Owner', addr(d.owner, 'A Tangem hardware wallet. It can pause new sales, set the price of future positions and change the keeper. It cannot move anyone\'s money or change the split.')],
['Company', addr(d.company, '5xYourTeam. Fixed in the contract when it was deployed.')],
['Best Coach pot', addr(d.prizeWallet, 'Receives 10% of every position in the same transaction. Fixed in the contract when it was deployed. Each payout from it is listed on the ledger.')],
+1 -1
View File
@@ -27,6 +27,6 @@
<section class="panel"><div class="tbl"><table id="facts"></table></div></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/contract.js?v=2"></script>
<script src="/assets/contract.js?v=3"></script>
</body>
</html>