substrate-contracts-node icon indicating copy to clipboard operation
substrate-contracts-node copied to clipboard

How many tokens are endowed accounts meant to have?

Open forgetso opened this issue 4 years ago • 0 comments

When querying the substrate contracts node with polkadot-js, it tells me that Alice has 1.1529 MUnit.

Alice Balance:  {
  nonce: '0',
  consumers: '0',
  providers: '1',
  sufficients: '0',
  data: {
    free: '1.1529 MUnit',
    reserved: '0',
    miscFrozen: '0',
    feeFrozen: '0'
  }
}

I have asked in the substrate technical channel whether the . is a thousand separator or decimal separator.

@shawntabrizi: i believe in this case, it is actually a decimal. That’ll says Alice has 1 million 152 thousand ... units

In the substrate contracts node the initial endowment of Alice, Bob, etc. is set to 1 << 60 which is 1 152 921 504 606 846 976 or 1.152 * 10^18. Based on this, the decimal point in 1.1529 MUnit would indicate a thousand separator.

https://github.com/paritytech/substrate-contracts-node/blob/912282c90257b0a33a9baff5953cf7d2cd667929/node/src/chain_spec.rs

			// Configure endowed accounts with initial balance of 1 << 60.
			balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),

Can you confirm what the correct value of tokens should be?

forgetso avatar Sep 21 '21 09:09 forgetso