COMP6452 Assignment 1

Assignment 1: A Decentralized Poll Smart Contract (12.5 marks)
For this first assignment, you will 1) write a smart contract and deploy to the public Ethereum Testnet (Rinkeby) and 2) list out potential extension in the contract. The motivation for creating this smart contract is to solve a million-dollar question: Where to have lunch?
The required functions for this smart contract are listed below: (10 marks)
1. The contract creator is able to add n choices
2. Only the contract creator is able to add n choices via deployed contract
3. The contract creator is able to select m friends to vote for n
4. Only the contract creator is be able to add m friends via deployed contract
5. Contract creator shall set q quorum.
6. Anyone can list out all the added choices.
7. Each selected friend can only vote once.
8. The contract must stop accepting vote when q is met
9. Anyone can call the getResult() function to get the result of the poll
10. The creator can destroy the smart contract after the poll
How would you extend the functionality of the smart contract? The description should appear as comments in the contract source code. (2 marks)
• List out function definition, variables declaration, and pseudo-code
• Explain why
——————————————————————————————————————————-
You are required to submit the address of the deployed smart contract, the complete contract source code by week 5 (24 March 2019, AEDT 11.59pm).
• 0.5 mark will be given to those who submit by the deadline.
• 2 marks will be deducted per day for submission after the deadline.
* Plagiarism checker will be used to analyze the submitted code and answer for open question (Changing the name of state variables will not help). UNSW has an ongoing commitment to fostering a culture of learning informed by academic integrity. All UNSW staff and students have a responsibility to adhere to this principle of academic integrity. Plagiarism undermines academic integrity and is not tolerated at UNSW.
CS Help, Email: tutorcs@163.com