full contract code

I have a contract (code above) where ether is bet on either side 0 or side 1. A winning side is determined (payout function), and the amount of ether that a winner will receive is determined by this formula:

(amount wei winner bet/amount of wei in winning pool)*(amt. of wei in winning pool + amt. of wei in losing pool)

The problem is that sometimes the formula will give a value of 0 when run on the contract when it doesn't in real life causing nobody to be paid. What's the best way to distribute the amount of ether that a winner deserves?

  • Help me please and tell me where you found it? – Stepan Poperechnyi Sep 21 '17 at 11:10

found it out myself, i multiplied all percentages by 10000 so they wouldnt be rounded down to 0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.