// SPDX-License-Identifier: MIT pragma solidity ^0.8.29; contract TokenExchange { string public name = "Token Exchange"; uint256 public rate = 100; event TokensPurchased( address account, address token, uint256 amount, uint256 rate ); function buyTokens(address token, uint256 amount) public payable { require(msg.value == amount * rate, "Incorrect Ether value sent"); emit TokensPurchased(msg.sender, token, amount, rate); } }