{
  "id": 8892394,
  "title": "I claimed my gas refunds were exact. An audit found the 21,000 I was crediting twice.",
  "url": "https://urgent.news/2026/09/21/i-claimed-my-gas-refunds-were-exact-an-audit-found-the-21-000-i-was",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-21T09:36:29.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/edycutjong/i-claimed-my-gas-refunds-were-exact-an-audit-found-the-21000-i-was-crediting-twice-50fd"
  },
  "original_language": "en",
  "account": "A gas refund system claimed to be exact, but an audit revealed an error. A contract that batched K orders into one transaction over-refunded 21,000 × (K − 1) gas. The issue stemmed from a standing on-chain order needing someone to call it, incurring gas costs. To repay the gas, a price oracle and keeper network were needed, which the contract lacked. The Legwork contract, live on Arc mainnet, addressed this issue. The contract monitors the gas used during an execute function call, subtracts the intrinsic gas cost, and replicates this process for each call in a transaction. This ensures that the refund accurately matches the gas utilized, resolving the over-refunding issue.",
  "summary": "My README said the gas refund was exact . An audit round the next day showed it wasn't: a contract that batched K orders in one transaction was over-refunded 21,000 × (K − 1) gas. Nobody had exploited it, it was bounded by each order's reserve, and it was still not \"exact\". This post is the mechanism, the mistake, the fix, and the receipts that stayed in the repo. Live: https://legwork.edycu.dev/…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}