*Paid Advertisement. Not financial advice. RugDoc is not responsible for the projects showcased here. DYOR and ape safu.

Rugdoc Reviews vs Smart Contract Audits

Smart contracts play a critical role in decentralized finance. Due to this, it’s important that they work as intended. To gain the trust of investors, DeFi platforms proudly show off audit badges on their website but what exactly is a smart contract audit? How does such an audit work and what does it say about the safety and reliability of a project? We will answer these questions in this article.

What are Smart Contract Audits #

During a smart contract audit, the code of smart contracts is examined for bugs, issues and vulnerabilities. Often audit institutions work methodically to analyze the code. These analyses are typically applied to multiple smart contracts within a DeFi protocol because smart contracts usually interact with each other.

Smart contract audits are essential prior to the launch of a new DApp because smart contracts are typically designed to manage large amounts of crypto assets, making it important that they function properly and are safe from exploits. A minor bug or vulnerability can result in major or even complete losses for investors.

In addition to security reasons, developers also use smart contract audits to gain the trust of potential new investors. An audited DeFi platform with an “Audited By” badge looks safer and more professional than a DeFi platform that has not been audited.

It is important to check the website of the smart contract audit institution to see whether a DeFi platform has actually been audited. Malicious DeFi platforms often use badges from audit institutions with the ultimate goal of stealing investors’ assets.

A few well-known smart contract audit institutions are:

How Smart Contract Audits are conducted #

Typically, audit institutions work via a certain system, which means that they perform the audit methodologically and within a certain period of time. They often work with both formal verification tools and a manual review by experts.

Formal verification is a specialized process to mathematically prove the security and correctness of smart contracts. By using formal verification, the smart contracts codes and algorithms can be proved or disproved in terms of their intended function.

Because formal verification tools make use of mathematical systems, they can calculate near-infinite scenarios. Whenever an error or bug is found, the tool can pinpoint the piece of code causing the bug and instantly propose a solution. Due to these capabilities, formal verification tools are much more powerful than error-prone human judgments. It should be noted that formal verification is only as good as the model it is based on, so such a review is no guarantee against exploits.

It differs per auditing institution how extensively smart contracts are checked. Audit institution Certik checks smart contracts for:

  • Gas optimization
  • Mathematical operations
  • Logical issues
  • Control flow
  • Volatile Codes
  • Data flow
  • Language-specific issues
  • Coding style
  • Inconsistency
  • Magic numbers
  • Compile errors

Although each audit institution has its own procedures and analysis methods, a smart contract audit generally proceeds as follows:

  1. Agreement on a specification: By providing a specification and other associated documentation the audit team understand what the project’s architecture is and what the smart contracts codes should be doing. Auditors will also often ask for a “code freeze”, which requires that all the coding is finalized or in its final stage before conducting the audit.
  2. General testing: During this step, various tests are conducted that target individual functions or larger chunks of codes. By performing these general tests, the number of easily detectable bugs diminishes quickly. Typically, a line coverage of 90% per contract is achieved.
  3. Formal verification (automated analysis): This step covers the previously mentioned formal verification tools for smart contracts.
  4. Manual analysis: After the automated analysis, experts go through the entire contract manually in order to check if the contract contains any functions that are contrary to the specification, and to enhance detection of potential vulnerabilities.
  5. Audit report: Finally, the audit institution compiles a report with their findings. Ideally the project team and the audit institution will discuss the results and how to fix any vulnerabilities or bugs.

Smart contract audits vs RugDoc reviews #

It is important to know the difference between smart contract audits and RugDoc reviews. Smart contract audits mainly focus on whether a smart contract works as it should: is the coding style right, are there any major and minor bugs in the contract, how is the gas optimization, etc. It is important to realize that smart contract audits do not fully focus on exploits and hard rug functions within smart contract codes.

Rugdoc.io is not a smart contract audit institution and focuses solely on analysing the smart contracts of DeFi farms (e.g. Masterchefs) for hard rug potential.

Rugdoc mainly screens coding aspects such as:

  • Masterchef ownership
  • Time locks
  • Transfer tax
  • Anti-whale functions
  • Locker contracts
  • Harvest lockups
  • Previously performed rug pull codes

Rugdoc doesn’t focus on aspects like bugs or gas optimization. Simply put, Rugdoc evaluates code on how able the resulting DeFi platform will be to perform a hard rug.

It is also important to realize that a smart contract audit says little about how secure a DeFi platform is: have the developers adjusted their smart contract codes after the audit? Is the team behind the platform publicly known? Did the developers swap their Masterchef contract with a malicious one? Regardless of these unanswered questions, the developers of the protocol will still be able to use the “Audited By” badge on their website.

Conclusion #

Smart contract audits play an important role in checking and analyzing smart contract codes. Thanks to smart contract audits, bugs and vulnerabilities can be fixed. It is good to remember that smart contract audits mainly focus on the performance and potential bugs of a smart contract.

We recommend that you use RugDoc.io for checking the reliability of projects. If you have a farm that you would like us to review, click on this link.

Updated on July 9, 2021
How do you feel about this article?

One comment

Leave a Reply

*Paid Advertisement. Not financial advice. RugDoc is not responsible for the projects showcased here. DYOR and ape safu.

Our mission here at RugDoc is to screen for hard rug code that results in 100% theft of ALL underlying funds for ALL participants.

This is the ONE part of the due diligence process that most people cannot simply do on their own as it costs thousands of dollars to hire a senior solidity developer to look over a farm for safety.

A project coin with terrible code can go up in price, and a project with good code and a good team can also go down in price.

Do NOT use our ratings to refer to your likelihood in making money if you invest in the project. They are ONLY in reference to code safety.

Everything else beyond code safety is YOUR responsibility to go do research on. We just make sure the casino you’re betting in won’t rob you before you even get to place a bet.

Our reviews for projects are organized into a few colors.

🟢 Least Risk
These projects are the least likely to hard or soft rug. Usually reserved for cornerstone projects of an ecosystem where it makes no financial sense for them to rug in any manner as they make more money just being legit.

🔵 Low Risk
These projects are usually established projects in an ecosystem that have a track record of success or have KYC’d to us or other authoritative sources in the real world. As a result, it is extremely unlikely for them to soft rug or hard rug their projects. The projects can still fail and the token price can go down, but usually more as a result of natural market forces.

⚪️ Some Risk
This is the default rating for projects with unknown teams but have code that is unlikely to have hard rug risk. Since the team is unknown and doesn’t have a track record of success, it’s entirely possible that they may try to soft rug by dumping tokens, abandoning the project, etc. Even a last minute contract swap to a malicious contract is possible. The only thing that is unlikely is a complete hard rug as long as you are 100% sure you deposit into the contract we review.

🟠 Medium Risk
Similar to Some Risk, but the underlying code itself is custom enough or complex enough that it warrants an elevated risk rating that needs deeper research. Make sure you read every point presented to make sure you’re comfortable with that before entering. Still unlikely to hard rug, but more chances of custom code behaving incorrectly and causing other issues.

🔴 High Risk
Project contains code or practices that are HIGHLY LIKELY to lead to catastrophic losses as they are right now. Make sure you read the description carefully as we will always warn what these issues are. If you see the words Hard Rug anywhere in the review, STAY FAR AWAY!

⚫️ Not Eligible
We reserve the right to not review exceedingly complex projects that would require tens of thousands of dollars of senior security analyst man hours. Typically these are projects that deal with leverage, lending, options, derivatives, and anything that is overly complex and which requires tons of peer reviews and audits from top audit companies.

Search

🟢 For owners who have made impactful changes and would like an update to their farm review:

1️⃣ Use #update at @RugDocChat with your description and proof of changes and it will be forwarded to our scanners.

2️⃣ This does not guarantee a change in your review.

3️⃣ Owners who have difficulty solving the issues can consider our Consultation Package - please contact @BaymaxCrypto on Telegram to discuss.