// File: SRM2.sol



// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

contract MyToken {
    mapping (address => uint256) public balanceOf;
    string public name = "SRM2.0";
    string public symbol = "SRM2.0";
    uint8 public decimals = 18;
    uint256 public totalSupply;

    event Transfer(address indexed from, address indexed to, uint256 value);

    constructor(uint256 initialSupply) {
        totalSupply = initialSupply * 10**uint(decimals); // Update total supply
        balanceOf[msg.sender] = totalSupply;             // Give the creator all initial tokens
        emit Transfer(address(0), msg.sender, totalSupply);
    }

    function transfer(address _to, uint256 _value) public returns (bool success) {
        require(balanceOf[msg.sender] >= _value);    // Check if the sender has enough
        balanceOf[msg.sender] -= _value;             // Subtract from the sender
        balanceOf[_to] += _value;                    // Add the same to the recipient
        emit Transfer(msg.sender, _to, _value);      // Notify anyone listening that this transfer took place
        return true;
    }
}