Skip to main content

IotaSystemStateV2

IotaSystemStateV2

class IotaSystemStateV2

A typed view of the 0x3::iota_system_state_inner::IotaSystemStateV2 inner system state.

Exposes the scalar epoch parameters plus the nested validator set ([ValidatorSetV2]), storage fund ([StorageFundV1]), system parameters ([SystemParametersV1]), and the treasury's total supply.

debugDescription

var debugDescription: String { get }

A textual representation of this instance, suitable for debugging.

Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the String(reflecting:) initializer. This initializer works with any type, and uses the custom debugDescription property for types that conform to CustomDebugStringConvertible:

struct Point: CustomDebugStringConvertible {
let x: Int, y: Int

var debugDescription: String {
return "(\(x), \(y))"
}
}

let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"

The conversion of p to a string in the assignment to s uses the Point type's debugDescription property.

epoch()

func epoch() -> UInt64

epochStartTimestampMs()

func epochStartTimestampMs() -> UInt64

Unix timestamp (ms) of the current epoch start.

extraFieldsId()

func extraFieldsId() -> ObjectId

Object ID of the Bag holding fields added to this struct after its current on-chain layout was set.

iotaTotalSupply()

func iotaTotalSupply() -> UInt64

Total IOTA supply controlled by the system treasury, in nanos.

parameters()

func parameters() -> SystemParametersV1

The system parameters.

protocolVersion()

func protocolVersion() -> UInt64

referenceGasPrice()

func referenceGasPrice() -> UInt64

The reference gas price for the current epoch, in nanos.

safeMode()

func safeMode() -> Bool

Whether the system is running in a downgraded safe mode.

safeModeComputationCharges()

func safeModeComputationCharges() -> UInt64

Computation charges accumulated during safe mode, in nanos.

safeModeComputationChargesBurned()

func safeModeComputationChargesBurned() -> UInt64

Computation charges burned during safe mode, in nanos.

safeModeNonRefundableStorageFee()

func safeModeNonRefundableStorageFee() -> UInt64

Non-refundable storage fees accumulated during safe mode, in nanos.

safeModeStorageCharges()

func safeModeStorageCharges() -> UInt64

Storage charges accumulated during safe mode, in nanos.

safeModeStorageRebates()

func safeModeStorageRebates() -> UInt64

Storage rebates accumulated during safe mode, in nanos.

storageFund()

func storageFund() -> StorageFundV1

The storage fund.

systemStateVersion()

func systemStateVersion() -> UInt64

validatorReportRecords()

func validatorReportRecords() -> [Address : [Address]]

Validator report records: each reported validator's address mapped to the addresses of the validators reporting it.

validators()

func validators() -> ValidatorSetV2

The validator set.

tryFromBcs(bytes:)

static func tryFromBcs(bytes: Data) throws -> IotaSystemStateV2

Decode an IotaSystemStateV2 from raw BCS bytes.

There is no object-based constructor: the inner state is stored as a dynamic field of the 0x5 wrapper, not as a top-level object with its own type tag.