Loading tools
Loading tool
ERC-20/721/1155 + OZ v5 + 9 extensions + gas estimates.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20, ERC20Permit, Ownable {
constructor(address initialOwner) ERC20("MyToken", "MTK") Ownable(initialOwner) ERC20Permit("MyToken") {
_mint(initialOwner, 1000000 * 10 ** decimals());
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
Open Remix or Foundry / Hardhat, paste, deploy via MetaMask. Pass your wallet address as initialOwner.
A Solidity 0.8.20+ contract generator for ERC-20, ERC-721, and ERC-1155 tokens. Uses OpenZeppelin Contracts v5 -the most-audited Solidity library on mainnet -with toggles for Mintable, Burnable, Pausable, Ownable, Permit (EIP-2612 gasless approvals), Votes (governance), Flash Mint, URIStorage, Enumerable, and Supply Tracking.
Most generators dump unsafe code or skip conflict resolution. This one ships proper override(ERC20, ERC20Pausable, ERC20Permit) declarations, gas estimates per extension, and inline warnings when toggles conflict (e.g. Votes requires Permit). Copy into Remix or Foundry and deploy.
Yes. Unlimited use, no signup. OpenZeppelin Wizard is also free but doesn't show gas estimates or auto-add Permit-with-Votes conflict checks. Use both -we generate the same OZ v5 patterns plus extras.
Three: ERC-20 (fungible -USDC, UNI, governance tokens), ERC-721 (NFTs -BAYC, ENS), and ERC-1155 (multi-token -games, packs, semi-fungibles). Pick the one matching your use case; the form adapts.
It uses OpenZeppelin Contracts v5 (the most-audited Solidity library on mainnet) and Solidity 0.8.20+. For mainnet deploys with significant value, still get a third-party audit (Trail of Bits, OpenZeppelin, Spearbit) -generated code is solid but auditors catch deployment-config bugs we cannot.
Permit enables gasless ERC-20 approvals via signature. Users sign a message off-chain; relayer pays gas to call permit(). Essential for UX in DeFi protocols. Adds ~150k deploy gas. Required if you enable Votes.
Base URI: all tokens share a URI prefix; tokenURI = baseURI + tokenId. Cheaper to deploy + mint. URIStorage: each tokenId can have a custom URI, set via _setTokenURI. Use base URI for generative collections (BAYC), URIStorage for one-off art.
Only if you need on-chain enumeration (tokenOfOwnerByIndex, tokenByIndex). Adds ~250k deploy + 50k per mint. Most dApps use The Graph or Alchemy/Moralis for off-chain enumeration instead -much cheaper.
Pausable adds pause() / unpause() functions (owner-only) that freeze all transfers. Useful for emergency stop during exploits. Trade-off: centralization. Skip if you want truly trustless.
Within ±15%. Based on OZ Wizard typical deploys at 30 gwei + $3000 ETH. Actual cost depends on network gas price (use Etherscan gas tracker), L2 vs mainnet (10-100x cheaper), and constructor input size. Estimate for budgeting, not exact.
No -for safety. Copy the code into Remix (remix.ethereum.org), Foundry, or Hardhat. Deploy via your own MetaMask + tested RPC. Never paste private keys into a web tool.
Yes. Code generation runs in your browser. Token name, symbol, supply, toggles all stay on your device. Only thing that goes on-chain is what you deploy yourself.
ERC-20/721/1155 + 9 extensions + gas estimates. OpenZeppelin v5. Free unlimited.
Open the generatorThe Token Contract Generator page is built, reviewed, and maintained by the Molixa team. We use the tool we ship and update the docs when the behavior changes.