This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import "forge-std/Test.sol"; | |
| import "forge-std/console.sol"; | |
| import "../src/Vulnerable.sol"; | |
| import "../src/Attack.sol"; | |
| contract ReentrancyTest is Test { | |
| Vulnerable public vulnerable; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| contract Vulnerable { | |
| mapping(address => uint) public balances; | |
| function deposit() public payable { | |
| balances[msg.sender] += msg.value; | |
| } | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import "./Vulnerable.sol"; | |
| contract Attack { | |
| Vulnerable public vulnerable; | |
| uint public attackCount; | |
| constructor(address _vulnerable) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "overrides": [ | |
| { | |
| "files": "*.sol", | |
| "options": { | |
| "printWidth": 80, | |
| "tabWidth": 4, | |
| "useTabs": false, | |
| "singleQuote": false, | |
| "bracketSpacing": false |