Files
viraladsource/README.md
T
martbost 608ec6547b Approved launch numbers; members earn for free; Boost = a 7-day board spot (placement only)
- config: 5 sponsor levels x 10% (company 20%), approved numbers labelled as such, POT_DAILY_CENTS display (2500).
- Eligibility: a network member with a linked wallet earns a level or the resharer cut, Boost or not. /api/my/order drops line
  members with no wallet (compression); empty levels and the no-resharer cut go to the company.
- shop.js: VASShop ABI after the contract fix (Purchase.boardDays, skus().boardDays, potDailyMaxCents, potCentsToday); purchase days
  from the chain. wire.js keeps the on-chain days.
- Copy: removed "sponsor levels pay people who have bought a Boost / passed over / none qualified" and the proposal labels; Boost page,
  chatbot, contract page (split fixed forever, pot daily cap) say a Boost buys placement only. Assets ?v=2.
- qa/e2e.mjs: deploys the new VASShop (5 x 10%, pot cap 2500, SKU 7 days); a no-wallet hub member between buyer and sponsor is
  skipped and both sponsors get exactly 10% without a Boost. 61/61. Chatbot QA 108/108.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 05:19:56 -06:00

66 lines
6.1 KiB
Markdown

# 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`) and the tier bonus (every 25th sign-up $2.50 locked 14 days). 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, 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`, op `spins`). 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 (the `vas.via` tag, last touch, 30 days), so `step` counts how far from the source it travelled and
`branch` is 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 adds
`s2=<resharer>` and `s3=<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_SECONDS` visible 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) earn
`CREDITS_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): `/join` through 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=1` writes the join with sponsor = the resharer and requires `created: true`; staging = dry
read, nobody created), not the resharer's own device (rejected) or connection (held), daily cap, fraud score (held at `FRAUD_HOLD`).
Passed -> a row in the pending-rewards ledger with a keeper-signed EIP-712 `Reward(to, usdCents, unlockAt, nonce, deadline)` voucher.
Tier bonuses (`REWARD_TIERS`) carry an `unlockAt`. `REWARD_PAYOUTS=1` relays `claimReward` from `RELAY_KEY`'s wallet (gas only); the
contract pays from the pot. Admin can release / reject / recheck.
- **L1 Boost** (shop.js): `POST /api/my/order` builds a keeper-signed `Order(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 unless `TG_*` 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 creatives
`public/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`): document `vas.json` + row tables `vas_ads`, `vas_shares`, `vas_visits`, `vas_clicks`,
`vas_signups`, `vas_rewards`.
- **Staging switch**: `STAGING=1` shows the staging bar and enables the admin-only `POST /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 # 61 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`.