Token builder
Fill in the token name, symbol, and supply. The contract preview updates below.
Contract preview
Git-style diff view of the Solidity 0.8.34 contract you are preparing for Ethereum.
// SPDX-License-Identifier: GPL-3.0pragma solidity ^0.8.34; abstract contract Context { // Returns the wallet address making the current call. function _msgSender() internal view virtual returns (address) { return msg.sender; }} interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address from, address to, uint256 amount) external returns (bool);} interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8);} contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } // Returns the full token name shown in wallets and explorers. function name() public view virtual override returns (string memory) { return _name; } // Returns the short ticker symbol for the token. function symbol() public view virtual override returns (string memory) { return _symbol; } // Uses the common ERC20 precision of 18 decimal places. function decimals() public view virtual override returns (uint8) { return 18; } // Shows how many tokens exist in total. function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } // Shows the token balance for a specific wallet. function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } // Sends tokens from the caller to another wallet. function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } // Shows how many tokens a spender is allowed to use. function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } // Grants another wallet permission to spend tokens on your behalf. function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } // Moves tokens using a previously approved allowance. function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } // Internal transfer logic with basic balance and address checks. function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; _balances[to] += amount; } emit Transfer(from, to, amount); } // Creates the token supply and assigns it to a wallet. function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; unchecked { _balances[account] += amount; } emit Transfer(address(0), account, amount); } // Stores approval details for delegated token spending. function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } // Reduces an allowance after delegated transfers are used. function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } }} contract Token is ERC20 { // Mints the full fixed supply to the wallet that deploys the contract. constructor() ERC20("<token-name>", "<symbol>") { constructor() ERC20("", "") { _mint(msg.sender, <total-supply> * 10 ** 18); _mint(msg.sender, 0 * 10 ** 18); }} Deployment checklist
Keep these steps in view for Ethereum.
Enter the token details first.
The full supply is minted to the connected wallet on deployment.
Review the generated source before signing.
Deployment prompts come from your wallet provider.