Many substrate cryptocurrencies contain code referencing DOLLARS
, CENTS
and MILLICENTS
, eg:
pub const UNITS: Balance = 10_000_000_000;
pub const DOLLARS: Balance = UNITS; // 10_000_000_000
pub const CENTS: Balance = DOLLARS / 100; // 100_000_000
pub const MILLICENTS: Balance = CENTS / 1_000; // 100_000
(see: kusama, polkadot, rococo, westend)
I am struggling to grasp what these terms are meant to reference.
Because
DOLLARS
is originally set to the constant value ofUNITS
(eg: 10 billion for polkadot), my inference is that the term is meant to describe total supply at genesis. Is that correct? If so, it begs the question why theDOLLARS
constant wasn't namedTOTAL_SUPPLY_AT_GENESIS
to avoid the ambiguity of the chosen term. Perhaps I've misunderstood what the term is referencing.I have completely failed to develop an inference for what
CENTS
andMILLICENTS
are supposed to represent. Because of their conventional meaning in fiat currency, I initially assumed they refer to a fractional monetary unit however, most substrate currencies assign a value toCENTS
andMILLICENTS
that doesn't provide logical support for that inference. eg for polkadot:pub const CENTS: Balance = DOLLARS / 100; // 100_000_000
or kusama:
pub const CENTS: Balance = UNITS / 30_000;
I find it unfortunate that cent is used in this manner in substrate codebases since
Etymologically, the word 'cent' derives from the Latin word centum meaning hundred
(wikipedia:Cent) and don't get me started on
MILLICENTS
.
I would really appreciate some clarification on what these terms mean in the substrate context.