Urgent.News

What's breaking now, across thousands of outlets.

AI

Gas Optimization Audit: Gemini

Gas Optimization Audit: Gemini Target Protocol : Gemini (TVL: $5340.2M) Gemini – Gas‑Optimization Audit Protocol TVL: ≈ $5.34 B (Ethereum + L2) Audit Scope: All on‑chain contracts that handle user deposits, withdrawals, order‑matching, and fee distribution. The focus is on gas‑efficiency , execution‑cost reduction , and mitigation of gas‑related attack vectors (e.g., gas‑griefing, out‑of‑gas…

On 18th October 2026, Gemini conducted a gas optimization audit on its Target Protocol, aimed at identifying inefficiencies, quantifying potential savings, and surfacing gas-related attack vectors that could impact user experience or protocol stability. The audit encompassed all on-chain contracts involved in user deposits, withdrawals, order-matching, and fee distribution.

The audit methodology included static analysis using Slither, MythX, and custom gas-profiling scripts, along with dynamic profiling on the mainnet and L2 (Arbitrum, Optimism). Review of compiler settings, storage layout, calldata handling, and external-call patterns were also carried out.

Key findings from the audit include:

1. Storage-slot fragmentation in OrderBook and UserBalances, leading to approximately 12% excess gas per order.

2. Unchecked loops over dynamic arrays causing quadratic gas growth during batch-settlement (worst-case 1.8 million gas per transaction).

3. Redundant require checks on immutable values increasing gas by around 3% per call.

4. Presence of missing custom errors and overuse of require(string) inflation bytecode size and runtime cost.

5. Lack of gas caps in external-call patterns ('call{value: …}') creates potential for gas-griefing Distributed Denial of Service (DoS) attacks on Layer 2 (L2) where gas-price spikes are common.

The potential savings from implementing the recommendations are substantial, with an estimated overall reduction of around 18% on deposit/withdrawal (approximately 30,000 gas per transaction), 22% reduction on order-matching (approximately 45,000 gas per match), and 12% reduction on batch-settlement (around 120,000 gas per batch). This could amount to approximately $3.2 million in annual gas fee savings, assuming 1 million transactions per year at an average gas price of 30 gwei.

The risk score assigned to the protocol is 4 out of 10, indicating a functionally sound contract with gas-related inefficiencies and minor DoS vectors that may impact user experience and increase operating costs, particularly under high-load L2 conditions. The recommended prioritized technical recommendations include storage packing, loop optimizations, and implementing custom errors. It is advised to deploy a gas-budgeted upgrade through Gemini's proxy pattern within the next 4-6 weeks to address these issues.

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 AI

The Silent Costs of AI APIs Nobody Warns You About

We've all been there. You're building something cool, you've got an idea that'll change the world (or at least get you a few stars on GitHub), and you're shopping around for AI APIs.

  • Context Window Tax: Costs rise with conversation history, increasing token usage
  • Rate Limit Trap: Production hits limits, causing 429 errors and engineering time
  • Output Token Inflation: Structured data leads to higher priced output tokens

More from Sunday 18 October →