Mokens and ERC998 Composable Functionality

Nick Mudge
mokens
Published in
2 min readSep 11, 2018

The Mokens contract fully implements the ERC998 Composable standard.

What does this mean?

  1. It means it is possible to transfer any ERC721-compliant cryptocollectible or non-fungible token into any moken.
  2. It means you can add any amount of any ERC20 token to any moken.
  3. It means that you can transfer your own mokens to any ERC721 tokens. Yes, that is right, your cryptokitty can own a moken. It is even possible for your moken to own a cryptokitty and for a different cryptokitty to own your moken. You can keep it simple or you can create intricate trees of mokens owning NFTs and NFTs owning mokens.

Another way to say this is that a moken acts as a wallet for ERC20 tokens and ERC721 tokens. And it is possible to buy and sell your moken wallet as if it was an ERC721 token itself, because that is exactly what it is. When you sell your moken wallet, everything inside it goes with it.

The ERC998 standard provides two different ways for an NFT to own NFTs. In the top-down approach an NFT keeps track of the child NFTs that it owns. In the bottom-up approach an NFT keeps track of the parent NFT that owns it. The Mokens contract implements both approaches which is why a moken can own child NFTs and why a moken can be owned by an ERC721 token.

Some real examples:

  1. At the time of this writing Moken 9 owns CryptoKitty 153961 and CryptoKitty 178688.
  2. At the time of this writing Moken 4 owns 50 DAI and 1.31 DGX.

User Interface Problem

At the moment there is no good user interface for transferring NFTs into Mokens or seeing what NFTs are owned by mokens. But this is going to change soon. I am currently working on the first version of a user interface that shows what NFTs are owned by a moken and gives the ability to interact with the Mokens contract so that NFTs can be transferred into mokens and out of mokens.

But how to do it now?

The MyCrypto contract interact functionality can be used to call the ERC998 functions on the Mokens contract to view the NFTs owned by Mokens and to transfer NFTs into and out of mokens. Here is a link to the Mokens abi that is needed to call the various ERC998 functions: Mokens ABI Version 1

--

--

Nick Mudge
mokens
Editor for

Ethereum contract programmer, security auditor and standards author. Author of the diamond standard.