Git Product home page Git Product logo

eth-contracts's Introduction

eth-contracts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

reptilehaus

eth-contracts's Issues

Adjust ballot contract

Consider ElGamal encryption to be as follows:

  E(m) = (G, H) = (g^r, h^r * g^m), with h = g^x and m = message

Then, the contract should include dedicated arguments in the method vote for:

  • A string representing the ciphertext, i.e. (G, H)
  • A string representing the corresponding proof

NOTE the ballot contract should not assume anything about how the values are encoded. Currently they are in base 36, as this is the largest radix Java supports. However, this may change, in case the length of the native datatypes of Ethereum does not suffice to store these values.

-- EDIT --
NOTE that using dedicated arguments to the vote method is not allowed due to the restricted amount of local variables one can declare in an Ethereum smart contract function. Causes

Stack too deep, try removing local variables

From http://james.carlyle.space/2015/07/22/solidity-stack-too-deep/:

Depending on what you do, you can have around 16 local variables (including parameters and return parameters).
So every input parameter to the function takes one variable, and each return value takes one variable, and each local declaration takes another variable, and references to storage take two

Clean up ballot contract

Rethink Proposal struct

  • number of voters -> length
  • return values -> return only bool or make constant
  • create mapping on Voter struct directly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.