Cypherium | Three Application Examples of Smart Contracts

Cypherium
Cypherium
Published in
4 min readNov 10, 2018

For how to deploy smart contract bytecode on Cypherium, please go to our video tutorial: https://youtu.be/zE_ovc1Wspg

1. Flight delay insurance

An example of aviation delay insurance. At present, the delay reimbursement process for domestic flights is rather cumbersome. After confirming that the flight has not taken off for a certain period of time, we need to inform the insurance company to file a claim, prepare relevant materials, such as delay certificates, air tickets, boarding passes, and prepare ID card copies, etc., send them to the insurance company, and wait for the insurance company to review the payment.

You must have encountered this situation. When we purchase the delay insurance, the aircraft is often delayed until the passengers get on the plane before the deadline of 2 hours. This avoids the insurance company paying the compensation fee. More seriously, the airline may let you sit still on the plane and wait after you get on the plane..

Combining blockchain technology can solve two problems encountered here.

(1). The issue of “automated underwriting claims”. Assuming that our policy is recorded on the blockchain, once the aircraft is delayed, the smart contract can automatically determine the claim and transfer the claim amount directly from the insurance company’s account to the customer’s account.

(2). Problems of the objectivity of claims judgment. Insurance companies as insurance bookmakers, the formulation and review of rules can not be completely fair, and the corresponding predict machine equipped with smart contracts on the public chain can solve such fairness problems.

Our smart contract example for flight delay insurance from Pacific Insurance Company is as follows:

See the specific code:

https://github.com/cypherium/ContractExample/tree/master/src/use_case/Insurance

Four interfaces are provided:

1.Set insurance fee

Public static String feeSet(long fee )

2.User buys insurance with token

Public static String buy(long number )

3.User taking a flight-

Public static String flight(String flightNo, long useNumber )

4. Automatically compensate all users according to Flight delays

Public static String flightResult(String flightNo, long delay )

The airline issues a delay insurance token. One token corresponds to one yuan. The user uses money to purchase a certain amount of delay insurance tokens, and then uses the token to purchase multiple delay insurances. Whenever you want to take the plane, enter it on the App. The number of the flight number and the number of used policies, when the airport confirms the delay of the aircraft, the flightResult function is called, and all the insured will be automatically compensated, and the compensation token will be automatically sent to the customer account, and the customer can exchange the token into money at any time.

2. Logistics pledge

In the logistics industry, especially in some minerals, steel, and chemical industries, after the goods are produced, they are often piled up in warehouses. If the manufacturers want to develop again, they often need to pledge the goods in the warehouse to get the funds of the financial company, and then use these themselves. Reproduction is continuously cycled.

As shown below:

In the actual process, due to the involvement of manufacturers, transportation companies, warehouses, quotation filing, financial companies, etc., multi-party coordination and mutual trust costs are very large, the procedures are very cumbersome, the use of blockchain can solve their coordination problems well, improve the parties trust, and manufacturers can quickly get funding to organize new production.

Our example code is as follows:

https://github.com/cypherium/ContractExample/tree/master/src/use_case/Logistics

The following interfaces are provided:

1. Goods into the warehouse

String in(String name, long number )

2. Setting Goods’s token price
String setTokenPrice(String name, long tokenPrice )

3. Pledged goods and get some token

String pledge(String name, long number, String addr /*the Funder*/ )

4. The funder confirm Pledge

String confirmPledge(String name, String addr /*the supplier*/, long number )

5. Release pledge and return token

String releasePledge(String name, long number )

6. Goods out of the warehouse

String out(String name, long number )

7. Get Goods list Info

String getGoodsInfo(String name )

After the goods enter the warehouse, the manufacturer needs to set the price. When the funds are needed, the manufacturer can submit the pledge application. After receiving the application, the financial company will use the account to call confirmPledge to confirm that the completed funds (tokens) will automatically enter the manufacturer. The account and the goods are also locked. The balance of the goods after the manufacturer cannot ship out of the warehouse cannot be less than the locked amount. When the manufacturer needs to release the pledge, only the funds (tokens) need to be returned to the financial company, and the goods are automatically unlocked.

Which can be seen to involve interactive multi-party accounts, due to the characteristics of a good blockchain to help us solve the access control and value transfer automation problems.

3. Blockchain e-commerce

The traditional e-commerce model is highly centralized. As the connection point between the merchant and the user, the platform is almost the only one to shoulder the audit responsibility. In this model, the absence of the credit mechanism directly declares the invalidity of the merchant’s self-certification.

The non-tamperable and traceable features of the blockchain can better establish the trust relationship between users and merchants, uncover the fox tail of fake goods, and let the bad marks of the fake sellers always put on the chain, and fundamentally put an end to it. The corruption of the centralized platform has shaken the lawless elements.

Our example is relatively simple, only contain the function of information setting, transmission and query of goods.

See the specific code

--

--