reward

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 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 ITC per block
	PreStakedBlocks = new(big.Int).Mul(big.NewInt(24), big.NewInt(denominations.Itc))
	// StakedBlocks is the flat-rate block reward for epos staking launch.
	// 28 ITC per block.
	StakedBlocks = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(28), big.NewInt(denominations.Itc),
	))
	// FiveSecStakedBlocks is the flat-rate block reward after epoch 230.
	// 17.5 ITC per block
	FiveSecStakedBlocks = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(17.5*denominations.Intello), big.NewInt(denominations.Intello),
	))
	// TwoSecStakedBlocks is the flat-rate block reward after epoch 360.
	// 7 ITC per block
	TwoSecStakedBlocks = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(7*denominations.Intello), big.NewInt(denominations.Intello),
	))
	// HIP30StakedBlocks is the reward received after HIP-30 goes into
	// effect. It is simply double the TwoSecStakedBlocks reward, since
	// the number of shards is being halved and we keep emission
	// constant.
	HIP30StakedBlocks = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(14*denominations.Intello), big.NewInt(denominations.Intello),
	))

	// TotalInitialTokens is the total amount of tokens (in ITC) 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 ITC) 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 ITC. 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 INTELLI).

Types

This section is empty.

Jump to

Keyboard shortcuts

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