Add support to Math.Pow
Problem: The Decimals property "can't" be used inside smart contracts to deal with the supply. Example: It's not possible to convert 100_000_000 to 100_000_000.00000000.
Solution: Add support to Math.Pow (or equivalent). Python Example:
@public(name="totalSupply", safe=True)
def total_supply() -> int:
return 100000000 * 10 ** decimals() # 100,000,000.00000000
Note: I'm not sure if there is another solution for this.
Question: How do people calculate the total supply without using the decimals property? (inside the smart contract).
BigInteger.Pow
Would it be hard to add Math.Pow and make it work like BigInteger.Pow? Identical behavior, just so it's easier to use
Can't you use BigInteger in python? Would be like this:
BigInteger.Pow(100_000_000, 8); // (value, exponent)
Would it be hard to add Math.Pow and make it work like BigInteger.Pow?
Identical behavior, just so it's easier to use
Well, not hard at all, just a few lines of code. I am working to make the method support more complete, but will take time to get merged.
Sure, no rush. Thank you for looking into it