You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This contract stores the history of random sources generated by
96
96
the Flow network. The defined Heartbeat resource is
@@ -104,11 +104,11 @@ You can find transactions for interacting with the random beacon
104
104
105
105
`contracts/NodeVersionBeacon.cdc`
106
106
107
-
| Network | Contract Address |
108
-
| ----------------- | -------------------- |
109
-
| Emulator |`0xf8d6e0586b0a20c7`|
110
-
| Testnet |`0x8c5303eaa26202d6`|
111
-
| Mainnet |`0xe467b9dd11fa00df`|
107
+
| Network | Contract Address |
108
+
| ---------| -------------------- |
109
+
| Emulator |`0xf8d6e0586b0a20c7`|
110
+
| Testnet |`0x8c5303eaa26202d6`|
111
+
| Mainnet |`0xe467b9dd11fa00df`|
112
112
113
113
The `NodeVersionBeacon` contract holds the past
114
114
and future protocol versions that should be used
@@ -122,11 +122,11 @@ history contract in the `transactions/nodeVersionBeacon` directory.
122
122
`contracts/FlowIDTableStaking.cdc`
123
123
`contracts/epochs/FlowEpoch.cdc`
124
124
125
-
| Network | Contract Address |
126
-
| ------------------- | -------------------- |
127
-
| Emulator |`0xf8d6e0586b0a20c7`|
128
-
| Testnet |`0x9eca2b38b18b5dfe`|
129
-
| Mainnet |`0x8624b52f9ddcd04a`|
125
+
| Network | Contract Address |
126
+
| ---------| -------------------- |
127
+
| Emulator |`0xf8d6e0586b0a20c7`|
128
+
| Testnet |`0x9eca2b38b18b5dfe`|
129
+
| Mainnet |`0x8624b52f9ddcd04a`|
130
130
131
131
These contract manages the list of identities that correspond to node operators in the Flow network
132
132
as well as the process for adding and removing nodes from the network via Epochs.
@@ -152,11 +152,11 @@ These scripts are documented in the [staking scripts section of the docs](https:
152
152
153
153
`contracts/LockedTokens.cdc`
154
154
155
-
| Network | Contract Address |
156
-
| --------------- | -------------------- |
157
-
| Emulator |`0xf8d6e0586b0a20c7`|
158
-
| Testnet |`0x95e019a17d0e23d7`|
159
-
| Mainnet |`0x8d0e87b65159ae63`|
155
+
| Network | Contract Address |
156
+
| ---------| -------------------- |
157
+
| Emulator |`0xf8d6e0586b0a20c7`|
158
+
| Testnet |`0x95e019a17d0e23d7`|
159
+
| Mainnet |`0x8d0e87b65159ae63`|
160
160
161
161
This contract manages the two year lockup of Flow tokens that backers purchased in the initial
162
162
token sale in October of 2020. See more documentation about `LockedTokens`[here.](https://docs.onflow.org/flow-token/locked-account-setup/)
@@ -195,16 +195,24 @@ then all the changes are handled for them and there is nothing for you to worry
195
195
196
196
### Staking Collection Technical features
197
197
198
-
* The staking collection contract stores [a dictionary of staking objects](https://github.com/onflow/flow-core-contracts/blob/master/contracts/FlowStakingCollection.cdc#L68) from the staking contract that are used to manage the stakers tokens. Since they are dictionaries, there can be as many node or delegator objects per account as the user wants.
198
+
* The staking collection contract stores [a dictionary of staking objects](https://github.com/onflow/flow-core-contracts/blob/master/contracts/FlowStakingCollection.cdc#L68) from the staking contract that are used to manage the stakers tokens. Since they are dictionaries, there can be as many node or delegator objects per account as the user wants.
199
199
* The resource only has one set of staking methods, which route the call to the correct staking object based on the arguments that the caller specifies. (nodeID, delegatorID)
200
200
* The contract also stores an [optional capability to the locked token vault](https://github.com/onflow/flow-core-contracts/blob/master/contracts/FlowStakingCollection.cdc#L63) and [locked tokens `TokenHolder` resource](https://github.com/onflow/flow-core-contracts/blob/master/ontracts/FlowStakingCollection.cdc#L73). This is only used if the user already has a locked account. The staking collection does not change the locked account setup at all, it only has access to it and to the locked vault.
201
201
* The collection makes the staking objects and vault capability fields private, because since it has access to the locked tokens, it needs to mediate access to the staking objects so users cannot withdraw tokens that are still locked from the sale. The resource has fields `unlockedTokensUsed` and `lockedTokensUsed`, to keep track of how many locked and unlocked tokens are being used for staking in order to allow the user to withdraw the correct amount when they choose to.
202
202
* The staking collection contract is a brand new contract that will be deployed to the same account as the existing locked tokens contract. A few of the fields on the `LockedTokens` contract have been updated to have `access(account)` visibility instead of `access(self)` because the staking collection contract needs to be able to access to them in order to work properly.
203
-
* We also included a public interface and getters in the contract so you can easily query it with an address to get node or delegator information from a collection.
203
+
* We also included a public interface and getters in the contract so you can easily query it with an address to get node or delegator information from a collection.
204
204
205
205
Looking for feedback on design decisions, implementation details, any events that would be useful to include in the contract, and whatever you feel is important!
206
206
207
-
We intend for this to be the method that all Flow Port users (ledger, blocto, etc) use for the forseeable future. When we enable it in Flow Port, we will ask every user to run a transaction to set up their account to use the staking collection from then on.
207
+
We intend for this to be the method that all Flow Port users (ledger, blocto, etc) use for the forseeable future. When we enable it in Flow Port, we will ask every user to run a transaction to set up their account to use the staking collection from then on.
208
+
209
+
## Linear Code Address Generator
210
+
211
+
`contracts/LinearCodeAddressGenerator.cdc`
212
+
213
+
The linear code address generator contract allows translating an address index to an address,
214
+
and and address back to an address index.
215
+
It implements the same address generation logic as used on all Flow networks.
208
216
209
217
# Testing
210
218
@@ -218,22 +226,22 @@ Flow Core Contracts were audited by Quantstamp in July 2021: [final report](http
218
226
219
227
# Getting Transaction Templates
220
228
221
-
If you need to use the contracts and transaction templates we have provided in an app, you don't necessarily
229
+
If you need to use the contracts and transaction templates we have provided in an app, you don't necessarily
222
230
need to copy and paste them into your code. We plan on providing packages for different
223
231
languages to import in order to use the transactions instead of copying and pasting.
224
232
225
233
We currently include the `lib/go/templates` package for getting templates in the Go programming language.
226
234
To use this package, run `go get github.com/onflow/flow-core-contracts/lib/go/templates@{latest version}`
227
-
in your Go project direcory. To use it in your Go code, you can simply call one of the many
228
-
template getters in one of the `*_templates.go` files.
235
+
in your Go project direcory. To use it in your Go code, you can simply call one of the many
236
+
template getters in one of the `*_templates.go` files.
229
237
230
238
### Packages in other languages
231
239
232
240
We would like to add new packages for other popular languages to get transaction templates.
233
241
If you would like to contribute to add one of these new packages, please reach out
234
242
to the team and we would be happy to help!
235
243
236
-
## License
244
+
## License
237
245
238
246
The works in these folders are under the [Unlicense](https://github.com/onflow/flow-core-contracts/blob/master/LICENSE):
0 commit comments