Creating an ERC404 token might sound like an adventure through the unexplored corners of Ethereum—and that’s because it is. If you’ve dipped your toes into both ERC20 (fungible tokens) and ERC721 (non-fungible tokens), you’re probably wondering: “Can we somehow blend these?” Well, ERC404 is your answer.
In this guide, we’ll walk you through what ERC404 really is, how it works, and how to build one from scratch. Ready? Let’s get our hands dirty!
🔍 Introduction to ERC404
ERC404 is a new experimental token standard on the Ethereum blockchain that fuses the capabilities of ERC20 (fungible) and ERC721 (non-fungible) tokens.
Think of it like peanut butter and jelly—both great on their own, but magical when combined.
🧬 What Makes ERC404 Different?
Unlike traditional standards, ERC404 lets a single asset behave like both a token and an NFT. One token can be divisible and also carry unique metadata. Cool, right?
- Fungibility of ERC20
- Uniqueness of ERC721
- Bridging liquidity with individuality
🚀 Why ERC404 Is Gaining Traction
Because it unlocks new possibilities:
- Gamers can trade fractional characters.
- Artists can split and sell their digital art.
- DeFi protocols can tokenize liquidity in entirely new ways.
🧰 Prerequisites for Creating an ERC404 Token
Before you dive into code, make sure you have your tools in place.
🧱 Development Tools You’ll Need
- Node.js & npm
- Hardhat or Foundry
- MetaMask wallet
- Remix IDE (for beginners)
📜 Essential Knowledge of Solidity
You don’t need to be Vitalik, but you should know Solidity basics:
- How functions, mappings, structs work.
- Understanding of inheritance and interfaces.
- Familiarity with ERC20 & ERC721 contracts.
💼 Wallet & Testnet Setup
- Install MetaMask
- Switch to Goerli or Sepolia Testnet
- Get some test ETH from a faucet.
🏗️ Smart Contract Architecture of ERC404
Here’s where it gets spicy. Let’s explore what makes ERC404 tick.
🧬 Hybrid Design: ERC20 + ERC721
ERC404 isn’t officially standardized yet. It merges logic from both:
- ERC20 balances for transferability.
- ERC721 mappings for metadata and uniqueness.

🗂️ Token Metadata Handling
Each token ID links to unique metadata, typically hosted on IPFS or Arweave. The metadata contains:
- Name
- Image
- Description
- Properties
🔄 Minting Logic in ERC404
Minting is not just increasing supply—it also assigns unique token IDs and links them to metadata.
⚙️ What’s New in the Mint Function?
When minting:
- Increase the total supply like ERC20
- Generate a unique NFT ID
- Attach metadata
- Ensure compatibility with OpenSea or marketplaces
🛠️ Step-by-Step Guide to Creating an ERC404 Token
Let’s roll up our sleeves and build one.
👨💻 Step 1: Set Up Your Development Environment
bashCopyEditnpm init -y
npm install --save-dev hardhat
npx hardhat
Choose “Create a basic sample project” and install dependencies.
📄 Step 2: Write the Smart Contract
Create ERC404Token.sol
and start with imports:
solidityCopyEditimport "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
🔗 Step 3: Integrate ERC404 Logic
- Create dual mappings
- Handle minting to assign token ID + metadata URI
- Ensure transfer reflects on both interfaces

🚀 Step 4: Deploy on Ethereum Testnet
Use Hardhat or Remix to deploy on Goerli:
bashCopyEditnpx hardhat run scripts/deploy.js --network goerli
🧪 Step 5: Test Token Functions
Test:
- Transfers
- Balance queries
- Ownership verification
- Marketplace visibility
🌍 Step 6: Deploy to Mainnet
Once all tests pass:
- Switch network to Ethereum mainnet
- Use Etherscan or Hardhat scripts to deploy
- Verify contract code

🧾 Example ERC404 Code Snippet
Here’s a quick simplified mint function:
solidityCopyEditfunction mint(address to, uint256 amount, string memory uri) public {
_mint(to, amount); // ERC20 logic
uint256 tokenId = uint256(keccak256(abi.encodePacked(to, block.timestamp)));
_safeMint(to, tokenId); // ERC721 logic
_setTokenURI(tokenId, uri);
}
⚠️ Common Mistakes and How to Avoid Them
Even pros slip up. Here’s what to avoid:
🧩 Token Metadata Mismatch
Make sure token IDs match between ERC20 logic and ERC721 metadata. Sync them properly during minting.
🔥 Improper Minting/Burning Logic
If tokens can be burned or transferred, ensure the logic reflects on both the ERC20 and ERC721 sides. One imbalance can crash your app.
🌍 Real-World Use Cases of ERC404 Tokens
What makes ERC404 exciting is how practical it is.
🎮 Gaming NFTs with Fungibility
Game items like swords or shields can be owned in bulk (fungible) but still have unique looks, power stats, or skins (non-fungible).
🖼️ Fractional Art Ownership
Artists can tokenize a single artwork and let users own fractions with attached NFTs—each showing a different view or detail of the piece.

🧠 Final Thoughts
ERC404 is experimental, flexible, and powerful. If ERC20 and ERC721 were Lego bricks, ERC404 is like building a mech suit with them. Sure, it’s still being explored, but that’s the fun part. Whether you’re a dev, a DeFi degen, or a curious creator—now’s a good time to start building.
Happy coding!
❓ FAQs
1. Is ERC404 an official Ethereum standard?
Nope! It’s experimental and not officially recognized by the Ethereum Foundation—yet.
2. Can ERC404 tokens be listed on marketplaces like OpenSea?
Yes, as long as you integrate ERC721 logic and metadata, they’re visible.
3. Are there libraries available for ERC404?
There’s no official OpenZeppelin ERC404 library yet, but devs are starting to open-source their implementations.
4. Can I use ERC404 for DeFi protocols?
Absolutely. It opens up interesting use cases like tokenized vault shares with unique properties.
5. What happens if I mess up the dual logic?
Your contract might break or behave inconsistently. Always test thoroughly on testnets before deploying live.