Is Your Smart Contract Secured? This Is How We Find Out!

Updated at: April 8, 20258 minutes

Author: QuillAudits Team

Why Do We Need Auditing?

Over the past three years, the Web3 ecosystem has experienced significant financial losses due to security breaches, underscoring the critical need for robust smart contract security audits.

2022: Escalating Threats

In 2022, the Web3 space witnessed approximately $3.7 billion in losses across various security incidents. This surge in attacks highlighted vulnerabilities in decentralized finance (DeFi) platforms and cross-chain bridges, emphasizing the necessity for comprehensive security measures.

2023: A Decline with Persistent Risks

The following year saw a decline in total losses to about $1.84 billion from 751 incidents, representing a 51% decrease compared to 2022. Despite this reduction, the average loss per incident remained substantial at $2.45 million. Notably, private key compromises accounted for nearly half of the financial losses, totaling $880.9 million in just 47 incidents. This period underscored that while overall losses decreased, significant risks persisted, particularly concerning private key security.

2024: Resurgence of Attacks

In 2024, the trend reversed with losses escalating to approximately $2.36 billion across 760 on-chain security incidents, marking a 31.6% increase in value stolen compared to 2023. Phishing attacks emerged as the most costly vector, responsible for $1.05 billion in losses over 296 incidents, accounting for nearly half of the total value stolen. Additionally, private key compromises resulted in $855.4 million in losses across 65 incidents. Ethereum remained the most targeted blockchain, experiencing 403 incidents that led to $748.7 million in losses.

The Imperative for Smart Contract Security Audits

These statistics from 2022 to 2024 highlight the evolving and persistent threats within the Web3 ecosystem. The substantial financial losses, particularly from phishing and private key compromises, demonstrate that malicious actors continually adapt their strategies to exploit vulnerabilities. Implementing rigorous smart contract security audits is essential to identify and mitigate these vulnerabilities proactively. Regular audits not only enhance the resilience of smart contracts against known attack vectors but also bolster investor confidence, contributing to the sustainable growth of decentralized technologies.

Annual Financial Losses

Security Incidents

Financial Pie Chart

Multi Layer Audit Process

Things We Cover in the Audit Process :

  • Business Logic’s Review
  • Functionality Checks
  • Access Control & Authorization
  • Oracle Manipulation
  • Token Supply Manipulation
  • User Balances Manipulation
  • Data Consistency Manipulation
  • Kill-Switch Mechanism
  • Operation Trails & Event Generation
  • Gas Optimisation
  • Security Best Practices

We ensure your smart contract goes through all the stages, from manual code review to automated testing, before generating the Initial Audit Report. Once your team updates the code, we will thoroughly scrutinise the smart contract to provide you with the final audit report. Let's dive deep into the auditing process.

Multi layer audit process

Step 1 - Specification Gathering / Prepare For a Security Audit

This is the most crucial stage because the details are key for a successful smart contract security audit. Here is how you can prepare for it:

Code quality

  • Remove dead code and comments.
  • Consistent coding style. 
  • Follow the Solidity / Rust (Solana) style guide.

Use comments to document complex parts of the code and ensure these are consistent with the code.

Test the code

  • Make sure the contracts can be compiled and thoroughly tested.
  • Perform high coverage and high-quality unit tests.

This will maximize focus on the difficult parts of the code. Auditing should not discover that some functions are uncallable or do not do what they are expected to do under entirely straightforward inputs. Optimal auditing should focus on unexpected, corner-case, and adversarial behaviour.

Code freeze

  • Freeze the code and specify the commit hash. Or, deploy the code on testnet and share the link.

After freezing the code, we will gather the specifications from you to know the intended behaviour of the smart contract through the 'Smart Contract Specification' document.

How you can help - Please ask your developers to fill out the specification doc - It would help us to understand & verify the business logic and facilitate confirming everything thoroughly.

Step 2 - Manual Review

Here we would look for undefined, unexpected behaviour and common security vulnerabilities. The goal is to get as many skilled eyes on contract code as possible. Aims of manual review:

  • Focus on security, attacks, mathematical errors, logical issues, etc.
  • Check the code for any vulnerabilities that can be exploited.
  • Verify that every detail in the specification is implemented in the smart contract.
  • Verify that the contract does not have any behaviour that is not stated in the specifications.
  • Verify that the contract does not violate the originally intended behaviour of specifications.

Step 3 - Functional Testing

  • The smart contract will be manually deployed in a sandbox environment like testnet/mainnet forks, hardhat, ganache, etc.
  • Smart contract functions will be tested on multiple parameters and under various conditions to ensure that all paths of functions are operating as intended.
  • In this phase, the expected behaviour of the smart contract is verified.
  • In this phase, we also ensure that smart contract functions are not consuming unnecessary gas.
  • Gas limits of functions will be verified in this stage.

Step 4 - Formal Verification / Fuzzing*

  • The smart contract will be subjected to formal verification using industry-standard tools and techniques.
  • This process involves mathematically proving the correctness of the smart contract's code with respect to its formal specification. We will define formal properties that capture the intended behavior of the contract, such as safety (e.g., no unauthorized access to funds) and liveness (e.g., certain operations will eventually complete).
  • The formal verification process will then rigorously check whether the smart contract's code satisfies these defined properties. This provides a high degree of assurance in the contract's correctness and helps to identify potential vulnerabilities that might be missed by other testing methods.
  • To further enhance the robustness of the smart contract, we will employ fuzzing techniques. Fuzzing involves automatically generating a large number of diverse and often malformed inputs to the smart contract functions.
  • These inputs are designed to trigger unexpected behaviour or edge cases that might not be covered by traditional testing. By analyzing the contract's response to these fuzzed inputs, we can identify potential vulnerabilities such as crashes, exceptions, or unexpected state changes.
  • This process helps to uncover hidden bugs and improve the overall resilience of the smart contract.

Step 5 - Testing over the Latest Attack Vectors

The team researches newly discovered attacks (like market manipulation, LP pricing, front-running vectors, and more) and tries to replicate them to ensure the project is safe from those attacks.

If the current implementation is vulnerable to those newly discovered attacks, we recommend the project team switch to a safer implementation.

Step 6 - Testing with Automated Tools

Testing with automated tools is essential to catch those bugs that humans miss. Some of the tools we would use are (based on the requirement/auditor preference, we use specific tools) :

  • QuillShield
  • Mythril / Mythx
  • Solgraph
  • Solidity Coverage
  • Slither
  • Solidity Visual Developer
  • echidna
  • foundry

Step 7 - Initial Audit Report

In the end, we will provide you with a comprehensive report, which we call the Initial Audit Report (IAR):

How you can help - You have to prepare an 'Updation Summary' or 'Comment Report' with details of the changes you've made after getting the IAR; this would help us identify the differences and test them rigorously.

  • A comprehensive Audit Report.
  • Encapsulate details of the Audit & solutions to the vulnerabilities (if we found any) in your contracts.
  • We expect you to resolve the identified bugs & make suitable changes to the code, or we will connect with development partners for issues.

Note - Please acknowledge that we start the Audit Process once the Audit Scope is frozen (commit hash or explorer link). If you make any changes to the code during the process, we can check the updated code only after delivering the Initial Audit Report. We cannot abort the process in between and start working on the updated code.

Step 8 - Final Audit Report

After initial audit fixes, the process is repeated, and the Final Audit Report is delivered. Even after the fixes you've made, some issues are still unresolved, and/or those changes have led to a few more issues.

So, after receiving the Final Audit report, you have to take a call (based on the severity table containing the unresolved issues) on whether to alter the code again or to move forward as it is.

Step 9: Quill Vigilant Squad*

Following the completion of the second audit review, the Fixed codebase, along with the comprehensive audit report, will be formally delivered to our dedicated Vigilant Squad. This elite team is comprised of world-class security researchers, each possessing extensive experience and expertise in identifying and analyzing vulnerabilities within complex systems. The Vigilant Squad will undertake a meticulous and in-depth review of both the codebase itself and the accompanying report. They will dedicate their full time and resources to this critical task, leveraging their specialized skills to proactively search for and uncover any potential security issues, however subtle they may be. In the event that the Vigilant Squad discovers any vulnerability, security flaw, or other issue, we will be notified immediately, ensuring swift action can be taken to mitigate any potential risks.

How you can help - You have to prepare an 'Updation Summary' or 'Comment Report' with details of the changes in case, if you get any New issues from our side; this would help us identify the differences and test them rigorously.

Step 10 - Final Audit Report Review

Both the QuillAudits primary team and the Vigilant Squad will thoroughly review the audit findings to ensure all identified issues have been either resolved or properly acknowledged. Upon confirmation that all concerns have been addressed to our satisfaction, we will proceed to the next phase.

Step 11 - Delivery

After getting the green light from the previous Step, we sent the report-designed PDF of the Audit Report, displaying all the necessary details of the auditing process.

Sample Audit Report - Dayvidende

Then the report is uploaded on our official GitHub Repository and QuillAudits LeaderBoard, after which we share the link to the Audit Report to you

Step 12: Post-Audit

After the Final Audit Report, we take your project in front of the masses through:

Social Media Announcements

  • As per the requests from you, we make an Audit Announcement from our social media handles to mark the completion of the Audit.

LinkedIn - X (Twitter) - Telegram - Reddit - Medium

Magpie Audit

The completion of this step totally depends on the calendar availability of our marketing team. Therefore, this step might take some time to complete.

  • Access to QuillAudits Ecosystem (Exchanges, IDO, KYC, Incubators, VC Partners)

AMA Sessions

  • Expert auditors explaining the nuances of the Audit Report.
  • QnA and direct interaction with your audience to build trust in your project.

Niche Targeted PR Services

  • Articles & guest posts in renowned publications.
  • Cross-platform promotions to give more exposure to the project.

Organize Product launches, Community Meetups etc.

  • QuillAudits team will help you in your product launch in India.
  • Set up community meetups, product workshops and web3 events for you.
  • QuillAudits expert team and partners will take care of everything from content creation to marketing and event location to event coordination.

What Can the Project Team Expects From Us?

  • Delivery of initial report within the agreed timeline (considering a margin of +- 2 days due to unforeseen circumstances).
  • Reviewing the final version of the code before concluding the audit.
  • Following the complete audit process, i.e., Manual Review, Functional Testing, Automated Testing, and Reporting bug findings.
  • Publishing Audit Reports and Making Post Audit Announcements based on agreed-upon terms.

What Do We Expect From the Project Team?

  • A working test suite (all tests written are executable) covering at least 90% of the project code and edge-case scenarios.
  • Structured code following reasonable naming conventions and consistent coding style.
  • Well-documented contracts/functions and updated whitepaper.
  • Fixing issues from the initial bug-finding report and providing detailed comments, stating what fixes have been implemented to the concerned issues.
  • Reviewing the final report so that QuillAudits can conclude the audit.

About Us

QuillAudits is a leading blockchain security firm with 7 years of experience, securing $30B in TVL with multi-layered audit framework, across 1400+ projects in DeFi, GameFi, NFT, Gaming, and all blockchain layers.

Our senior auditors conduct line-by-line code reviews, combining manual & AI-driven audits for smart contracts on 20+ chains including Ethereum, BSC, Arbitrum, Algorand, Tron, Polygon, Polkadot, Fantom, NEAR, & Solana. We also offer token risk assessments & real-time monitoring tools to fortify Web3 security. 

Beyond audits, we’ve hosted 50+ global events and 300+ workshops to educate and support the Web3 community.

QuillAudits about us

Frequently Asked Questions

What is the time scale for an audit to complete?
The time span of an audit depends on the code size & the complexity of the project. A standard token (ERC20 & other ERC standards) can be audited within a week, on the other hand, complex DeFi projects, Blockchain wallets/dApps may stretch around a couple of weeks to a month.
How many reviews will be done by the auditing team?
Is the timeline mentioned for the Final audit?
Can QuillAudit Team also make changes in the smart contracts based on our initial review?
Do we charge Ether + Bsc Individually?
How do we manage any modifications or new code created by your team after the start of the audit?
Apart from Smart contract auditing, what other services are we offering?
Why do we conduct our testing on a sandbox environment rather than doing it on public testnets?
Difference between unit testing and functional testing?
logo
Loading...
Loading...
Loading...
Telegram