Preparation
Preparing for an Audit
ChainPlus recommends taking these steps before you send your code for an audit.
- 01
Perform an internal security review
Before submitting your code, conduct a thorough internal review to identify obvious vulnerabilities, edge cases, and incorrect assumptions.
- 02
Run an automated review with AI tooling
Use AI tools to perform an automated security review and surface issues early, before the audit begins.
- 03
Build on well-audited libraries
Use widely adopted, audited libraries and frameworks (such as OpenZeppelin for Solidity) instead of writing common components from scratch.
- 04
Document public functions
Describe the intended behavior, inputs, outputs, and assumptions of every public and external function, for example with NatSpec in Solidity. Clear documentation significantly improves audit efficiency and accuracy.
- 05
Provide system and technical documentation
Share resources that help auditors understand the protocol (architecture diagrams, specs, whitepapers, design discussions) and explain each contract, its responsibilities, and how components interact. If full documentation is not available, a concise system overview is acceptable.
- 06
Build a comprehensive, passing test suite
Cover core logic, edge cases, and failure scenarios. All tests must pass, and we recommend at least 90% code coverage, with particular focus on critical paths and high-risk components.
- 07
Structure tests for flexibility
Use a modular test suite that allows auditors to easily extend tests, build proofs of concept, and simulate adversarial scenarios.
- 08
Include reproducible setup instructions
Ensure the repository includes clear instructions (e.g., in the README) for compiling contracts and running the full test suite.
- 09
Define security properties and invariants
Clearly list the critical properties and invariants that must always hold. This helps guide both manual review and testing efforts.
The better prepared your codebase, the more of the audit goes into finding deep issues instead of understanding the basics.
Ready to secure your protocol?
Tell us about your project and get a scope and quote within 24 hours.
