# What should an Ethereum smart contract audit cover?

URL: https://shield.quillaudits.com/chains/ethereum/

An Ethereum smart contract audit should test your Solidity against mainnet as it behaves today: accounts that can run code since EIP-7702, a cap on the gas one transaction can use, a public mempool where bots sandwich trades, and flash loans that hand an attacker a large balance for one transaction. QuillShield audits the Solidity code of a Foundry project that targets Ethereum mainnet, builds a security graph of it, and then reviews every pull request against that graph.

Last updated 3 December 2026. 6 minute read. By the QuillAudits Team.

## What is different about auditing on Ethereum?

Ethereum mainnet is the reference EVM, so the differences that matter are recent protocol changes that older code doesn't expect. Each item below changes what a reviewer should test.

- **An EOA can now run code.** [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702), part of the [Pectra upgrade](https://ethereum.org/roadmap/pectra/7702.md), lets an account delegate to contract code. The EIP warns that this breaks reentrancy guards of the form `require(tx.origin == msg.sender)` and sandwich protections that rely on `tx.origin`, and a delegated account reports an `EXTCODESIZE` of 23.
- **Delegation keeps old storage and runs no initcode.** The [ethereum.org guide to EIP-7702](https://ethereum.org/roadmap/pectra/7702.md) notes that delegating code does not clear existing storage, so a wallet that switches implementations can misread its own slots. The EIP adds that setup calldata has to be signed by the account key, because no initcode runs on delegation.
- **One transaction can use at most 16,777,216 gas.** [Fusaka](https://ethereum.org/en/roadmap/fusaka) went live on 3 December 2025 with EIP-7825, a cap of 2^24 gas per transaction. A migration, airdrop or batch liquidation that needs more gas in one call can no longer be sent as one transaction, however high the block gas limit goes.
- **Searchers watch the public mempool.** The [ethereum.org MEV docs](https://ethereum.org/developers/docs/mev.md) describe searchers who watch the mempool for large DEX trades, buy just before one and sell just after it. A swap path without a minimum output and a deadline hands them the difference.
- **Gas costs are set to change again.** [Glamsterdam](https://ethereum.org/roadmap/glamsterdam/) had no mainnet date on 3 December 2026, but its scheduled EIP-8038 raises the gas cost of state-access opcodes such as `EXTCODESIZE`, and EIP-2780 would make an ETH transfer that creates a new account cost about 204,600 gas. Calls that forward a fixed amount of gas are worth flagging before it ships.

The first change is easiest to see in code. A guard that tells people from contracts with `tx.origin` stops working once the person's account can hold code.

**Breaks under EIP-7702: an onlyEOA check used as a reentrancy guard (illustrative, not audited code)** `HumansOnlyVault.sol`

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

/// Uses tx.origin == msg.sender to keep contracts out. A delegated EOA passes
/// this check and still runs code when it receives ETH.
contract HumansOnlyVault {
    mapping(address => uint256) public balances;

    modifier onlyEOA() {
        require(tx.origin == msg.sender, "no contracts");
        _;
    }

    function deposit() external payable onlyEOA {
        balances[msg.sender] += msg.value;
    }

    function withdraw() external onlyEOA {
        uint256 amount = balances[msg.sender];
        require(amount > 0, "nothing to withdraw");
        // The delegated account re-enters from its receive function. In that
        // call msg.sender and tx.origin are still the same address.
        (bool ok, ) = msg.sender.call{value: amount}("");
        require(ok, "send failed");
        balances[msg.sender] = 0;
    }
}
```

**Holds under EIP-7702: state first and a transient lock, no tx.origin rule (illustrative, not audited code)** `AnyCallerVault.sol`

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

/// Treats every caller as code that can call back.
contract AnyCallerVault {
    mapping(address => uint256) public balances;
    bool transient locked;

    modifier nonReentrant() {
        require(!locked, "reentrant call");
        locked = true;
        _;
        locked = false;
    }

    function deposit() external payable {
        balances[msg.sender] += msg.value;
    }

    function withdraw() external nonReentrant {
        uint256 amount = balances[msg.sender];
        require(amount > 0, "nothing to withdraw");
        balances[msg.sender] = 0;
        (bool ok, ) = msg.sender.call{value: amount}("");
        require(ok, "send failed");
    }
}
```

## Which Ethereum assumptions should a reviewer test?

- Search for `tx.origin`, `extcodesize` and `code.length` checks that try to tell people from contracts, and replace each with a check that still holds when the caller runs code.
- Treat every ETH send and token transfer to a user as a call into code, since a delegated account can run a receive function. The ethereum.org guide also notes that some delegation code rejects assets such as ERC-1155 NFTs.
- List every loop over users, positions or tokens, and confirm the worst case fits in one transaction under the 2^24 gas cap that [Fusaka](https://ethereum.org/en/roadmap/fusaka) set.
- Check that each swap, and each liquidation that trades, sets a minimum output and a deadline the caller controls.
- Find calls that forward a fixed gas amount and note which would fail if state-access opcodes cost more.
- In lending code, confirm that every function that changes collateral or debt runs the same health check, donations and transfers included.
- In account contracts, check the storage layout across implementations and that setup data is signed by the account key.

## What went wrong at Euler Finance?

| Protocol | Euler Finance |
| --- | --- |
| Date | 13 March 2023 |
| Chain | Ethereum |
| Loss | about $197M |
| What happened | Euler had added a `donateToReserves` function in an improvement proposal, eIP-14, and it cut the donor's collateral without checking the donor's account health. The attacker took a 30 million DAI flash loan from Aave V2, donated until the account held more debt than collateral, then liquidated that account at the maximum 20% discount. |
| Sources | [Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454), [Bloomberg](https://www.bloomberg.com/news/articles/2023-03-13/defi-s-euler-finance-hit-by-197-million-hack-experts-say) |

No single line of `donateToReserves` looked dangerous. What it broke was the rule every lending market depends on: no action may leave an account with more debt than its collateral covers. Reading a new function against that rule, rather than against its own diff, is the review that finds this. The [guide to reviewing changes since your last audit](https://shield.quillaudits.com/guides/review-changes-since-your-last-audit/) and the [liquidation logic page](https://shield.quillaudits.com/learn/vulnerabilities/liquidation-logic-bugs/) go further, and the [Euler Finance exploit page](https://shield.quillaudits.com/exploits/euler-finance-2023/) has the full timeline.

## Which protocols run on Ethereum, and what do they need checked?

Mainnet holds the contracts that other chains settle to, such as the [Arbitrum](https://shield.quillaudits.com/chains/arbitrum/) delayed inbox and the [Linea](https://shield.quillaudits.com/chains/linea/) rollup contract, next to lending pools like the Aave V2 pool the Euler attacker borrowed from and the DEX pools searchers trade around. Each type has its own first question on mainnet.

| Protocol type | What to check first on Ethereum |
| --- | --- |
| Lending market | The same health check on every path that moves collateral or debt, and the liquidation discount math |
| DEX or aggregator | A minimum output and a deadline on every swap, and any price read a sandwich can move |
| Rollup bridge or L1 escrow | Message validation, replay protection, and who can upgrade or pause |
| Smart account or wallet | EIP-7702 delegation, storage layout across implementations, signed setup data |
| Token, airdrop or migration | Loops that must fit under the per-transaction gas cap |

## Which vulnerabilities matter most on Ethereum?

- [Reentrancy](https://shield.quillaudits.com/learn/vulnerabilities/reentrancy/): since EIP-7702, `tx.origin == msg.sender` no longer proves the caller can't call back, so locks and ordering have to do the work.
- [tx.origin authentication](https://shield.quillaudits.com/learn/vulnerabilities/tx-origin-authentication/): any rule that uses `tx.origin` to separate people from contracts now admits delegated accounts.
- [Sandwich attacks](https://shield.quillaudits.com/learn/vulnerabilities/sandwich-attack/): swaps on mainnet pass through a public mempool that searchers watch.
- [Flash loan attacks](https://shield.quillaudits.com/learn/vulnerabilities/flash-loan-attack/): the Euler attacker started from 30 million DAI borrowed for a single transaction.
- [Denial of service](https://shield.quillaudits.com/learn/vulnerabilities/denial-of-service/): a loop that grows with users can outgrow the per-transaction gas cap and stop running.

## How do you audit Ethereum contracts with QuillShield?

1. Put the contracts in a Foundry project. QuillShield supports Solidity in Foundry projects today.
2. Import the repository from GitHub or GitLab.com, or upload a Foundry .zip of up to 50 MiB, a folder or a single .sol file. A zip gets a full audit but no pull request checks.
3. Before the audit, add context: which contracts expect calls from EIP-7702 accounts, which functions must fit in one transaction, and which mainnet protocols you integrate with.
4. Check the quote and approve it. You see the exact price before anything is charged.
5. Read the findings once the audit is complete. A separate reviewer agent tries to disprove each one first, and each finding that holds up comes with the exact lines, the impact, a recommended fix and the proof of concept result.
6. Turn on [pull request checks](https://www.quillaudits.com/quillshield/guides/guides/ci-cd-checks), so each later change is compared with the audit's security graph.

Full audits start at $49 and are priced from the lines of Solidity in scope, as the [pricing page](https://shield.quillaudits.com/pricing/) shows. New accounts get $50 in credit, good for up to half of an order.

QuillShield doesn't replace a manual audit. Before a mainnet launch you can [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit) or [talk to an auditor](https://calendly.com/akshadh-a-quillaudits/30min). The [Solidity page](https://shield.quillaudits.com/languages/solidity/) covers what QuillShield checks in the language.

**[Run a full audit](https://shield.quillaudits.com/register) of your Ethereum contracts. Sign-up is free.**

## FAQ

### Does EIP-7702 break existing contracts?

It breaks contracts that use `tx.origin == msg.sender` or a code-size check to keep contracts out, because a delegated account passes the first check and runs code. [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) names reentrancy guards and sandwich protections of that kind.

### Is the Fusaka gas cap the same as the block gas limit?

No. EIP-7825 caps each transaction at 16,777,216 gas, and a block can hold many transactions. The cap has applied on mainnet since [Fusaka went live on 3 December 2025](https://ethereum.org/en/roadmap/fusaka).

### Can QuillShield audit Vyper contracts on Ethereum?

Not today. QuillShield supports Solidity in Foundry projects. For Vyper code, [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit).

### How much does an Ethereum smart contract audit cost?

A QuillShield full audit starts at $49 and is priced from the lines of Solidity in scope, for example $379 for 1,000 lines as of November 2026 ([pricing](https://shield.quillaudits.com/pricing/)). The [audit cost page](https://shield.quillaudits.com/learn/smart-contract-audit-cost/) compares that with manual audit prices.

## Sources

- [EIP-7702 specification, Ethereum Improvement Proposals](https://eips.ethereum.org/EIPS/eip-7702) · checked 3 December 2026
- [EIP-7702 in the Pectra upgrade, ethereum.org](https://ethereum.org/roadmap/pectra/7702.md) · checked 3 December 2026
- [Fusaka, ethereum.org](https://ethereum.org/en/roadmap/fusaka) · checked 3 December 2026
- [Maximal extractable value (MEV), ethereum.org](https://ethereum.org/developers/docs/mev.md) · checked 3 December 2026
- [Glamsterdam, ethereum.org](https://ethereum.org/roadmap/glamsterdam/) · checked 3 December 2026
- [Euler Finance Incident Post-Mortem, Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454) · checked 3 December 2026
- [DeFi Lender Euler Finance Hit By $197 Million Hack, Experts Say, Bloomberg](https://www.bloomberg.com/news/articles/2023-03-13/defi-s-euler-finance-hit-by-197-million-hack-experts-say) · checked 3 December 2026
