diff --git a/public/assets/my.js b/public/assets/my.js
index 2a1c3b4..558bf9d 100644
--- a/public/assets/my.js
+++ b/public/assets/my.js
@@ -53,7 +53,7 @@
const live = d.banners.filter(b => b.state !== 'cycled').length, cyc = d.banners.filter(b => b.state === 'cycled').length;
$('stats').innerHTML = [['Post credits', d.credits], ['Banners waiting or in the loop', live], ['Banners cycled', cyc], ['Network ad views earned', VBB.n(d.rewardViews)]]
.map(x => '
' + esc(x[1]) + '' + esc(x[0]) + '
').join('');
- $('creditNote').textContent = (d.grantedNow ? 'Your free credit for today was just added. ' : d.freeToday ? 'Today\'s free credit is in. ' : '')
+ $('creditNote').textContent = !d.netVerified ? 'Free daily credits are for network members. Sign in through InstantAdPay or LinkSpin, or make a free InstantAdPay account with this wallet, and your free credit arrives each day you sign in. You can have up to ' + d.maxQueued + ' banners waiting at once.' : (d.grantedNow ? 'Your free credit for today was just added. ' : d.freeToday ? 'Today\'s free credit is in. ' : '')
+ 'One free credit arrives each day you sign in (they bank up to ' + d.freeCreditCap + '). You can have up to ' + d.maxQueued + ' banners waiting at once.';
$('postBtn').disabled = d.credits < 1;
if (d.credits < 1) VBB.status('You have used your credits. Come back tomorrow for a free one.');
diff --git a/public/how.html b/public/how.html
index 3721154..354893e 100644
--- a/public/how.html
+++ b/public/how.html
@@ -28,7 +28,7 @@
How the loop works
One public page, one shared loop. The whole community moves it with real visitors.
- - Sign in, get a creditSign in through InstantAdPay, LinkSpin or a wallet. Every day you sign in you get one free post credit.
+ - Sign in, get a creditSign in through InstantAdPay, LinkSpin or a wallet. Network members (InstantAdPay or LinkSpin) get one free post credit every day they sign in.
- Post a bannerA 125x125 image and a link. It waits in line, then enters the loop at the front.
- Visitors move the loopEvery 10 verified visitors shift every banner one place forward.
- Ride out, earn advertisingThe banner at the end rides out. It has cycled, and you earn 150 network ad views.
diff --git a/public/packages.html b/public/packages.html
index e41219d..1e5610d 100644
--- a/public/packages.html
+++ b/public/packages.html
@@ -37,7 +37,7 @@
Banner look
$2 per banner
A border and a hover teaser that make your banner stand out in the loop.
Coming soon
Tokens
Network visits
Each token is a visit to your site from the network, at the InstantAdPay visit rate.
Coming soon
- Until packages open, every member gets one free post credit each day they sign in.
Use my free credit
+ Until packages open, every network member (InstantAdPay or LinkSpin) gets one free post credit each day they sign in.
Use my free credit
diff --git a/qa/smoke.mjs b/qa/smoke.mjs
index 974223d..c1f2bf1 100644
--- a/qa/smoke.mjs
+++ b/qa/smoke.mjs
@@ -22,8 +22,12 @@ const DATA = path.join(OUT, 'data-' + Date.now()); fs.mkdirSync(DATA, { recursiv
const PW = process.env.PLAYWRIGHT || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright';
const PORT = Number(process.env.SMOKE_APP_PORT || 3217), BASE = 'http://127.0.0.1:' + PORT;
const ADMIN = 'smoke-admin-token', SSO_SECRET = crypto.randomBytes(32).toString('hex');
+// stand-in for the network member lookup: wallets in NET are network members, everyone else is a stranger
+const NET = new Set(); const LOOKUP_PORT = PORT + 1;
+require('node:http').createServer((q, r) => { const a = (new URL(q.url, 'http://x').searchParams.get('a') || '').toLowerCase();
+ r.setHeader('Content-Type', 'application/json'); r.end(JSON.stringify(NET.has(a) ? { address: a, username: 'net' + a.slice(2, 10) } : {})); }).listen(LOOKUP_PORT, '127.0.0.1').unref();
const ENV = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, ADMIN_TOKEN: ADMIN, NODE_ENV: 'development', DOCSTORE_URL: '',
- LOOP_SIZE: '5', VISITORS_PER_SHIFT: '3', VIEWS_PER_CYCLE: '150', VISIT_SECONDS: '2', VISITS_PER_IP_DAY: '2', LINK_PROBE: '0', NETWORK_LOOKUP_URL: '',
+ LOOP_SIZE: '5', VISITORS_PER_SHIFT: '3', VIEWS_PER_CYCLE: '150', VISIT_SECONDS: '2', VISITS_PER_IP_DAY: '2', LINK_PROBE: '0', NETWORK_LOOKUP_URL: 'http://127.0.0.1:' + (PORT + 1) + '/api/network/member',
NETWORK_SSO_SECRET: SSO_SECRET, IAP_URL: 'https://iap.invalid', LS_URL: 'https://ls.invalid' });
const sleep = ms => new Promise(r => setTimeout(r, ms));
let pass = 0, fail = 0; let srv = null;
@@ -63,8 +67,8 @@ async function boot() {
async function stop() { const p = srv; srv = null; if (!p) return; const done = new Promise(r => p.once('exit', r)); p.kill('SIGINT'); await Promise.race([done, sleep(3000)]); }
// a signed-in member by wallet signature
-async function walletMember() {
- const w = ethers.Wallet.createRandom(); const c = client();
+async function walletMember(o = {}) {
+ const w = ethers.Wallet.createRandom(); const c = client(); if (!o.stranger) NET.add(w.address.toLowerCase());
const ch = await c.json('/api/auth/challenge', { address: w.address });
const v = await c.json('/api/auth/verify', { address: w.address, signature: await w.signMessage(ch.message) });
c.address = w.address.toLowerCase(); c.ok = v.ok === true && !!c.jar['vbb.sid'];
@@ -122,7 +126,10 @@ async function main() {
const A = await walletMember();
ok(A.ok, 'wallet signature sign-in sets a session');
let my = await A.json('/api/my');
- ok(my.credits === 1 && my.freeToday === true, 'first sign-in of the day: one free post credit', my);
+ ok(my.credits === 1 && my.freeToday === true && my.netVerified === true, 'network wallet, first sign-in of the day: one free post credit', my);
+ const X = await walletMember({ stranger: true }); let mx = await X.json('/api/my');
+ ok(mx.credits === 0 && mx.netVerified === false && mx.grantedNow === false, 'a wallet the network does not know gets no free credit', mx);
+ mx = await X.json('/api/my'); ok(mx.credits === 0, 'still none on the next visit', mx);
my = await A.json('/api/my'); ok(my.credits === 1 && my.grantedNow === false, 'no second free credit the same day');
const bad = client(); const w0 = ethers.Wallet.createRandom(), w1 = ethers.Wallet.createRandom();
const ch0 = await bad.json('/api/auth/challenge', { address: w0.address });
diff --git a/server.js b/server.js
index aa36e1b..7d79a95 100644
--- a/server.js
+++ b/server.js
@@ -116,8 +116,17 @@ function signedIn(addr, patch) {
const m = store.upsertMember(addr, patch);
grantDaily(m); return m;
}
+// free daily credits go to network-verified members only (Marty 2026-11-13, stops wallet farming): signed in through InstantAdPay or
+// LinkSpin, or a wallet the network knows. A plain wallet is rechecked on each visit, so joining InstantAdPay later unlocks it.
+const netVerified = m => !!m && (m.via === 'iap' || m.via === 'linkspin' || m.netOk === true);
+async function verifyNet(addr) {
+ const m = store.member(addr); if (!m || netVerified(m)) return;
+ const n = await netMember({ a: addr }).catch(() => null);
+ if (n && n.address === m.address) { store.upsertMember(addr, { netOk: true }); await fillUsername(addr).catch(() => {}); }
+}
// one free post credit a day (Central time), banked up to freeCreditCap
function grantDaily(m) {
+ if (!netVerified(m)) return false;
const day = store.ctDay(); if (m.freeDay === day) return false;
m.freeDay = day; let granted = false;
const add = Math.min(C.freeCreditsPerDay, Math.max(0, C.freeCreditCap - m.credits));
@@ -129,7 +138,7 @@ function myData(addr) {
const banners = store.bannersOf(addr).slice().reverse().map(b => Object.assign({ id: b.id, img: b.img, link: b.link, createdAt: b.createdAt, cycledAt: b.cycledAt || null, clicks: b.clicks || 0 }, loop.placeOf(b)));
const rewards = store.ledger().filter(e => e.owner === m.address);
const shareName = m.username || m.address;
- return { address: m.address, username: m.username, credits: m.credits, freeCreditCap: C.freeCreditCap, freeToday: m.freeDay === store.ctDay(),
+ return { address: m.address, username: m.username, credits: m.credits, freeCreditCap: C.freeCreditCap, freeToday: m.freeDay === store.ctDay(), netVerified: netVerified(m),
maxQueued: C.maxQueuedPerMember, banners, rewards: rewards.slice(-50).reverse(), rewardViews: rewards.reduce((t, e) => t + e.views, 0),
week: loop.memberWeek(m.address), share: 'https://' + C.site + '/?ref=' + encodeURIComponent(shareName) };
}
@@ -282,7 +291,7 @@ const server = http.createServer(async (req, res) => {
const s = session(req); if (!s) return json(res, 401, { error: 'Sign in first.' });
const me = s.address;
if (!store.member(me)) signedIn(me, { via: 'wallet' });
- if (p === '/api/my' && req.method === 'GET') { const m = store.member(me); const granted = grantDaily(m); m.lastSeen = Date.now(); return json(res, 200, Object.assign(myData(me), { grantedNow: granted })); }
+ if (p === '/api/my' && req.method === 'GET') { await verifyNet(me); const m = store.member(me); const granted = grantDaily(m); m.lastSeen = Date.now(); return json(res, 200, Object.assign(myData(me), { grantedNow: granted })); }
if (p === '/api/my/upload' && req.method === 'POST') {
if (limited(req, 'upload', 40, 3600000)) return json(res, 429, { error: 'Too many uploads this hour.' });
let buf; try { buf = await readRaw(req, safety.MAX_UPLOAD + 1); } catch (e) { return json(res, 400, { error: 'The file is over 100 KB.' }); }