# Solidity smart contract audit: what it checks and what it costs

URL: https://shield.quillaudits.com/languages/solidity/

A Solidity smart contract audit reads every contract in scope for the ways it can lose funds or control, from missing access checks and reentrancy to price, rounding and upgrade errors, and it checks the compiler settings the code is built with. QuillShield, an AI security auditor from the audit firm QuillAudits, runs a full audit of a Solidity codebase in a Foundry project, builds a security graph and tests its findings with proofs of concept, then checks every pull request against that graph. It is AI-Powered Code Review and does not replace a manual audit, which you can request from QuillAudits.

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

## What does a Solidity smart contract audit cover?

An audit starts from one fixed commit and a list of files in scope. For each contract the reviewer asks who can call each function, what state it changes, which external calls it makes and in what order, and what it trusts about the tokens, oracles and other protocols it talks to. Inherited and library code is read where your contracts depend on it, because the behavior of a base contract becomes yours once you inherit it.

The review also covers how the code is built and changed: the compiler version, the upgrade and initialization paths, and the roles that exist on deployment day. The output is a list of findings, each with a severity, the lines involved, the impact and a fix.

The ethereum.org security guide says [audits won't catch every bug](https://ethereum.org/developers/docs/smart-contracts/security/) and should not be treated as a silver bullet, which is why teams keep tests, a bug bounty and a review of every change that lands after the audit. The guide to [reviewing changes since your last audit](https://shield.quillaudits.com/guides/review-changes-since-your-last-audit/) shows that last step.

## What are the most common Solidity security vulnerabilities?

Most losses come from a short list of classes, and access control leads it. The OWASP Smart Contract Top 10 ranks improper access control first and, as [Dedaub reports](https://dedaub.com/blog/solidity-security-vulnerabilities/), attributes $953.2M of the $1.42B lost across 149 documented incidents in 2024 to that class. The table maps each class to what goes wrong in Solidity and to the page that explains it with code.

| Bug class | What goes wrong in Solidity | First thing to check |
| --- | --- | --- |
| [Access control](https://shield.quillaudits.com/learn/vulnerabilities/access-control/) | A function that moves funds, mints or changes roles has no check, or an initializer is left open. | List every external function and the role that should guard it. |
| [Reentrancy](https://shield.quillaudits.com/learn/vulnerabilities/reentrancy/) | An external call runs before balances are final, and the callee comes back in. | Is state updated before each call, and is every function that shares it guarded? |
| [Read-only reentrancy](https://shield.quillaudits.com/learn/vulnerabilities/read-only-reentrancy/) | A view returns a value from the middle of an update, and another protocol prices with it. | Which of your views do other contracts read while your calls are in flight? |
| [Oracle price manipulation](https://shield.quillaudits.com/learn/vulnerabilities/oracle-price-manipulation/) | A price read from a thin pool or a short TWAP moves within one transaction. | Where does each price come from, and what does it cost to move it? |
| [Stale oracle price](https://shield.quillaudits.com/learn/vulnerabilities/stale-oracle-price/) | A feed stops updating and the contract keeps using the last answer. | Is the update time of each feed checked against a limit for that asset? |
| [Flash loan attack](https://shield.quillaudits.com/learn/vulnerabilities/flash-loan-attack/) | Borrowed capital inflates a balance, a vote or a price for one transaction. | Can any value the contract trusts be pushed and restored in one transaction? |
| [Rounding and precision](https://shield.quillaudits.com/learn/vulnerabilities/rounding-precision-errors/) | Division rounds toward the caller, and small leaks repeat until they drain a pool. | Does each division round in favor of the protocol? |
| [ERC-4626 inflation attack](https://shield.quillaudits.com/learn/vulnerabilities/erc4626-inflation-attack/) | A donation to an empty vault rounds the next deposit down to 0 shares. | Is the first deposit protected by virtual shares, a seed deposit or a minimum? |
| [Integer overflow and underflow](https://shield.quillaudits.com/learn/vulnerabilities/integer-overflow-underflow/) | An `unchecked` block or inline assembly skips the checks Solidity 0.8 adds. | Does every `unchecked` block have the check that makes it safe right above it? |
| [Unsafe casting](https://shield.quillaudits.com/learn/vulnerabilities/unsafe-casting/) | A cast to a smaller type drops the high bits of a large value. | Is every downcast bounded before it happens? |
| [Unchecked external call](https://shield.quillaudits.com/learn/vulnerabilities/unchecked-external-call/) | A low-level call fails and the code carries on as if it had worked. | Is the success flag of every low-level `call` checked? |
| [Delegatecall](https://shield.quillaudits.com/learn/vulnerabilities/delegatecall-vulnerability/) and [storage collision](https://shield.quillaudits.com/learn/vulnerabilities/storage-collision/) | Code runs against the storage of your contract, and a layout mismatch overwrites the wrong slot. | Do the proxy and every implementation keep one storage layout? |
| [Uninitialized proxy](https://shield.quillaudits.com/learn/vulnerabilities/uninitialized-proxy/) | A proxy or its implementation can still be initialized by anyone. | Does each initializer run once, in the deployment or upgrade transaction? |
| [Signature replay](https://shield.quillaudits.com/learn/vulnerabilities/signature-replay/) | A permit or meta-transaction signature is used twice, or on another chain. | Does each signed message carry a nonce, a domain separator and a deadline? |
| [Front-running](https://shield.quillaudits.com/learn/vulnerabilities/front-running/) | A pending transaction is seen and beaten, or a swap accepts any output. | Does each swap and price-dependent call take a minimum and a deadline from the user? |
| [Denial of service](https://shield.quillaudits.com/learn/vulnerabilities/denial-of-service/) | A loop over a growing list reaches the block gas limit, or one failing recipient blocks the rest. | Can any loop or payout list grow with user input? |
| [tx.origin authentication](https://shield.quillaudits.com/learn/vulnerabilities/tx-origin-authentication/) | A check on `tx.origin` passes when the owner is tricked into calling a contract the attacker controls. | Search every authorization check for `tx.origin`. |
| [Uniswap v4 hooks](https://shield.quillaudits.com/learn/vulnerabilities/uniswap-v4-hook-vulnerabilities/) | A hook callback anyone can call, or deltas that don't settle the way the pool expects. | Can only the PoolManager call each hook function? |

The Solidity docs give the reasons behind two of these rows directly: [never use `tx.origin` for authorization](https://docs.soliditylang.org/en/latest/security-considerations.html), and a loop whose iteration count grows with storage can stall a contract at the gas limit. The [vulnerability library](https://shield.quillaudits.com/learn/vulnerabilities/) has vulnerable and fixed code for each class, and the [use-case pages](https://shield.quillaudits.com/use-cases/) show which classes matter most for [lending markets](https://shield.quillaudits.com/use-cases/defi-lending/), [ERC-4626 vaults](https://shield.quillaudits.com/use-cases/erc-4626-vaults/), [staking contracts](https://shield.quillaudits.com/use-cases/staking/), [token contracts](https://shield.quillaudits.com/use-cases/token-contracts/), [bridges](https://shield.quillaudits.com/use-cases/bridges/) and [stablecoins](https://shield.quillaudits.com/use-cases/stablecoins/).

## Which compiler version and pragma should a Solidity audit assume?

An audit reviews code as compiled, so the compiler version belongs in the scope. The Solidity team keeps a [list of known compiler bugs](https://docs.soliditylang.org/en/latest/bugs.html) with the versions each one affects, and its security guide warns that the compiler itself might have a bug and says to [always use the latest version of the compiler](https://docs.soliditylang.org/en/latest/security-considerations.html). Pin one exact version, as the examples on this page do with `pragma solidity 0.8.28;`, so the code you test is the code you deploy. A range such as `^0.8.0` accepts any later 0.8 release, and two builds of the same commit can then differ.

Version 0.8 changed how arithmetic bugs show up. [Before Solidity 0.8, arithmetic wrapped silently](https://dedaub.com/blog/solidity-security-vulnerabilities/), and in 2018 the batchOverflow bug in the Beauty Ecosystem Coin ERC-20 token (CVE-2018-10299) multiplied a recipient count by a value large enough to overflow and minted an astronomical balance from nothing. Since 0.8 the default checked mode reverts on overflow, but `unchecked` blocks, inline assembly and casts to smaller types bring the old behavior back.

**Vulnerable: an unchecked block hides an underflow (illustrative, not audited code)** `PointsLedger.sol`

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

contract PointsLedger {
    mapping(address => uint256) public points;
    address public immutable issuer;

    constructor() {
        issuer = msg.sender;
    }

    function award(address user, uint256 amount) external {
        require(msg.sender == issuer, "not issuer");
        points[user] += amount;
    }

    function redeem(uint256 amount) external {
        // unchecked saves gas, but nothing above it proves
        // that the caller holds `amount` points.
        unchecked {
            points[msg.sender] -= amount;
        }
    }
}
```

An account with 0 points calls `redeem(1)`. The subtraction wraps, and the account now holds 2^256 minus 1 points. In checked mode the same line would have reverted.

**Fixed: the check that makes the unchecked block safe (illustrative, not audited code)** `PointsLedgerFixed.sol`

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

contract PointsLedgerFixed {
    mapping(address => uint256) public points;
    address public immutable issuer;

    error InsufficientPoints(uint256 held, uint256 asked);

    constructor() {
        issuer = msg.sender;
    }

    function award(address user, uint256 amount) external {
        require(msg.sender == issuer, "not issuer");
        points[user] += amount;
    }

    function redeem(uint256 amount) external {
        uint256 held = points[msg.sender];
        if (amount > held) revert InsufficientPoints(held, amount);
        // Safe: the check above proves held >= amount.
        unchecked {
            points[msg.sender] = held - amount;
        }
    }
}
```

Compilers have bugs of their own. In July 2023 a reentrancy lock that [Vyper 0.2.15, 0.2.16 and 0.3.0 shipped](https://dedaub.com/blog/solidity-security-vulnerabilities/) did not protect across functions, and attackers drained several Curve pools, a case the [Vyper audit page](https://shield.quillaudits.com/languages/vyper/) covers. When a finding depends on the compiler, the report should name the version it was checked against.

## What does QuillShield need from a Foundry project?

QuillShield supports Solidity, for Foundry projects, today. A full audit can start from a GitHub or GitLab.com repository, a git URL, a Foundry .zip of up to 50 MiB, a folder, or a single .sol file. Zip uploads get a full audit and no pull request checks, so connect the repository if you want every later change checked.

Before an audit you can add context such as the whitepaper, trust assumptions, privileged roles and previous audit reports. The guide to [running your first audit](https://shield.quillaudits.com/guides/run-your-first-audit/) shows where you choose the files in scope and see the quote, and the [docs quickstart](https://www.quillaudits.com/quillshield/guides/getting-started/quickstart) covers sign-up to first report. Code imported from GitHub or GitLab is not stored after the audit, and code you upload stays in your workspace until you delete that version. The [security page](https://shield.quillaudits.com/security/) covers the rest of how code and findings are handled.

## How does an AI Solidity audit with QuillShield work?

1. Sign up, connect a GitHub or GitLab.com repository or upload the code, and choose the Solidity files in scope.
2. See the exact price before anything is charged. A quote stays valid for 7 days.
3. QuillShield builds a security graph of the code and lists the invariants the code must keep.
4. A separate reviewer agent tries to disprove every finding before you see it. Each finding that holds up comes with the exact lines, the impact, a recommended fix and, on full audits, the proof of concept result.
5. Findings show once the audit is complete, and the report downloads as Markdown or PDF.
6. Turn on pull request checks, and each change is checked against the security graph from the audit.

On GitHub, with branch protection or rulesets, a required QuillShield check blocks a merge while the pull request has a High or Critical finding, or one at the threshold you set. Each full audit comes with five pull request checks, and more can be added. Checks need a GitHub or GitLab.com repo. The guide to [pull request checks on GitHub](https://shield.quillaudits.com/guides/check-every-pull-request-on-github/) and the [docs on pull request checks](https://www.quillaudits.com/quillshield/guides/guides/ci-cd-checks) show the setup.

For a sense of the output, a full audit of the Mini DeFi Vault, our own demo contract, on 23 October 2026 reported 5 findings, 3 of them Critical and 2 Medium. The audit took 2h 7m on our own demo code, and larger codebases take longer. During the private beta, 90% of the QuillShield findings that QuillAudits auditors reviewed on client Solidity code were valid, reported in November 2026 with no published count. In that beta, which ran until October 2026, QuillShield reviewed 350,000+ lines of Solidity across 155 projects.

You can start the same audit from an AI agent. The [Cursor and Claude guide](https://shield.quillaudits.com/guides/first-audit-from-cursor-or-claude/) has one prompt that quotes a first review of a Foundry repo and waits for your confirm. An agent can't create its own API key: an owner or admin of the organization creates it and gives it to the agent.

## How much does a Solidity audit cost?

A full audit is priced from the lines of Solidity in scope, not counting comments and blank lines, and starts at $49. These are the examples on the [pricing page](https://shield.quillaudits.com/pricing/), as of November 2026. Above 40,000 lines the price is quoted by hand.

| Lines of Solidity in scope | Price |
| --- | --- |
| 100 | $79 |
| 1,000 | $379 |
| 5,000 | $1,169 |
| 10,000 | $1,899 |
| 40,000 | $5,429 |

Each full audit of a GitHub or GitLab.com repository includes five pull request checks. After those, a check costs $5 for up to 50 added lines of Solidity plus $0.10 for each added line after that, so a change that adds 150 lines costs $15. Sign-up is free. New accounts get $50 in credit, good for up to half of an order. The credit expires after six months.

For what manual audits cost and how the two kinds of review compare on price, see [smart contract audit cost in 2026](https://shield.quillaudits.com/learn/smart-contract-audit-cost/).

**[Start free](https://shield.quillaudits.com/register) and see the exact quote for your own Foundry project before anything is charged, or [talk to an auditor](https://calendly.com/akshadh-a-quillaudits/30min) about a codebase above 40,000 lines.**

## When do you need a manual audit as well?

QuillShield does not replace a manual audit. It reviews every change between audits, and you can [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit), the audit firm that makes QuillShield, which has audited 1,500+ protocols since 2018 and is ISO/IEC 27001:2022 certified.

One way to split the work is to run a full QuillShield audit while the code is still moving and fix what it finds, book the manual audit before a launch with real value behind it, and keep pull request checks on every change after it. [AI audit vs manual audit](https://shield.quillaudits.com/blog/ai-audit-vs-manual-audit/) covers what each one is for. Teams that would rather not run QuillShield themselves can book a call, and QuillAudits auditors run it on their code.

## What should you check before a Solidity audit?

- Is the compiler pinned to one exact version, and have you read the known bugs listed for it?
- Does every `unchecked` block, inline assembly block and downcast have its reason written next to it?
- Is there a list of every role, who holds it at deployment and what it can change?
- Does each initializer run once, in the deployment or upgrade transaction?
- Is every external call made after the state it depends on is updated?
- Where does each price come from, and what happens when it is stale, zero or moved within one block?
- Do your Foundry tests include invariants for balances and supply, as well as unit tests?
- Are the files in scope frozen at one commit, with earlier audit reports ready to attach as context?

## FAQ

### Does Solidity 0.8 prevent overflow bugs?

Solidity 0.8 prevents them in checked arithmetic, which is the default, but `unchecked` blocks, inline assembly and casts to smaller types skip those checks, so each one needs a reason and a test.

### What does QuillShield need to audit a Solidity project?

It needs Solidity in a Foundry project, from a GitHub or GitLab.com repository, a git URL, a Foundry .zip of up to 50 MiB, a folder, or a single .sol file. Pull request checks need a GitHub or GitLab.com repository.

### Is an AI Solidity audit enough before mainnet?

An AI audit on its own is not enough for a launch with real value behind it. QuillShield does not replace a manual audit, so use it to find and fix issues early and to check every change between audits, and request a manual audit from QuillAudits before launch.

### How long does a QuillShield audit of Solidity take?

The full audit of our own Mini DeFi Vault demo contract on 23 October 2026 took 2h 7m. Larger codebases take longer, and findings show once the audit is complete.

### How much does a Solidity smart contract audit cost with QuillShield?

It starts at $49 and follows the lines of Solidity in scope: as of November 2026, 1,000 lines cost $379 and 10,000 lines $1,899. New accounts get $50 in credit, good for up to half of an order.

## Sources

- [Security considerations, Solidity documentation, Solidity team](https://docs.soliditylang.org/en/latest/security-considerations.html) · checked 3 December 2026
- [List of known bugs, Solidity documentation, Solidity team](https://docs.soliditylang.org/en/latest/bugs.html) · checked 3 December 2026
- [Solidity security vulnerabilities: a 2026 guide, Dedaub](https://dedaub.com/blog/solidity-security-vulnerabilities/) · checked 3 December 2026
- [Smart contract security, ethereum.org](https://ethereum.org/developers/docs/smart-contracts/security/) · checked 3 December 2026
