Skip to main content

What are you looking for?

Explore our services and discover how we can help you achieve your goals

Client Workspace

Smart Contract Audit Preparation: Scope, Tests and Review Options

To prepare smart contracts for an external audit, freeze the code at one commit, write down what is in and out of scope, finish unit, fuzz and invariant tests, document the roles and expected behaviour, and reserve time to fix findings. Netbase prepares contracts this way so that paid audit days go to real logic flaws.

Book a solution review See the related solution

By Netbase Delivery and Quality Desk · Reviewed by David (CEO) · Updated · 10 min read

star

This guide is for product owners, CTOs and founders with an audit to book, written from the side of the team that builds and fixes the contracts. It sits in our emerging technology guides, next to blockchain development.

In this guide

What should be ready before the auditors start?

Before the auditors start, the code should be frozen at a tagged commit, every in-scope file should compile without warnings and pass its tests from a fresh clone, and a short document should explain what the system does, who is trusted and which properties must always hold. Anything missing turns into questions during paid days.

Deployed contract code is hard to change. The ethereum.org security guide is clear that audits will not catch every bug and are an extra round of review, not a replacement for the team's own testing.

Scope is the first decision. List the exact contract files and the commit hash, and name what is excluded: test mocks, deployment scripts and unmodified library code. If you changed a library contract, it is in scope. Then add what code files alone do not show: the target chains, the compiler version, the external protocols and price feeds the contracts call, and who can upgrade, pause, mint or move funds.

Readiness checklist

  1. Freeze the code

    Tag the audit commit and keep new work on a separate branch until the report arrives.

  2. Write the scope

    Files, commit, chains, compiler version, external dependencies and exclusions, plus any known issue you accept and why.

  3. Make the build reproducible

    A fresh clone must install, compile and run the full test suite with one documented command and no manual steps.

  4. Cover failure paths, not only happy paths

    Every check that should reject a call needs a test that proves it does, including zero amounts, maximum values, the first deposit and the last withdrawal.

  5. Write invariants and fuzz them

    State the properties that must always hold, such as total balances matching the supply, and let a fuzzer try to break them with random inputs.

  6. Run static analysis and close the obvious items

    Fix or explain every warning before the auditors see it, so their time goes to logic rather than known patterns.

  7. Document roles and trust

    For each privileged role, write what it can do, who holds the key, whether a multi-signature wallet or time delay applies, and what happens if that key is lost or misused.

  8. Explain the expected behaviour

    The flow of funds, each contract's job and the economic assumptions, so auditors can tell a bug from a design decision.

  9. Reserve the fix window

    Book engineering time after the report for fixes, regression tests and a re-review of the changes, before the launch date.

Steps 4 and 5 matter most. The OWASP Smart Contract Top 10 (2025) puts access control flaws, price oracle manipulation and logic errors at the top of its list, classes that happy-path tests miss.

Which review option fits your contracts?

The review option depends on the value at stake, how often the code changes and how much outside attention the project can absorb. Most teams combine an internal review with one external audit, and add a public bug bounty after launch.

Option Strength Limit Choose it when
Internal review and automated analysis only Fast, repeatable on every change, cheap to run again Same blind spots as the authors; no independent opinion Contracts hold little value, run on a test network, or a later external audit is already planned
One external audit firm Experienced reviewers read the whole scope; a report partners and investors recognise A fixed window and a fixed team; finds what those reviewers look for Contracts will hold real value and the scope is frozen and documented
Second independent audit A different team with different habits; covers what the first one missed More calendar time and coordination High value at stake, novel logic, or the first audit found serious design issues
Public bug bounty after launch Ongoing review by a wide community, paid only for valid findings Starts after deployment; needs a disclosure process and someone on call Contracts are live and the team can respond to reports quickly

Do not treat a bug bounty as a substitute for an audit before launch: by the time a report arrives, the flaw is already on a live network.

How should findings be fixed and re-reviewed?

Findings should be triaged as soon as the report arrives, fixed at the root cause with a regression test for each one, and the changed code re-reviewed by the same auditors before deployment. A re-review confirms that the fixes are correct; it does not certify that the contracts are free of other flaws.

Give each finding one owner. If a finding shows that one function trusts an unchecked external call, check every function that calls outside the contract, not only the one in the report. The Solidity security considerations describe the checks-effects-interactions pattern, which is often the root-cause fix for reentrancy findings.

Record the fixed commit and keep the diff small. A re-review is quick when the changes are limited to the findings; it turns into a new audit when features were added at the same time.

When is an external audit the wrong next step?

An external audit is the wrong next step when the design is still changing, the tests are thin, or the problem may not need a blockchain at all. In each case, an internal review, a test sprint or a design decision finds the same issues for less effort, and the audit is booked when the code is stable.

  • The design is still moving. Auditing code that will be rewritten produces a report nobody can use.
  • Tests are thin. Paying auditors to find what a failure-path test or a fuzzer would catch wastes the engagement. Run a test sprint first, as with any quality engineering work.
  • Nobody owns the off-chain parts. Many incidents start in the web application, the signing service or the key handling around the contracts. Plan an application test as well; see penetration test preparation.
  • A shared database would do. If one organisation controls the data and no outside party needs to verify it, a ledger adds cost and risk without a benefit. Our blockchain development work starts with that fit check.

Where AI fits

AI helps most with the preparation work around an audit. A model can draft the scope inventory from the repository, list every external call and privileged function, suggest invariants and fuzz properties for engineers to review, and group duplicate items from static analysis and the audit report. Engineers still decide the scope, confirm every invariant and review each generated test, because a property that passes for the wrong reason gives false comfort. Netbase works with the major commercial and open-source AI tools and models, chosen per project.

What delivery record exists, and what does not?

Netbase designs, builds, integrates and runs software in every technology that large software market players offer, and blockchain applications are part of that scope. This page describes the capability and the approach; it is not backed by a published blockchain client project.

Netbase's published security practices are secure code review and version control, TLS in transit and AES at rest, role-based access control, MFA for admin dashboards, vulnerability scanning and penetration testing, and disaster recovery. Security by design is part of how Netbase delivers, alongside API-first integration and IoT work.

Delivery follows a six-step lifecycle from discovery to ongoing support, with weekly reviews and a named project manager, which is where the audit window, the fix window and the re-review are scheduled. The same lifecycle runs on long-running products such as the multi-tenant cloud ERP for a US client.

Most Netbase projects are delivered on fixed-price contracts. No Netbase record publishes smart contract audit reports, finding counts, audited value or launch outcomes, and none is offered here as evidence.

Alternatives: who prepares the contracts, and how to choose

The audit itself is bought from an independent firm; the open question is who prepares the code and fixes the findings.

  • Your in-house team. Best when the engineers who wrote the contracts are still there and have time after the report. Check that someone owns the fix window and the re-review date.
  • The development partner that built the contracts. Best when the partner holds the code, tests and deployment scripts; ask for the readiness checklist and the fix plan in writing, and for secure development practices that run on every change.
  • A separate security engineering team. Best when the original team has left or the contracts were inherited; give it time to learn the code before the audit through application security assurance.

Choose by who can reproduce a finding fastest, who can ship a fix without breaking deployed state, and who will own the next audit.

Limits of this guide

  • It covers preparation for an audit of contracts on public or permissioned networks, not token economics, legal structuring or exchange listing rules.
  • It is not legal, financial or compliance advice.

Plan the next step with a Netbase consultant

Frequently asked questions

Freeze it before the audit starts and keep it frozen for the whole review. Auditors build an understanding of the code on the first days, and every change after that forces them to re-read parts they already covered.

Auditors expect tests that cover failure paths as well as normal use, plus invariants or fuzz properties for the rules that must always hold. A high line-coverage figure with no failure-path tests still leaves the most common flaws untested.

One external audit is enough for many contracts if the scope is frozen, the tests are strong and every finding is fixed and re-reviewed. Contracts with high value at stake or novel logic often add a second independent audit and a public bug bounty after launch.

No. An audit report records what a team of reviewers found in a fixed scope and time window. It lowers risk but does not prove the absence of flaws, which is why monitoring, a pause or upgrade plan and a bug bounty still matter after launch.

Next step

If your contracts are heading for an external audit and you want the scope, tests and fix plan prepared by the team that will fix the findings, book a solution review.

IoT development with AI analytics that connects devices to the business IoT development with AI analytics that connects devices to the business

Netbase provides IoT development for manufacturers, logistics operators and product companies to connect devices and sensor data to the business platforms that act on them, with AI that spots anomalies and forecasts what needs attention. We design the device-to-cloud data path, build the back end, dashboards and integrations, and treat security, data ownership and AI as design decisions.

Learn More
line
Application security assurance for web, SaaS and AI features Application security assurance for web, SaaS and AI features

Netbase provides application security testing for product and engineering leaders to find and fix vulnerabilities before release, including in AI features. We review code with AI-assisted triage, scan dependencies and test running applications, then rank findings and retest fixes. Netbase's own alignment with ISO 27001 and SOC 2 Type II covers Netbase's operations, never your application.

Learn More
line
Blockchain development: smart contracts, wallets and tokenisation built to last Blockchain development: smart contracts, wallets and tokenisation built to last

Netbase designs and builds blockchain applications: smart contracts, wallet integrations, tokens and permissioned ledgers, connected to the web, mobile and business systems you already run. We start by checking whether a blockchain is the right tool at all, test every contract against known attack patterns and plan an independent audit before anything holds real value.

Learn More
line
Enterprise integration hub ready for AI agents: one monitored layer for commerce, ERP and CRM data Enterprise integration hub ready for AI agents: one monitored layer for commerce, ERP and CRM data

An enterprise integration hub is a central layer that moves orders, customers, stock and invoices between your commerce, ERP and CRM systems, with monitoring, retries and replay in one place, and scoped APIs that AI agents can call safely. Netbase builds it as a custom layer on the stack you already run, starting from the flows that break most often.

Learn More
line

Work with Netbase remotely

Every Netbase engagement is delivered remotely, so clients in any country and any industry can work with us; Netbase has worked with clients in 80 countries. Contracts and invoices are issued by Netbase JSC, and payment is made by bank transfer to Netbase JSC's company account or PayPal Business. Talk to the CEO, Huy Nguyen (David), on WhatsApp or by email.

Contact Netbase

Discuss a project

Netbase JSC helps organizations design, build, modernize, and operate digital products and AI-enabled business systems.
Project enquiries

project@netbasejsc.com

WhatsApp

+84 937 869 689

Office address

91 Nguyen Chi Thanh, Dong Da, Hanoi, Vietnam

Get in touch

Tell us what you want to build, modernize, or operate.

Tell us what you want to build, modernize, or operate.

Contact Netbase