-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up core contracts pages, add CTF addresses, and add events docs
- Loading branch information
1 parent
ad3f333
commit 59ed6d5
Showing
15 changed files
with
451 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,91 @@ | ||
--- | ||
title: Service Account Contracts | ||
sidebar_position: 4 | ||
sidebar_label: Service Account | ||
--- | ||
|
||
The service account is the account that manages the core protocol requirements of Flow. | ||
There are three contracts deployed to the service account: | ||
|
||
- `FlowServiceAccount` tracks transaction fees, deployment permissions, and provides | ||
| Network | Contract Address | | ||
| ----------------- | -------------------- | | ||
| Emulator | `0xf8d6e0586b0a20c7` | | ||
| Cadence Testing Framework | `0x0000000000000001` | | ||
| PreviewNet | `0xb6763b4399a888c8` | | ||
| Testnet | `0x8c5303eaa26202d6` | | ||
| Mainnet | `0xe467b9dd11fa00df` | | ||
|
||
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](https://github.com/onflow/flow-core-contracts/blob/master/contracts/FlowServiceAccount.cdc) | ||
|
||
## Events | ||
|
||
Important events from `FlowServiceAccount` are: | ||
|
||
```cadence | ||
access(all) event TransactionFeeUpdated(newFee: UFix64) | ||
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](https://github.com/onflow/flow-core-contracts/blob/master/contracts/RandomBeaconHistory.cdc) | ||
|
||
## Events | ||
|
||
Important events from `RandomBeaconHistory` are: | ||
|
||
```cadence | ||
// Event emitted when missing SoRs from past heartbeats are detected and will be backfilled: | ||
// - `blockHeight` is the height where the gap is detected | ||
// - `gapStartHeight` is the height of the first missing entry detected | ||
access(all) event RandomHistoryMissing(blockHeight: UInt64, gapStartHeight: UInt64) | ||
// Event emitted when missing SoRs are backfilled on the current heartbeat: | ||
// - `blockHeight` is the height where the backfill happened, it also defines the SoR used to backfill | ||
// - `gapStartHeight` is the height of the first backfilled entry | ||
// - `count` is the number of backfilled entries | ||
// Note that in very rare cases, the backfilled gap may not be contiguous. This event does not | ||
// fully define the backfilled entries in this case. | ||
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](https://github.com/onflow/flow-core-contracts/blob/master/contracts/NodeVersionBeacon.cdc) | ||
|
||
| Network | Contract Address | | ||
| ----------------- | -------------------- | | ||
| Emulator | `0xf8d6e0586b0a20c7` | | ||
| PreviewNet | `0xb6763b4399a888c8` | | ||
| Testnet/Crescendo | `0x8c5303eaa26202d6` | | ||
| Mainnet | `0xe467b9dd11fa00df` | | ||
## Events | ||
|
||
Important events from `NodeVersionBeacon` are: | ||
|
||
```cadence | ||
/// Event emitted when the version table is updated. | ||
/// It contains the current version and all the upcoming versions | ||
/// sorted by block height. | ||
/// The sequence increases by one each time an event is emitted. | ||
/// It can be used to verify no events were missed. | ||
access(all) event VersionBeacon( | ||
versionBoundaries: [VersionBoundary], | ||
sequence: UInt64 | ||
) | ||
/// Event emitted any time the version boundary freeze period is updated. | ||
/// freeze period is measured in blocks (from the current block). | ||
access(all) event NodeVersionBoundaryFreezePeriodChanged(freezePeriod: UInt64) | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.