Skip to main content
info

For Cadence 0.42 go to Legacy Docs

The service account is the account that manages the core protocol requirements of Flow.

NetworkContract Address
Emulator0xf8d6e0586b0a20c7
Cadence Testing Framework0x0000000000000001
Testnet0x8c5303eaa26202d6
Mainnet0xe467b9dd11fa00df

Here are three important contracts deployed to the service account:

FlowServiceAccount

FlowServiceAccount tracks transaction fees, deployment permissions, and provides some convenience methods for Flow Token operations.

Source: FlowServiceAccount.cdc

Events​

Important events from FlowServiceAccount are:


_10
access(all) event TransactionFeeUpdated(newFee: UFix64)
_10
access(all) event AccountCreationFeeUpdated(newFee: UFix64)

RandomBeaconHistory

  • RandomBeaconHistory stores the history of random sources generated by the Flow network. The defined Heartbeat resource is updated by the Flow Service Account at the end of every block with that block's source of randomness.

Source: RandomBeaconHistory.cdc

Events​

Important events from RandomBeaconHistory are:


_12
// Event emitted when missing SoRs from past heartbeats are detected and will be backfilled:
_12
// - `blockHeight` is the height where the gap is detected
_12
// - `gapStartHeight` is the height of the first missing entry detected
_12
access(all) event RandomHistoryMissing(blockHeight: UInt64, gapStartHeight: UInt64)
_12
_12
// Event emitted when missing SoRs are backfilled on the current heartbeat:
_12
// - `blockHeight` is the height where the backfill happened, it also defines the SoR used to backfill
_12
// - `gapStartHeight` is the height of the first backfilled entry
_12
// - `count` is the number of backfilled entries
_12
// Note that in very rare cases, the backfilled gap may not be contiguous. This event does not
_12
// fully define the backfilled entries in this case.
_12
access(all) event RandomHistoryBackfilled(blockHeight: UInt64, gapStartHeight: UInt64, count: UInt64)

NodeVersionBeacon

  • NodeVersionBeacon holds the past and future protocol versions that should be used to execute/handle blocks at a given block height.

Source: NodeVersionBeacon.cdc

Events​

Important events from NodeVersionBeacon are:


_13
/// Event emitted when the version table is updated.
_13
/// It contains the current version and all the upcoming versions
_13
/// sorted by block height.
_13
/// The sequence increases by one each time an event is emitted.
_13
/// It can be used to verify no events were missed.
_13
access(all) event VersionBeacon(
_13
versionBoundaries: [VersionBoundary],
_13
sequence: UInt64
_13
)
_13
_13
/// Event emitted any time the version boundary freeze period is updated.
_13
/// freeze period is measured in blocks (from the current block).
_13
access(all) event NodeVersionBoundaryFreezePeriodChanged(freezePeriod: UInt64)