VBBShop hooks (inert until configured, nothing deployed): GET /api/my/voucher signs an EIP-712 sponsor voucher with KEEPER_KEY when the hub lookup names the member's network sponsor (new optional sponsor field; none or self = no voucher); shop.js watcher reads Purchase logs (CONTRACT_ADDRESS + CHAIN_RPC, confirmed blocks, 1,000-block ranges) and credits packs once per txHash:logIndex, dedupe marks saved in vbb.json with the credits; admin status shows the watcher, never the key. Packages page stays coming soon. Smoke 117/117 (fake chain + voucher checks)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 16:20:24 -06:00
parent 471fefacf0
commit 07cc1944e6
6 changed files with 186 additions and 13 deletions
+10 -2
View File
@@ -1,4 +1,4 @@
# Viral Banner Blitz app env (Coolify later). Never commit real values. v1 is off-chain: no contract, no payments.
# Viral Banner Blitz app env (Coolify later). Never commit real values. v1 takes no payments in the UI (packages: coming soon).
DOCSTORE_URL= # mysql://user:pass@host:3306/vbb REQUIRED for any real launch (files are local prototype only)
SITE_HOST=viralbannerblitz.com
SESSION_SECRET= # random hex; default = generated into DATA_DIR/.secret
@@ -15,7 +15,7 @@ FREE_CREDIT_CAP=7 # free credits bank up to this many
MAX_QUEUED_PER_MEMBER=3
CREDIT_PACKS=10:3,40:10 # credits:usd, shown as coming soon
LOOK_USD=2 # banner look, shown as coming soon
SPONSOR_PCT=30 # planned on-chain split (company gets the rest); not used in v1
SPONSOR_PCT=30 # display only; the real split is fixed in VBBShop (sponsor 30, prize 10, company 60)
PRIZE_PCT=10 # weekly prize pot = this % of the week's sales
PRIZE_FLOOR_USD=20 # never less (company tops it up)
PRIZE_CAP_USD=50 # never more (internal, not shown)
@@ -23,3 +23,11 @@ PRIZE_PLACES=50,30,20 # % of each board's half, 1st/2nd/3rd
LINK_PROBE=1 # 0 skips the target-link frame check (local tests only)
CF_PROXIED=0 # 1 only if Cloudflare proxies the domain (then cf-connecting-ip is trusted)
NETWORK_LOOKUP_URL= # default InstantAdPay /api/network/member; empty = off
# VBBShop (../contracts). All empty = inert. Vouchers need KEEPER_KEY + CONTRACT_ADDRESS; the watcher needs CONTRACT_ADDRESS + CHAIN_RPC.
CONTRACT_ADDRESS= # the deployed VBBShop (not deployed yet)
CHAIN_RPC= # server-side Polygon RPC for the purchase watcher
SHOP_START_BLOCK= # the deploy block; the first scan starts here
SHOP_CONFIRMATIONS=10 # credit only this many blocks behind the head
SHOP_POLL_MS=30000
KEEPER_KEY= # private key of the contract's keeper (signs sponsor vouchers). Coolify secret only, never in git
VOUCHER_SECONDS=1800 # a voucher is good for 30 minutes