Tags: [[NFT]] [[NFT Standards]] [[composability]] [[standard extension]] [[draft]] Composing ERC721 with ERC20 into semi fungible token. Seems to be similar to [[ERC1155]]. Composability of the NFTs as crypto revolution of non fungibles. # [[Simple-explanantion]] Selling the part of a parcel that has the biggest value. This contract is breaking down single NFT contract into more items and alllows you to set higher price on the value of the contract itself. Imagine a land with house, the hiuse have bigger value than the land itself so you are able to set higher price for the house and lower for the land. Adding children to the NFT: Parent -> [[ERC998]] Children -> [[ERC721]] - [[ERC998]] requires mapping from the parent [[tokenID]] of the composable to another mapping between child contract address and signer - Child tokens are only able to be transferred from the contract if the sender also owns the parent token ID. - You MUST trust the composable ERC-998 contract does not also have the ability to arbitrarily transfer child tokens the contact technically owns. ## Requirements [[ERC998]] contract requires approval from the [[ERC721]] token in order to use the [[transferFrom]] (owner, to, tokenId) function # [[Fuctions]] - You can transfer [[ERC721]] to [[ERC223 Token Standard]] using [[bytes]] field to indicate which NFT in the ERC998 you wish to transfer to - The sender of the function call owns the parent token, a standard method in the ERC-721 specification implemented as `_owns(address, tokenId)` - Implemented [[rootOwnerOf]] which will actually check who owns the parent token ID all the way up the tree if there is a hierarchy of composable tokens - The parent token ID is mapped to the child token ID through the child contract address, enforcing the parent child relationship Once these are OK, we can call the transfer function of the child contract and if our transfer is successful we set the children mapping to 0 reflecting that the child asset is no longer owned by the parent asset. This is called decomposing the asset. # [[Use case]] - Food or breeding fuctions of cryptokitties - Aavegotchi - Legal - Supply chain provenance - Virtual assets # [[further reading]] Source for the basics: https://medium.com/coinmonks/introducing-crypto-composables-ee5701fde217 Source for the Use cases: https://medium.com/coinmonks/crypto-composables-building-blocks-and-applications-65902709298c GitHub Issue: https://github.com/ethereum/EIPs/issues/998 Reference implementation: https://github.com/mattlockyer/composables-998/ Master implementation: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-998.md