[Solved] CSE426 Lab 1

$25

File Name: CSE426_Lab_1.zip
File Size: 113.04 KB

SKU: [Solved] CSE426 Lab 1 Category: Tag:
5/5 - (1 vote)
  1. Overview: In this first lab you will learn to develop a Dapp for common problem of balloting or voting. Balloting is used in widely in many situations from choosing a winner in a democracy to deciding a verdict by the members of a jury in legal system. You are required to design and implement an end-to-end decentralized (Dapp) for digital balloting. Each of you should implement balloting for a unique use case.
  2. Description: Balloting is an age old method for realizing consensus among participants with different opinions and opposing views. An online digital balloting opens up its application to diverse applications from a local land dispute resolution to planetary level decision on global governance. You are required to design and develop a Dapp that can enable a trustworthy and transparent online voting system with automatic counting of votes. To address these needs, you will design and implement an Ethereum blockchain-based Dapp.
  3. Your use case: Research about online and digital voting and decide on a unique decentralized problem that you will solve. Lock this unique problem for each of you by discussing it with one of the TAs or the instructor. Think out of the box, think of unusual use cases that may benefit by the use decentralized technologies. Only for Lab1 you can work in groups of no more than 2 people.
  4. Software installation: Before you begin development make sure these tools are installed in your laptop: Get help from your TAs during the block hours and office hours.

1) Truffle: v5.0.27 or latest https://www.npmjs.com/package/truffle 2) Node: v10.15.3 or latest : v10.16.3. https://nodejs.org/en/ 3) npm: 6.4.1 or latest https://www.npmjs.com/getnpm

4) ganache v2.1.1

https://www.trufflesuite.com/ganache

  1. Design and implementation: The core logic of a blockchain-based application is in a smart contract. That is where all the rules and regulation governing the system are coded. The smart contract (SC) encodes the main logic of the decentralized problem by means of its functions, and data, other elements such as events and modifiers. But we need to provide users access to the functions encoded in the smart contract. We plan to do that by adding a web user interface (UI) and a glue code connecting the web UI and the SC. Thus we have two components as shown in figure 1. This will be the standard structure for all the Dapps you will develop in this course.

Figure 1 Overall architecture of a Dapp

Where do you begin your design and development? You will begin with the SC, and the <Dapp>-contract based on the problem requirement. Then move on to develop the <Dapp>-app based on the features of the SC that need to be exposed to the user.

5a: The idea: The idea has to be in application domain where balloting is used. Think of the domain that you are familiar with. Research online. Find a non-trivial, plausible, feasible, and practical use case. Provide a link to the source of your idea or the application you plan to implement. You have to add reasonable number of features (functions) and rules (modifiers) to the base Ballot solution I have provided. Submit a title of your idea and 100 word abstract of your idea. I will discuss what is trivial and what is not during lecture today (9/25).

5b: The design: Explain your idea using use case diagram. Who are actors (users) and what are their roles? What are the use cases? What stimulus invoke the use cases? For example, a person (actor) in her role as a voter and sends a stimulus vote to the vote use case. Now look at the use case I have provided for Ballot. Your idea should result many more non-trivial use cases in the diagram than ones I have provided. That is measure of a significant problem.

  1. Part I: Smart contract design and development: Now lets focus on the development of the Consider the voting sample code in the in Solidity documentation. Analyze the code and design a contract diagram. Also provide a sequence diagram that shows the dynamics of the process of various functions work together to accomplish the task that you stated in the idea. Execute it and understand the functions. Ballot.sol is already pre-loaded in the Remix environment. Compile, deploy and interact with it.

Add any other functions you may need (register(), unregister()?? and others you need based on your choice the problem in step 3. Add other rules you may want to enforce for your use case. For example for your particular use case, voter must be 18 years or older. For another use case, voter must be older than 65 (senior citizen) and so on. If this is a rule, it may be necessary to input the age during registration of the voter.

Figure 2 Ballot user interface on Remix IDE

Using Ballot.sol as the base code, and the contract diagram as the design, develop the smart contract: let it be named XYZBallot.sol where XYZ stands for your use case. It could be an abbreviation of your application. Submit the XYZBallot.sol and an image similar to figure 2 showing the interface of your application on Remix. Demo it to your TA to get full grade.

Reviews

There are no reviews yet.

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

Shopping Cart
[Solved] CSE426 Lab 1
$25