Urgent.News

What's breaking now, across thousands of outlets.

Tech

I claimed my gas refunds were exact. An audit found the 21,000 I was crediting twice.

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/…

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.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Monday 21 September →