diff --git a/layout.js b/layout.js index 61ce122..efd5af5 100644 --- a/layout.js +++ b/layout.js @@ -171,7 +171,7 @@ function personalize(html, who, st) { // it on as ?ref=); Earners Corner (nwec) takes none if (/^https:\/\/linkspin\.app\/r\/nw[a-z]+\?/.test(h) && !/[?&](?:amp;)?s1=/.test(h)) return /\/r\/nwec\?/.test(h) ? m : 'href="' + h + '&s1=' + who + '"'; if (/^https:\/\/(instantadpay\.com|linkspin\.app)\//.test(h)) return 'href="' + h.replace(/\/join\/martbost\b/, '/join/' + who).replace(/([?&](?:amp;)?ref=)martbost\b/, '$1' + who).replace(/([?&](?:amp;)?s1=)martbost\b/, '$1' + who) + '"'; // s1 = the member on a LinkSpin network link (nwvbb, 2026-11-15) - if (/^https:\/\/(downlinebanners\.com|viralbannerblitz\.com|viraladblitz\.com|viraladsource\.com|yourprogrambuilder\.com|5xyourteam\.com|downlinehydra\.com)\//.test(h)) return 'href="' + h.replace(/([?&](?:amp;)?ref=)martbost\b/, '$1' + who) + '"'; + if (/^https:\/\/(downlinebanners\.com|viralbannerblitz\.com|viraladblitz\.com|viraladsource\.com|yourprogrambuilder\.com|videoappincome\.com|5xyourteam\.com|downlinehydra\.com)\//.test(h)) return 'href="' + h.replace(/([?&](?:amp;)?ref=)martbost\b/, '$1' + who) + '"'; return m; }); } diff --git a/netsites.js b/netsites.js index 3991d65..378181a 100644 --- a/netsites.js +++ b/netsites.js @@ -10,6 +10,7 @@ const FALLBACK = [ { id: 'viraladblitz', name: 'ViralAdBlitz', url: 'https://viraladblitz.com' }, { id: 'viraladsource', name: 'ViralAdSource', url: 'https://viraladsource.com' }, { id: 'yourprogrambuilder', name: 'YourProgramBuilder', url: 'https://yourprogrambuilder.com' }, + { id: 'videoappincome', name: 'Video App Income', url: 'https://videoappincome.com' }, { id: 'fivex', name: '5xYourTeam', url: 'https://5xyourteam.com' }, { id: 'downlinehydra', name: 'DownlineHydra', url: 'https://downlinehydra.com' }, { id: 'stackpol', name: 'Stack POL', url: 'https://stackpol.com' }, diff --git a/programs.js b/programs.js index f3d842a..b10ce14 100644 --- a/programs.js +++ b/programs.js @@ -35,6 +35,11 @@ const PROGRAMS = [ { k: 'ypb', guides: 'https://yourprogrambuilder.com/guides', slug: 'yourprogrambuilder', n: 'YourProgramBuilder', c: '#22844a', kind: 'Program directory', verb: 'Join', app: true, site: 'https://yourprogrambuilder.com', join: u => tracked('yourprogrambuilder', 'stackpol', { s1: u }), d: 'An open program directory the network grows. Plant a program you already use, free: your link with your ID, checked every day. Network members save their own IDs in it, and a visitor who comes through a member sees the link of the member they came through first. At 10 saved IDs a program goes to review for the Crypto Team Build Network builder. A $10 Spotlight is a one-time purchase of 1,000 views, paid with SafePal or any other crypto wallet, never a subscription. Nothing is promised.', how: 'Payouts here are the shares the YPBShop smart contract pays up the line of the buyer in the same transaction as each Spotlight: 20% to the direct sponsor and 5% to each of the next four levels. No Spotlight is needed to receive a share. The company share is not counted.' }, + // Video App Income (live 2026-11-20): direct join link carrying the network username (videoappincome.com/join?ref=; the site + // resolves the username through the hub). Facts from the VAI app (site.js, server.js) and the VideoAppIncome contract 0x0cfF...C201 only. + { k: 'vai', slug: 'video-app-income', n: 'Video App Income', c: '#8b5cf6', kind: 'Video maker', verb: 'Join', app: true, site: 'https://videoappincome.com', join: u => 'https://videoappincome.com/join?ref=' + encodeURIComponent(u), + d: 'Make short vertical promo videos from your phone for any website, offer or niche. Paste a link and the app reads the page, writes the script and adds the voice, captions, footage of the site and music in about a minute and a half, no camera needed. Every video gets a tracked share page with a button to your link, so you can see who opened it, how much they watched and who tapped. Sign in with SafePal or any other crypto wallet, or with your network account. The first video is free; after that a video is 10 credits, and a $10 pack is 100 credits, a one-time purchase in POL, never a subscription. Nothing is promised.', + how: 'Payouts here are the shares the Video App Income smart contract pays members in the same transaction as each credit purchase: 30% to the buyer\'s sponsor and 8% to each of the five positions above the buyer in a 3-wide matrix, to people who have bought credits themselves. The company shares are not counted.' }, // 5xYourTeam The Draft (live 2026-11-15): join through the LinkSpin network link (nw5x, src=stackpol), landing on 5xyourteam.com/?ref=. // Facts from the 5x app (README, config) and the DraftPosition contract 0x83Bb...bc74 only. { k: 'fx', guides: 'https://5xyourteam.com/guides', slug: '5xyourteam', n: '5xYourTeam', c: '#ffc93c', kind: 'Team draft', verb: 'Join', app: true, site: 'https://5xyourteam.com', join: u => tracked('fivex', 'stackpol', { s1: u }), diff --git a/public/img/vai.jpg b/public/img/vai.jpg new file mode 100644 index 0000000..1069392 Binary files /dev/null and b/public/img/vai.jpg differ diff --git a/tools/indexer.py b/tools/indexer.py index 8ef4257..22b8639 100644 --- a/tools/indexer.py +++ b/tools/indexer.py @@ -9,7 +9,7 @@ weekly prize transfers listed in VBB's prizes.json, each checked on chain (sent by the prize wallet, to that winner, succeeded). The scan position and the checked prize transfers are cached in /root/stackpol-indexer/vbb-chain.json. - ViralAdBlitz (2026-11-15): VABShop Paid (level 1-5 shares) and Claimed logs read from Polygon the same way, cached in - /root/stackpol-indexer/vab-chain.json (ViralAdSource 2026-11-17: + resharer cut and pot rewards, vas-chain.json; YourProgramBuilder ypb-chain.json). These caches are the only files it writes. + /root/stackpol-indexer/vab-chain.json (ViralAdSource 2026-11-17: + resharer cut and pot rewards, vas-chain.json; YourProgramBuilder ypb-chain.json; Video App Income vai-chain.json, its own reader vai_rows). These caches are the only files it writes. It builds one snapshot (network totals, per-program totals, last 7 days, latest 300 payouts, a stack per opted-in member) and POSTs it to https://stackpol.com/api/ingest with the key in /root/.stackpol-ingest-key. Nothing is written anywhere else. The ledger shows each payout's username (Marty 2026-11-09); only opted-in members get a public stack page. @@ -68,6 +68,13 @@ FX_HOUSE = {FX_SHOP, '0x7627fc78876948ac9d95c1c9eb061e7d6d647b70', '0x818daeedef # failed in that tx: then the later Claimed counts it), and Claimed by a member. Kind 0 = company; contract, company, keeper and relay excluded. # YourProgramBuilder (2026-11-17): YPBShop on Polygon, read-only; same Paid/Claimed events as VABShop. Member payouts = Paid kind 1-5 # (sponsor 20% + four levels 5%) + Claimed by a member (a failed push is owed and counted when claimed). Kind 0 = company; contract, company, keeper excluded. +# Video App Income (2026-11-20): VideoAppIncome contract on Polygon, read-only. Its Paid event names the receiving POSITION, not a +# wallet: Paid(uint32 buyerId, uint32 toId, uint8 kind, uint256 amount), kind 0 = the 30% sponsor share, 1-5 = the 8% matrix levels. +# Every Paid event is a member payout (company shares are a separate CompanySplit event and are not read). The position's wallet is +# looked up once with member(toId) when the log is first seen and stored with it. Cache: vai-chain.json. +VAI_SHOP = '0x0cff5d57933812b0fbac4d1138aa6b0ce5bac201' +VAI_START = 97669974 # deploy block +VAI_PAID = '0x1953924ceb3951f9e9936e1ed523923640c00c51daa472fb1ab22b924f42f564' YPB_SHOP = '0x44a02c5ece4e6eb0edc406a8020f289956803e2a' YPB_START = 97486277 # deploy block (the app's SHOP_START_BLOCK) YPB_HOUSE = {YPB_SHOP, '0x7627fc78876948ac9d95c1c9eb061e7d6d647b70', '0x5453a3973ed54cd2687c1675b73f1be5dacf26c4'} # + company (Tangem), keeper @@ -282,6 +289,60 @@ def vab_rows(dry=False, k='vab', shop=VAB_SHOP, start=VAB_START, house=VAB_HOUSE last, len(logs), allwei / 1e18, len(rows), sum(r['pol'] for r in rows), ('; ' + note) if note else '') +def vai_rows(dry=False): + """Video App Income member payouts (sponsor 30% + five matrix levels 8%), read-only on chain. Returns (rows, note).""" + cpath = os.path.join(HERE, 'vai-chain.json') + cache = load(cpath, {}) or {} + last = int(cache.get('lastBlock') or VAI_START - 1) + logs = cache.get('logs') or [] + bts, accts = {}, {} + + def btime(n): + if n not in bts: + b = rpc('eth_getBlockByNumber', [hex(n), False]) + bts[n] = int(b['timestamp'], 16) if b and b.get('timestamp') else 0 + return bts[n] + + def account(pid): + if pid not in accts: + r = rpc('eth_call', [{'to': VAI_SHOP, 'data': '0xbfca75d1' + '%064x' % pid}, 'latest']) or '0x' # member(uint32): first word = wallet + accts[pid] = '0x' + r[2:66][-40:].lower() if len(r) >= 66 else '' + return accts[pid] + note = '' + try: + head = int(rpc('eth_blockNumber', []), 16) - VBB_CONFIRM + seen = {(x['tx'], x['li']) for x in logs} + spans = 0 + while last < head and spans < VBB_MAX_SPANS: + frm, to = last + 1, min(head, last + VBB_SPAN) + for l in rpc('eth_getLogs', [{'address': VAI_SHOP, 'topics': [VAI_PAID], 'fromBlock': hex(frm), 'toBlock': hex(to)}]) or []: + if l.get('removed') or str(l.get('address', '')).lower() != VAI_SHOP: + continue + t, data = l['topics'], l.get('data') or '0x' + key = (l['transactionHash'].lower(), int(l['logIndex'], 16)) + if key in seen or len(t) < 3: + continue + n, pid = int(l['blockNumber'], 16), int(t[2], 16) + w = account(pid) + if not w or int(w, 16) == 0: + raise RuntimeError('no wallet for position %d' % pid) # stop before this span is marked done; retried next run + logs.append({'ev': 'Paid', 'pos': pid, 'to': w, 'kind': int(data[2:66], 16), 'wei': str(int(data[66:130], 16)), 'tx': key[0], 'li': key[1], 'block': n, 'ts': btime(n)}) + seen.add(key) + last = to + spans += 1 + if last < head: + note = 'catching up, %d blocks to go' % (head - last) + except Exception as e: + note = 'chain read failed (kept the cached logs): %s' % e + if not dry: + tmp = cpath + '.tmp' + with open(tmp, 'w', encoding='utf-8', newline='\n') as f: + json.dump({'lastBlock': last, 'logs': logs, 'at': int(time.time())}, f) + os.replace(tmp, cpath) + rows = [{'k': 'vai', 'pol': int(x['wei']) / 1e18, 'tx': x['tx'], 'ts': ms(x['ts']), 'w': x['to'], 'gu': ''} for x in logs if int(x['wei']) > 0 and x['to'] != VAI_SHOP] + return rows, 'vai: scanned to block %d, %d Paid logs, %d member payouts %.4f POL%s' % (last, len(logs), len(rows), sum(r['pol'] for r in rows), ('; ' + note) if note else '') + + def iap_wallet_users(): """{address_lower: username} from IAP accounts + positions, via the IAP container (its DATABASE_URL never leaves it).""" c = subprocess.run(['docker', 'ps', '--format', '{{.Names}}'], capture_output=True, text=True).stdout.split() @@ -379,6 +440,9 @@ def main(): yr, ynote = vab_rows(dry, 'ypb', YPB_SHOP, YPB_START, YPB_HOUSE, 'ypb-chain.json') rows += yr print(ynote) + ir, inote = vai_rows(dry) + rows += ir + print(inote) # wallet -> username wu = iap_wallet_users() lsd = voldir(CHAINS['ls'])