Protocol Smart Contracts 1.0 Changes Guide
Protocol Smart Contracts in Cadence 1.0
On September 4th, 2024 the Flow Mainnet upgraded to Cadence 1.0. In addition to many changes to the Cadence programming language and the Cadence token standards, the Flow Protocol smart contracts also updated to be compatible with the changes.
All applications that interact with these contracts need to update their transactions and scripts in order to be compatible with the changes.
Important Info
This document assumes you have a basic understanding of the Cadence 1.0 improvements and modifications to the Fungible Token Standard. We encourage you to consult those guides for more details on these changes if you are interested.
The updated code for the Cadence 1.0 versions of the protocol smart contracts is located in the
master
branch of the flow-core-contracts repo.
Please look at the PR that made the changes
to understand how the contracts have changed. Every contract in the repo changed.
Additionally, here are the import addresses for all of the important contracts related to the protocol:
Contract | Emulator Import Address | Testing Framework |
---|---|---|
FungibleToken | 0xee82856bf20e2aa6 | 0x0000000000000002 |
ViewResolver | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
Burner | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
MetadataViews | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
FungibleTokenMetadataViews | 0xee82856bf20e2aa6 | 0x0000000000000002 |
FlowToken | 0x0ae53cb6e3f42a79 | 0x0000000000000003 |
FlowFees | 0xe5a8b7f23e8b548f | 0x0000000000000004 |
FlowStorageFees | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
FlowServiceAccount | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
NodeVersionBeacon | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
RandomBeaconHistory | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
LockedTokens | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
StakingProxy | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
FlowIDTableStaking | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
FlowClusterQC | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
FlowDKG | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
FlowEpoch | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
FlowStakingCollection | 0xf8d6e0586b0a20c7 | 0x0000000000000001 |
See the other guides in this section of the docs for the import addresses of other important contracts in the emulator.
Upgrade Guide
The NFT guide covers a lot of common changes that are required for NFT contracts, but many of these changes will also apply to any contract on Flow, so it is still useful to read even if you don't have an NFT contract.
The core contracts do not have any meaningful changes outside of what is required to be compatible with Cadence 1.0 and the token standard changes. If you have questions about the core contracts changes for Cadence 1.0, please reach out to the Flow team in Discord and we will be happy to help.