Exploring ERC-404m: A Multi-Chain Improvement of the 404 Standard

Easily deploy true multi-chain tokens based on the experimental ERC404 token — empowered by Muon-tech

Robert Wallace
Muon

--

Over the last week, there has been a lot of buzz surrounding ERC-404, a new experimental token on Ethereum. It aims at fractionalizing NFTs which makes them ownable and tradeable on Uniswap just like ERC20 tokens. Pandora, the first token using ERC-404, has experienced a remarkable surge since its launch on February 2 and the community has rallied around potential opportunities around the standard.

Enter ERC-404m, an upgrade by the Muon team that makes ERC-404 multi-chain. That means tokens created with this standard can be transferred between different chains in real-time (depending on each chain’s finality). NFTs as well as Tokens can be moved across chains, currently deployed on Optimism, Arbitrum and Mainnet.

(Please be cautious, this is a totally new experimental token type that has not gone through the formal EIP approval.)

What is ERC-404 (Skip if you already know.)

In the realm of blockchains, there have been two dominant token standards: ERC20 for fungible tokens and ERC-721 for non-fungible tokens or NFTs. ERC-404 is a new type of token aiming to unify the functionalities of the two into a single token. This means ERC-404 tokens can be both fungible and non-fungible, depending on their implementation and status.

Here is a simple demonstration of ERC-404.

Mechanism

An NFT is minted to the wallet that has a whole ERC-404 token. When the token is sold, the NFT is automatically burned. The ERC20 part of the tokens can be traded on Uniswap while the NFTs can be traded on opensea, at the same time with the same contract, magical right?

Now MUON makes this interesting new token cross-chain, and available to all DEXs & NFT Marketplaces.

ERC-404m: Muon’s Technical Feat

Blockchains are intrinsically isolated and cannot easily or securely communicate with other chains, as keeping state of everything is expensive, a tale as old as the scalability trilemma.

ERC-404m addresses this issue and enables tokens created with this standard to move between different blockchains. An ERC-404m token can be listed on any DEX and any NFT market. Its randomness for the buyer is currently deterministic, but will be truly (100%) random in its next iteration.

Pion Network — the Muon ecosystem’s canary network — is a stateless and chain-independent network with over 1,600+ uniquely verified nodes.

An ERC-404m inherits the necessary features to be bridged via mint/burn protocol. Using this protocol, erc-404m tokens can exist on multiple chains and be traded across them, without the need to wrap them into a standard ERC20 or ERC721.

These changes will make ERC404 more like real NFTs rather than “Replicants”. They are called Replicants because you can “Re-Roll” your rarity; that is, every time you transfer the token to a new wallet it gets randomly “replicated” on the other wallet, burnt on Wallet A and reissued on Wallet B. Unfortunately this defeats the purpose of NFTs which are meant to be unique.

We are working on improving this by keeping an off-chain database of replicas on the Muon layer. More about this soon!

Direction of Technical Changes

In the current version certain fundamental changes were done to the original ERC404 standard and other improvements are planned for the next upgrades.

Implemented Changes

1- Adding accessControl & Integrating with Muon Bridge

Two roles have been added:

bytes32 public constant MINTER_ROLE = keccak256(“MINTER_ROLE”);
bytes32 public constant DAO_ROLE = keccak256(“DAO_ROLE”);
  • MINTER_ROLE: Muon Bridge was granted MINTER_ROLE role so that Muon Bridge can mint tokens on the destination chain for the users about to run cross-chain transactions.
  • DAO_ROLE: A role to let admins manage the whitelisted wallets, such as minter wallet or Uniswap pair. (When an ERC404 token is transferred to the whitelists, the NFT will not be minted for them.)

The following two functions were also added

  • burnFrom: The bridge needs this function to be able to burn the tokens on the source chain.
function burnFrom(address from, uint256 amount) public {

uint256 allowed = allowance[from][msg.sender];
if (allowed != type(uint256).max){
if (allowed < amount) {
revert ERC20InsufficientAllowance(msg.sender, allowed, amount);
}
allowance[from][msg.sender] = allowed - amount;
}

uint256 erc20BalanceOfSenderBefore = erc20BalanceOf(from);

balanceOf[from] -= amount;
totalSupply -= amount;

// Skip burn for certain addresses to save gas
if (!whitelist[from]) {
uint256 tokensToWithdrawAndStore = (erc20BalanceOfSenderBefore / units) -
(balanceOf[from] / units);
for (uint256 i = 0; i < tokensToWithdrawAndStore; i++) {
_withdrawAndStoreERC721(from);
}
}

emit ERC20Transfer(from, address(0), amount);
}

mint: ‏This lets the bridge (with MINTER_ROLE) mint the tokens on destination chain.

function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {
uint256 erc20BalanceOfReceiverBefore = erc20BalanceOf(to);

_transferERC20(address(0), to, amount);

// Skip minting for certain addresses to save gas
if (!whitelist[to]) {
uint256 tokensToRetrieveOrMint = (balanceOf[to] / units) -
(erc20BalanceOfReceiverBefore / units);
for (uint256 i = 0; i < tokensToRetrieveOrMint; i++) {
_retrieveOrMintERC721(to);
}
}
}

See the code.

2- Implementing ERC404 Standard across Multiple Chains

Visit the landing page for ERC-404m.

‎See the following GitHub repositories for details.

Contracts: https://github.com/muon-protocol/erc404m-contracts

UI: https://github.com/muon-protocol/mrc20-ui/tree/erc404

Muon Bridge: https://github.com/muon-protocol/mrc20-contracts

Changes Planned for the Next Iteration

  • Improving randomness using Muon tech
  • Making metadata consistent & removing rarity rerolling
  • Making minting/burning ERC721 tokens more gas efficient
  • Combine ERC404 and SPL tokens and support Solana
  • Supporting other non-EVM chains

Stay tuned for more.

Muon is a chain-independent and stateless DON (Decentralized Oracle Network) that enables dApps to make their off-chain components decentralized. By incorporating Muon, the manner in which decentralized applications store, process, and access data will be fundamentally transformed.

Pion is the ecosystem’s Canary network.

Run a Pion node and help secure the ERC404m bridges while earning $PION tokens.

Twitter | Telegram | Discord | Website | Medium | GitBook | Developer’s Guide

--

--