Module sui_system::stake_subsidy
- Struct StakeSubsidy
- Constants
- Function create
- Function advance_epoch
- Function current_epoch_subsidy_amount
- Function get_distribution_counter
use std::address;
use std::ascii;
use std::bcs;
use std::internal;
use std::option;
use std::string;
use std::type_name;
use std::u128;
use std::u64;
use std::vector;
use sui::accumulator;
use sui::accumulator_settlement;
use sui::address;
use sui::bag;
use sui::balance;
use sui::bcs;
use sui::coin;
use sui::config;
use sui::deny_list;
use sui::dynamic_field;
use sui::dynamic_object_field;
use sui::event;
use sui::funds_accumulator;
use sui::hash;
use sui::hex;
use sui::object;
use sui::party;
use sui::protocol_config;
use sui::sui;
use sui::table;
use sui::transfer;
use sui::tx_context;
use sui::types;
use sui::url;
use sui::vec_map;
use sui::vec_set;
Struct StakeSubsidy
public struct StakeSubsidy has store
Click to open
Fields
- balance: sui::balance::Balance<sui::sui::SUI>
- Balance of SUI set aside for stake subsidies that will be drawn down over time.
- distribution_counter: u64
- Count of the number of times stake subsidies have been distributed.
- current_distribution_amount: u64
-
The amount of stake subsidy to be drawn down per distribution.
This amount decays and decreases over time. - stake_subsidy_period_length: u64
- Number of distributions to occur before the distribution amount decays.
- stake_subsidy_decrease_rate: u16
- The rate at which the distribution amount decays at the end of each period. Expressed in basis points.
- extra_fields: sui::bag::Bag
- Any extra fields that's not defined statically.
Constants
const ESubsidyDecreaseRateTooLarge: u64 = 0;
const BASIS_POINT_DENOMINATOR: u128 = 10000;
Function create
public(package) fun create(balance: sui::balance::Balance<sui::sui::SUI>, initial_distribution_amount: u64, stake_subsidy_period_length: u64, stake_subsidy_decrease_rate: u16, ctx: &mut sui::tx_context::TxContext): sui_system::stake_subsidy::StakeSubsidy
Function advance_epoch
Advance the epoch counter and draw down the subsidy for the epoch.
public(package) fun advance_epoch(self: &mut sui_system::stake_subsidy::StakeSubsidy): sui::balance::Balance<sui::sui::SUI>
Function current_epoch_subsidy_amount
Returns the amount of stake subsidy to be added at the end of the current epoch.
public fun current_epoch_subsidy_amount(self: &sui_system::stake_subsidy::StakeSubsidy): u64
Function get_distribution_counter
Returns the number of distributions that have occurred.
public(package) fun get_distribution_counter(self: &sui_system::stake_subsidy::StakeSubsidy): u64