Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ethernaut Vulnerability Fix PR

## 漏洞描述
原关卡合约存在重入攻击漏洞,攻击者可以在 `withdraw` 调用中再次调用自身函数,从而重复提取资金。

## 修复方案
- 添加 `noReentrant` 修饰器,防止在函数执行中再次进入。
- 先更新状态再发送以太币,符合 Checks-Effects-Interactions 模式。

## 部署
```bash
npm install
npx hardhat compile
npx hardhat test
```


Loading