Luggage crowdsurance

Sergei Sevriugin
Coinmonks
Published in
3 min readApr 20, 2018

--

The luggage crowdsurance product is TokenCrowdsurance NFT721SmartToken. To build a decentralised financial product we need to use the non fungible token standard ERC721 but as each token it has its own value, so we are connecting this standard with ERC20 token. The following picture shows how it works:

To access ERC20 functions that also has ERC721 token we’ve created ERC20 Adapter, the smart contract connected to the ERC721SmartToken that implements ERC20Controller. So, to get ERC20 balance for a specific account address we should call BalanceOf of the ERC20Adapter and the result (in our example) will be 200. If we want to get a number of tokens belonging to the same address, we will call BalanceOf function of the ERC721 and get 3 as the result. This is just one example how to use the ERC721SmartToken. The full smart contract description is here.

The next level for building crowdsurance product is adding the TokenContainer concept. One ERC721 token can hold other tokens in the same smart contract.

In this example the Person NFT ID 10 owns to the pets tokens: CAT — NFT ID 1 and DOG — NFT ID 2. Token Container provides a number of functions to work with the containers including token adding and removing.

For the specific tasks, including crowdsurance, we need to create the next level that we call the TokenPool.

Now we have the 4 level pool hierarchy : Super Pool, Pool, SubPool and NFT token. The last level can be also the container as shows our example where the NFT token Person owns two pets tokens and belongs to SubPool NFT ID 3.

Based on TokenPool we have developed the TokenCrowdsurance smart contract that provides the functionality of Crowdsurance product. The term “Crowdsurance” means people unite in communities to provide a guarantee of compensation for unexpected loss. Thanks to ERC721SmartToken crowdsurance product can be 'tokenized' and can be availible as ERC20 token.

In this example we can see how the “join” crowdsurance function works. The join amount has been distributed between pools and commission of the token provider. The description of the issuing process:

The next picture demonstrates how the claim payment process works when the claim for payment appears:

Finally we introduce the LuggageCrowdsurance token with the following parameters:

--

--