HQ20 / contracts

A set of reusable smart-contracts

Home Page:https://hq20-contracts.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use fixed point math in Issuance.sol

uivlis opened this issue · comments

There is an issue with the current formula for token issuance, which is

amount(issuanceToken) = amount(currencyToken)/issuePrice

because you cannot set a subunitary issuePrice. It should be:

amount(issuanceToken) = amount(currencyToken).fixedDiv(issuePrice, 10**18)

or something similar using fixed point math. See ABDK or Fixidity.