The Vault has been hailed as the next big thing in DeFi. Rumor has it, though, that a flaw was overlooked during its development. Do you have what it takes to uncover it?
WINNING CONDITION
The Vault is out of funds.
▾src
Vault.sol
▸interfaces
IVault.sol
▸script
Deploy.sol
IsSolved.sol
pragma solidity 0.8.19;
import {IVault} from "./interfaces/IVault.sol";
contract Vault is IVault {
uint256 public totalDeposited;
function deposit() external payable {
totalDeposited += msg.value;
emit Deposit(msg.sender, msg.value);
}
function withdraw(uint256 amount) external {
totalDeposited -= amount;
payable(msg.sender).transfer(amount);
emit Withdraw(msg.sender, amount);
}
}