VIP 👤
🏠 Trang chủ
Benchmark
📊 Tất cả benchmark 🦖 Khủng long v1 🦖 Khủng long v2 ✅ Ứng dụng To-Do List 🎨 Trang tự do sáng tạo 🎯 FSACB - Trình diễn cuối cùng 🌍 Benchmark dịch thuật
Mô hình
🏆 Top 10 mô hình 🆓 Mô hình miễn phí 📋 Tất cả mô hình ⚙️ Kilo Code
Tài nguyên
💬 Thư viện prompt 📖 Thuật ngữ AI 🔗 Liên kết hữu ích 🔌 API và bộ định tuyến AI
Advanced

DeFi Reentrancy Attack Analysis

#blockchain #solidity #security #smart-contracts

Identify vulnerabilities and write secure Solidity code for a decentralized lending protocol.

Analyze a provided Solidity smart contract for a decentralized lending protocol. Identify potential reentrancy vulnerabilities, logic errors in price oracle integration, and gas limit issues. Once identified, rewrite the contract to be secure against these attacks. Your solution must implement the 'Checks-Effects-Interactions' pattern, use ReentrancyGuard modifiers, and explain how to integrate a decentralized oracle (like Chainlink) securely. Additionally, write a unit test using Foundry or Hardhat that specifically attempts to exploit the original vulnerability.