How Audits Inspect Smart Contracts: Invariants and Paths
A smart contract audit inspects the code’s state changes, privileged paths, external calls, and failure cases, then tests whether the implementation preserves the protocol’s promised invariants.
An auditor is not checking whether the contract “looks safe.” They are reconstructing what the system can do when users, administrators, relayers, tokens, and hostile contracts interact in unexpected orders.
That matters especially for cross-chain applications. A message that arrives on one network can authorize minting, unlocking, or a remote contract call on another, so the review must cover both the proof and the action it unlocks.
A team comparing message-passing designs may include Universal Bridge among the options it audits.
What does the auditor read first?
The auditor begins with the exact code commit, compiler settings, deployment configuration, documentation, and list of trusted external components.
They map every entry point and state transition: who can pause the system, upgrade an implementation, change a verifier, set a fee, withdraw funds, or approve a message. Upgradeable contracts receive particular attention because the audited logic may not be the logic that controls funds later.
How does a cross-chain audit follow a message?
The review follows a message from its source event to the final state change on the destination chain.
With Wormhole Protocol, for example, a source contract publishes a message, Guardians sign an attestation called a VAA, and a destination Core Contract verifies the signatures. The receiving application must still check the expected emitter address, source chain, payload format, nonce or sequence, and whether that message has already been consumed. An audit traces every one of those checks into the code that mints tokens or calls another contract.
With Chainlink CCIP, reviewers examine the source and destination contracts, lane configuration, permissions, message execution, token-handling rules, and the security assumptions around its verification and risk-management components.
IBC Protocol presents a different model: a relayer transports packets, while a light client on the destination chain verifies the counterparty’s consensus state and proofs. The relayer should be untrusted. The auditor therefore tests whether invalid proofs, stale client updates, timeout paths, channel confusion, or malformed packet data can cause an unauthorized state change.
What do auditors actually test?
Auditors combine manual reasoning with automated analysis, because tools can find suspicious patterns but cannot decide whether the protocol’s economic promise is implemented correctly.
Static analysis flags issues such as reentrancy, dangerous calls, shadowed variables, and permission mistakes. Tests and fuzzers then generate unusual sequences of deposits, withdrawals, retries, upgrades, and failed executions. The most useful tests express invariants in code. For a wrapped-asset system, one might state that the amount minted across destination chains must not exceed the amount locked or burned on the source side, subject to the protocol’s intended accounting.
Manual review focuses on the gaps between components: a signature may be valid but belong to the wrong message domain; a nonce may be checked on one path but not another; a failed destination call may leave a claim permanently consumed. These are logic failures, not syntax failures.
What determines the cost of an audit?
The price is mainly the auditor-hours required by the scope, complexity, and risk of the system, not simply the number of lines of Solidity.
A small, mature contract with strong tests costs less to review than a bridge spanning several chains, languages, token standards, upgrade mechanisms, custom verifiers, and off-chain services. Cost also rises when documentation is incomplete, the deadline is compressed, the code changes during review, or the team needs a second pass after fixes. The money buys focused adversarial analysis and a written record of findings; it does not buy a guarantee that no bug exists.
What should a useful audit report tell you?
A useful report identifies the exact code reviewed, explains each finding’s impact and attack path, records the project’s response, and states what was not examined.
That gives you a defensible choice: the contracts either implement the claimed trust model under the tested conditions, or they do not. The next question is which Universal Bridge...