Preview:
contract ERC20 {
	string public name;
	string public symbol;

	mapping(address => uint256) public balanceOf;
	address public owner;

	uint256 public totalSupply;

	constructor(string memory _name, string memory _symbol) {
		name = _name;
		symbol = _symbol;

		owner = msg.sender;
	}

	function mint(address to, uint256 amount) public {
		require(msg.sender == owner, "only owner can create tokens");
		totalSupply += amount;
		balanceOf[owner] += amount;

	}

	function transfer(address to, uint256 amount) public {
		require(balanceOf[msg.sender] >= amount, "you aint rich enough");
		require(to != address(0), "cannot send to address(0)");
		balanceOf[msg.sender] -= amount;
		balanceOf[to] += amount;
	}
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter