Create ERC-404 Token

This tutorial will guide you through creating and deploying an experimental ERC-404 token on the Fiefdom Playground Testnet.

The ERC-404 standard is a novel implementation that mixes ERC-20 and ERC-721 standards to allow for native liquidity and fractionalization of non-fungible tokens (NFTs). This guide is designed for developers eager to explore innovative token standards on the Fiefdom Playground Testnet.

Prerequisites

  • Node.js and npm installed on your development environment.

  • A crypto wallet compatible with Ethereum and Fiefdom, configured for the Fiefdom Playground Testnet.

  • Basic understanding of Solidity and smart contract development.

Step 1: Project Setup

  1. Create a Project Directory: Initialize a new directory for your project and navigate into it.

  2. Initialize a Node.js Project: Run npm init -y to create your package.json file.

  3. Install Hardhat: Add Hardhat to your project with npm install --save-dev hardhat.

Step 2: Hardhat Project Configuration

  1. Initialize Hardhat: In your project directory, execute npx hardhat and select "Create an empty hardhat.config.js" when prompted.

  2. Install OpenZeppelin Contracts: Run npm install @openzeppelin/contracts for secure token implementations.

Step 3: Crafting Your ERC-404 Token Contract

  1. Create a Contracts Directory: Make a contracts folder within your project.

  2. Write Your ERC-404 Contract: In the contracts directory, create a file named MyERC404Token.sol. Use the provided ERC-404 abstract contract as a starting point to implement your token logic.

  3. See Further Details below for a full example contract.

Step 4: Compiling Your Contract

  1. Configure Hardhat for Fiefdom Playground: Adjust your hardhat.config.js to include the Fiefdom Playground Testnet settings:

Replace /* Your private key here */ with your wallet's private key, safeguarding it appropriately.

  1. Compile Your Contract: Execute npx hardhat compile to compile your contract.

Step 5: Deploying to the Fiefdom Playground Testnet

  1. Create a Deployment Script: In the scripts directory, add a deploy.js file with the deployment logic for your ERC-404 token:

  1. Execute Deployment: Deploy your ERC-404 token to the Fiefdom Playground Testnet by running:

Further Details

This example contract code provided is from the official GitHub of Pandora Labs, a primary group leading the development charge of ERC-404. - https://github.com/Pandora-Labs-Org/erc404.

From their documentation:

This is an extremely simple minimal version of an ERC-404 that mints the entire supply to the initial owner of the contract.

Generally the initial tokens minted to the deployer will be added to a DEX as liquidity. The DEX pool address should also be added to the whitelist to prevent minting NFTs to it and burning NFTs from it on transfer.

Note: WFIEF and FiefSwap DEX Contracts will be available for full proper testing of the ERC-404 standard on Fiefdom Playground soon.

Last updated