The last stretch of working on the ETHGlobal Hackathon. Here's the progress of my project:
Molecule Protocol
If each token is an atom, and a combination of tokens will form a molecule, which can enable methods on a wallet. For example, only if a wallet contains a KYC token the transfer can be executed.
While DeFi is all about permission-less and censorship-resistant finance, it could nonetheless handle the regulation and compliance requirements, too. I started thinking how can a transfer of ERC20 or ERC721 token be subjected to KYC constrain.
I have looked at the existing standards such as the security token standard (ERC1400), the composable token standard (ERC998) and the Set Protocol for inspirations. While these are either designed to satisfy the constraints or can be modified to do so, they require launching new tokens or sticking to a rigid framework.
I want to create a simple smart contract that handles transfer of ERC20 and/or ERC721 tokens only if certain constraints are met for both the sender and recipient.
For example, to enforce a KYC requirement, a smart contract can be deployed that checks for the existence of an ERC721 KYC token from a whitelisted ERC721 contract address before approving or completing the transfer.
An arbitrarily combination of ERC20 (with quantity as an optional param) and/or ERC721 (with tokenId as an optional param) can be defined before a transfer can be executed.
After poking around, I realize that the implementation is a combination of a DEX and a Marketplace smart contract—DEX being the edge case where the tokens involved are ERC20s only; in all other cases, it is essentially a (modified) marketplace. Since DEX is already well-implemented, the focus on this development is to create a modified marketplace smart contract to achieve the Molecule composition functionalities.
Then I started thinking what modification is needed in order for this to support the "molecule" structure in a marketplace—I realized that the only process I need to take is to create a whitelisting plug-in, to any existing marketplace, to enable the (molecule-structure) permission check, and for each combination of the molecules, developers should be able to customize with their own "plug-ins" smart contracts, too.
The smaller this protocol is, the more it can fit into the composable format, the more useful it would be. With that in mind, I reduced this project to the scope of generating a "whitelist approver" smart contract.
In addition to marketplaces, this can also be integrated with existing DEX, such as Uniswap, to allow KYC whitelisting before transactions are permitted. It can also be connected to a slightly modified Opensea, to enable collections (similar to composable ERC998) but without messing with the original tokens, and by allowing combination of tokens to be specified (as the molecule structure), it can also achieve some of the Set Protocol functionalities (very tiny part of it, just the token combination portion).
What's Next?
Hey Calvin, I participated on ETH Online as well, how was your experience? Could ou share the https://hack.ethglobal.co/showcase/ link to check the protocol?
I'll leave you mine here: https://hack.ethglobal.co/showcase/coinosis-recap9UDJ0EjE9FYa
I'm going to create a post to get things moving for the crypto IH. Keep building, would love your feedback on coinosis.co