Token builder

Fill in the token name, symbol, and supply. The contract preview updates below.

No wallet connected token builder
Minted on deploy0
Selected networkEthereum

Contract preview

Git-style diff view of the Solidity 0.8.34 contract you are preparing for Ethereum.

Template vs generated contractOnly your token details appear as changed lines on Ethereum.
1 // SPDX-License-Identifier: GPL-3.0
2 pragma solidity ^0.8.34;
3
4 abstract contract Context {
5 // Returns the wallet address making the current call.
6 function _msgSender() internal view virtual returns (address) {
7 return msg.sender;
8 }
9 }
10
11 interface IERC20 {
12 event Transfer(address indexed from, address indexed to, uint256 value);
13 event Approval(address indexed owner, address indexed spender, uint256 value);
14
15 function totalSupply() external view returns (uint256);
16 function balanceOf(address account) external view returns (uint256);
17 function transfer(address to, uint256 amount) external returns (bool);
18 function allowance(address owner, address spender) external view returns (uint256);
19 function approve(address spender, uint256 amount) external returns (bool);
20 function transferFrom(address from, address to, uint256 amount) external returns (bool);
21 }
22
23 interface IERC20Metadata is IERC20 {
24 function name() external view returns (string memory);
25 function symbol() external view returns (string memory);
26 function decimals() external view returns (uint8);
27 }
28
29 contract ERC20 is Context, IERC20, IERC20Metadata {
30 mapping(address => uint256) private _balances;
31 mapping(address => mapping(address => uint256)) private _allowances;
32 uint256 private _totalSupply;
33 string private _name;
34 string private _symbol;
35
36 constructor(string memory name_, string memory symbol_) {
37 _name = name_;
38 _symbol = symbol_;
39 }
40
41 // Returns the full token name shown in wallets and explorers.
42 function name() public view virtual override returns (string memory) {
43 return _name;
44 }
45
46 // Returns the short ticker symbol for the token.
47 function symbol() public view virtual override returns (string memory) {
48 return _symbol;
49 }
50
51 // Uses the common ERC20 precision of 18 decimal places.
52 function decimals() public view virtual override returns (uint8) {
53 return 18;
54 }
55
56 // Shows how many tokens exist in total.
57 function totalSupply() public view virtual override returns (uint256) {
58 return _totalSupply;
59 }
60
61 // Shows the token balance for a specific wallet.
62 function balanceOf(address account) public view virtual override returns (uint256) {
63 return _balances[account];
64 }
65
66 // Sends tokens from the caller to another wallet.
67 function transfer(address to, uint256 amount) public virtual override returns (bool) {
68 address owner = _msgSender();
69 _transfer(owner, to, amount);
70 return true;
71 }
72
73 // Shows how many tokens a spender is allowed to use.
74 function allowance(address owner, address spender) public view virtual override returns (uint256) {
75 return _allowances[owner][spender];
76 }
77
78 // Grants another wallet permission to spend tokens on your behalf.
79 function approve(address spender, uint256 amount) public virtual override returns (bool) {
80 address owner = _msgSender();
81 _approve(owner, spender, amount);
82 return true;
83 }
84
85 // Moves tokens using a previously approved allowance.
86 function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
87 address spender = _msgSender();
88 _spendAllowance(from, spender, amount);
89 _transfer(from, to, amount);
90 return true;
91 }
92
93 // Internal transfer logic with basic balance and address checks.
94 function _transfer(address from, address to, uint256 amount) internal virtual {
95 require(from != address(0), "ERC20: transfer from the zero address");
96 require(to != address(0), "ERC20: transfer to the zero address");
97
98 uint256 fromBalance = _balances[from];
99 require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
100
101 unchecked {
102 _balances[from] = fromBalance - amount;
103 _balances[to] += amount;
104 }
105
106 emit Transfer(from, to, amount);
107 }
108
109 // Creates the token supply and assigns it to a wallet.
110 function _mint(address account, uint256 amount) internal virtual {
111 require(account != address(0), "ERC20: mint to the zero address");
112
113 _totalSupply += amount;
114
115 unchecked {
116 _balances[account] += amount;
117 }
118
119 emit Transfer(address(0), account, amount);
120 }
121
122 // Stores approval details for delegated token spending.
123 function _approve(address owner, address spender, uint256 amount) internal virtual {
124 require(owner != address(0), "ERC20: approve from the zero address");
125 require(spender != address(0), "ERC20: approve to the zero address");
126
127 _allowances[owner][spender] = amount;
128 emit Approval(owner, spender, amount);
129 }
130
131 // Reduces an allowance after delegated transfers are used.
132 function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
133 uint256 currentAllowance = allowance(owner, spender);
134
135 if (currentAllowance != type(uint256).max) {
136 require(currentAllowance >= amount, "ERC20: insufficient allowance");
137
138 unchecked {
139 _approve(owner, spender, currentAllowance - amount);
140 }
141 }
142 }
143 }
144
145 contract Token is ERC20 {
146 // Mints the full fixed supply to the wallet that deploys the contract.
147- constructor() ERC20("<token-name>", "<symbol>") {
148+ constructor() ERC20("", "") {
148- _mint(msg.sender, <total-supply> * 10 ** 18);
149+ _mint(msg.sender, 0 * 10 ** 18);
149 }
150 }
151

Deployment checklist

Keep these steps in view for Ethereum.

1
Start with your token details right away.

Enter the token details first.

2
Choose a name, symbol, and fixed supply.

The full supply is minted to the connected wallet on deployment.

3
Review the generated Solidity before deploying.

Review the generated source before signing.

4
Deploy when ready and approve wallet access only at that point.

Deployment prompts come from your wallet provider.