Documentation
¶
Index ¶
Constants ¶
const (
// Dollar is 10^11 nanocents
Dollar = 100000000000
)
const (
// SaleBlockQty is the number of ndau in a sale block
SaleBlockQty = 1000
)
Variables ¶
This section is empty.
Functions ¶
func ApproxPriceAtUnit ¶
ApproxPriceAtUnit returns the price of the next ndau in USD given the number already sold
func ApproxTotalPriceFor ¶
ApproxTotalPriceFor returns the total price for a group of ndau given the amount to be purchased and the number already sold The numbers passed in are integer number of napu NOT ndau
func ApproxUnitAtPrice ¶
ApproxUnitAtPrice does a binary search for the lowest multiple of 1000 units that exceeds the price
Types ¶
type Nanocent ¶
type Nanocent int64
A Nanocent is one billionth of one hundredth of one USD.
It is fundamentally an integer and is computed using only integer math, for perfect determinism.
func ParseDollars ¶
ParseDollars parses strings expressed in dollars and returns nanocents
func PriceAtUnit ¶
PriceAtUnit returns the price of the next ndau given the number already sold
func PriceAtUnit10000 ¶
PriceAtUnit10000 returns the price of the next ndau given the number already sold, using the (incorrect) end-point of the 10000th block as the one at which the price reaches 16384.
This function is provided to ensure deterministic playback of early blocks. It should _never_ be used in new code.
func PriceAtUnit9999 ¶
PriceAtUnit9999 returns the price of the next ndau given the number already sold, using the (correct) end-point of the 9999th block as the one at which the price reaches 16384.
func (Nanocent) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler