About This Guide
This guide walks through creating a basic ERC20 token and deploying it on Ethereum using Solidity.
This guide walks through creating a basic ERC20 token and deploying it on Ethereum using Solidity.
pragma solidity ^0.8.0;
contract MyToken {
string public name = 'MyToken';
string public symbol = 'MTK';
uint256 public totalSupply = 1000000;
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, 'Insufficient balance');
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
return true;
}
}
45 min
Advanced
DeFi, Ethereum, Solidity, smart contracts
Copyright © 2026 Atragate IT Ltd. All Rights Reserved.