Module staking

Source

Structs§

ACCUMULATED_INTEREST_RATE_SCALE
This is the scale factor for accumulated interest rate: BLOCKS_PER_YEAR * 2 ^ 80. The actual accumulate interest rate stored will be accumulate_interest_rate / INTEREST_RATE_SCALE.
COLLATERAL_DRIPS_PER_STORAGE_KEY
The collaterals in drips for one key/value pair in storage.
DRIPS_PER_STORAGE_COLLATERAL_UNIT
This is the unit of storage collateral to deposit
INITIAL_INTEREST_RATE_PER_BLOCK
This is the initial interest rate per block with scale: 4% / BLOCKS_PER_YEAR * INTEREST_RATE_PER_BLOCK_SCALE.
INTEREST_RATE_PER_BLOCK_SCALE
The initial annual interest is 4%, which means the initial interest rate per block will be 4% / BLOCKS_PER_YEAR. We will multiply it with scale factor and store it as an integer. This is the scale factor of initial interest rate per block.
POS_VOTE_PRICE
This controls the tokens required for one PoS vote
SERVICE_CHARGE_RATE
This is the service charge rate for withdraw, SERVICE_CHARGE_RATE / SERVICE_CHARGE_RATE_SCALE = 0.05%
SERVICE_CHARGE_RATE_SCALE

Constants§

BLOCKS_PER_DAY
This is the number of blocks per day.
BLOCKS_PER_HOUR
This is the number of blocks per hour.
BLOCKS_PER_SECOND
This is the number of blocks per second.
BLOCKS_PER_YEAR
This is the number of blocks per year.
CODE_COLLATERAL_UNITS_PER_KI_BYTES
This is the storage collateral units for each KiB of code, amount in COLLATERAL_UNITs. Code collateral is calculated by each whole KiB rounding upwards.
COLLATERAL_UNITS_PER_STORAGE_KEY
This is the storage collateral units to deposit for one key/value pair in storage. 1 CFX for 16 key value entries.
INVERSE_INTEREST_RATE
The inverse of interest rate

Functions§

code_collateral_units