Putting immutable contracts on mainnet before an external audit


BOT Bazaar is a 3D market on BOT Chain where people and AI agents sell goods and services to each other. It has no token, no platform fee, no backend and no admin key. The seven Solidity contracts (1,373 lines in total, no imports) have no owner, no pause switch and no proxy.

Players can trust that kind of system because nobody can change the rules under them. It also means we can’t patch a bug after deployment. Once a contract holds other people’s funds, the code we shipped is the code that runs.

So the question for mainnet was how to launch something we cannot fix, before an external audit, without asking players to take on a risk they can’t see.

Step 1: ship the contract that moves nothing

The first contract on mainnet was PixelWorkshop on its own, deployed with a constructor flag that makes it free-only:

bool public immutable freeOnly;

constructor(bool freeOnly_) {
    freeOnly = freeOnly_;
}
// in register():
require(price == 0 || !freeOnly, "free-only");

With freeOnly set, publishing a pixel design works, but register rejects any non-zero price, so no BOT ever passes through the contract. That let us prove the whole path on the real chain (wallet onboarding, gas, the 3D client, reading state straight from the contracts) while nothing was at stake.

Step 2: a cap the contract enforces, not a promise

The other six contracts went out the same day as “test version 0.1”. The three that hold value (the market, offers and the request board) take a cap as a constructor immutable:

uint128 public immutable maxAmount;
error OverCap(uint256 cap, uint256 amount);

function _capped(uint256 amount) private view {
    if (maxAmount != 0 && amount > maxAmount) revert OverCap(maxAmount, amount);
}

On mainnet the cap is 10^15 wei, which is 0.001 BOT. Every purchase, offer and request reward checks it before anything is stored.

We didn’t want the cap to depend on someone remembering a flag, so the deploy script refuses an uncapped market on mainnet:

if (network === "mainnet" && !only && maxAmount === 0n) {
  console.error("Mainnet market contracts need --max-amount until they are audited ...");
  process.exit(1);
}

We’re explicit about one limit. The cap is per action, not aggregate. Many capped purchases can add up to any total. The cap bounds what a single bug can cost a single trade. It doesn’t bound the system as a whole, and the README and audit notes say so in those words.

Raising the cap means a new deployment

Because nothing is upgradeable, raising the cap is not a transaction. It means deploying the market, offers and request contracts again at new addresses.

The plan for that is already written down. The 0.1 contracts keep running so every open item finishes under the rules it started with. The web client keeps the old addresses, so those items still show their settle and refund buttons. Nobody’s escrow is migrated by us, because we have no way to do that, and we think that’s a feature.

Proving the bytecode is ours

“The source is public” only helps if the deployed bytecode matches it. scripts/verify-explorer.mjs recompiles the contracts with the exact settings used for deployment (solc 0.8.28, evmVersion: paris, 200 optimizer runs), compares the result with the on-chain code (masking the immutables, which differ per deployment) and then submits standard-JSON to the BOTScan explorer. All seven contracts matched.

Then we used the product the way a player would. scripts/core-flows.mjs ran every core flow on mainnet on 2026-10-15: open a shop, buy, confirm, make and accept an offer, cancel an offer, post, assign, submit and accept a request, cancel a request, enter Bot or Not, declare a kind in AgentPass, close the shop. That’s 20 transactions, all successful, with 0.045 BOT in gas fees in total. The full list with explorer links is in the repository’s audit notes.

What we have not done

Our review package (static analysis plus a line-by-line review of every path that moves value) found no High or Medium issues. We ran no fuzzing and no formal verification. The docs say that plainly, and it’s the reason the cap exists.

What we took away

  • If you can’t patch it, limit what it can lose. A per-action cap in the constructor costs a few lines and turns “we hope there’s no bug” into “a bug costs at most this much per trade”.
  • Put safety rules in the tooling, not in a checklist. The deploy script refusing to run is more reliable than a note telling us to pass the right flag.
  • Write down the limits next to the guarantees. “Per action, not aggregate” is less impressive than “capped”, but it’s the accurate version.