// File: /eth_kasma/contracts/HelloWorld.sol



// SPDX-License-Identifier: MIT

// Deployed with the Atlas IDE
// https://app.atlaszk.com

pragma solidity ^0.8.0;

contract PasswordProtectedPool {
    address payable public owner;
    string private constant PASSWORD = "Baka240445";
    uint256 public poolBalance;

    constructor() {
        owner = payable(msg.sender);
    }

    function deposit(string memory password) public payable {
        require(keccak256(abi.encodePacked(password)) == keccak256(abi.encodePacked(PASSWORD)), "Incorrect password");
        poolBalance += msg.value;
    }

    function withdraw(uint256 amount, string memory password) public {
        require(keccak256(abi.encodePacked(password)) == keccak256(abi.encodePacked(PASSWORD)), "Incorrect password");
        require(poolBalance >= amount, "Insufficient balance in the pool");

        poolBalance -= amount;
        (bool success, ) = payable(msg.sender).call{value: amount}("");
        require(success, "Transfer failed");
    }

    function getPoolBalance() public view returns (uint256) {
        return poolBalance;
    }
}