reward

package
v1.10.3-0...-ec03cfc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2021 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PreStakedBlocks is the block reward, to be split evenly among block signers in pre-staking era.
	// 24 ONE per block
	PreStakedBlocks = new(big.Int).Mul(big.NewInt(24), big.NewInt(denominations.One))
	// StakedBlocks is the flat-rate block reward for epos staking launch.
	// 28 ONE per block.
	StakedBlocks = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(28), big.NewInt(denominations.One),
	))
	// FiveSecStakedBlocks is the flat-rate block reward after epoch 230.
	// 17.5 ONE per block
	FiveSecStakedBlocks = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(17.5*denominations.Nano), big.NewInt(denominations.Nano),
	))
	// TwoSecStakedBlocks is the flat-rate block reward after epoch 360.
	// 7 ONE per block
	TwoSecStakedBlocks = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(7*denominations.Nano), big.NewInt(denominations.Nano),
	))

	// TotalInitialTokens is the total amount of tokens (in ONE) at block 0 of the network.
	// This should be set/change on the node's init according to the core.GenesisSpec.
	TotalInitialTokens = numeric.Dec{Int: big.NewInt(0)}

	// None ..
	None = big.NewInt(0)

	// ErrInvalidBeaconChain if given chain is not beacon chain
	ErrInvalidBeaconChain = fmt.Errorf("given chain is not beaconchain")
)

Functions

func GetTotalPreStakingTokens

func GetTotalPreStakingTokens() numeric.Dec

GetTotalPreStakingTokens returns the total amount of tokens (in ONE) in the network at the the last block of the pre-staking era (epoch < staking epoch).

func GetTotalTokens

func GetTotalTokens(chain engine.ChainReader) (numeric.Dec, error)

GetTotalTokens in the network for all shards in ONE. This can only be computed with beaconchain if in staking era. If not in staking era, returns the rewards given out by the start of staking era.

func SetTotalInitialTokens

func SetTotalInitialTokens(initTokensAsAtto *big.Int)

SetTotalInitialTokens with the given initial tokens (from genesis in ATTO).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL