Project 2 – Smart ContractBy Echolink Solutions / May 7, 2024 AI Ethics and Bias Audit with Blockchain Technology (Security and Legal) Module 1: Understanding Blockchain Technology Project 2 - Smart Contract Project 2: As a Blockchain Security Analyst, Consultant. The smart contract below has a Vulnerability. What is it? Fix and deploy the new smart contract. DUE DATE: Tuesday, May 14, 2024. This contract has a vulnerability known as the reentrancy attack. The vulnerability lies in the withdraw function. When a user calls the withdraw function, it first checks if the user has a sufficient balance to withdraw. If so, it transfers the requested amount to the user and then updates the user's balance. However, this order of operations can be exploited. Smart Contract pragma solidity ^0.8.0; contract VulnerableContract { mapping(address => uint256) public balances; function deposit() public payable { balances[msg.sender] += msg.value; } function withdraw(uint256 _amount) public { require(balances[msg.sender] >= _amount, "Insufficient balance"); require(msg.sender.call{value: _amount}(""), "Transfer failed"); balances[msg.sender] -= _amount; } } * Previous Lesson Next Lesson