2

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?

1
  • Help me please and tell me where you found it? Sep 21, 2017 at 11:10

1 Answer 1

2

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 and acknowledge you have read our privacy policy.

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