A smart-contract security audit should answer a narrower and harder question than “was the repository reviewed?” The buyer needs to know which code actually runs at named addresses, who can change its behaviour, which external systems its decisions rely on, and which properties must continue to hold as state and prices change.
This is why a conventional source-code security audit is only one input. A clean commit and reproducible build still do not identify a proxy’s current implementation, upgrade authority, oracle configuration, or shared economic assumptions. Before commissioning specialist work, turn those parts into an object register with acceptance evidence.
Treat the deployed protocol as the audit object
The examples below primarily concern EVM and Solidity. Other chains and languages require their corresponding deployment and authority models.
Start with the network, chain ID, contract addresses, and a reference block or deployment transaction. For each address, record whether it is an implementation, proxy, beacon, registry, library, factory, oracle adapter, token, bridge endpoint, or another dependency. A repository name does not identify a deployed instance.
Connect every component to a source revision and build. Preserve the compiler version, optimizer and intermediate-representation settings, linked libraries, constructor arguments, initializer data, and deployment artifact. Source verification compares rebuilt code with bytecode at an address; it does not prove correct behaviour. A partial match may offer less identity assurance than one including compilation metadata. State the comparison method and exceptions, not only an explorer’s “verified” badge.
For an upgradeable protocol, resolve the proxy to the implementation or beacon at the chosen block and preserve storage-layout evidence. Acceptance binds source, build, deployed bytecode, configuration, and on-chain state; name any missing link.
Map every path that can change behaviour
An audit scope should enumerate privileged functions and the addresses or roles that can call them. Include upgrade authorization, pause and unpause, parameter changes, oracle replacement, token minting or burning, asset recovery, allowlists, fee changes, and emergency paths. For proxies, determine where upgrade logic lives and which check authorizes it; looking only at the implementation’s business functions can miss the control plane.
Resolve role names to actual holders. Evidence may include on-chain membership, ownership, multisignature threshold and signers, timelock delay, proposer, executor and canceller roles, and administrators able to change them. The assessment needs no seed phrases or private keys; it needs proof of the authority structure, approval process, and delay bypasses.
A timelock is not self-explanatory. Verify which operations pass through it, who schedules and executes them, the effective delay, cancellation, and any emergency or proxy-administrator bypass. Separate code-enforced facts from team-described custody procedures.
- IdentityFix chain, address, block, source revision, compiler, and bytecode relationship
- AuthorityResolve proxy, implementation, roles, key holders, delays, and emergency paths
- BehaviourState economic invariants, oracle assumptions, and cross-contract dependencies
- AcceptanceRe-run bounded checks on the final deployment and record remaining assumptions
Write economic properties before choosing tools
The protocol team should express required properties in business language and, where possible, executable assertions. Examples include conservation of assets and liabilities, supply matching balances, bounded fees, adequate collateral, correct share accounting, defined withdrawal availability, and rounding that cannot systematically create value. These properties are project-specific.
Map each property to the contracts and states that affect it: unusual token behaviour, callbacks, external calls, liquidation, settlement, queues, bridges, and governance. Record where it must hold. Excluding paused, insolvent, migrating, or liquidation states can be valid, but must be explicit and tested separately.
Economic review does not predict market performance or establish that a product is a safe investment. It tests whether the implemented mechanics preserve documented properties under the reviewed assumptions. An attractive model can still be implemented incorrectly, while correct code can faithfully implement a flawed or incomplete model.
Make oracle assumptions testable
For every external data input, identify the provider, feed address, network, units and decimals, update mechanism, expected freshness, acceptable bounds, and the consumer contracts. Record how the protocol reacts to stale, incomplete, delayed, unavailable, or implausible data. If there is a fallback, identify who activates it and whether that action changes trust or timing assumptions.
Oracle documentation distinguishes triggers such as deviation thresholds and heartbeat intervals. Values vary by feed and network, so capture the actual configuration. Consumers may need to examine update timestamps and normalize decimals. A correct interface call does not show that data suits the protocol’s risk window.
Apply the same discipline to bridges, sequencers, keepers, off-chain signers, governance relays, and external tokens. Record each dependency’s owner, failure mode, detection signal, and safe response. If governance intervenes, that path belongs in scope.
Build an object register the buyer can accept
Consider a hypothetical vault upgrade. The repository contains reviewed Solidity, the public address is a proxy, a multisignature can request upgrades through a timelock, and the share price uses an external feed. The table below prevents the commission from collapsing those facts into “the contract was audited.”
Scroll sideways to compare
| Audit object | Immutable identifier or snapshot | Authority or dependency | Property to verify | Acceptance evidence |
|---|---|---|---|---|
| Implementation source and build | Commit, compiler, settings, artifact hash | Build pipeline and linked libraries | Rebuild corresponds to reviewed runtime code | Reproducible build record and explained bytecode comparison |
| Deployed proxy | Chain, address, reference block | Implementation or beacon, admin | Proxy resolves to the reviewed implementation; initialization and storage layout are valid | On-chain reads, deployment transaction, proxy mapping and layout check |
| Upgrade path | Role holders and timelock configuration at the reference block | Multisignature, proposer, executor, canceller, emergency role | No undocumented route changes logic or critical parameters | Role graph, effective delay, approval evidence and exception list |
| Oracle input | Feed address, network and captured configuration | Provider, fallback and consumer contracts | Freshness, decimals, bounds and failure response match documented assumptions | Dependency test results and explicit residual assumptions |
| Economic invariant | Versioned statement and test identifier | All contracts and actors that can change the state | Assets, shares, debt, fees or collateral preserve the stated relationship | Manual reasoning, executable checks, counterexamples and coverage limits |
Version the register. A change to an implementation, address, role, delay, feed, compiler setting, or invariant then shows which evidence no longer supports the deployment and which inputs procurement must request.
Match methods to questions and disclose their limits
Manual analysis addresses intent, authority, interactions, and documentation gaps. Static tools identify patterns but require triage. Unit and integration tests establish expected examples. Single-call fuzzing varies operation inputs; stateful invariant testing varies call sequences against named contracts, selectors, actors, and environments.
Randomized testing remains bounded by the written invariants, harness, reachable state, target selection, input constraints, run count, sequence depth, time limit, and treatment of reverts. A passing campaign supports only the properties exercised within those boundaries. Coverage metrics, discarded calls, seeds and reproducible counterexamples belong in the evidence package.
Symbolic analysis and formal verification can establish specified properties within a model, but they do not invent the correct specification. Solver timeouts may yield unknown results, unsupported operations can be approximated, and incorrect assumptions about external calls or the environment may exclude real behaviour. Sound overapproximation can produce false alarms; it does not by itself invalidate a proved property. The report should list the property, model, assumptions, tool and version, result category, and any unproved or out-of-model paths. No combination of methods guarantees an absence of defects.
Accept the report against the final deployment
The report should include the object register, authority graph, reviewed revisions and addresses, build and bytecode comparison, dependency assumptions, invariants, method configuration, findings, and limitations. Each finding needs affected objects, preconditions, consequence, evidence, and a remediation test. Severity without a reproducible link to the deployment is insufficient.
Retesting should use the remediated revision and the intended deployment configuration. After deployment or upgrade, confirm the on-chain implementation, initialization state, role holders, timelock, oracle addresses and critical parameters at a named block. A test of a local candidate does not automatically accept a different transaction or later governance change.
The acceptance statement should remain bounded: which deployment was checked, which properties were tested, what passed, what remains open, and which assumptions still require operational monitoring. The Pentest.red scope guide can help structure targets, exclusions, access and evidence, while the sample pentest report shows how reproducible findings and limitations can be presented. Neither replaces a contract-specific acceptance record.
Choose specialist expertise and keep interfaces in view
Before appointing a smart-contract auditor, verify experience with the protocol’s chain, language, proxy pattern, financial mechanics, oracle model and testing stack. Ask for an example deliverable, conflict rules, method configuration, handling of fixes, and the evidence that will tie the conclusion to the final deployment. Specialist contract work should be performed by people whose relevant expertise can be verified.
The surrounding product still matters. A sound contract can be exposed through a web interface that prepares the wrong transaction, an API that misapplies authorization, or an administrative service that protects privileged actions poorly. Pentest.red may be considered conditionally for an authorized web application or API interface assessment with a defined scope. That is separate from specialist smart-contract assurance and does not imply Pentest.red Web3 expertise.
A useful commission ends with connected records for the contract’s deployed objects and invariants, and the interface’s users, roles, transaction construction and administrative paths. Neither report promises flawless code or financial safety.
PENTEST.RED
Discuss pentest scope and pricing
We start by agreeing on systems, access, constraints and the expected evidence.
Based on in-depth research, edited for clarity and practical use.