Shared Taxi Business on Block-chain with Solidity – 区块链上的共享出租车业务区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Shared Taxi Business on Block-chain with Solidity – 区块链上的共享出租车业务区块链毕设代写 是一篇很好的国外资料

Shared Taxi Business on Block-chain with Solidity


Shared Taxi Business on Block-chain with Solidity - <a href=区块链blockchain上的共享出租车业务”>


A Smart Contract Application

  • Constructor: Called by owner of the contract and sets the manager and other initial values for state variables

  • Join function: Public, Called by participants, Participants needs to pay the participation fee set in the contract to be a member in the taxi investment

  • SetCarDealer: Only Manager can call this function, Sets the CarDealer’s address

  • CarProposeToBusiness: Only CarDealer can call this, sets Proposed Car values, such as CarID, price, offer valid time and approval state (to 0)

  • ApprovePurchaseCar: Participants can call this function, approves the Proposed Purchase with incrementing the approval state. Each participant can increment once.

  • PurchaseCar: Only Manager can call this function, sends the CarDealer the price of the proposed car if the offer valid time is not passed yet and approval state is approved by more than half of the participants.

  • RepurchaseCarPropose: Only CarDealer can call this, sets Proposed Purchase values, such as CarID, price, offer valid time and approval state (to 0)

  • ApproveSellProposal: Participants can call this function, approves the Proposed Sell with incrementing the approval state. Each participant can increment once.

  • Repurchasecar: Only CarDealer can call this function, sends the proposed car price to contract if the offer valid time is not passed yet and approval state is approved by more than half of the participants.

  • ProposeDriver: Only Manager can call this function, sets driver address, and salary.

  • ApproveDriver: Participants can call this function, approves the Proposed Driver with incrementing the approval state. Each participant can increment once.

  • SetDriver: Only Manager can call this function, sets the Driver info if approval state is approved by more than half of the participants. Assume there is only 1 driver.

  • FireDriver: Only Manager can call this function, gives the full month of salary to current driver’s account and fires the driver by changing the address.

  • GetCharge: Public, customers who use the taxi pays their ticket through this function. Charge is sent to contract. Takes no parameter. See slides 5 deposit () function example.

  • ReleaseSalary: Only Manager can call this function, releases the salary of the Driver to his/her account monthly. Make sure Manager is not calling this function more than once in a month.

  • GetSalary: Only Driver can call this function, if there is any money in Driver’s account, it will be sent to his/her address, avoiding recursive calls.

  • CarExpenses: Only Manager can call this function, sends the CarDealer the price of the expenses every 6 month avoiding recursive calls. Make sure. Manager is not calling this function more than once in the last 6 months.

  • PayDividend: Only Manager can call this function, calculates the total profit after expenses and Driver salaries, calculates the profit per participant and releases this amount to participants in every 6 month. Make sure Manager is not calling this function more than once in the last 6 months.

  • GetDividend: Only Participants can call this function, if there is any money in participants’ account, it will be send to his/her address avoiding recursive calls.


区块链blockchain上的共享出租车业务


Shared Taxi Business on Block-chain with Solidity - <a href=区块链blockchain上的共享出租车业务”>


智能合约应用程序

  • 构造函数:由合同所有者调用,并设置状态变量的管理器和其他初始值
  • 连接函数:Public,参与者调用,参与者需要支付合同中规定的参与费,才能成为出租车投资的一员,提供有效时间和审批状态(至0)
  • ApprovePurchaseCar:参与者可以调用此函数,在审批状态递增的情况下批准提议的采购。每个参与者可以增加一次。
  • 购车:只有经理才可以调用此函数,如果报价有效期未过,且审批状态已被超过半数的参与者批准,则发送该卡支付所提议汽车的价格。
  • reprchasecarpropose:只有CarDealer可以调用此函数,设置建议的购买值,例如CarID、price、offer valid time和approval state(为0)
  • ApproveSellProposal:参与者可以调用此函数,在审批状态递增的情况下批准建议的销售。每个参与者可以增加一次。
  • 购车:只有CarDealer可以调用此函数,如果报价有效期尚未过,且审批状态已超过半数参与者批准,则将建议的汽车价格发送到合同中。
  • 建议驱动程序:只有经理才能调用此函数,设置驱动程序地址和工资。
  • ApproveDriver:参与者可以调用此函数,通过增加审批状态来批准建议的驱动程序。每个参与者可以增加一次。
  • SetDriver:只有管理者可以调用此函数,如果审批状态是由超过一半的参与者批准的,则设置驱动程序信息。假设只有一个司机。
  • FireDriver:只有经理才能调用此函数,将当月的工资存入当前司机的账户,并通过更改地址解雇司机。
  • 获取费用:公众,使用出租车的客户通过此功能支付车票。费用已发送到合同中。不带参数。请参阅幻灯片5 deposit()函数示例。
  • 下发工资:只有经理可以调用此函数,每月将司机的工资发放到其账户。确保经理一个月内调用此函数的次数不超过一次。
  • GetSalary:只有司机才可以调用此函数,如果司机的账户里有钱,就会发到他/她的地址,避免递归调用。管理者只能调用这个函数来避免每月的开销。确保。在过去6个月内,管理器调用此函数的次数不超过一次。
  • 派息:只有经理可以调用此函数,计算扣除费用和司机工资后的总利润,计算每个参与者的利润,并在每6个月将该金额发放给参与者。确保经理在过去6个月内调用此函数的次数不超过一次。
  • getdivident:只有参与者可以调用此函数,如果参与者的帐户中有钱,则会发送到参与者的地址,避免递归调用。在
  • getdivident:只有参与者可以调用这个函数,如果参与者的账户中有钱,它会被发送到他/她的地址,避免递归调用。

  • PayDividend: Only Manager can call this function, calculates the total profit after expenses and Driver salaries, calculates the profit per participant and releases this amount to participants in every 6 month. Make sure Manager is not calling this function more than once in the last 6 months.

  • GetDividend: Only Participants can call this function, if there is any money in participants’ account, it will be send to his/her address avoiding recursive calls.

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Shared Taxi Business on Block-chain with Solidity – 区块链上的共享出租车业务区块链毕设代写

提供最优质的资源集合

立即查看 了解详情