You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, with planetarium/libplanet#2200 and planetarium/libplanet#2225, maximum supply cap and total supply tracking has been introduced to libplanet and how one would define an instance has changed from new Currency() to Currency.Capped() and Currency.Uncapped().
New currencies defined since the introduction of the features now support IAccountStateView.GetTotalSupply() to get the total supply amount of the Currency, and Currency.Capped() currencies are enforced to be minted at most the maximum cap defined.
Currency.Capped() and Currency.Uncapped() are intended for currencies defined from now on, but for currencies originally defined before these changes and currently on the live blockchain cannot be changed to either of these kinds of currencies. (In fact, after the currency has been active on the live chain, their definition cannot be changed including the maximum cap, as an instance of currency can only have one definition.)
For this, Currency.Legacy() is provided, albeit marked as obsolete. It should not be used for new currencies defined, but they must be used for defining legacy currencies including NCG and CRYSTAL on Nine Chronicles.
As the use of obsolete methods produce compiler warnings, they are suppressed with #pragma warning disable CS0618 directives on the Nine Chronicles-related codes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Recently, with planetarium/libplanet#2200 and planetarium/libplanet#2225, maximum supply cap and total supply tracking has been introduced to libplanet and how one would define an instance has changed from
new Currency()
toCurrency.Capped()
andCurrency.Uncapped()
.New currencies defined since the introduction of the features now support
IAccountStateView.GetTotalSupply()
to get the total supply amount of the Currency, andCurrency.Capped()
currencies are enforced to be minted at most the maximum cap defined.Currency.Capped()
andCurrency.Uncapped()
are intended for currencies defined from now on, but for currencies originally defined before these changes and currently on the live blockchain cannot be changed to either of these kinds of currencies. (In fact, after the currency has been active on the live chain, their definition cannot be changed including the maximum cap, as an instance of currency can only have one definition.)For this,
Currency.Legacy()
is provided, albeit marked as obsolete. It should not be used for new currencies defined, but they must be used for defining legacy currencies includingNCG
andCRYSTAL
on Nine Chronicles.As the use of obsolete methods produce compiler warnings, they are suppressed with
#pragma warning disable CS0618
directives on the Nine Chronicles-related codes.Beta Was this translation helpful? Give feedback.
All reactions