Jak audytorzy wykrywają oszustwo DeFi Rug Pull: czy możesz to zrobić sam?

Jak audytorzy wykrywają oszustwo DeFi Rug Pull: czy możesz to zrobić sam?

How Auditors Detect a DeFi Rug Pull Scam: Can You Do It Yourself? PlatoBlockchain Data Intelligence. Vertical Search. Ai.

Hakerzy ukradli więcej kryptowalut z platform zdecentralizowanego finansowania (DeFi) niż kiedykolwiek wcześniej w 2022 roku. Prawie 98% wszystkich tokenów uruchomionych na flagowym DeFi, DEX Uniswap, zostało zidentyfikowanych jako podróbki.

Najnowszy, Defrost Finance, oprawa ołowiana witrażu jako świąteczny koszmar dla inwestorów kryptograficznych, niszcząc 12 milionów dolarów ich pieniędzy. 

Większość włamań na platformy DeFi ma miejsce w wyniku naruszenia bezpieczeństwa i wykorzystania kodu. Projects that end up being rug pull scams have serious security issues that have been allowed to slide, or maybe, undetected on purpose. To prevent similar risks, DeFi security audits are critical.

Here we’ll find out more about these audits, how they are conducted, and whether it is possible to run a DeFi audit by yourself. 

What Is a DeFi Security Audit?

DeFi projects are implemented as complex, self-executing smart contracts, often transparent and open-source. They act as legal agreements between two parties. And since no centralized entity is behind them, even a small bug in smart contracts might lead to irreversible consequences.

Oznacza to, że w smart kontraktach nie powinno być miejsca na błędy. Audyty bezpieczeństwa smart kontraktów DeFi mają to zapewnić.

Security audits examine the code of smart contracts and how it grounds contracts’ terms and conditions. The detailed analysis searches for potential security flaws, violations, and system bugs in the code, so it cannot be exploited. 

Security audits, usually conducted by third parties, are vital to ensuring the security and credibility of projects and maintaining a healthy DeFi ecosystem.

How Do Scammers Exploit Smart Contracts for a Rug Pull?

A rug pull is a type of exit scam that operates in a simple model: developers create a legit-looking DeFi protocol, run and promote it until the project attracts enough liquidity, then pull out the funds and disappear. 

Well, not always. Occasionally, rug-pull scammers blame hackers for stealing liquidity and stay in business until the next time.

Aby przeprowadzić atak, oszuści osadzają złośliwy kod w inteligentnych umowach. Modyfikują je, aby uniemożliwić inwestorom sprzedaż: ustalają maksymalną (100%) opłatę za sprzedaż, umieszczają na czarnej liście właścicieli tokenów i blokują pieniądze użytkowników w kontrakcie.

Niektóre inteligentne kontrakty obejmują zakodowanie w nich złośliwych „tylnych drzwi”, które umożliwiają programistom wycofanie płynności.  

W większości przypadków zmodyfikowane inteligentne kontrakty nie są weryfikowane przez audytorów bezpieczeństwa i są ukryte przed opinią publiczną. Ponieważ większość umów on-chain jest publicznie dostępna, brak przejrzystości w tym zakresie GitHub może być czerwona flaga. 

How to Check Whether a DeFi Smart Contract Is Safe

Branża blockchain i inteligentnych kontraktów jest wciąż stosunkowo młoda, podobnie jak sektor audytu inteligentnych kontraktów. Wiele firm specjalizuje się w audytach bezpieczeństwa inteligentnych kontraktów, rozwija swoje narzędzia i kształtuje swoje know-how. 

Standardy branżowe i najlepsze praktyki w zakresie bezpieczeństwa inteligentnych kontraktów ewoluują. Mimo to gracze z branży audytu DeFi stosują dość standardowe metody audytu.

Zazwyczaj ich dochodzenia rozpoczynają się od oceny inteligentnego kontraktu. Audytor analizuje oficjalny dokument, logikę biznesową i specyfikację techniczną protokołu DeFi, aby oszacować potencjalne ryzyko i funkcje bezpieczeństwa.

Następnie przenoszą uwagę na kod smart kontraktu. To wtedy rozpoczyna się przegląd kodu i analiza. 

Auditors inspect code line by line, looking for vulnerabilities of different levels: critical ones that can result in a liquidity leak; medium-level, which could partially damage the smart contract; and low-level issues, which affect the contract’s security the least.

Wdrażają szereg technik audytu, w tym analizę automatyczną i ręczną. Oba mają swoje wady i zalety.

An automated security audit means scanning the code with automated analysis software, which searches for bugs against the database of known vulnerabilities and identifies their precise location in the code.

The software-based audit is typically conducted before the manual analysis to detect errors that humans might overlook. It is faster and less time-consuming, but at the same time, it may not always be aware of the context and thus miss certain vulnerabilities. 

Manual code analysis is king in smart contract auditing and is the most critical part of a comprehensive and accurate smart code security audit. It is conducted by at least two separate experts that inspect the code line by line.

Celem jest sprawdzenie, czy każdy szczegół w specyfikacji projektu jest zaimplementowany w smart kontrakcie i czy nic nie narusza jego pierwotnie zamierzonego zachowania. 

The auditors scrutinize the code for unintended, unexpected behavior, crucial security issues, and vulnerabilities like re-entrance, data manipulations, flash loans, and other manipulations that might be implemented while the smart contract interacts with others.

In addition to that, manual audits run simulations to evaluate how well the DeFi project’s smart contract responds to unidentified threats and how capable it is of defending itself against them. 

W końcowej części ręcznej analizy kodu audytor porównuje logikę smart kontraktu z jego opisem w whitepaper projektu. 

Po zidentyfikowaniu i naprawieniu wszystkich luk w zabezpieczeniach audytorzy przeprowadzają proces podwójnej kontroli, aby upewnić się, że inteligentny kod działa zgodnie z oczekiwaniami.

Ostatecznie po zakończeniu audytu bezpieczeństwa audytorzy przygotowują kompleksowy raport. Tam przekazują szczegółowe informacje zwrotne na temat tego, co odkryli. Zazwyczaj ich raport zawiera zalecenia, w jaki sposób można naprawić wykryte słabości kodu, aby złagodzić bezpieczeństwo projektu. 

What Ensures that a Smart Contract Audit Is Professional?

Smart contracts are a relatively new innovation. Their security standards are evolving accordingly. This means no golden rule guarantees total smart contract safety.

Co więcej, nie wszystkie firmy audytorskie inteligentnych kontraktów są takie same i nie wszystkie audyty gwarantują bezpieczeństwo. Audytorzy mogą mieć różne poziomy umiejętności, różne cele i różne koszty.

Not to mention the fact that the market is full of sketchy developers that forge audits and still benefit from the name of a respectable company. This is what happened to Peckshield, a blockchain security and data analytics company, more than a year ago.

Takie sytuacje są dość powszechne w przestrzeni kryptowalut. Przyjmują nazwisko legalnego i szanowanego audytora i umieszczają je w swoim dokumencie, mówiąc, że ich protokół został skontrolowany.

The only way to avoid cases like this is to check for confirmation on the auditor’s original channels. If there aren’t any, chances are that the auditor’s name has been stolen. 

Always check its client portfolio to evaluate whether the auditor is solid and reputable. Google the cases to verify their experience records, and check if any of the audited projects have suffered a rug pull or other attacks.

Can You Conduct Code Audit Yourself?

With so many hacks and rug pulls in the crypto space, it’s naive to imagine that DeFi projects are safe without looking into them in more detail. Smart contract audits provide a critical layer of safety. 

However, even the most professional ones do not guarantee that a DeFi project is absolutely bug-free. Smart contracts are complex. They require detailed and comprehensive analysis, expertise, tools, and, most importantly, more than one pair of eyes.

Znak czasu:

Więcej z Codzienna moneta