[SOLVED] CS IS3101 Cryptocurrency & Blockchain (2021/22 Semester B)

$25

File Name: CS_IS3101_Cryptocurrency_&_Blockchain_(2021/22_Semester_B).zip
File Size: 546.36 KB

5/5 - (1 vote)

IS3101 Cryptocurrency & Blockchain (2021/22 Semester B)
Department of Information Systems, College of Business, City University of
Individual Assignment: Auction Smart Contract [10%] Intended Learning Outcomes:
ILO1: Explain the concepts related to cryptocurrency, blockchain, and distributed ledger technologies. ILO3: Evaluate security issues related to cryptocurrency and blockchain.

Copyright By Assignmentchef assignmentchef

Part 1. Problem Statement
Consider the problem of Chinese auction or penny social. We will refer to it as simple Auction. It is a conventional approach used for fundraising for a cause. The organizers collect gifts to be auctioned off for raising funds. Before the auction, the gifts for auctions are received and arranged each with a bowl to place the bid. A chairperson is a special person among the organizers. She/he heads the effort and is the only person who can determine the winner by random drawing at the end of the auction. A set of donors buy sheets of tickets with their money. The donors ticket has a stub that identifies the donors number, and tokens bought.
The donors examine the gifts to bid, place the one or more tickets in the bowl in front of the gifts they desire to bid for until all the tickets are used. After the auction period ends, the chairperson, collects the bowls, randomly selects a ticket from each gifts bowl to determine the winning donor for that gift. The gift is transferred to the winning donor. Total money collected is the fund raised by the penny social auction.
Assumptions:
The description given above is for a general penny social auction. For the sake of our project implementation, we will introduce some simplifying assumptions. Here they are:
1. Fixed number of donors, initialized to 4. All 4 need to self-register. Funds transfer from donor is automatically done and is not in the scope of this application.
2. Fixed number of gifts to be auctioned off, initialized to 3.
3. Gifts auctioned are indexed from 0N-1 where N is the number of gifts for auction. N is 3.
4. Each donor buys just 1 sheet of tickets or tokens; each sheet has only 5 tokens.
5. Assume simple number for the serial numbers for the sheet of tickets: 0,1,2,3. Here we show
the tokens of donor 0 and 1.
00000 11111 .. n-1 n-1 n-1 n-1 n-1
For n donors and so on.
Page 1 of 3

IS3101 Cryptocurrency & Blockchain (2021/22 Semester B)
Department of Information Systems, College of Business, City University of
Part 2. Design
Lets design the smart contract for this. Visualize the situation using the screen shot given below.
These are the pictures of gifts; we need to define Gifts in the smart contract. We will also need to define Donors who will bidding on the Gifts. We will also need some supporting data variables.
The functions are similar to the Ballot of our lessons. Constructor that initializes the owner, register that allows (decentralized person) to register online to get the tokens and start bidding, bid function that lets a donor bid, and finally revealWinner(), to randomly choose the winner for the gift auctioned. Here is our design. Always to design first. The Auction smart contract has Gift and Donor structs and other data items such as array of Gifts, array of Donors, array of winners, mappings, and beneficiary address.
constructor() register()
bid() revealWinner() getDonorDetails giftTokens
addr remainingTokens
giftId giftTokens
Page 2 of 3

IS3101 Cryptocurrency & Blockchain (2021/22 Semester B)
Department of Information Systems, College of Business, City University of
Part 3. Implementation
We have provided the partial code templates for you to start with.
Please understand the problems before you proceed.
Copy the template into your Remix IDE. Complete the code. You will need to fill in the code at
o *ONLY*atthelocations/lineindicated. o Testittoseeifitisoperational.
o There are 7 tasks where you will fill in the code. You need to review the code given and understand it fully before you start adding code. This partial code is available in the Canvas individual assignment section as iAssg_template.sol.
Part 4. Testing on Remix:
Test the completed code by compiling and running it on Remix JavaScript VM.
(i) Account 0 provided by JavaScript VM is the Auction beneficiary and will not bid.
(ii) Navigate to each of the other accounts, and register. You will register four donors
using register function.
(iii) The next step is for the donors to each bid; for test purposes, you can execute the bid
function with {{0,1}{1,1}{2,1} } for each of the four donor accounts.
(iv) Next, execute the revealWinner() function to determine the winner for each gift
(v) The getter of the winners data can be executed with {0, 1 and 2} as a parameter in
sequence to reveal the winners of the draw respectively. You can do a lot of more testing and exploration with the buttons provided by the Remix web interface.
Part 5. Submit your work
Please submit your smart contract and some screen captures on your test results.
Upload to Canvas folder Individual Assignment Submission.
Deadline: Week 12 Sunday, 23:59.
Late submission will result in 10%/day deduction.
Reference:
https://docs.soliditylang.org/en/v0.5.11/solidity-by-example.html
Page 3 of 3

CS: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS IS3101 Cryptocurrency & Blockchain (2021/22 Semester B)
$25