Module 0x3::genesis
- Struct
GenesisValidatorMetadata
- Struct
GenesisChainParameters
- Struct
TokenDistributionSchedule
- Struct
TokenAllocation
- Constants
- Function
create
- Function
allocate_tokens
- Function
activate_validators
use 0x1::option;
use 0x1::vector;
use 0x2::balance;
use 0x2::coin;
use 0x2::object;
use 0x2::sui;
use 0x2::tx_context;
use 0x3::stake_subsidy;
use 0x3::sui_system;
use 0x3::sui_system_state_inner;
use 0x3::validator;
use 0x3::validator_set;
Struct GenesisValidatorMetadata
struct GenesisValidatorMetadata has copy, drop
Click to open
Fields
Struct GenesisChainParameters
struct GenesisChainParameters has copy, drop
Click to open
Fields
Struct TokenDistributionSchedule
struct TokenDistributionSchedule
Click to open
Fields
Struct TokenAllocation
struct TokenAllocation
Click to open
Fields
Constants
The create function was called with duplicate validators.
const EDuplicateValidator: u64 = 1;
The create function was called at a non-genesis epoch.
const ENotCalledAtGenesis: u64 = 0;
Function create
This function will be explicitly called once at genesis. It will create a singleton SuiSystemState object, which contains all the information we need in the system.
fun create(sui_system_state_id: object::UID, sui_supply: balance::Balance<sui::SUI>, genesis_chain_parameters: genesis::GenesisChainParameters, genesis_validators: vector<genesis::GenesisValidatorMetadata>, token_distribution_schedule: genesis::TokenDistributionSchedule, ctx: &mut tx_context::TxContext)
Click to open
Implementation
Function allocate_tokens
fun allocate_tokens(sui_supply: balance::Balance<sui::SUI>, allocations: vector<genesis::TokenAllocation>, validators: &mut vector<validator::Validator>, ctx: &mut tx_context::TxContext)
Click to open
Implementation
Function activate_validators
fun activate_validators(validators: &mut vector<validator::Validator>)
Click to open