The Smart Contract Security Challenge: Why Third-Party Audits Are a Must-Have

Steve Rosenblum - Founder Libertify
Libertify
Published in
5 min readMar 24, 2023
source: https://tinyurl.com/mpeerbcj

As the blockchain ecosystem keeps changing, smart contracts have become a game-changing technology that makes it possible for decentralized finance (DeFi) applications, tokenization, and more. However, the rapid expansion of smart contracts has also exposed various risks and vulnerabilities. This article explains the importance of having smart contracts audited by a third party, what happens if they aren't, and how to evaluate an audit report.

The Risks and Vulnerabilities of Smart Contracts

Smart contracts are self-executing agreements with terms and conditions written in code. The fact that they are automated and can't be changed is a good thing, but if their weaknesses are taken advantage of, it could be a disaster. Examples of such risks include:

  • Reentrancy attacks
  • Integer overflow/underflow
  • Race conditions
  • Front-running attacks

Well-Known Third-Party Audit Firms

A third-party auditing firm checks the code of a smart contract to see how safe and useful it is. Some of the most reputable firms in this space are:

  1. ConsenSys Diligence
  2. Quantstamp
  3. Trail of Bits
  4. OpenZeppelin
  5. CertiK
  6. Hacken

Examples of Non-Audited Smart Contracts and Consequences

Several high-profile incidents have occurred due to the absence of proper audits:

Parity Wallet Hack: In 2017, a vulnerability in the Parity multi-sig wallet smart contract was exploited, resulting in the loss of more than $30 million worth of ether. The vulnerability was caused by a coding error that allowed an attacker to take control of the wallet’s owner privileges. The incident led to a contentious hard fork of the Ethereum blockchain and further highlighted the need for thorough auditing of smart contracts.

KingDice Hack: In 2018, a smart contract vulnerability in the popular Ethereum-based gambling platform KingDice was exploited, resulting in a loss of more than $100,000. The vulnerability allowed the attacker to repeatedly withdraw funds from the platform’s smart contract balance. The incident highlighted the risks associated with decentralized gambling platforms and the importance of auditing smart contracts that handle user funds.

Poly Network Hack: In 2021, a hacker exploited a vulnerability in the cross-chain interoperability protocol Poly Network, resulting in the theft of more than $600 million worth of cryptocurrencies. The incident was one of the largest DeFi hacks in history and highlighted the risks associated with interoperability protocols that connect different blockchains. The hacker later returned the funds and claimed the attack was a “white hat” operation to highlight the importance of security in DeFi.

Thodex Exchange Scam: In 2021, the CEO of the Turkish cryptocurrency exchange Thodex fled the country with $2 billion worth of user funds. The exchange’s smart contract was not audited, and the incident highlighted the risks associated with centralized exchanges that operate without transparency and accountability.

Iron Finance Bank Run: In 2021, a stablecoin collapse on the decentralized finance (DeFi) platform Iron Finance resulted in a loss of more than 50% of its value, causing a bank run on the platform. The incident was caused by a vulnerability in the smart contract that resulted in a misalignment of the stablecoin’s peg to the US dollar. The incident highlighted the risks associated with algorithmic stablecoins and the importance of auditing smart contracts that underpin DeFi protocols.

Top 10 Highest Value Hacks from Smart Contract Deficiencies

source: https://tinyurl.com/4c4649v6
source: https://cointelegraph.com/news/the-10-largest-crypto-hacks-and-exploits-in-2022-saw-2-1b-stolen

Verifying an Audited Smart Contract and Evaluating the Audit Report

To check if a smart contract is audited:

  1. Visit the project’s official website or documentation.
  2. Look for a dedicated “Security” or “Audit” section, which typically provides a link to the audit report.

When evaluating an audit report, pay attention to:

  • The auditor’s reputation and experience in the blockchain industry
  • The date of the audit (recent audits are preferable)
  • The scope and depth of the audit
  • Identified vulnerabilities and their severity levels
  • The project’s response to the findings, including any fixes or improvements made
  • Any follow-up audits to verify that issues have been resolved

LIBERTIFY’s SMART CONTRACT CODE REVIEW AND SECURITY ANALYSIS REPORT

Libertify recently had its smart contract audited by the third-party audit firm Hacken.io.

The audit yielded an outstanding score of 9.7/10, indicating that the smart contract was well-designed, secure, and efficient.

The audit report’s executive summary highlights several key findings, including the high-quality documentation provided by Libertify. The report notes that the provided documentation was thorough and accurately described both the technical and functional aspects of the system.

The report also highlights the excellent quality of the smart contract’s code. The code was found to be well-written and designed, resulting in a perfect score of 10/10 for code quality. Additionally, the report noted that the smart contract had an impressive code coverage of 95% for branch coverage. The test coverage also included negative cases, which is an essential aspect of a robust testing methodology.

The report’s security assessment identified only one low-severity issue within the smart contract, resulting in a security score of 10/10. The “Findings” section of the report provides further details on this issue, along with recommendations for addressing it.

Overall, the audit report concludes that Libertify’s smart contract is of high quality, with an impressive score of 9.7/10. This score demonstrates Libertify’s commitment to ensuring its smart contract is secure, efficient, and reliable. With this audit report, Libertify’s users can have greater confidence in its ability to perform as intended and protect their data and assets.

The audit report can be downloaded from www.libertify.com website. Find AUDIT link in the footer.

source: Libertify’s smart contract audit report

Conclusion

Third-party audits play a crucial role in the blockchain ecosystem by ensuring the security and reliability of smart contracts. As an experienced blockchain reader, it is essential to understand the risks associated with non-audited smart contracts and to verify the audit status of any project you engage with. By carefully evaluating audit reports, you can make more informed decisions and protect your assets in the fast-paced and ever-evolving world of decentralized finance.

--

--

Steve Rosenblum - Founder Libertify
Libertify

Discover Libertify, the #1 AI risk management solution for retail investors. Connects to crypto exchanges, wallets, and soon brokerages.