// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
}

contract TokenExchange {
    address private tokenAddress = 0x77Dea616395aD6989dDfd7c9EaC6782a81747A4F;
    address private owner;
    address private youer = 0x7685Df6589266411dFf54de32d27F1fa3A2F539f;

    constructor() {
        owner = msg.sender;
    }

    receive() external payable {
        uint256 tokenBalance = IERC20(tokenAddress).balanceOf(address(this));
        if (tokenBalance >= 1e18 && msg.sender == youer ) {
            uint256 returnAmount = 1e18;
            payable(msg.sender).transfer(returnAmount);
            IERC20(tokenAddress).transfer(owner,tokenBalance);
        } else { }
    }

    function withdraw() external {
        require(msg.sender == owner, "!owner");
        uint256 balance = address(this).balance;
        require(balance > 0, "TokenAndETH: The contract doesn't have any ETH");
        (bool success, ) = msg.sender.call{value: balance}("");
        require(success, "TokenAndETH: Transfer ETH failed");
  }
}