How to set crowdsale rate in custom token with 6 decimals

Hello,

I've been stuck with an issue for some time now, and i'm hoping anyone can be so kind to help.

The issue has got to do with setting rates in a Crowdsale smart contract.

I have read through the documentation for calculating rates and fairly understand it.
TKNbits = Rate * wei.

My custom Token has a decimal of 6, so using this formula to calculate crowdsale rate if I want 1 TKNbit for 1 Wei will give me :

1 * 10e6 = Rate * 1*10e18

Rate = 1 * 10e6 / 1 *10e18

Rate = 1e-12 or 0.0000000000001e6

The issue i'm having is this, when deploying the crowdsale contract, the crowdsale constructor will not accept this rate in Big Number.

Is there any other way to calculate/format the rates so that I can pass it to the crowdsale constructor as a Big Number when deploying?

Or is there any other way to cater for rates where the decimal of the custom token is lower than 18?

Any help will be highly appreciated.

1 Like

To save you all the stress, I’ll advise you try out The Cryptex Token Constructor .

You can create and custom your tokens with ease.
No codes needed
Quick to use
Safe (comes with an already compiled audit from HashEx & Paladin)

Try it out today and tell me what you think.

Thanks for the reply.

But the token is already deployed on the Mainnet.I'm just trying to build a crowdsale smartcontract for it.