CarOwnerShip – Solidity – 汽车所有权-坚固性区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,CarOwnerShip – Solidity – 汽车所有权-坚固性区块链毕设代写 是一篇很好的国外资料

CarOwnerShip – Solidity

Introduction

This Codes are made for Lecture of Blockchain Theory and Practice was held in Utretch Summer School of Netherlands.

Our team made the business model of Car Recode and also made the Blockchain System using Solidity programming language.

Now I will go on an explanation about the concept of the business model and special part of codes

UML of Car Onwership

The Picture shown below is UML of our business Model.

There are 7 nodes(Buyer, Government, Dealer, Seller, Insurancer, Maintenance, Recycle).

Each node can access Car(Object) specific function.

And Our team made the each Object and its function based on this diagram.

CarOwnerShip - Solidity - 汽车所有权-坚固性

SwimLane Image of Car Onwership

This is the SwimLane Of Car Ownership process.

The left part of the picture(looked like 5 SwimLane) represents the process of car ownership proceeded by each node.

The right part of the picture represents the On-blockchain Part. Also, we put the two-sided-arrow-signal to explain what information is linked to the On-blockchain part and Off-blockchain part.

CarOwnerShip - Solidity - 汽车所有权-坚固性

Composition of CarOwnership

  1. carOwnership

  2. carTransantionBC

carOwnership

contract CarOwnership {      struct CarMasterInfo {                CarRecord carRecord;        repairRecord [] repairRecords;        accidentRecord [] accidentRecords;        transanctionRecord [] transanctionRecords;        rentalRecord [] rentalRecords;     }          struct CarRecord     {         string dateOfMainterancet;         string originOfMainternace;         string vin;         string model;         string make;         int numCyclinders;         int numEngine;         int mileage;     }      struct repairRecord     {         string dateRepaired;         string timeRepaired;         string service;     }          struct accidentRecord     {         string dateAccident;         string timeAccident;         string description;     }          struct transanctionRecord     {         string dateTransanction;         string amount;         string buyerDesc;         string sellerDesc;     }          struct rentalRecord     {         string dateRental;         int rentalDays;         string rentToDesc;         string rentByDesc;     }      function setCarRecord(string _dateOfMainterancet,         string _originOfMainternace,         string _vin,         string _model,         string _make,         int _numCyclinders,         int _numEngine,         int _mileage)     {         dateOfMainterancet = _dateOfMainterancet;         originOfMainternace = ;         string vin;         string model;         string make;         int numCyclinders;         int numEngine;         int mileage;     } }

CarTransantionBC

contract CarTransanctionBC  {     uint public currentBalance;     uint private transanctionCount;//count how many repair?          address public myaddress =0x068eF6F367c6E54266A14041dCE460D5A62dDb3e;     address public seller=0x43EFa709c7f973667232dEFf99F79D5399cd8aAA;      function awardTokken(uint amount ) public // award tokken function     {         seller.transfer(amount);     }          function depositTokken()public payable     {// deposit` tokken function      }              function withdraw() public     {         myaddress.transfer(address(this).balance);     }          function getBallance() public     {         currentBalance  = address(this).balance;     }           function concenString(string str1,string str2) public returns (string)     {         bytes memory newString;                bytes memory str1b = bytes(str1);         bytes memory str2b = bytes(str2);                  uint str1l=bytes(str1).length;         uint str2l=bytes(str2).length;                  uint a = 0;         uint b = 0;                  for(uint i=0; i< (str1l+str2l); i++)         {                          if(a<str1l)             {                 newString[i]=str1b[a] ;                 a=a+1;                              }else             {                 newString[i]=str2b[b];                 b=b+1;             }                      }                  return string(newString);     }          struct transanctionRecord     {         string dateTransanction;         string amount;         string buyerDesc;         string sellerDesc;     }          mapping(uint => transanctionRecord) trans; //  **craete constructor by mapping**          function setTransanctionRecord(         string _dateTransanction,         string _amount,         string _buyerDesc,         string _sellerDesc)     {         trans[transanctionCount].dateTransanction = _dateTransanction; //linked the constructor         trans[transanctionCount].amount = _amount;         trans[transanctionCount].buyerDesc = _buyerDesc;         trans[transanctionCount].sellerDesc = _sellerDesc;                  addTransanctionCount();                  awardTokken(10); // input information, give tokken 10     }        // individual print     function getDataTransanction() public returns (string)     {         string memory str;                  for(uint i=0; i<transanctionCount; i++)         {              concenString(str,trans[transanctionCount].dateTransanction);             concenString(str,",");                          concenString(str,trans[transanctionCount].amount);             concenString(str,",");                          concenString(str,trans[transanctionCount].buyerDesc);             concenString(str,",");                          concenString(str,trans[transanctionCount].sellerDesc);             concenString(str,",");                          return str;         }     }                function CarTransanctionBC() public     {         transanctionCount=0;         currentBalance=0;     }          function addTransanctionCount() public     {         transanctionCount++;     }          function getTransanctionCount() public returns (uint)     {         return transanctionCount;     }        } 

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.


CarOwnerShip – Solidity

Introduction

本代码是为在荷兰乌特利奇暑期学校举办的区块链blockchain理论与实践讲座而编写的。

我们的团队制作了汽车识别的商业模式,并使用Solidity编程语言制作了区块链blockchain系统。

现在我将对业务模型的概念和代码的特殊部分进行解释

UML of Car Onwership

下图是我们业务模型的UML。

共有7个节点(买方、政府、经销商、卖方、保险商、维护、回收)。

每个节点都可以访问特定于车辆(对象)的功能。

我们的团队根据这个图表制作了每个对象及其功能。

CarOwnerShip - Solidity - 汽车所有权-坚固性

SwimLane Image of Car Onwership

<CarOwnerShip - Solidity>

这是拥有汽车过程的泳道。

图片左侧(看起来像5条泳道)代表了每个节点的汽车拥有过程。

图片右侧代表区块链blockchain上的部分。此外,我们使用双面箭头信号来解释哪些信息链接到了区块链blockchain上和链外部分。

Composition of CarOwnership

  1. carOwnership

  2. <CarOwnerShip - Solidity>

carOwnership

contract CarOwnership {      struct CarMasterInfo {                CarRecord carRecord;        repairRecord [] repairRecords;        accidentRecord [] accidentRecords;        transanctionRecord [] transanctionRecords;        rentalRecord [] rentalRecords;     }          struct CarRecord     {         string dateOfMainterancet;         string originOfMainternace;         string vin;         string model;         string make;         int numCyclinders;         int numEngine;         int mileage;     }      struct repairRecord     {         string dateRepaired;         string timeRepaired;         string service;     }          struct accidentRecord     {         string dateAccident;         string timeAccident;         string description;     }          struct transanctionRecord     {         string dateTransanction;         string amount;         string buyerDesc;         string sellerDesc;     }          struct rentalRecord     {         string dateRental;         int rentalDays;         string rentToDesc;         string rentByDesc;     }      function setCarRecord(string _dateOfMainterancet,         string _originOfMainternace,         string _vin,         string _model,         string _make,         int _numCyclinders,         int _numEngine,         int _mileage)     {         dateOfMainterancet = _dateOfMainterancet;         originOfMainternace = ;         string vin;         string model;         string make;         int numCyclinders;         int numEngine;         int mileage;     } }

CarTransantionBC

contract CarTransanctionBC  {     uint public currentBalance;     uint private transanctionCount;//count how many repair?          address public myaddress =0x068eF6F367c6E54266A14041dCE460D5A62dDb3e;     address public seller=0x43EFa709c7f973667232dEFf99F79D5399cd8aAA;      function awardTokken(uint amount ) public // award tokken function     {         seller.transfer(amount);     }          function depositTokken()public payable     {// deposit` tokken function      }              function withdraw() public     {         myaddress.transfer(address(this).balance);     }          function getBallance() public     {         currentBalance  = address(this).balance;     }           function concenString(string str1,string str2) public returns (string)     {         bytes memory newString;                bytes memory str1b = bytes(str1);         bytes memory str2b = bytes(str2);                  uint str1l=bytes(str1).length;         uint str2l=bytes(str2).length;                  uint a = 0;         uint b = 0;                  for(uint i=0; i< (str1l+str2l); i++)         {                          if(a<str1l)             {                 newString[i]=str1b[a] ;                 a=a+1;                              }else             {                 newString[i]=str2b[b];                 b=b+1;             }                      }                  return string(newString);     }          struct transanctionRecord     {         string dateTransanction;         string amount;         string buyerDesc;         string sellerDesc;     }          mapping(uint => transanctionRecord) trans; //  **craete constructor by mapping**          function setTransanctionRecord(         string _dateTransanction,         string _amount,         string _buyerDesc,         string _sellerDesc)     {         trans[transanctionCount].dateTransanction = _dateTransanction; //linked the constructor         trans[transanctionCount].amount = _amount;         trans[transanctionCount].buyerDesc = _buyerDesc;         trans[transanctionCount].sellerDesc = _sellerDesc;                  addTransanctionCount();                  awardTokken(10); // input information, give tokken 10     }        // individual print     function getDataTransanction() public returns (string)     {         string memory str;                  for(uint i=0; i<transanctionCount; i++)         {              concenString(str,trans[transanctionCount].dateTransanction);             concenString(str,",");                          concenString(str,trans[transanctionCount].amount);             concenString(str,",");                          concenString(str,trans[transanctionCount].buyerDesc);             concenString(str,",");                          concenString(str,trans[transanctionCount].sellerDesc);             concenString(str,",");                          return str;         }     }                function CarTransanctionBC() public     {         transanctionCount=0;         currentBalance=0;     }          function addTransanctionCount() public     {         transanctionCount++;     }          function getTransanctionCount() public returns (uint)     {         return transanctionCount;     }        } 

carOwnership

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/18431.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » CarOwnerShip – Solidity – 汽车所有权-坚固性区块链毕设代写

提供最优质的资源集合

立即查看 了解详情