Hi there. I am currently writing smart contracts for someone who wishes to conduct a crowdsale of ERC884 tokens.
ERC884 is a standard devised for Delaware Amendment Compliance for keeping company stock ledgers on a blockchain. You can technically perform an STO by offering a crowdsale of ERC884 tokens.
The main sticking point here is that the ERC884 token strictly has zero decimals.
The group performing their sale wishes to have their token sold at a price of $0.12 USD per token, which roughly amounts to 846753500847432 wei (0.000846753500847432 ETH). They also wish to have a cap of 3.15 billion tokens.
By these parameters, I simply am unable to figure out a way to properly calculate the token math, without scaling every number up by a constant. I believe this is related to fixed point arithmetics.
tokenAmount(_weiAmount) = _weiAmount.mul(rate):
I want tokenAmount(846753500847432) = 1
rate must be 1/846753500847432.
But this cannot be represented in solidity without multiplying by a constant, thereby diluting the token supply.
My question here is, what is the best way to approach this in a smart contract, given Solidity’s constraints?