DEV Community

Nexus Intelligence Research
Nexus Intelligence Research

Posted on

DeFi Smart Contract Vulnerabilities Audit Guide

Here are three common DeFi smart contract vulnerabilities, along with specific methods and tools to detect them. These vulnerabilities are frequently exploited in the wild and remain top priorities in security audits.


1. Reentrancy

Description:

Reentrancy occurs when a smart contract calls an external contract (e.g., sending ETH or calling another contract’s function) before it has finished updating its internal state (e.g., user balances). An attacker can exploit this by having the external contract call back into the vulnerable function before the first call completes, leading to repeated withdrawals or state inconsistencies.

Common Scenario:

A withdraw() function sends ETH to the user before decrementing their balance. The attacker’s contract, upon receiving ETH, re-enters withdraw() again, repeating the process until funds are drained.

How to Detect:

  • Static Analysis Tools:
    • Slither: Run slither . on your Solid

Top comments (0)