From 9dc5989aa39c83d6f25f3ecd45c246752e783f21 Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 4 Sep 2026 13:47:49 -0500 Subject: [PATCH] Contract verification page, cache-busted assets, no-withdrawal line /contract: plain-language security review with the six design laws, honest operator CAN/CANNOT lists, split walkthrough, oracle bridge and anti-stall notes, testing summary, live explorer + Sourcify verified-source links (config-driven so it follows the mainnet flip). Nav gains The contract. All asset URLs now carry a version query so deploys bust browser caches (the level-cycler stall). Earn-deeper checklist leads with: no withdrawal requests, ever. Co-Authored-By: Claude Fable 5 --- public/assets/common.js | 1 + public/assets/contract.js | 13 ++++ public/contract.html | 135 ++++++++++++++++++++++++++++++++++++++ public/index.html | 9 +-- public/ledger.html | 6 +- public/my.html | 8 +-- server.js | 1 + 7 files changed, 162 insertions(+), 11 deletions(-) create mode 100644 public/assets/contract.js create mode 100644 public/contract.html diff --git a/public/assets/common.js b/public/assets/common.js index 63c87c1..8f70aa2 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -32,6 +32,7 @@ window.IAP = (function () { + 'How it works' + 'Ad packages' + 'Live ledger' + + 'The contract' + 'Members' + '…'; document.body.prepend(nav); diff --git a/public/assets/contract.js b/public/assets/contract.js new file mode 100644 index 0000000..4a46cd0 --- /dev/null +++ b/public/assets/contract.js @@ -0,0 +1,13 @@ +// Contract page: inject live address, chain, explorer + verified-source links. +(async function () { + await IAP.renderNav('contract'); + const c = await IAP.getConfig(); + const $ = IAP.$; + $('cAddr').textContent = c.contract.slice(0, 10) + '…' + c.contract.slice(-6); + $('cChain').textContent = c.chainName; + $('mockAddr').textContent = c.contract.slice(0, 18) + '…'; + $('lnkExplorer').href = c.explorer + '/address/' + c.contract + '#code'; + const src = 'https://repo.sourcify.dev/contracts/full_match/' + c.chainId + '/' + c.contract + '/'; + $('lnkSource').href = src; + $('lnkSource2').href = src; +})(); diff --git a/public/contract.html b/public/contract.html new file mode 100644 index 0000000..0ee2007 --- /dev/null +++ b/public/contract.html @@ -0,0 +1,135 @@ + + + + +The contract | InstantAdPay + + + + + +
+
+

The contract, in plain language.

+

Every dollar on this platform moves through one smart contract. This page explains + what it does, what nobody can change, and exactly what powers we kept. Verify every claim + yourself. That is the point.

+

+ address: … + … +

+

+ Raw contract on the explorer ↗ + Verified source code ↗ +

+
+ +
+

The six laws the code enforces

+
    +
  • It never holds funds. Every purchase is fully paid out in the same transaction. The contract balance is zero after every sale. There is nothing to freeze, drain, or run away with.
  • +
  • The compensation rules are constants. 50 percent, 20 percent, 10 percent, 20 percent platform. They are compiled into the bytecode. No function exists to change them.
  • +
  • No upgrade path, no pause switch, no self-destruct. The deployed bytecode is the program forever.
  • +
  • Purchased credits only ever go down by delivering your ads. No function reduces them for any other reason, and nothing can mint them except a purchase.
  • +
  • Qualification is earned, never bought. Deeper levels unlock only by referring real buyers of $20 or more. No spend-based shortcuts exist.
  • +
  • Everything is observable. Every state change emits a public event. The website is a mirror of the chain, never the source of truth for money.
  • +
+
+ +
+
+

What the operator CAN do

+
    +
  • Add ad packages to the catalog (price floor $1, ceiling $500)
  • +
  • Queue a price change, which waits behind a public 24-hour timelock before anyone can apply it
  • +
  • Retire a package from sale, and reactivate it later
  • +
  • Rotate the fee-receiver, ad-engine, and owner addresses (key-loss insurance)
  • +
  • The ad engine can burn credits, but only as your campaigns consume delivery
  • +
+
+
+

What the operator CANNOT do

+
    +
  • Change any split percentage or qualification threshold
  • +
  • Pause, upgrade, or replace the contract
  • +
  • Hold, redirect, or claw back anyone's payout
  • +
  • Mint credits, take credits, or touch anyone's membership record
  • +
  • Move a price outside the $1 to $500 bounds, or skip the 24-hour notice
  • +
+
+
+ +
+

Where every purchase goes

+
+
50%
direct sponsor
+
20%
level 2
+
10%
level 3
+
20%
platform
+
+

On a $20 package: $10.00 to the direct sponsor, $4.00 to level 2, $2.00 to level 3, + $4.00 to the platform. Rounding dust of a few billionths of a cent goes to the platform wallet so the + books always balance to zero. When a level has no qualified recipient, that share visibly passes up + to the next qualified person; if none exists within 25 candidates, it goes to the platform. Every one + of these movements is an event on the live ledger.

+
+ +
+
+

Dollar prices, POL settlement

+

Packages are priced in dollars and settled in POL using the Chainlink POL/USD + oracle at the moment of purchase. If you send slightly too much because the rate moved, the excess + refunds to you in the same transaction. If the oracle ever goes quiet, the contract keeps selling + at its last fresh price for up to 24 hours, then new purchases pause until the feed returns. + Settled money, credits, and memberships are never affected by an oracle outage.

+
+
+

Nobody can stall it

+

Payouts are pushed with a strict gas allowance. A wallet that refuses to + accept payment is simply treated as unqualified and its share passes up. No escrow forms, no + purchase reverts, nobody waits on anybody. One practical note: use a normal wallet address for + payouts. Some exotic smart-contract wallets cost more gas to receive than the allowance and would + be passed over.

+
+
+ +
+

How it was tested

+

Before deployment the contract passed a suite of 24 tests covering every split + scenario, the pass-up walk to its exact 25-candidate boundary, oracle outages and price swings, + refunds, hostile recipient wallets, and catalog rules. On top of that, an invariant fuzzer ran + 128,000 randomized transactions and confirmed after every single one: the contract balance stayed + zero, every wei in equaled every wei out, credits equaled purchases minus delivery, and nobody was + qualified without earning it. The full specification was then audited line by line against the code. + The source you see at the verified-source link is byte-for-byte what runs on chain.

+
+ +
+
+

Do not trust this page. Check it.

+

The whole reason this platform exists is that you should + not have to take anyone's word, including ours. Open the source, open the ledger, click a + transaction.

+ Read the verified source + Open the live ledger +
+
+
contract
+
+
compiler checkexact match
+
bytecode checkexact match
+
upgrade pathnone
+
pause switchnone
+
+
+
+ +
+
InstantAdPay · how it works · live ledger
+
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.
+
+
+ + + + diff --git a/public/index.html b/public/index.html index 45b0daa..b6a32ca 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ InstantAdPay: advertise and earn, locked in code - + @@ -191,6 +191,7 @@

Level 1 is open to every member: your direct referrals each pay you 50 percent of every package they ever buy, straight to your wallet.

@@ -344,8 +345,8 @@ - - - + + + diff --git a/public/ledger.html b/public/ledger.html index 5447535..22be73c 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -5,7 +5,7 @@ Live ledger | InstantAdPay - +
@@ -25,7 +25,7 @@
InstantAdPay · how it works · contract source ↗
- - + + diff --git a/public/my.html b/public/my.html index f8b54d6..d0c235a 100644 --- a/public/my.html +++ b/public/my.html @@ -4,7 +4,7 @@ My account | InstantAdPay - +
@@ -130,8 +130,8 @@
- - - + + + diff --git a/server.js b/server.js index 96ebdaa..7bdbd96 100644 --- a/server.js +++ b/server.js @@ -337,6 +337,7 @@ const server = http.createServer(async (req, res) => { if (req.method === 'GET') { if (p === '/') return sendFile(res, path.join(PUBLIC_DIR, 'index.html')); if (p === '/ledger') return sendFile(res, path.join(PUBLIC_DIR, 'ledger.html')); + if (p === '/contract') return sendFile(res, path.join(PUBLIC_DIR, 'contract.html')); if (p === '/my') return sendFile(res, path.join(PUBLIC_DIR, 'my.html')); const safe = path.normalize(p).replace(/^([.\\/])+/, ''); const file = path.join(PUBLIC_DIR, safe);