SECURITY GUIDE

Smart contract audits, testing
and formal verification.

Choose the method around the question your system needs answered. Define the scope, assumptions and deliverables before the work begins.

CHOOSE THE QUESTION

What do you need to establish?

Three methods for different security questions
MethodUse it to investigateRead the result as
Smart contract auditAttack paths, implementation mistakes, design assumptions and interactions that need researcher judgment.Findings about the reviewed code and scope. An audit does not establish the absence of every vulnerability.
Testing and fuzzingWhether concrete executions produce the expected result. Fuzzing generates inputs to explore more cases.Evidence about the cases exercised. Passing tests do not establish a property for every possible execution.
Formal verificationWhether an explicitly specified property holds across the behaviors represented by a model.A proof under the stated assumptions, a counterexample to investigate, or an unresolved check.

These practices can overlap. An auditor may write tests or use formal methods while investigating a finding. The engagement should state which work is included and which artifacts you receive.

A CONCRETE EXAMPLE

An upgrade adds a recovery role.

The requirement is that only an authorized recovery operator can move funds from a paused vault. Each method examines a different part of that change.

AUDIT

Challenge the authority.

Review how the role is granted, who can upgrade the implementation, and whether another call path can bypass the pause or access check.

TESTING

Exercise the transitions.

Test authorized and unauthorized callers, paused and active states, and role changes. Fuzz sequences of deposits, pauses and recovery calls.

VERIFICATION

Check the stated rule.

Specify the authorization condition and check the recovery path in the model. Review external calls and upgrade assumptions before interpreting the result.

A proof about the recovery function does not establish that the real operator’s key is secure. Key management, deployment permissions and other operational controls require their own review.

PLAN THE WORK

Choose an order that fits the code.

While the design is changing

Clarify requirements and trust boundaries. Use tests and researcher review to challenge the design. Frequent changes may require revising any formal specifications already written.

Before a critical release

Define the code revision and the failures with the greatest impact. Use an audit to investigate attack paths and formal verification for requirements that can be stated precisely.

After a change

Rerun relevant tests and maintained specifications. Review changed code, dependencies and assumptions; a previous report applies to its documented revision and scope.

AGREE THE DELIVERABLES

Four questions for the proposal.

01

Which repositories, revisions, dependencies and integrations are included?

02

Which requirements will be specified, and which assumptions will the model make?

03

Will you receive findings, reproduction steps, specifications, property results and unresolved gaps?

04

Which fix reviews, future reruns, Prover access and researcher support are included or scoped separately?

For a reusable handover, name the engineer responsible for maintaining the rules. When intended behavior changes, the specification needs review as well as the code.

WORK WITH CERTORA

Scope an audit or verification engagement.

Bring the code revision, critical requirements and release timeline.

Get Started