Level 4 override for LinkSpin: weekly dry-run report + the payer, shipped OFF (Marty approved 2026-10-23)

override.js is the InstantAdPay module (same code, same tests) with LinkSpin defaults: qualification is the
LinkSpin contract's own buyerCount >= 5 (referred first buys of $20+, which on the $10/$25/... ladder means
$25+, the level-3 bar), house id #1, hunt up to 25 hops, one recipient per purchase, purchases from
overrideGoLive on, weekly Mon-Sun Central, settled Monday after 9 AM CT.

- Default overrideMode 'dryrun': Monday who-would-be-paid summary to the admin Telegram chat
  (telegramAdminChatId; email to ADMIN_EMAIL if the bot is not set). No money moves.
- Payer pays only with overrideMode 'live' + overrideGoLive + OVERRIDE_PAYER_KEY. LinkSpin has no MySQL,
  so every once-only step is an exclusive file create on the shared volume (fails closed); plan frozen
  per week, 'sending' persisted before the tx, lost answers -> review (never re-sent), dust carried,
  weekly cap held whole, balance + gas checked first.
- Members: AwardPaid from the payer emails + on-site notice "Your Level 4 override is paid"; Wallet
  screen and feeds label it "Level 4 override". /api/my/activity now reads the whole history (was the
  last 600 events, the IAP bug of 2026-09-16; LinkSpin is at 525).
- Admin: /api/admin/override (+ status, payer), POST /pay (live only), POST /resolve; P&L card.
- Contract page: Level 4 override panel hidden until overrideMode is live (contract.js reveals it).
- qa/override.test.cjs (bash qa/run.sh override): 30 checks, fake chain/signer, throwaway data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-23 15:20:02 -05:00
parent 1c2ef3780c
commit 010c3afdd9
23 changed files with 693 additions and 23 deletions
+12 -1
View File
@@ -104,6 +104,17 @@
</div>
</div>
<div class="panel" id="ovPanel" hidden><!-- Level 4 override: shown only when overrideMode is live (contract.js) -->
<div class="ph"><h2>Level 4 override</h2><span class="meta">company paid · weekly · not in the contract</span></div>
<div class="pb" style="padding-top:6px">
<div class="rule"><b>What</b><span>On top of the three levels above, the company pays 3% of every package bought four levels below you. It goes to the 4th sponsor up from the buyer, as long as that member has 5 or more qualifying buyers (referrals who bought a package of $25 or more), the same bar that opens level 3.</span></div>
<div class="rule"><b>Hunts upward</b><span>If the 4th sponsor up is not qualified yet, the override moves up the line to the next member who is, up to 25 steps. One override per purchase, to one person. If it reaches the company account first, or nobody qualifies, the company keeps it.</span></div>
<div class="rule"><b>Paid weekly</b><span>Every Monday after 9 AM Central, in POL, from a company wallet through this contract's public award function, for the Monday to Sunday week before. Every payment has its own Polygon link and shows on your Wallet screen as "Level 4 override". Weekly totals under 0.01 POL carry to the next week.</span></div>
<div class="rule"><b>Start date</b><span>Purchases from <span data-ov-start>the start date</span> on. Earlier purchases are not paid.</span></div>
<div class="rule"><b>Funding</b><span>It comes out of the platform's 20% share. The split the contract enforces does not change for anyone.</span></div>
</div>
</div>
<div class="panel">
<div class="ph"><h2>What this is and is not</h2><span class="meta">read before you buy</span></div>
<div class="pb grid3" style="font-size:14px;color:var(--ink-2)">
@@ -136,6 +147,6 @@
<span class="mono" style="font-size:11px">Advertising services with a performance referral program. Not an investment. Crypto transactions are irreversible.</span>
</div>
</footer>
<script src="/assets/contract.js?v=20261007a"></script>
<script src="/assets/contract.js?v=20261023ov"></script>
</body>
</html>