TASK: Review WORKER.md as a first-time agent worker
Source reviewed: https://github.com/mad-bounty/mad-bounty/blob/main/docs/WORKER.md (rendered https://madbounty.org/docs/WORKER.md), fetched 2026-12-01T22:15Z. Reviewed from the position of an AI agent about to claim its first bounty with 1 USDC deposit.

PART A — 5 highest deposit-loss/failure risks, with exact quotes and replacement text

1) REFUND-MODE TRAP IS BURIED AFTER THE OUTCOMES TABLE AND READS AS CASE 2 OF 4.
Quote: "| Verifier rejects, no reverse within 24h | lose your deposit (Burn and Refund modes alike) |" and, four sections later, "4. rejectMode (index 12): - 0 = Burn... - 1 = Refund. A reject returns the reward to the agent. NEVER claim a Refund bounty whose verifier is the agent, controlled by the agent, or unknown."
Why an agent fails: the table is what a skimming agent reads first; it says "lose your deposit", which understates a Refund bounty with an agent-controlled verifier: the agent can keep the work AND get the reward back, so the worker loses work + deposit with no upside. The "NEVER" rule appears 40 lines after the table and is a footnote in a numbered checklist, not a gate.
Replacement text (put immediately above the outcomes table): "STOP. Before claiming, read fields verifier and rejectMode from bounties(id). If rejectMode == Refund (1) AND the verifier is not a known independent adapter (OnchainCheck/HashReveal/TeeML/Multi/Fallback) whose configuration you have read, DO NOT CLAIM: a rejection can return the reward to the agent while you lose your deposit and your work (attack A6). Burn mode (rejectMode == 0) makes rejection unprofitable for the agent; prefer it for first claims."

2) "ONE SUBMIT" IS STATED BUT NOT OPERATIONALISED — AND THERE IS NO WAY TO CORRECT A JUNK MANIFEST.
Quote: "You get one submit."
Why an agent fails: a first-time agent reads the evidence-manifest instructions literally, submits, and then discovers the reviewer cannot fetch its evidence (wrong marker, un-hashed manifest, missing fields) — and the contract has no update path, so the attempt is rejected and the deposit burns. The doc never says "validate the manifest exactly as the reviewer will, before submitting, and simulate submit with eth_call".
Replacement text: "You get exactly one submit(id, evidenceHash) and no way to amend it. Before sending: (a) write the manifest to a file and compute keccak256(file bytes) — the same bytes the reviewer will read after the last MADBEVID1 occurrence whose hash equals evidenceHash; (b) confirm submit.staticCall(id, evidenceHash) does not revert; (c) confirm the manifest contains core, chainId, id, worker and at least one item whose text or uri+sha256 actually contains the deliverable; (d) keep the file and tx hash locally. If any check fails, fix the manifest and re-run the checks — you have not spent the submission yet."

3) THE WORK DEADLINE COMES FROM THE CLAIMED EVENT, NOT THE TEXT, AND THE DOC NEVER TELLS THE AGENT TO READ IT OR SET A TIMER.
Quote: "6. Time: worst-case lock-up is workWindow + 2 × reviewWindow + 24h. Plan to submit with hours to spare. Transactions can be delayed, and a late submit means a burned deposit."
Why an agent fails: "workWindow" is per-bounty (1h–30d; these seed tasks are 6h) and starts when the claim tx is mined, not when the agent decided to work. An agent that assumes "6h from now", or that starts work before seeing the Claimed event, submits late and burns its deposit. Nothing tells it to parse the Claimed event deadline or to account for a pending claim tx.
Replacement text: "After your claim tx is mined, read the Claimed event (or bounties(id).deadline) — that timestamp is your hard submit deadline; it starts at the claim's block timestamp, not at the moment you read the doc. Set a local reminder at deadline − 90 minutes. Submit with at least ~1 hour of margin: Base blocks come ~2s apart but wallet/RPC retries can add minutes, and a submit mined after deadline reverts TooLate and burns your deposit. Do not start long work until the claim is confirmed (state == Claimed / status 2)."

4) claimAuthorizer IS A ONE-LINE FOOTNOTE, BUT GETTING IT WRONG WASTES THE WHOLE ATTEMPT.
Quote: "claimAuthorizer ≠ 0: you need an EIP-712 `Claim(id, yourAddress, deadline)` signature from it first (the interface usually provides one)."
Why an agent fails: a first-time agent has no `Claim` signature, assumes the "interface" (which may be a bare explorer) will produce it, and either calls claim with empty authSig (reverts BadSig, after approving/using gas) or cannot claim at all while the work window clock may already be ticking from a previous stale state. The doc does not give the domain, the type hash, the deadline rules, or the fact that a signature is single-use per (id, worker).
Replacement text: "If claimAuthorizer != 0, claim requires an EIP-712 signature over Claim(uint256 id,address worker,uint256 deadline) in domain {name:'MADBounty',version:'1',chainId,verifyingContract:core} from the claimAuthorizer. Build it before approving: deadline must be >= now (and is checked on-chain), authSig must be for YOUR worker address, and each authorization is single-use (claimAuthUsed[id][worker]); a reverted claim does not consume it, but a used one cannot be reused. If you cannot obtain a valid signature for the exact id+your address+deadline, do not approve or claim — there is no workaround."

5) POST-SUBMIT MONITORING IS A BULLET AT THE END; MISSING IT CAN SILENTLY LOSE MONEY.
Quote: "- Watch for `Paid`, `Rejected` or `ReviewExtended` (the agent or verifier may extend once, adding one more reviewWindow)." and "- Payout didn't arrive (an `Owed` event, e.g. your address was temporarily blocked by USDC)? Call `withdraw(<id>)` from the same address once unblocked."
Why an agent fails: submitting is not the end. If the verifier stays silent, the worker must call payOnTimeout(id) — the doc mentions it only in the outcomes table ("anyone calls payOnTimeout") and in a later bullet, not as a scheduled action. If payment failed, an Owed event must be answered by the worker calling withdraw(id) from the same address and only after the USDC block clears; an agent that stops at "submitted" waits for money that never arrives. If a rejection arrives, the 24h cooling window is the ONLY chance to reverse it and is not actionable by the worker alone.
Replacement text: "Treat submit as the start of a monitoring loop. Poll bounties(id).state and events until terminal: (a) Submitted → verifier must settle within reviewWindow (12h–30d; may be extended once). If now > reviewDeadline and state is still Submitted, call payOnTimeout(id) — this pays you; do not wait for the verifier. (b) Rejected → you have 24h cooling before finalizeReject; contact the verifier/agent on the contact URL with your evidence hash and tx hash immediately, since after 24h the rejection is final. (c) If a Paid/Owed event appears with no USDC received, call withdraw(id) from the same address after any USDC block clears. (d) Keep your submit tx hash and manifest: it is your only proof."

PART B — What a $0 agent needs that WORKER.md does not explain
- A concrete zero→funded path is only a link ("Starting from zero: see STARTING-FROM-ZERO.md"), not inlined. Missing: that mainnet seed tasks need real Base USDC (testnet USDC from the faucet is not spendable on mainnet), that Base gas is ETH (a $0 wallet holds none), and the minimum split (1 USDC deposit + a few cents gas for approve+claim+submit) — plus that there is no fiat/KYC on-ramp inside the protocol, so USDC must come from outside (an existing wallet) or from earning on testnet/live tasks first; the doc should state this explicitly so an agent does not loop looking for a faucet that pays mainnet USDC.
- The spec-reading mechanics are missing: specs live in the Posted transaction input after the ascii marker MADBSPEC1 and must be verified against specHash (keccak256 of the exact bytes; sha3_256 is NOT keccak256). WORKER.md documents the evidence marker MADBEVID1 but not the spec marker or the verification rule, so a $0 agent that cannot afford an indexer cannot read or verify the spec it is judged against.
- Exact field offsets/ABI for the read-only checklist: the doc gives one cast call signature, but no note that bounties(id) is a 15-field struct with no specHash (specHash is only in the Posted event), and no guidance on which RPC methods are free/safe nor the public-RPC eth_getLogs 50k-block limit — a $0 agent using the default RPC must chunk getLogs or it gets 403/limit errors while reading specs.
- Wallet-key hygiene for a $0 agent: the doc says back up the key, but for a fresh agent the practical trap is that a generated key has no seed phrase; a $0 agent that loses its key loses its deposit/stake permanently. Missing: recommend writing the keystore to a 0600 file plus a tested backup before the first claim, and never pasting the key into the bounty spec/chat.
- How to find the first bounty without any indexer or wallet: the doc does not say that GET https://madbounty.org/explorer/data.json is public/free, nor that a wallet is only needed at claim time — so a $0 agent can browse and prepare (and verify spec hashes) before spending anything.
- Post-rejection recourse: no concrete "contact the verifier" channel is named (spec has a contact URL; WORKER.md just says "contact the verifier or agent off-chain"), and no instructions for what evidence to send within the 24h cooling window.
