99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

COMP5125M代做、Java/Python程序代寫

時(shí)間:2024-05-02  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



School of Computing: Assessment Brief
Module title Blockchain Technologies
Module code COMP5125M
Assignment title Coursework
Assignment type
and description
It is a programming assignment where students are required to develop smart contracts for carpooling system.
Rationale
The aim of this assignment is to evaluate the students’
knowledge of blockchain based systems and smart contract development skills
Word limit and
guidance N/A
Weighting 30%
Submission deadline 3.5.2024
Submission
method Student will upload their assignment on Gradescope
Feedback provision Feedback will be provided online through Gradescope
Learning outcomes
assessed
Design decentralized applications and implement smart
contracts, Understand the context to which distributed
ledgers are applied
Module lead Evangelos Pournaras
Other Staff contact Zhuolun Li
1
1 Assignment Guidance
Context
Carpooling, also known as car sharing or ride sharing, involves individuals
sharing a single vehicle for travel in the same direction or to a common destination, instead of driving separate cars. The primary aim of carpooling is to
reduce the number of vehicles on the road, offering a sustainable transportation option. It addresses challenges such as traffic congestion, environmental
impact, fuel costs, and energy conservation, while increasing social interaction among people.
A blockchain-based carpooling service offers distinct advantages over traditional, centralized carpooling apps. Its primary benefit is to enhance trust
among users, thanks to the transparent and immutable nature of blockchain
technology. Furthermore, blockchain enables smart contract-based, automatic payment settlements, ensuring fair compensation for drivers. This approach not only simplifies the payment process but also reduces intermediary
fees. Overall, a blockchain-based carpooling system enhances transparency,
security, and efficiency, providing a more trustworthy and cost-effective solution compared to conventional carpooling apps. In this coursework, you are
required to develop a smart contract in Solidity for a carpooling system.
Scenario
This coursework focuses on a carpooling system with two types of participants: drivers and passengers, in a simplified scenario described below:
• Rides: Only drivers can create rides. It is assumed that drivers are
honest in attending and completing rides. Passengers can view available
rides and book seats. Passengers are assumed to always attend the rides
they book, hence ride cancellations are not considered.
• The map: The system operates on a map with three independent
locations: A, B, and C. Vehicles can travel between these points (e.g.,
A to B, B to C). Passengers can book a ride only if the starting point
and destination match their travel requirements.
• Time tracking: For simplicity, we assume rides are created one day
ahead of the travel date, eliminating the need to track days. Journey
2
start times, precise to the hour, should be recorded. Time can be
represented as an unsigned integer from 0 to 23 in the smart contract,
where 0 represents 00:00, 1 represents 01:00, and so on.
• Payment: Ether is the currency used in the system. Passengers must
pay for their seat in Ethers in advance when booking a ride. The seat
price, set by the driver, is automatically transferred to the driver‘s
account once the ride is marked as complete.
The Smart Contract
You are provided with a template for the smart contract in contract template.sol.
This template outlines the structure and essential functionalities that you
need to implement. The details of these functionalities are as follows:
Basic Functionalities
• Registration: Before using any other functions, a blockchain address
must register as either a driver or a passenger in the contract. For instance, the function to create a ride should only be used by a registered
driver, and the function to join a ride should verify if the caller is a
registered passenger.
• Rides creation and recording: Drivers can create rides by providing
information including:
– travel time (journey start time, represented as an unsigned integer
from 0 to 23)
– available seats in the ride
– price of a seat
– starting point of the ride
– destination of the ride
When rides are stored in the smart contract, additional information
should be recorded, including:
– unique ID of the ride (starts counting from 0)
– blockchain address of the driver
3
– status of the ride (the possible status are BookingOpen, FullyBooked, Started, Completed)
– blockchain addresses of the passengers who have booked the ride
The function should include necessary checks to ensure the ride is valid:
the travel time should be a number between 0 and 23; the starting point
and destination should be different; the price of a seat should be greater
than zero; the available seats should be greater than zero.
• Rides querying: Passengers can find suitable rides by using the findRides function. This function returns all ride IDs that match the passenger’s starting point and destination and are in BookingOpen status.
Passengers can then query detailed information about a ride using the
getRideById function provided in the template.
• Rides booking: Passengers book rides using the joinRide function,
which requires a deposit of the seat price in Ethers. This function
updates the available seats and passenger addresses accordingly. It
also updates the ride status to FullyBooked when all seats are booked.
• Starting and completing rides: On departs, drivers call the startRide function to update the ride status to Started. On completing
rides, they use the completeRide function to mark the ride as Completed, which triggers the transfer of the passengers’ payments to the
driver’s account.
Coordination Mechanism
In the current setup, passengers individually book rides by manually selecting the most suitable option and sending a booking request to the contract.
However, with access to information about all available rides and the preferences of all potential passengers, more efficient arrangements can be made.
For instance, consider a scenario where two available rides go from point
A to point B, each with only one seat left. One departs at 8:00, the other
at 14:00. Two passengers, Alice and Bob, wish to travel from A to B. Alice
prefers to leave at 6:00, and Bob at 10:00. If they book separately and Bob
books first, he would likely choose the 8:00 ride, closer to his preferred time.
This leaves Alice with the 14:00 ride, which is far from her preferred time.
However, through coordination, we could arrange for Bob to take the 14:00
4
ride and Alice the 8:00 ride. This adjustment would result in a smaller total
deviation from their preferred travel times.
Let’s denote the preferred travel time of a passenger as tpreferred and the
actual travel time as tactual. The travel time deviation is calculated as
|tpreferred − tactual|. The total travel time deviation is the sum of travel
time deviation of all passengers. In the example above, the original total
travel time deviation is |10 − 8| + |6 − 14| = 10. If Alice and Bob agree to
coordinate, the total travel time deviation is |10 − 14| + |6 − 8| = 6.
The aim of the coordination mechanism is to minimize the total travel
time deviation in a gas-efficient way. It is crucial that this goal is achieved
without excluding passengers from ride assignments. If an available ride
matches a passenger’s starting point and destination, they must be assigned
to that ride, regardless of the travel time deviation. Failure to do so will
result in a very low mark in this part.
To implement this, complete two functions in the template: awaitAssignRide and assignPassengersToRides, detailed below:
• awaitAssignRide: Passengers who opt for coordination use this function instead of joinRide. They provide their starting and destination
points, preferred travel time, and the price they are willing to pay.
The price they are willing to pay is transferred to the contract as the
deposit. The function ensures the deposit is in place before recording
the passenger’s information. For simplicity, assume coordinating passengers always pay a good amount of deposits that are enough to join
any rides (so you don’t need to worry about this factor when assigning
rides). Rather than immediately assigning a ride, this function records
the passenger’s information in the contract, awaiting the assignPassengersToRides function call.
• assignPassengersToRides: This function, executed by the system,
assigns rides to passengers who have used awaitAssignRide. It aims to
minimize the sum of differences between passengers’ preferred and actual travel times. You are free to implement any assignment algorithm
that meets this objective. Remember, when assigning a passenger to
a ride, update the available seats, passenger addresses, and potentially
the ride status, similar to the joinRide function. Moreover, if the allocated price is cheaper than the price a passenger prepaid, the difference
should be refunded to the passenger; if a passenger is not assigned to
any ride, the deposit should be fully refunded.
5
There are no restrictions on the data structures or auxiliary functions you
can use to implement the coordination mechanism. Grading will be based on
(1) the correctness of the implementation, e.g. one passenger should not be
able to call awaitAssignRide twice, assignPassengersToRides should
assign passengers to rides where it is possible; (2) the effectiveness of the
coordination mechanism in reducing the total travel time deviation; and (3)
the gas efficiency of the implementation.
2 Tasks and Requirements
Based on the information provided above, you are required to complete the
following tasks:
1. Complete the smart contract template provided in contract template.sol.
You are required to complete the basic functionalities and the coordination mechanism.
• You are allowed (but not required) to: add auxiliary functions,
structures, contract variables, as per your requirements. For example, your findRide function can call another function you created to check if a ride matches the passenger‘s travel requirements.
• You are not allowed to: change or delete anything declared in
the template, including structs, function names, input parameters
and return values in the template. External libraries are also
not allowed. Failure to do so will make your contract fail tests,
resulting in zero grading.
2. Complete a short documentation in the markdown file using the template provided in readme template.md. The template provides instructions on what to include in the documentation. You are required to:
• Provide a brief description of your proposed coordination mechanism.
• If you use additional data structures, auxiliary functions other
than the one provided in the template, please provide a short
rationale.
• If you implement any test cases to test your smart contract, please
provide a short description of the test cases.
6
Recommended Development Environment
You are recommended to use Hardhat as your development environment.
To set up the development environment, follow the steps below as a general
guidelines (more resources for Hardhat can be found on Minerva):
1. Install Hardhat on your computer.
2. Create a new Hardhat JavaScript project with npx hardhat init. Use
the default settings.
3. Copy the template file contract template.sol to the /contracts folder of
the project.
4. Copy the test file basic contract test.js to the /test folder of the project.
5. Implement the smart contract and test it using npx hardhat test.
Contract Size Limit
Ethereum has a limit of 24576 bytes for the code size of a smart contract.
You must keep the contract size below this limit. If you see a warning about
the contract size when compiling, or an error of deployment failure due to
the contract size when running tests, it means your contract is too large.
If you reach the limit, it is likely because you implemented a sophisticated coordination mechanism that requires a large amount of code. In this
case, you can move some coordination logic (with auxiliary functions) to a
library while keeping awaitAssignRide and assignPassengersToRides
functions. In this case, you must name the library Coordination for it to
be correctly graded by the test cases. If it still exceeds the limit, here are
other solutions to follow.
3 General guidance and study support
The reading list and study support material will be available on Minerva.
Refer to the lab manuals and the smart contract development lecture slides
for the course. You can also refer to the Solidity documentation and the
Ethereum documentation for additional information.
7
4 Assessment criteria and marking process
The assessment criteria are provided at the end of this document in the form
of rubrics. Please refer to Section 8 of the document.
Before submitting your work, you are strongly recommended using the
test cases provided in basic contract test.js to make sure your implementation
of the basic functionalities is correct. As the assignment will be marked
by Autograder on Gradescope, your smart contract will be tested using a
comprehensive set of test cases that are not limit to the provided basic test
cases.
The grading test cases include: (1) Unit testing of each functions in both
positive (e.g. registered driver should be able to create a ride) and negative
(e.g. unregistered addresses try to create rides) cases. (2) Integration testing of the whole system that simulates scenarios with multiple drivers and
passengers interacting with the system.
Therefore, it is also recommended writing your own test cases with different scenarios to test the behaviour for your smart contract. If you implement
any additional test cases, briefly discuss what you tested in the readme file
in your deliverables. The test cases you write are not used for grading, but
could be used as additional reference in the case of having unexpected auto
grading outputs of your smart contract.
Important: You are responsible for ensuring your contract compiles correctly. Failure to compile will result in a mark of zero. This includes making
sure the contract code size below the limit of 24576 bytes. Moreover, ensure
the basic functionalities (e.g. passengerRegister, driverRegister, createRide,
joinRide) are working correctly because the advanced test cases are based
on the basic functionalities. Failure to do so will result in very low marks.
5 Deliverables
You are required to upload on Gradescope: (1) your code file(s) of smart
contracts along with (2) a text (readme.md) file. In the readme file, you
are required to give an overview of the proposed coordination mechanism.
8
6 Submission requirements
This is an individual assignment (no teams). Submit your files on Gradescope and names of your files should be as follows:
Firstname Surname readme.md
car pooling.sol
7 Academic misconduct and plagiarism
• Students at University of Leeds are part of an academic community
that shares ideas and develops new ones.
• You need to learn how to work with others, how to interpret and present
other people’s ideas, and how to produce your own independent academic work. It is essential that you can distinguish between other
people’s work and your own, and correctly acknowledge other people’s
work.
• All students new to the University are expected to complete an online
Academic Integrity tutorial and test, and all Leeds students should
ensure that they are aware of the principles of Academic integrity.
• Generative artificial intelligence systems, such as ChatGPT, are not
allowed in this assignment.
• When you submit work for assessment it is expected that it will meet
the University’s academic integrity standards.
• If you do not understand what these standards are, or how they apply
to your work, then please ask the module teaching staff for further
guidance.
9
8 Assessment/marking criteria grid
Requirement and delivery
> **% All functions are correctly implemented. The assignPassengersToRides function effectively reduces the total
travel time deviation in all test scenarios compared to
the non-coordinating approach under the same setting.
The implementation of functions is gas efficient.
< **% All functions are correctly implemented. The assignPassengersToRides function reduces the total travel time
deviation in some test scenarios compared to the noncoordinating approach under the same setting. Gas efficiency can be improved.
< 70% All functions are correctly implemented. The assignPassengersToRides function is able to assign passengers to
rides, the assignment does not improve on total travel
time deviation compared to the non-coordinating approach under the same setting.
< 60% The basic functions including register drivers, register
passengers, create ride, find rides, join ride are correctly implemented. Coordination mechanism is proposed but the functions awaitAssignRide and assignPassengersToRides are not fully functioning.
< 50% If smart contract is not compiling or smart contract fails
to perform register drivers, register passengers, create
ride, find rides, join ride, start ride or complete ride
correctly. Coordination functions awaitAssignRide and
assignPassengersToRides are not completed.
請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp











 

掃一掃在手機(jī)打開當(dāng)前頁(yè)
  • 上一篇:菲律賓南部有什么大學(xué)嗎 有哪些著名大學(xué)
  • 下一篇:COM398SUST代做、代寫Java/Python程序
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開團(tuán)工具
    出評(píng) 開團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
  • 短信驗(yàn)證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                成人av网址在线| 捆绑紧缚一区二区三区视频 | 久久精品国产亚洲a| 国产视频一区不卡| 7777精品伊人久久久大香线蕉最新版| 亚洲人成精品久久久久| 一区在线观看视频| 精品日韩一区二区| 91精品久久久久久久91蜜桃| 日本韩国欧美在线| 日本欧美一区二区三区乱码| 日韩福利电影在线| 亚洲主播在线播放| 久久麻豆一区二区| 91一区一区三区| 中文字幕中文字幕一区二区| 国产精品99精品久久免费| 久久精品夜夜夜夜久久| 国产精品99久久久久久久vr| 国产视频一区在线播放| 欧美日韩另类国产亚洲欧美一级| 午夜视频在线观看一区二区三区| 日韩一区二区三区视频在线| 国产一区二区看久久| 中文字幕日本不卡| 日韩影视精彩在线| 欧美精品一区二区三区蜜桃视频 | 日韩你懂的在线播放| 成人a区在线观看| 欧美怡红院视频| 欧美性大战久久久久久久| 欧美视频中文一区二区三区在线观看 | 在线电影院国产精品| 欧美日韩国产综合草草| 欧美日韩国产小视频在线观看| 91久久国产最好的精华液| 91久久精品一区二区三区| 99国产欧美另类久久久精品| 成人精品免费网站| 久久精品视频免费| 日韩电影一区二区三区| 中文字幕巨乱亚洲| 久久综合久久99| 一区二区三区国产豹纹内裤在线 | 国产成人在线观看| 色呦呦网站一区| 亚洲一区二区在线视频| 在线日韩国产精品| 久久国产精品99久久久久久老狼 | 久久精品人人做人人综合 | 蜜臀av亚洲一区中文字幕| 色婷婷一区二区三区四区| 国产91丝袜在线播放九色| 欧美三区在线观看| 久久综合999| 中文字幕在线观看一区二区| 国模无码大尺度一区二区三区| 亚洲精品综合在线| 日韩一区二区三区在线| 91久久免费观看| 欧美另类videos死尸| 91精品国产综合久久久久久久| 欧美一区二区三区男人的天堂| 久久夜色精品一区| 91精品欧美福利在线观看| 亚洲欧洲色图综合| 性做久久久久久久久| 国产最新精品精品你懂的| 国产喂奶挤奶一区二区三区| 欧美日韩一区二区不卡| 成人自拍视频在线观看| 亚洲大型综合色站| 成人免费看黄yyy456| 欧美va在线播放| 欧美亚洲动漫制服丝袜| 精品一区二区三区不卡| 91网址在线看| 91亚洲精品久久久蜜桃网站| 亚洲成人激情自拍| 国产亚洲欧洲997久久综合| 国内成+人亚洲+欧美+综合在线| 国产精品久久三区| 国产女人18水真多18精品一级做 | 6080亚洲精品一区二区| 麻豆精品一区二区三区| 悠悠色在线精品| 亚洲美腿欧美偷拍| 欧美激情中文不卡| 精品国产sm最大网站| 欧美午夜精品理论片a级按摩| 亚洲六月丁香色婷婷综合久久| 欧美日本在线视频| 一本色道久久加勒比精品 | 91麻豆精品国产91久久久更新时间| 成人午夜精品在线| 美女脱光内衣内裤视频久久影院| 亚洲高清免费观看 | 欧美国产一区二区在线观看 | 国产亚洲一本大道中文在线| 国产欧美精品一区二区色综合 | 亚洲午夜视频在线| 精品sm捆绑视频| 国产成人在线观看免费网站| 国产白丝网站精品污在线入口| 成人国产精品视频| 色妹子一区二区| 日韩欧美国产精品一区| 国产精品久99| 一区二区理论电影在线观看| 麻豆精品在线播放| 欧美日韩一级黄| 欧美系列在线观看| 国产女同性恋一区二区| 欧美videos大乳护士334| 日韩一区二区影院| 中文字幕色av一区二区三区| 日韩精品一级二级| 日本大香伊一区二区三区| 日韩欧美一区二区在线视频| 亚洲欧洲成人av每日更新| 亚洲成人动漫在线免费观看| 蜜桃免费网站一区二区三区| 欧美怡红院视频| 99r国产精品| 久久国产精品区| 欧美色区777第一页| 国产精品一区久久久久| 欧美精品一二三| 99精品黄色片免费大全| 日韩精品一区二区三区视频播放| 久久亚洲精品小早川怜子| 国产精品视频麻豆| 亚洲最大成人综合| 欧美一卡2卡三卡4卡5免费| 成人精品视频一区二区三区尤物| 午夜国产精品影院在线观看| 国产精品婷婷午夜在线观看| 欧美日韩aaa| 欧美精品一二三区| 欧美日本免费一区二区三区| 欧美日韩一区二区三区视频| 久久国产欧美日韩精品| 亚洲国产日日夜夜| 亚洲欧洲一区二区三区| 日本一区二区三区国色天香 | 欧美老人xxxx18| 国产成人精品1024| 欧美性色综合网| 青娱乐精品视频在线| 欧美网站大全在线观看| 美女国产一区二区| 中文字幕在线播放不卡一区| 欧美精品高清视频| 国产91综合网| 日韩高清国产一区在线| 日韩精品91亚洲二区在线观看| 日本成人在线不卡视频| 日韩不卡一区二区三区| 国产在线不卡一区| 亚洲午夜影视影院在线观看| 国产偷国产偷亚洲高清人白洁| 欧美日韩色综合| 在线中文字幕一区| 成人免费毛片嘿嘿连载视频| 国产一区啦啦啦在线观看| 精品亚洲成a人| jizzjizzjizz欧美| 91丨九色丨尤物| 日本二三区不卡| 91精品办公室少妇高潮对白| 91麻豆视频网站| 欧美日韩亚洲不卡| www.亚洲在线| 欧美精品一卡两卡| 5566中文字幕一区二区电影| 欧美日韩高清在线| 中文字幕不卡在线播放| 无码av免费一区二区三区试看| 国产综合一区二区| 欧美视频中文字幕| 国产精品日产欧美久久久久| 日本不卡视频在线观看| 99久久免费精品| 日韩免费看的电影| 日韩美女精品在线| 韩国一区二区三区| 欧美日韩精品一区二区三区| 欧美xxxx老人做受| 一区二区三区中文字幕| 国产一区二区美女| 精品久久国产字幕高潮| 性做久久久久久免费观看| 精品亚洲porn| 538在线一区二区精品国产| 日韩欧美一级精品久久| 免费高清在线一区| 91麻豆精品91久久久久同性| 蜜臀av一区二区三区| 欧美zozo另类异族| 国产伦精品一区二区三区免费|