- config: REWARD_TIERS defaults to none (the every-25th $2.50 tier stays available as a setting); the "bigger tiers" sentence only shows when a tier is configured. - hubline: the walk reads the raw hub answer so it continues past a blocked sponsor instead of stopping; entries carry `blocked`. /api/my/order skips blocked members like no-wallet ones, so the level passes up. - e2e: B -> no-wallet -> hub-blocked (with a wallet) -> O -> S: both skipped, O and S each get 10%, the blocked one gets nothing; tiers off checked. 63/63. Chatbot QA 108/108. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6.2 KiB
ViralAdSource app (viraladsource.com rebuild)
"Every ad has a source. Watch yours travel." Approved by Marty 2026-11-16 (mockup: Design canvas 2XuFAog3KEiuXbfEvVvTZk).
Plain Node http server, no framework (the ViralAdBlitz / VBB / Downline Banners pattern). Contract: ../contracts (VASShop).
Launch numbers APPROVED by Marty 2026-11-17: Boost $5 = a 7-day board spot (placement only); resharer cut 20% of a Boost bought through
their branch (paid by the contract in the same tx); reward pot 10% of every Boost; 5 sponsor levels x 10% (company keeps 20%); split
immutable on chain; new-member reward $0.25 in POL per verified brand-new network member through a branch, cap 10/day per person;
10 ad credits per 100 verified views. Still proposals: the global pot cap figure ($25/day, POT_DAILY_CENTS display + the contract's
potDailyMaxCents). Reward tiers are OFF at launch (flat $0.25 only; REWARD_TIERS can turn one on later). Payouts of sign-up rewards are OFF on staging
(REWARD_PAYOUTS).
Members earn for free. A Boost buys placement only. Level shares and the resharer cut need only a network sign-in (hub member) and a
linked wallet. Compression: /api/my/order drops everyone in the hub sponsor line without a wallet or hub-blocked, so each level passes up to the next
eligible person; levels left when the line runs out go to the company; with no resharer, the 20% resharer cut goes to the company.
What it does
- Free text ad (headline 60, two lines of 90, an https link, or the member's OWN LinkSpin spin link picked from "Use one of my spin
links"; ownership confirmed through LinkSpin's signed partner endpoint
/api/partner/<LS_PARTNER>/links, opspins). One ad per network member. Membership from the network hub (hubpeople.js), sign-in through the hub (networksso.js,HUB_SSO=on) or a wallet signature. - Reshares (tree.js): every ad has a source link
/s/<code>(step 0). A member who reshares gets ONE unique link per ad; its parent is the reshare link they arrived through (thevas.viatag, last touch, 30 days), sostepcounts how far from the source it travelled andbranchis the step-1 link it descends from./a/<id>and/<username>open an ad at its source. - Family tree (
GET /api/my->tree): branch, step, reshares under it, verified views, verified clicks, sign-ups, Boosts, with totals and the furthest step. Clicks through a reshare link carry the branch:/go/<ad>?s=<code>; on LinkSpin links the relay addss2=<resharer>ands3=<code>so LinkSpin Reports split clicks and sign-ups per branch. - Verified views (wire.js, the VBB / ViralAdBlitz rules): the server decides what a page showed; after
VISIT_SECONDSvisible the browser redeems its ticket; one view per visitor per ad per 24 h; never the owner's own; never a resharer's own link;VISITS_PER_IP_DAY. - L3 ad credits: verified views through a reshare link (step 1+) count for that resharer; every
CREDITS_VIEWS(100) earnCREDITS_PER(10) credits. Credits are spent on the member's own ad in the "Featured with credits" places (1 credit per verified view there). Never paid out. "Ad credits buy advertising, not income." - L2 sign-up rewards (signup.js):
/jointhrough a reshare link -> confirm link (MAIL_URL relay; unset on staging = no mail, the admin page shows the link) -> real-time checks: share (a resharer, never the owner's own link), confirmed email, throwaway domain, hub-new (the hub has never seen the email;HUB_JOIN=1writes the join with sponsor = the resharer and requirescreated: true; staging = dry read, nobody created), not the resharer's own device (rejected) or connection (held), daily cap, fraud score (held atFRAUD_HOLD). Passed -> a row in the pending-rewards ledger with a keeper-signed EIP-712Reward(to, usdCents, unlockAt, nonce, deadline)voucher. Tier bonuses (REWARD_TIERS) carry anunlockAt.REWARD_PAYOUTS=1relaysclaimRewardfromRELAY_KEY's wallet (gas only); the contract pays from the pot. Admin can release / reject / recheck. - L1 Boost (shop.js):
POST /api/my/orderbuilds a keeper-signedOrder(buyer, sku, qty, ref, line[], resharer, nonce, deadline): line = the buyer's hub sponsor line (wallets, up to 20), resharer = the owner of the reshare link the buyer came through (never the buyer). The contract pays the resharer cut, the sponsor levels (places 1..5 of the compressed line, no Boost needed), the pot slice and the company in the same transaction. The watcher records Purchase and RewardPaid events; a Boost puts the ad on top of the reshare board for 7 days per unit. - Trust pack (proof.js):
/ledger(Boost splits + sign-up rewards, no emails),/contract(live from the chain, or the launch numbers before deploy), toasts (new ads, reshares, Boosts), Telegram photo card per Boost (off unlessTG_*are set), Terms / Earnings Disclaimer / Privacy (TrustClickz), the network footer (netsites.js). - Chatbot (chatbot.js + the shared chatcore / kb / netkb), promo kit (
/promote,/api/promo-kit, 24 creativespublic/art/kit/vas-{free,tree,boost}-<shape>.png), PolHunter embed on the front page (hunters' visits never count). - Old links (the YourFreeWorld site):
/?<old>,/index.php?<old>,/splashpg.php?r=,/lcp.php?r=-> the member's ad via oldrefs.json (POST /api/admin/oldrefs, payload D:/tmp/vas-reconcile/oldrefs-admin-payload.json, load at the domain switch); other*.php->/. - Data: docstore.js (MySQL via
DOCSTORE_URL): documentvas.json+ row tablesvas_ads,vas_shares,vas_visits,vas_clicks,vas_signups,vas_rewards. - Staging switch:
STAGING=1shows the staging bar and enables the admin-onlyPOST /api/admin/test-member(marks a wallet as a test network member). It is refused whenever SITE_HOST is viraladsource.com.
Run and test
npm install
node tools/pages.mjs # regenerate public/*.html (one source of copy + legal facts)
node tools/art.mjs # icon, OG image, proof cards, kit creatives (Playwright)
node qa/e2e.mjs # 63 checks: real VASShop on a local anvil chain + stand-in hub (needs ../contracts built)
node qa/chatbot.test.mjs # the site assistant
Env: .env.example.