VIP 👤
🏠 Home
Benchmark Hub
📊 All Benchmarks 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List Applications 🎨 Creative Free Pages 🎯 FSACB - Ultimate Showcase 🌍 Translation Benchmark
Models
🏆 Top 10 Models 🆓 Free Models 📋 All Models ⚙️ Kilo Code
Resources
💬 Prompts Library 📖 AI Glossary 🔗 Useful Links 🔌 API & Routers
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.