Created
November 13, 2024 11:14
-
-
Save rollendxavier/641fff023aa08a254a3a7b9c5589b3b2 to your computer and use it in GitHub Desktop.
Solidity Contract File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| contract MyToken { | |
| string public name = "MyToken"; | |
| string public symbol = "MTK"; | |
| uint8 public decimals = 18; | |
| uint256 public totalSupply = 1000000 * 10 ** uint256(decimals); | |
| mapping(address => uint256) public balanceOf; | |
| constructor() { | |
| balanceOf[msg.sender] = totalSupply; | |
| } | |
| function transfer(address _to, uint256 _value) public returns (bool success) { | |
| require(balanceOf[msg.sender] >= _value); | |
| balanceOf[msg.sender] -= _value; | |
| balanceOf[_to] += _value; | |
| return true; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment