New answers tagged

0

The actual problem had nothing to do with OpenZepllin, but I must admit that I didn't know about the know decimal limitations. @GoodVibrations noted that if I displayed everything WEI, the math was correct (and I updated the question with those numbers). So it was converting WEI to a decimal that was the problem. I had two helper routines in JavaScript ...


0

The immediate issue appears to be that you are expecting non-integer results from your equation when using integers in Solidity. As other people have commented, in Solidity when dealing with integers, 2/100 = 0 https://solidity.readthedocs.io/en/latest/types.html#division In Solidity, division rounds towards zero. Remix is great to quickly test ...


Top 50 recent answers are included