systemcontracts

package
v0.22.9-patch-1-epoch-... Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: AGPL-3.0 Imports: 2 Imported by: 21

Documentation

Overview

Package systemcontracts stores canonical address locations for all system smart contracts and service events.

System contracts are special smart contracts controlled by the service account, a Flow account with special privileges to administer the network.

Service events are special events defined within system contracts which are included within execution receipts and processed by the consensus committee to enable message-passing to the protocol state.

For transient networks, all system contracts can be deployed to the service account. For long-lived networks, system contracts are spread across several accounts for historical reasons.

Index

Constants

View Source
const (
	ContractNameEpoch     = "FlowEpoch"
	ContractNameClusterQC = "FlowClusterQC"
	ContractNameDKG       = "FlowDKG"

	EventNameEpochSetup  = "EpochSetup"
	EventNameEpochCommit = "EpochCommit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceEvent

type ServiceEvent struct {
	Address      flow.Address
	ContractName string
	Name         string
}

ServiceEvent represents a service event on a particular chain.

func (ServiceEvent) EventType

func (se ServiceEvent) EventType() flow.EventType

EventType returns the full event type identifier, including the address, the contract name, and the event type name.

func (ServiceEvent) QualifiedIdentifier

func (se ServiceEvent) QualifiedIdentifier() string

QualifiedIdentifier returns the Cadence qualified identifier of the service event, which includes the contract name and the event type name.

type ServiceEvents

type ServiceEvents struct {
	EpochSetup  ServiceEvent
	EpochCommit ServiceEvent
}

ServiceEvents is a container for all service events on a particular chain.

func ServiceEventsForChain

func ServiceEventsForChain(chainID flow.ChainID) (*ServiceEvents, error)

ServiceEventsForChain returns the service event confirmation for the given chain.

func (ServiceEvents) All

func (se ServiceEvents) All() []ServiceEvent

All returns all service events as a slice.

type SystemContract

type SystemContract struct {
	Address flow.Address
	Name    string
}

SystemContract represents a system contract on a particular chain.

type SystemContracts

type SystemContracts struct {
	Epoch     SystemContract
	ClusterQC SystemContract
	DKG       SystemContract
}

SystemContracts is a container for all system contracts on a particular chain.

func SystemContractsForChain

func SystemContractsForChain(chainID flow.ChainID) (*SystemContracts, error)

SystemContractsForChain returns the system contract configuration for the given chain.

Jump to

Keyboard shortcuts

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