Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

nspired by proof - of - stake, Amir would like to create an Ethereum smart contract in which people can lock up their funds (

nspired by proof-of-stake, Amir would like to create an Ethereum smart contract in which
people can lock up their funds (in ether) and then vote on a very important matter. The matter
can be resolved in one of ways, thus each persons vote is an integer {1,2,...,}. Amir is
asking for your help. Specifically, he would like to have a protocol (explained in English in a
pdf file) and a smart contract (implemented in solidity) that provides as many of the following
functionality/desired properties as possible:
a. Anyone on the Ethereum network can sign up in the protocol by depositing 1 ether. One
may sign up several times and thus pay a larger overall deposit.
b. At the end of the protocol, everyone can get their deposits back. The returned value may
be a bit smaller than the original deposit, e.g.0.9 ether, if you need to pay for something in
your protocol.
c. Each deposit of 1 ether entitles the depositor to one vote.
d. After a particular deadline 1, the contract stops accepting deposits and instead only accepts
votes by those who have already deposited money.
e. No one can vote twice for the same deposit.
f. After a later deadline 2, the contract stops accepting votes.
g. After an even later deadline 3, everyone with access to the blockchain should be able to
figure out which option from the set {1,2,...,} received the maximum number of votes. If
there is a tie, you can break it arbitrarily as you wish.
h. No one should be able to know another persons vote.
i. If Alice has voted for in {1,2,...,} and she wants to prove this to Bob, she should be able
to do so. You can assume that Bob has access to the blockchain.
j. Your contract should not have any of the security vulnerabilities discussed in the lectures.
k. Your contract should use as little gas as possible and be affordable. You should find out
exactly how much gas each one of your functions uses in the worst case and report it in
your pdf file.
Finally, you are allowed to have participants in the contract who take roles other than voting,
but any such participation should be well-incentivized, i.e. you should argue why they can
make money by helping you run your contract if your protocol depends on their participation.
2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

Identify the elements that make up the employee reward package.

Answered: 1 week ago

Question

Understand the purpose, value and drawbacks of the interview.

Answered: 1 week ago