 Supply question

Hi guys I'm trying to fork a contract and trying to change the supply too but it's a bit confusing.

uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 10 * 1012 * 10_decimals;

uint256 private constant MAX_SUPPLY = ~uint128(0);

uint256 public rebase_count = 0;

uint256 public rate;

uint256 public _totalSupply;

uint256 private constant rSupply = INITIAL_FRAGMENTS_SUPPLY;

uint256 public swapThreshold = rSupply * 10 / 10000;

I want the supply to be 666.666.666.666.666.
I only need to change this to?! uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 66 * 1012 * 10_decimals;
Thanks for the help guys.

1 Like

Hey,

Assuming that you had a typo in
uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 10 * 1012 * 10_decimals;

10 * 10**12 * 10**_decimals;
10* 1012 * 10_decimals:
(Most probably because markdown uses ** for bold text.

Easy way to do it is:
uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 666666666666666 * 10**_decimals;

No, that's not gonna give the expected value:

** in solidity refers to exponentiation.
In final calculation I will ignore 10**_decimals for the sake of simplicity and avoid confusion of _decimals variable:

66 * 10**12 * 10**_decimals means:

66 x (10 power 12 ) x (10 power _decimals)

66 x 1000000000000 this will represent your supply, Decimals will be used for fractions of token

66000000000000 this will be the total supply which is not what you need

1 Like

Thank you so much for claryfing this for me!

1 Like