From 26932511841c4228e330036593523f0ecb2d15d2 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Thu, 17 Oct 2024 11:10:39 -0400 Subject: [PATCH 01/17] PARTIAL stash progress --- docs/build/flow.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/build/flow.md b/docs/build/flow.md index f56808eb4e..5d301147a4 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -6,14 +6,33 @@ sidebar_position: 1 # Why Flow -Flow is a fast, decentralized, and developer-friendly blockchain designed to be the foundation for a new generation of games, apps, and [digital assets](https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets) that power them. It is based on a unique, [multi-role architecture](https://www.onflow.org/primer), and designed to [scale without sharding](https://www.onflow.org/post/flow-blockchain-multi-node-architecture-advantages), allowing for massive improvements in speed and throughput while preserving a developer-friendly, ACID-compliant environment. +Flow is a fast, decentralized, and developer-friendly blockchain designed to be the foundation for a new generation of games, apps, and [digital assets] that power them. It is based on a unique, [multi-role architecture], and designed to [scale without sharding], allowing for massive improvements in speed and throughput while preserving a developer-friendly, ACID-compliant environment. It also supports full [EVM] equivalence. ## What Makes Flow Unique - **Multi-role architecture:** Flow's node architecture allows the network to scale to serve billions of users without sharding or reducing the decentralization of consensus. -- **Resource-oriented programming:** Smart contracts on Flow are written in Cadence, an easier and safer programming language for crypto assets and apps. +- **Resource-oriented programming:** Smart contracts on Flow are natively written in [Cadence], an easier and safer programming language for crypto assets and apps. - **Developer ergonomics:** This network is designed to maximize developer productivity. Examples range from upgradeable smart contracts and built-in logging support to the Flow Emulator. - **Consumer onboarding:** Flow was designed for mainstream consumers, with payment onramps catalyzing a safe and low-friction path from fiat to crypto. +- **EVM Equivalence**: The [Cadence] VM is powerful enough to allow other VMs to run inside of it, almost like a Docker Container. The first one integrated in this way is [EVM], because of the comfort of many builders with Solidity and the EVM RPC API. + + + +- **True Fast Finality**: Unlike +- **Gasless Transactions**: +- **VM Token Bridge**: Assets can be bridged between Flow Cadence and Flow EVM easily with the VM token bridge. +- **Native VRF**: Flow supports +- **Native Account Abstraction**: The Flow has protocol native [account abstraction]. + +:::tip + +If you're already comfortable with Solidity, be sure to check out how [Cadence] works in our [Guide for Solidity Developers]! + +::: + + + + The following chapters summarize the content in this section. Read on more for details. @@ -57,3 +76,11 @@ The [FLOW](../build/core-contracts/03-flow-token.md) token is the native currenc ## More Concepts If you're a developer, looking to get a better understanding of working with Flow in your applications, use the šŸ‘ˆ left-hand navigation to explore the concepts pages. + +[digital assets]: https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets +[multi-role architecture]: https://www.onflow.org/primer +[scale without sharding]: https://www.onflow.org/post/flow-blockchain-multi-node-architecture-advantages +[Cadence]: https://cadence-lang.org/ +[EVM]: https://flow.com/upgrade/crescendo/evm +[Guide for Solidity Developers]: https://cadence-lang.org/docs/solidity-to-cadence +[account abstraction]: https://flow.com/account-abstraction From 0500d6e5c6d9cd47ad04123e286fe12f179106e4 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 21 Oct 2024 13:01:38 -0400 Subject: [PATCH 02/17] Edit first section of Why Flow --- docs/build/differences-vs-evm/index.md | 2 +- docs/build/flow.md | 37 +++++++++++++++++--------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/docs/build/differences-vs-evm/index.md b/docs/build/differences-vs-evm/index.md index ad2cadb9c9..db43d922c0 100644 --- a/docs/build/differences-vs-evm/index.md +++ b/docs/build/differences-vs-evm/index.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -title: Differences vs EVM +title: Differences vs. EVM sidebar_custom_props: icon: ā†”ļø --- diff --git a/docs/build/flow.md b/docs/build/flow.md index 5d301147a4..9019d81e5a 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -6,23 +6,31 @@ sidebar_position: 1 # Why Flow -Flow is a fast, decentralized, and developer-friendly blockchain designed to be the foundation for a new generation of games, apps, and [digital assets] that power them. It is based on a unique, [multi-role architecture], and designed to [scale without sharding], allowing for massive improvements in speed and throughput while preserving a developer-friendly, ACID-compliant environment. It also supports full [EVM] equivalence. +Flow is a fast, decentralized, and developer-friendly blockchain designed to be the foundation for a new generation of games, apps, and [digital assets] that power them. It is based on a unique, [multi-role architecture], and designed to [scale without sharding], allowing for massive improvements in speed and throughput while preserving a developer-friendly, ACID-compliant environment. It natively allows development of smart contracts in the powerful [Cadence] language, and also supports full [EVM] equivalence with contracts written in Solidity. ## What Makes Flow Unique -- **Multi-role architecture:** Flow's node architecture allows the network to scale to serve billions of users without sharding or reducing the decentralization of consensus. +### Flow Blockchain + +- **Multi-role architecture:** Flow's [multi-role architecture] allows the network to [scale without sharding] to serve billions of users without reducing the decentralization of consensus. +- **True Fast Finality**: For most other networks, it takes minutes, [a day], or even [a week] to reach hard finality - the point in which a transaction cannot be reversed. On Flow, this [happens in 20 seconds], without compromising security. +- **Native VRF**: Flow provides [onchain randomness] at the protocol level. Instead of implementing complex setup and [paying $10+ USD per number], simply call the built-in function. +- **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. +- **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. +- **EVM Equivalence**: The [Cadence] VM is powerful enough to allow other VMs to run inside of it, almost like a Docker Container. The first one integrated in this way is [EVM], because of the comfort of many builders with Solidity and the EVM RPC API. + +### Flow Cadence + - **Resource-oriented programming:** Smart contracts on Flow are natively written in [Cadence], an easier and safer programming language for crypto assets and apps. - **Developer ergonomics:** This network is designed to maximize developer productivity. Examples range from upgradeable smart contracts and built-in logging support to the Flow Emulator. - **Consumer onboarding:** Flow was designed for mainstream consumers, with payment onramps catalyzing a safe and low-friction path from fiat to crypto. -- **EVM Equivalence**: The [Cadence] VM is powerful enough to allow other VMs to run inside of it, almost like a Docker Container. The first one integrated in this way is [EVM], because of the comfort of many builders with Solidity and the EVM RPC API. +### Flow EVM - -- **True Fast Finality**: Unlike -- **Gasless Transactions**: -- **VM Token Bridge**: Assets can be bridged between Flow Cadence and Flow EVM easily with the VM token bridge. -- **Native VRF**: Flow supports -- **Native Account Abstraction**: The Flow has protocol native [account abstraction]. +- **Speed, Cost, and Compatibility**: Flow EVM can **already** run all of your audited Solidity contracts at **less than 1 second, less than 1 cent per transaction** (for transfers, etc.). +- **Bridge from Other EVM Networks**: You can [bridge] hundreds of assets from dozens of chains to Flow. +- **VM Token Bridge**: Assets can be bridged between Flow Cadence and Flow EVM easily with the VM token bridge. +- **Access to Cadence**: You can access Cadence features and contracts from Flow EVM to take advantage of features such as native VRF, higher computation for lower cost, and any asset on Cadence Flow. :::tip @@ -30,10 +38,6 @@ If you're already comfortable with Solidity, be sure to check out how [Cadence] ::: - - - - The following chapters summarize the content in this section. Read on more for details. ## App Development @@ -79,8 +83,15 @@ If you're a developer, looking to get a better understanding of working with Flo [digital assets]: https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets [multi-role architecture]: https://www.onflow.org/primer +[onchain randomness]: https://developers.flow.com/build/advanced-concepts/randomness +[paying $10+ USD per number]: https://docs.chain.link/vrf/v2-5/billing [scale without sharding]: https://www.onflow.org/post/flow-blockchain-multi-node-architecture-advantages +[a day]: https://docs.zksync.io/zk-stack/concepts/finality#finality-on-zksync-era +[a week]: https://docs.optimism.io/stack/rollup/overview#fault-proofs +[happens in 20 seconds]: https://developers.flow.com/build/basics/transactions#flow +[signer roles]: https://developers.flow.com/build/basics/transactions#signer-roles [Cadence]: https://cadence-lang.org/ [EVM]: https://flow.com/upgrade/crescendo/evm [Guide for Solidity Developers]: https://cadence-lang.org/docs/solidity-to-cadence [account abstraction]: https://flow.com/account-abstraction +[bridge]: https://developers.flow.com/ecosystem/bridges From 149fedee9f2944656581c930ec2580b432acef4d Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 21 Oct 2024 15:39:04 -0400 Subject: [PATCH 03/17] Update Why Flow and supporting first-pass at smoothing organization --- .../app-architecture/app-custody.png | Bin .../app-architecture/index.md | 8 +- .../app-architecture/self-custody.png | Bin ...smart-contracts.mdx => smart-contracts.md} | 0 docs/build/differences-vs-evm/index.md | 89 +++++--- .../explore-more.mdx => explore-more.md} | 0 docs/build/flow.md | 24 +- docs/build/getting-started/_category_.yml | 2 +- .../{quickstarts => }/fcl-quickstart.md | 10 +- .../{quickstarts => }/flow-cli.md | 18 +- .../{quickstarts => }/hello-world.md | 12 +- .../quickstarts/_category_.yml | 2 - .../{quickstarts => }/vertical-split.svg | 0 docs/build/smart-contracts/cadence.md | 207 ------------------ docs/build/smart-contracts/deploying.md | 2 +- docs/build/smart-contracts/learn-cadence.md | 9 + docusaurus.config.js | 14 +- .../HomepageStartListCadence/index.tsx | 2 +- .../Components/LandingHeaderHome/index.tsx | 2 +- .../src/lib/Components/LinkGrid/index.tsx | 2 +- vercel.json | 25 ++- 21 files changed, 141 insertions(+), 287 deletions(-) rename docs/build/{getting-started => }/app-architecture/app-custody.png (100%) rename docs/build/{getting-started => }/app-architecture/index.md (91%) rename docs/build/{getting-started => }/app-architecture/self-custody.png (100%) rename docs/build/basics/{smart-contracts.mdx => smart-contracts.md} (100%) rename docs/build/{getting-started/explore-more.mdx => explore-more.md} (100%) rename docs/build/getting-started/{quickstarts => }/fcl-quickstart.md (95%) rename docs/build/getting-started/{quickstarts => }/flow-cli.md (94%) rename docs/build/getting-started/{quickstarts => }/hello-world.md (94%) delete mode 100644 docs/build/getting-started/quickstarts/_category_.yml rename docs/build/getting-started/{quickstarts => }/vertical-split.svg (100%) delete mode 100644 docs/build/smart-contracts/cadence.md create mode 100644 docs/build/smart-contracts/learn-cadence.md diff --git a/docs/build/getting-started/app-architecture/app-custody.png b/docs/build/app-architecture/app-custody.png similarity index 100% rename from docs/build/getting-started/app-architecture/app-custody.png rename to docs/build/app-architecture/app-custody.png diff --git a/docs/build/getting-started/app-architecture/index.md b/docs/build/app-architecture/index.md similarity index 91% rename from docs/build/getting-started/app-architecture/index.md rename to docs/build/app-architecture/index.md index 62292e96af..5b7c455399 100644 --- a/docs/build/getting-started/app-architecture/index.md +++ b/docs/build/app-architecture/index.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 6 title: App Architecture description: Describes building self-custody and app custody applications on Flow Blockchain. sidebar_custom_props: @@ -12,7 +12,7 @@ The Flow blockchain, with its focus on scalability and user-centric design, offe While the Flow blockchain offers various architectural patterns, the recommended approaches for developers are **Self-Custody** and **App Custody**. These choices align with Flow's ethos of user-centric design and flexibility. -### **Self-Custody Architecture** +### Self-Custody Architecture In a self-custody architecture, users retain direct control over their private keys and assets. This model emphasizes user sovereignty and decentralization, placing the responsibility of asset management squarely on the user's shoulders. While it offers the highest degree of control, it also demands a certain level of technical knowledge and awareness from the user, which can sometimes lead to a more complex user experience. @@ -39,9 +39,9 @@ In a self-custody architecture, users retain direct control over their private k - **Decentralized Finance (DeFi)**: Users interacting with financial protocols while maintaining full control. - **Web3 Native Users**: Those familiar with blockchain technology and key management. -### **App Custody Architecture** +### App Custody Architecture -App custody on Flow offers a unique approach to key management and user experience. Unlike traditional app custody solutions on other blockchains, Flow's App Custody architecture introduces features like **[account linking](../../guides/account-linking/index.md)** and **[walletless onboarding](../../guides/account-linking/child-accounts.md)**. These features ensure that while users enjoy a seamless experience, they still have the option to link their accounts and move their assets freely around the Flow ecosystem, providing a balanced approach to key management. +App custody on Flow offers a unique approach to key management and user experience. Unlike traditional app custody solutions on other blockchains, Flow's App Custody architecture introduces features like **[account linking](../guides/account-linking/index.md)** and **[walletless onboarding](../guides/account-linking/child-accounts.md)**. These features ensure that while users enjoy a seamless experience, they still have the option to link their accounts and move their assets freely around the Flow ecosystem, providing a balanced approach to key management. ![app-custody.png](app-custody.png) diff --git a/docs/build/getting-started/app-architecture/self-custody.png b/docs/build/app-architecture/self-custody.png similarity index 100% rename from docs/build/getting-started/app-architecture/self-custody.png rename to docs/build/app-architecture/self-custody.png diff --git a/docs/build/basics/smart-contracts.mdx b/docs/build/basics/smart-contracts.md similarity index 100% rename from docs/build/basics/smart-contracts.mdx rename to docs/build/basics/smart-contracts.md diff --git a/docs/build/differences-vs-evm/index.md b/docs/build/differences-vs-evm/index.md index db43d922c0..0409b8a7ea 100644 --- a/docs/build/differences-vs-evm/index.md +++ b/docs/build/differences-vs-evm/index.md @@ -1,48 +1,60 @@ --- -sidebar_position: 1 +sidebar_position: 2 title: Differences vs. EVM sidebar_custom_props: icon: ā†”ļø --- -This document summarizes the differences you might encounter between building on Flow vs. other blockchains, especially Ethereum. This will be most useful to developers who are already familiar with building on a blockchain system. Check out [Why Flow](../flow.md) for a more beginner-friendly overview of the Flow blockchain. +Flow [Cadence] is designed with many improvements over prior blockchain networks. As a result, you'll notice many differences between Flow vs. other blockchains, especially Ethereum. This document will be most useful to developers who are already familiar with building on the EVM, but contains details useful to all developers. Check out [Why Flow] for a more general overview of the Flow blockchain. -## The Flow Account Model +:::tip -Key pairs establish ownership on blockchains. In other blockchains (e.g. Bitcoin), the userā€™s address is also calculated based on their public key, making a unique one-to-one relationship between accounts (addresses) and public keys. This also means there is no concrete ā€œaccount creationā€ process other than generating a valid key pair. With the advent of smart contracts, Ethereum introduced a new account type for deploying contracts that can use storage space (i.e., to store contract bytecode). You can learn more about the distinction between EOA and Contract accounts on Ethereum [here](https://ethereum.org/en/developers/docs/accounts/). +Remember, Flow also supports full [EVM] equivalence! You can start by moving over your existing contracts, then start building new features that take advantage of the power of Cadence. -Flow combines the concepts of EOAs and Contract Accounts into a single account model and decouples accounts and public keys. Flow accounts are associated with one or more public keys of varying weights that specify interested parties that need to produce valid cryptographic signatures for each transaction authorized by that account. +::: + +## The Flow Cadence Account Model + +Key pairs establish ownership on blockchains. In other blockchains (e.g. Bitcoin and Ethereum), the user's address is also calculated based on their public key, making a unique one-to-one relationship between accounts (addresses) and public keys. This also means there is no concrete "account creation" process other than generating a valid key pair. + +With the advent of smart contracts, Ethereum introduced a new account type for deploying contracts that can use storage space (i.e., to store contract bytecode). You can learn more about the distinction between EOA and Contract [accounts on Ethereum]. + +The [Flow account model] combines the concepts of EOAs and Contract Accounts into a single account model and decouples accounts and public keys. Flow accounts are associated with one or more public keys of varying weights that specify interested parties that need to produce valid cryptographic signatures for each transaction authorized by that account. ![Screenshot 2023-08-16 at 16.43.07.png](../basics/_accounts_images/Screenshot_2023-08-16_at_16.43.07.png) This natively enables interesting use cases, like key revocation, rotation, and multi-signature transactions. All Flow accounts can use network storage (e.g., for deploying contracts and storing resources like NFTs) based on the number of FLOW tokens they hold. - +:::warning -You must run an explicit account creation transaction on Flow to create a new account. [Flow CLI](../../tools/flow-cli/accounts/create-accounts.md) can create an account on any network with a given public key. +You must run an explicit account creation transaction on Flow to create a new account. [Flow CLI] can create an account on any network with a given public key. - +::: -Check out the [Accounts](../basics/accounts.md) concept document to learn more about Flow accounts. +Another key difference is that [storage] for data and assets related to an account are stored in the account, **not** in the contract as with the EVM. + +Check out the [Accounts] concept document to learn more about Flow accounts. ## Smart Contracts -On Flow, smart contracts are written in Cadence. Cadence syntax is user-friendly and inspired by modern languages like Swift. Notable features of Cadence that make it unique and the key power of the Flow blockchain are: +On Flow, smart contracts can be written in [Cadence], or Solidity. Cadence syntax is user-friendly and inspired by modern languages like Swift. Notable features of Cadence that make it unique and the key power of the Flow blockchain are: + +- **Resource-oriented**: Cadence introduces a new type called Resources. Resources enable onchain representation of digital assets natively and securely. Resources can only exist in one location at a time and are strictly controlled by the execution environment to avoid common mishandling mistakes. Each resource has a unique `uuid` associated with it on the blockchain. Examples of usage are fungible tokens, NFTs, or any custom data structure representing a real-world asset. Check out [Resources] to learn more. +- **Capability-based**: Cadence offers a [Capability-based Security] model. This also enables the use of Resources as structures to build access control. Capabilities and [Entitlements] can provide fine-grained access to the underlying objects for better security. For example, when users list an NFT on a Flow marketplace, they create a new Capability to the stored NFT in their account so the buyer can withdraw the asset when they provide the tokens. Check out [Capability-based Access Control] to learn more about Capabilities on Cadence. -- **Resource-oriented**: Cadence introduces a new type called Resources. Resources enable onchain representation of digital assets natively and securely. Resources can only exist in one location at a time and are strictly controlled by the execution environment to avoid common mishandling mistakes. Each resource has a unique `uuid` associated with it on the blockchain. Examples of usage are fungible tokens, NFTs, or any custom data structure representing a real-world asset. Check out [Resources](https://cadence-lang.org/docs/language/resources) to learn more. -- **Capability-based**: Cadence offers a [Capability-based Security](https://en.wikipedia.org/wiki/Capability-based_security) model. This also enables the use of Resources as structures to build access control. Capabilities and [Entitlements](https://cadence-lang.org/docs/1.0/language/access-control#entitlements) can provide fine-grained access to the underlying objects for better security. For example, when users list an NFT on a Flow marketplace, they create a new Capability to the stored NFT in their account so the buyer can withdraw the asset when they provide the tokens. Check out [Capability-based Access Control](https://cadence-lang.org/docs/language/capabilities) to learn more about Capabilities on Cadence. +:::warning - +Cadence is not compiled. All contracts are public and unobfuscated on Flow. This isn't that different from the EVM, where it's trivial to decompile a contract back into Solidity. -Cadence is not compiled. All contracts are open source on Flow. +::: - +Check out the [Cadence] website to learn the details of the Cadence programming language. -Check out the [Cadence website](https://cadence-lang.org/) to learn more about Cadence. +If you are a Solidity developer, we recommend you start with Cadence's [Guide for Solidity Developers] to dive deeper into the differences between the two languages. -If you are a Solidity developer, it's recommended to read Cadence's [Guide for Solidity Developers](https://cadence-lang.org/docs/solidity-to-cadence) to dive deeper into the differences between the two languages. Here are some additional resources that can help you get started with Cadence: +Here are some additional resources that can help you get started with Cadence: -- [The Cadence tutorial](https://cadence-lang.org/docs/tutorial/first-steps) +- [The Cadence tutorial] - ERC-20 equivalent on Flow is the Flow Fungible Token Standard - [Repository](https://github.com/onflow/flow-ft) - [Tutorial](https://cadence-lang.org/docs/tutorial/fungible-tokens) @@ -53,9 +65,9 @@ If you are a Solidity developer, it's recommended to read Cadence's [Guide for S - [Tutorial](https://cadence-lang.org/docs/tutorial/marketplace-setup) - [NFT Storefront](https://github.com/onflow/nft-storefront/) is an example marketplace standard -### Transactions and Scripts +## Transactions and Scripts -You can interact with the state on most other blockchains by cryptographically authorizing smart contract function calls. On Flow, transactions are more complex and are pieces of Cadence code. This means that any number of contracts and function calls can be composed together atomically to mutate the blockchain state. +You can interact with the state on most other blockchains by cryptographically authorizing smart contract function calls. On Flow, transactions are more complex and are written with Cadence code. This means that any number of contracts and function calls can be composed together atomically to mutate the blockchain state. Here is a sample transaction that mints an NFT from `ExampleNFT` contract on Testnet: @@ -109,12 +121,14 @@ transaction(recipient: Address) { } ``` -Authorizing transactions is also more complex on Flow involving multiple roles: +### Authorizing Transactions -- Accounts can have multiple keys with varying weights +The process to authorize a transaction on Flow Cadence is more complex, but also much more powerful than an EVM transaction: + +- [Accounts] can have multiple keys with varying weights - Multiple accounts can sign a single transaction (`prepare` takes any number of arguments) - Transaction computation fees can be paid by a different account, called the `Payer` account. -- The transaction [nonce](https://ethereum.org/en/developers/docs/accounts/#an-account-examined) is provided by the `Proposer` account. This enables rate control and order to be dictated by a different party if needed. +- The [transaction nonce] is provided by the `Proposer` account. This enables rate control and order to be dictated by a different party if needed. - All of the above roles can be the same account. The same powerful concept also exists for querying the blockchain state using Scripts. Here is a sample script that fetches the `ExampleNFT` IDs owned by a given account on Testnet: @@ -143,17 +157,17 @@ access(all) fun main(address: Address, collectionPublicPath: PublicPath): [UInt6 } ``` -Check out [Transactions](../basics/transactions.md) and [Scripts](../basics/scripts.md) to learn more about the concepts. You can also read the Cadence language reference on [Transactions](https://cadence-lang.org/docs/language/transactions) to dive deeper. +Check out [Transactions] and [Scripts] to learn more about the concepts. You can also read the Cadence language reference on [Transactions] to dive deeper. ## Flow Nodes -Developers need a blockchain node to send transactions and fetch state. Flow is based on a multi-node architecture that separates roles like consensus and computation. You can learn more about the Flow architecture [here](https://flow.com/primer#primer-how-flow-works). +Developers need a blockchain node to send transactions and fetch state. Flow is based on a multi-node architecture that separates tasks like consensus and computation into separate nodes. You can learn more about the Flow architecture in the [Flow Primer]. -Access Nodes are the node type that are most useful for developers, as they provide access to the Flow network [via an API](../../networks/flow-networks/index.md). +Access Nodes are the node type that are most useful for developers, as they provide access to the Flow network [via an API]. ## SDKs and Tools -If youā€™re already familiar with blockchain development, here's a comparison between popular software packages and Flow's tooling: +If you're already familiar with blockchain development, here's a comparison between popular software packages and Flow's tooling: - [hardhat](https://hardhat.org/) / [Truffle](https://trufflesuite.com/) / [Foundry](https://github.com/foundry-rs/foundry) - [Flow CLI](https://github.com/onflow/flow-cli/) provides local development tools and the [Flow Emulator](https://github.com/onflow/flow-emulator) @@ -172,3 +186,24 @@ If youā€™re already familiar with blockchain development, here's a comparison be - [Cadence testing framework](https://cadence-lang.org/docs/testing-framework) enables native tests in Cadence. - [overflow](https://github.com/bjartek/overflow) for testing in Go. - [js-testing](https://github.com/onflow/flow-js-testing) for testing in JS. + +[Why Flow]: ../flow.md +[EVM]: ../../evm/about +[accounts on Ethereum]: https://ethereum.org/en/developers/docs/accounts/ +[Flow CLI]: ../../tools/flow-cli/accounts/create-accounts.md +[Flow account model]: ../basics/accounts.md +[Accounts]: ../basics/accounts.md +[storage]: http://localhost:3000/build/basics/accounts#storage +[Cadence]: https://cadence-lang.org/ +[Resources]: https://cadence-lang.org/docs/language/resources +[Capability-based Security]: https://en.wikipedia.org/wiki/Capability-based_security +[Entitlements]: https://cadence-lang.org/docs/1.0/language/access-control#entitlements +[Capability-based Access Control]: https://cadence-lang.org/docs/language/capabilities +[Guide for Solidity Developers](https://cadence-lang.org/docs/solidity-to-cadence) +[The Cadence tutorial]: https://cadence-lang.org/docs/tutorial/first-steps +[transaction nonce]: https://ethereum.org/en/developers/docs/accounts/#an-account-examined +[Transactions]: ../basics/transactions.md +[Scripts]: ../basics/scripts.md +[Transactions]: https://cadence-lang.org/docs/language/transactions +[Flow Primer]: https://flow.com/primer#primer-how-flow-works +[via an API]: ../../networks/flow-networks/index.md \ No newline at end of file diff --git a/docs/build/getting-started/explore-more.mdx b/docs/build/explore-more.md similarity index 100% rename from docs/build/getting-started/explore-more.mdx rename to docs/build/explore-more.md diff --git a/docs/build/flow.md b/docs/build/flow.md index 9019d81e5a..e0c06c66fd 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -15,12 +15,12 @@ Flow is a fast, decentralized, and developer-friendly blockchain designed to be - **Multi-role architecture:** Flow's [multi-role architecture] allows the network to [scale without sharding] to serve billions of users without reducing the decentralization of consensus. - **True Fast Finality**: For most other networks, it takes minutes, [a day], or even [a week] to reach hard finality - the point in which a transaction cannot be reversed. On Flow, this [happens in 20 seconds], without compromising security. - **Native VRF**: Flow provides [onchain randomness] at the protocol level. Instead of implementing complex setup and [paying $10+ USD per number], simply call the built-in function. -- **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. -- **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. - **EVM Equivalence**: The [Cadence] VM is powerful enough to allow other VMs to run inside of it, almost like a Docker Container. The first one integrated in this way is [EVM], because of the comfort of many builders with Solidity and the EVM RPC API. ### Flow Cadence +- **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. +- **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. - **Resource-oriented programming:** Smart contracts on Flow are natively written in [Cadence], an easier and safer programming language for crypto assets and apps. - **Developer ergonomics:** This network is designed to maximize developer productivity. Examples range from upgradeable smart contracts and built-in logging support to the Flow Emulator. - **Consumer onboarding:** Flow was designed for mainstream consumers, with payment onramps catalyzing a safe and low-friction path from fiat to crypto. @@ -38,9 +38,13 @@ If you're already comfortable with Solidity, be sure to check out how [Cadence] ::: -The following chapters summarize the content in this section. Read on more for details. +## Learning Shortcuts -## App Development +To get a complete picture on how to build on Flow, follow the šŸ‘ˆ sidebar top to bottom. This path will give you the most thorough onboarding experience. + +If you like to jump right into the deep end of the pool, take a look below for more direct links to advanced topics! + +### App Development Quickstart The [Flow App Quickstart](./guides/flow-app-quickstart.md) covers the Flow core concepts, including: @@ -52,7 +56,7 @@ The [Flow App Quickstart](./guides/flow-app-quickstart.md) covers the Flow core - **Script:** A script is a request made to the blockchain that returns information about the state of your dApp's smart contracts. - **Flow Client Library (FCL):** The Flow Client Library is a framework that provides a standard interface to connect client applications and user wallets. -## Core Contracts +### Core Contracts The Flow blockchain implements core functionality using its own smart contract language, [Cadence](https://cadence-lang.org/docs/language/). The core functionality is split into a set of contracts, so-called [core contracts](../build/core-contracts/index.md): @@ -63,24 +67,20 @@ The Flow blockchain implements core functionality using its own smart contract l - **Staking Table:** The FlowIDTableStaking contract is the central table that manages staked nodes, delegation, and rewards. - **Epoch Contract:** The FlowEpoch contract is the state machine that manages Epoch phases and emits service events. -## FLOW Token +### FLOW Token The [FLOW](../build/core-contracts/03-flow-token.md) token is the native currency for the Flow network. Developers and users can use FLOW to transact on the network. Developers can integrate FLOW directly into their apps for peer-to-peer payments, service charges, or consumer rewards. FLOW can be held, transferred, or transacted peer-to-peer. -## Technical Background +### Technical Background - The [Flow Technical Primer](https://www.onflow.org/primer) is a great place to start to understand how Flow works. - The [Three technical whitepapers](https://www.onflow.org/technical-paper) cover the unique innovation behind the Flow blockchain network in-depth. -## Tokenomics +### Tokenomics - To understand more about Flow's Token Economics, and the **FLOW token**, you can read the [Flow Token Economics](https://www.onflow.org/flow-token-economics) guide. - FLOW tokens are Flow's native Fungible Token. To learn more about how to work with them in your applications, go [here](../build/core-contracts/03-flow-token.md). -## More Concepts - -If you're a developer, looking to get a better understanding of working with Flow in your applications, use the šŸ‘ˆ left-hand navigation to explore the concepts pages. - [digital assets]: https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets [multi-role architecture]: https://www.onflow.org/primer [onchain randomness]: https://developers.flow.com/build/advanced-concepts/randomness diff --git a/docs/build/getting-started/_category_.yml b/docs/build/getting-started/_category_.yml index d8b9da3dcd..d8b72d6c4a 100644 --- a/docs/build/getting-started/_category_.yml +++ b/docs/build/getting-started/_category_.yml @@ -1,2 +1,2 @@ label: Getting Started -position: 2 +position: 3 diff --git a/docs/build/getting-started/quickstarts/fcl-quickstart.md b/docs/build/getting-started/fcl-quickstart.md similarity index 95% rename from docs/build/getting-started/quickstarts/fcl-quickstart.md rename to docs/build/getting-started/fcl-quickstart.md index ee691443ee..deac8e81f1 100644 --- a/docs/build/getting-started/quickstarts/fcl-quickstart.md +++ b/docs/build/getting-started/fcl-quickstart.md @@ -1,9 +1,9 @@ --- sidebar_position: 3 -sidebar_label: 3 - Simple Frontend +sidebar_label: Simple Frontend --- -# Part 3 - Simple Frontend +# Simple Frontend [Flow Client Library] (FCL), is a JavaScript library developed to facilitate interactions with the Flow blockchain. It provides developers with tools to build, integrate, and interact with Flow directly from web applications. This web app quickstart will get you interacting with a contract already deployed to Flow. @@ -157,10 +157,10 @@ Run `npm start` again. After a moment, the greeting from `HelloWorld` will appe For a deeper dive into writing an FCL app, such as how to change the chain state with FCL, check out [the app quickstart guide] or the [FCL documentation]. -[Flow Client Library]: ../../../tools/clients/fcl-js +[Flow Client Library]: ../../tools/clients/fcl-js [Cadence]: https://cadence-lang.org/ [React]: https://react.dev/learn [Create React App]: https://create-react-app.dev/ [view the contract here]: https://f.dnz.dev/0xa1296b1e2e90ca5b/HelloWorld -[the app quickstart guide]: ../../guides/flow-app-quickstart -[FCL documentation]: ../../../tools/clients/fcl-js \ No newline at end of file +[the app quickstart guide]: ../guides/flow-app-quickstart +[FCL documentation]: ../../tools/clients/fcl-js \ No newline at end of file diff --git a/docs/build/getting-started/quickstarts/flow-cli.md b/docs/build/getting-started/flow-cli.md similarity index 94% rename from docs/build/getting-started/quickstarts/flow-cli.md rename to docs/build/getting-started/flow-cli.md index 2e853b48a2..d404d3cc3e 100644 --- a/docs/build/getting-started/quickstarts/flow-cli.md +++ b/docs/build/getting-started/flow-cli.md @@ -1,9 +1,9 @@ --- sidebar_position: 2 -sidebar_label: 2 - Local Development +sidebar_label: Local Development --- -# Part 2 - Local Development +# Local Development The [Flow Command Line Interface] (CLI) is a set of tools that developers can use to interact with the Flow blockchain by managing accounts, sending transactions, deploying smart contracts, running the emulator, and more. This quickstart will get you familiar with its main concepts and functionality. @@ -241,14 +241,14 @@ If you want to continue on generating your own contracts, you can also use the t After that, it's easy to add your contract to your project configuration using the Flow CLI [`config` commands]. -[Flow Command Line Interface]: ../../../tools/flow-cli +[Flow Command Line Interface]: ../../tools/flow-cli [Cadence]: https://cadence-lang.org/ -[configuration docs]: ../../../tools/flow-cli/flow.json/configuration +[configuration docs]: ../../tools/flow-cli/flow.json/configuration [homebrew]: https://brew.sh/ -[installation guide]: ../../../tools/flow-cli/install +[installation guide]: ../../tools/flow-cli/install [0xa1296b1e2e90ca5b]: https://contractbrowser.com/A.9dca641e9a4b691b.HelloWorld -[Dependency Manager]: ../../../tools/flow-cli/dependency-manager -[basic scripts]: ../../basics/scripts -[basic transactions]: ../../basics/transactions -[`generate` documentation]: ../../../tools/flow-cli/boilerplate +[Dependency Manager]: ../../tools/flow-cli/dependency-manager +[basic scripts]: ../basics/scripts +[basic transactions]: ../basics/transactions +[`generate` documentation]: ../../tools/flow-cli/boilerplate [`config` commands]: https://developers.flow.com/tools/flow-cli/flow.json/manage-configuration \ No newline at end of file diff --git a/docs/build/getting-started/quickstarts/hello-world.md b/docs/build/getting-started/hello-world.md similarity index 94% rename from docs/build/getting-started/quickstarts/hello-world.md rename to docs/build/getting-started/hello-world.md index 3059d7127e..d695aa6553 100644 --- a/docs/build/getting-started/quickstarts/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -1,10 +1,10 @@ --- sidebar_position: 1 -sidebar_label: 1 - Smart Contract Basics +sidebar_label: Hello World --- import VerticalSplit from "./vertical-split.svg" -# Part 1 - Smart Contract Basics +# Hello World In this quickstart guide, you'll interact with your first smart contract on the Flow Testnet. `Testnet` is a public instance of the Flow blockchain designed for experimentation, where you can deploy and invoke smart contracts without incurring any real-world costs. @@ -22,11 +22,11 @@ After completing this guide, you'll be able to: In later steps, you'll learn how to: -* Create a Flow project using the [Flow CLI](../../../tools/flow-cli). -* Add an already-deployed contract to your project with the [Dependency Manager](../../../tools/flow-cli/dependency-manager.md). -* Deploy a smart contract locally to the [Flow Emulator](../../../tools/emulator). +* Create a Flow project using the [Flow CLI](../../tools/flow-cli). +* Add an already-deployed contract to your project with the [Dependency Manager](../../tools/flow-cli/dependency-manager.md). +* Deploy a smart contract locally to the [Flow Emulator](../../tools/emulator). * Write and execute transactions to interact with a deployed smart contract. -* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../../tools/clients/fcl-js). +* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../tools/clients/fcl-js). ## Calling a Contract With a Script diff --git a/docs/build/getting-started/quickstarts/_category_.yml b/docs/build/getting-started/quickstarts/_category_.yml deleted file mode 100644 index 4fca40e4da..0000000000 --- a/docs/build/getting-started/quickstarts/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -position: 1 -label: Hello World diff --git a/docs/build/getting-started/quickstarts/vertical-split.svg b/docs/build/getting-started/vertical-split.svg similarity index 100% rename from docs/build/getting-started/quickstarts/vertical-split.svg rename to docs/build/getting-started/vertical-split.svg diff --git a/docs/build/smart-contracts/cadence.md b/docs/build/smart-contracts/cadence.md deleted file mode 100644 index d65ec10fee..0000000000 --- a/docs/build/smart-contracts/cadence.md +++ /dev/null @@ -1,207 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Intro to Cadence - -In a blockchain environment like Flow, programs that are stored on-chain in accounts are commonly referred to as smart contracts. -A smart contract is a program that verifies and executes the performance of a contract without the need for a trusted third party. -Programs that run on blockchains are commonly referred to as smart contracts because they mediate important functionality (such as currency) -without having to rely on a central authority (like a bank). - -## A New Programming Language - ---- - -Cadence is a resource-oriented programming language that introduces new features to smart contract programming -that help developers ensure that their code is safe, secure, clear, and approachable. Some of these features are: - -- Type safety and a strong static type system. -- Resource-oriented programming, a new paradigm that pairs linear types with object capabilities -to create a secure and declarative model for digital ownership by ensuring that resources (which are used to represent scarce digital assets) -can only exist in one location at a time, cannot be copied, and cannot be accidentally lost or deleted. -- Built-in pre-conditions and post-conditions for functions and transactions. -- The utilization of capability-based security, which enforces that access to objects -is restricted to only the owner of the object and those who have a valid reference to it. -This is Cadence's main form of access control. - -Cadenceā€™s syntax is inspired by popular modern general-purpose programming languages -like [Swift](https://developer.apple.com/swift/), [Kotlin](https://kotlinlang.org/), and [Rust](https://www.rust-lang.org/). -Its use of resource types maps well to that of [Move](https://medium.com/coinmonks/overview-of-move-programming-language-a860ffd8f55d), -the programming language being developed by the Diem team. - -## Cadence's Programming Language Pillars - ---- - -Cadence, a new high-level programming language, observes the following requirements: - -- **Safety and Security:** Safety is the underlying reliability of any smart contract (i.e., itā€™s bug-free and performs its function). -Security is the prevention of attacks on the network or smart contracts (i.e., unauthorized actions by malicious actors). -Safety and security are critical in smart contracts because of the immutable nature of blockchains, -and because they often deal with high-value assets. While auditing and reviewing code will be a crucial part of smart contract development, -Cadence maximizes efficiency while maintaining the highest levels of safety and security. -It accomplishes this via a strong static type system, design by contract, and ownership primitives inspired by linear types (which are useful when dealing with assets). -- **Clarity:** Code needs to be easy to read, and its meaning should be as unambiguous as possible. -It should also be suited for verification so that tooling can help with ensuring safety and security guarantees. -These guarantees can be achieved by making the code declarative and allowing the developer to express their intentions directly. -We make those intentions explicit by design, which, along with readability, make auditing and reviewing more efficient, at a small cost to verbosity. -- **Approachability:** Writing code and creating programs should be as approachable as possible. -Incorporating features from languages like Swift and Rust, developers should find Cadenceā€™s syntax and semantics familiar. -Practical tooling, documentation, and examples enable developers to start creating programs quickly and effectively. -- **Developer Experience:** The developer should be supported throughout the entire development lifecycle, from initial application logic to on-chain bugfixes. -- **Intuiting Ownership with Resources:** Resources are a composite data type, similar to a struct, that expresses direct ownership of assets. -Cadenceā€™s strong static type system ensures that resources can only exist in one location at a time and cannot be copied or lost because of a coding mistake. -Most smart contract languages currently use a ledger-style approach to record ownership, -where an asset like a fungible token is stored in the smart contract as an entry in a central ledger. -Cadenceā€™s resources directly tie an assetā€™s ownership to the account that owns it by saving the resource in the accountā€™s storage. -As a result, ownership isnā€™t centralized in a smart contractā€™s storage. Each account owns its assets, -and the assets can be transferred freely between accounts without the need for arbitration by a central smart contract. - -## Addressing Challenges with Existing Languages - ---- - -Other languages pioneered smart contract development, but they lack in areas that affect the long-term viability of next-generation applications. - -### Safety - -Safety is the reliability of a smart contract to perform its function as intended. -It is heavily influenced by the unchangeable-once-deployed nature of smart contracts: -Developers must take certain precautions in order to avoid introducing any potentially catastrophic vulnerabilities -prior to publishing a smart contract on the blockchain. -It is standard across many blockchains that modifying or updating a smart contract, even to fix a vulnerability, is not allowed. -Thus, any bugs that are present in the smart contract will exist forever. - -For example, in 2016, an overlooked vulnerability in an Ethereum DAO smart contract (Decentralized Autonomous Organization) -saw millions of dollars siphoned from a smart contract, -eventually leading to a fork in Ethereum and two separate active blockchains (Ethereum and Ethereum Classic). - -Bug fixes are only possible if a smart contract is designed to support changes, -a feature that introduces complexity and security issues. -Lengthy auditing and review processes can ensure a bug-free smart contract. -Still, they add substantial time to the already time-consuming task of getting the smart contractā€™s core logic working correctly. - -Overlooked mistakes cause the most damaging scenarios. -It is easy to lose or duplicate monetary value or assets in existing languages because they donā€™t check relevant invariants -or make it harder to express them. -For example, a plain number represents a transferred amount that can be accidentally (or maliciously) multiplied or ignored. - -Some languages also express behaviors that developers tend to forget about. -For example, a fixed-range type might express monetary value, without considerations for a potential overflow or underflow. -In Solidity, Ethereum's smart contract language, an overflow causes the value to wrap around, as shown [here](https://ethfiddle.com/CAp-kQrDUP). -Solidity also allows contracts to declare variables without initializing them. -If the developer forgets to add an initialization somewhere, -and then tries to read the variable somewhere else in the code expecting it to be a specific value, issues will occur. - -Cadence is type safe and has a strong static type system, -which prevents important classes of erroneous or undesirable program behavior at compile-time (i.e., before the program is run on-chain). -Types are checked statically and are not implicitly converted. Cadence also improves the safety of programs by preventing arithmetic underflow and overflow, -introduces optionals to make nil-cases explicit, and always requires variables to be initialized. -This helps ensure the behavior of these smart contracts is apparent and not dependent on context. - -### Security - -Security, in combination with safety, ensures the successful execution of a smart contract over time -by preventing unsanctioned access and guaranteeing that only authorized actions can be performed in the protocol. -In some languages, functions are public by default, creating vulnerabilities that allow malicious users to find attack vectors. -Cadence utilizes capability-based security, which allows the type system to enforce access control based on rules that users and developers have control over. - -Security is a consideration when interacting with other smart contracts. Any external call potentially allows malicious code to be executed. -For example, in Solidity, when the called function signature does not match any of the available ones, it triggers Solidityā€™s fallback functions. -These functions can be used in malicious ways. Language features such as multiple inheritances and overloading or dispatch can also make it difficult -to determine which code is invoked. - -In Cadence, the safety and security of programs are enhanced by **Design By Contract** and **Ownership Primitives.** -Design by contract allows developers to state pre-conditions and post-conditions for functions and interfaces in a declarative manner -so that callers can be certain about the behavior of called code. Ownership primitives are inspired by linear types and increase safety when working with assets. -They ensure that valuable assets are, for example, not accidentally or maliciously lost or duplicated. - -### Clarity and Approachability - -Implicitness, context-dependability, and expressiveness are language-based challenges that developers often encounter. -They affect the clarity (i.e. the readability of code and the ability to determine its intended function) -and the approachability (i.e. the ability to interpret or write code) of the language and the programs built using it. -For example, in Solidity, storage must be implemented in a low-level key-value manner, which obfuscates the developerā€™s intentions. -Syntax confusion is another example, with ā€œ=+ā€ being legal syntax leading to an assignment instead of a probably-intended increment. -Solidity also has features with uncommon behaviors that can lead to unintended results. -[Multiple inheritance may lead to unexpected behaviours in the program](https://medium.com/consensys-diligence/a-case-against-inheritance-in-smart-contracts-d7f2c738f78e), -and testing and auditing the code is unlikely to identify this issue. - -The Ethereum blockchainā€™s code immutability showcases the need for considerations around extensibility and mechanisms that allow ad-hoc fixes. -Developers using custom-made approaches such as the 'data separation' approach to upgradability -may run into problems with the complexity of data structures, -while developers using ā€˜delegatecall-based proxies` may run into problems with the consistency of memory layouts. -Either way, these challenges compromise approachability and overall extensibility. -Cadence has [contract upgradability built in by default](https://cadence-lang.org/docs/language/contract-updatability), -and contracts can be made immutable by removing all keys from an account. - -Cadence improves the clarity and extensibility of programs by utilizing interfaces to allow extensibility, code reuse, and interoperability between contracts. -Cadence modules also have configurable and transparent upgradeability built-in to enable projects to test and iterate before making their code immutable. - -Cadence allows the use of argument labels to describe the meaning of function arguments. -It also provides a rich standard library with useful data structures (e.g., dictionaries, sets) and data types for common use cases, -like fixed-point arithmetic, which helps when working with currencies. - -## Intuiting Ownership with Resources - -Most smart contract languages currently use a ledger-style approach to record ownership, -where an asset is stored in the smart contract as an entry in a central ledger, and this ledger is the source of truth around asset ownership. -There are many disadvantages to this design, especially when it comes to tracking the ownership of multiple assets belonging to a single account. -To find out all of the assets that an account owns, you would have to enumerate all the possible smart contracts that could potentially include this account -and search to see if the account owns these assets. - -In a resource-oriented language like Cadence, resources directly tie an asset to the account that owns it -by saving the resource in the accountā€™s storage. As a result, ownership isnā€™t centralized in a single, central smart contractā€™s storage. -Instead, each account owns and stores its own assets, and the assets can be transferred freely between accounts without the need for arbitration by a central smart contract. - -Resources are inspired by linear types and increase safety when working with assets, which often have real, intrinsic value. -Resources, as enforced by Cadenceā€™s type system, ensure that assets are correctly manipulated and not abused. - -- Every resource has exactly one owner. If a resource is used as a function parameter, an initial value for a variable, or something similar, the object is not copied. -Instead, it is moved to the new location, and the old location is immediately invalidated. -- The language will report an error if ownership of a resource was not properly transferred, i.e., -when the program attempts to introduce multiple owners for the resource or the resource ends up in a state where it does not have an owner. -For example, a resource can only be assigned to exactly one variable and cannot be passed to functions multiple times. -- Resources cannot go out of scope. If a function or transaction removes a resource from an accountā€™s storage, -it either needs to end the transaction in an account's storage, or it needs to be explicitly and safely deleted. There is no ā€œgarbage collectionā€ for resources. - -The special status of Resource objects must be enforced by the runtime; if they were just a compiler abstraction it would be easy for malicious code to break the value guarantees. - -Resources change how assets are used in a programming environment to better resemble assets in the real world. -Users store their currencies and assets in their own account, in their own wallet storage, and they can do with them as they wish. -Users can define custom logic and structures for resources that give them flexibility with how they are stored. -Additionally, because everyone stores their own assets, the calculation and charging of state rent is fair and balanced across all users in the network. - -## An Interpreted Language - ---- - -Currently, Cadence is an interpreted language, as opposed to a compiled language. This means that there is no Cadence Assembly, bytecode, compiler, or Cadence VM. - -The structure of the language lends itself well to compilation (for example, static typing), -but using an interpreter for the first version allows us to refine the language features more quickly as we define them. - -## Getting Started with Cadence - ---- - -Now that you've learned about the goals and design of Cadence and Flow, you're ready to get started with the Flow emulator and tools! -Go to the [Getting Started](https://cadence-lang.org/docs/tutorial/first-steps) page to work through language fundamentals and tutorials. - -## Why Cadence? - -### 1. Security and Safety - -Cadence provides security and safety guarantees that greatly simplify the development of secure smart contracts. As smart contracts often deal with valuable assets, Cadence provides the resource-oriented programming paradigm, which guarantees that assets can only exist in one location at a time, cannot be copied, and cannot be accidentally lost or deleted. -Cadence includes several language features which prevent entire classes of bugs. -These security and safety features allow smart contract developers to focus on the business logic of their contract instead of preventing accidents and attacks. - -### 2. Composability - -Cadence enables composability. Resources (which are arbitrary user-defined data types) are stored directly in usersā€™ accounts, and can flow freely between contracts: They can be passed as arguments to functions, returned from functions, or even combined in arbitrary data structures. This makes implementing business logic easier, more natural and promotes reuse of existing logic. - -### 3. Simplicity - -Cadenceā€™s syntax is inspired by popular modern general-purpose programming languages like [Swift](https://developer.apple.com/swift/), [Kotlin](https://kotlinlang.org/), and [Rust](https://www.rust-lang.org/), so developers will find the syntax and the semantics familiar. -Practical tooling, documentation, and examples enable developers to start creating programs quickly and effectively. Hundreds of developers were able to learn Cadence quickly and develop production-quality smart contracts with it shortly. diff --git a/docs/build/smart-contracts/deploying.md b/docs/build/smart-contracts/deploying.md index 7e59b91587..6a332bc5dd 100644 --- a/docs/build/smart-contracts/deploying.md +++ b/docs/build/smart-contracts/deploying.md @@ -23,7 +23,7 @@ Anyone can deploy and update contracts on mainnet. Audits are encouraged but not ### Create and deploy a mainnet project -The tool of choice is Flow CLI, there are quickstarts and guides that use Flow CLI, [Getting Started](../getting-started/quickstarts/flow-cli) +The tool of choice is Flow CLI, there are quickstarts and guides that use Flow CLI, [Getting Started](../getting-started/flow-cli) - It is highly encouraged to test your contracts, transactions and scripts on Testnet, have strong smart contract test coverage and follow any additional guidelines set out here: [Smart Contract Testing Guidelines](./testing.md). - Follow the Flow CLI instructions to [Create a Project](../../tools/flow-cli/index.md). You have the Flow CLI installed and ran `flow init` or `flow setup` in your project folder and generating a `flow.json` file - Mainnet account: You completed the mainnet account setup, (see above) and have your key pair and mainnet address ready. diff --git a/docs/build/smart-contracts/learn-cadence.md b/docs/build/smart-contracts/learn-cadence.md new file mode 100644 index 0000000000..38de28d479 --- /dev/null +++ b/docs/build/smart-contracts/learn-cadence.md @@ -0,0 +1,9 @@ +--- +sidebar_position: 1 +slug: /build/learn-cadence +title: Learn Cadence ā†—ļø +--- + +import {Redirect} from '@docusaurus/router'; + +; \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index 7e248d4026..5c453fd90a 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -202,11 +202,11 @@ const config = { }, ...(process.env.GA_TRACKING_ID ? { - gtag: { - trackingID: process.env.GA_TRACKING_ID, - anonymizeIP: true, - }, - } + gtag: { + trackingID: process.env.GA_TRACKING_ID, + anonymizeIP: true, + }, + } : {}), }), ], @@ -261,7 +261,7 @@ const config = { { to: 'evm/about', position: 'left', - label: 'EVM', + label: 'Build with EVM', activeBasePath: '/evm', }, { @@ -304,7 +304,7 @@ const config = { items: [ { label: 'Getting Started', - to: '/build/getting-started/quickstarts/hello-world', + to: '/build/getting-started/hello-world', }, { label: "SDK's & Tools", diff --git a/src/ui/design-system/src/lib/Components/HomepageStartListCadence/index.tsx b/src/ui/design-system/src/lib/Components/HomepageStartListCadence/index.tsx index ed70ab4d3c..367fbf80f3 100644 --- a/src/ui/design-system/src/lib/Components/HomepageStartListCadence/index.tsx +++ b/src/ui/design-system/src/lib/Components/HomepageStartListCadence/index.tsx @@ -14,7 +14,7 @@ const homepageData: Record = { icon: 'cadence-course', }, 'beginner-dapp': { - link: '/build/getting-started/quickstarts/hello-world', + link: '/build/getting-started/hello-world', icon: 'start-here', }, 'flow-quest': { diff --git a/src/ui/design-system/src/lib/Components/LandingHeaderHome/index.tsx b/src/ui/design-system/src/lib/Components/LandingHeaderHome/index.tsx index 2d67edd12d..3d84638a0f 100644 --- a/src/ui/design-system/src/lib/Components/LandingHeaderHome/index.tsx +++ b/src/ui/design-system/src/lib/Components/LandingHeaderHome/index.tsx @@ -32,7 +32,7 @@ export function LandingHeaderHome({ Get Building diff --git a/src/ui/design-system/src/lib/Components/LinkGrid/index.tsx b/src/ui/design-system/src/lib/Components/LinkGrid/index.tsx index 450dd5afcf..6706c684f2 100644 --- a/src/ui/design-system/src/lib/Components/LinkGrid/index.tsx +++ b/src/ui/design-system/src/lib/Components/LinkGrid/index.tsx @@ -25,7 +25,7 @@ const sections: LinkGridSection[] = [ links: [ { title: 'Hello World Tutorial', - href: '/build/getting-started/quickstarts/hello-world', + href: '/build/getting-started/hello-world', }, { title: 'App Architecture', diff --git a/vercel.json b/vercel.json index 95da669da3..71067480bc 100644 --- a/vercel.json +++ b/vercel.json @@ -185,7 +185,6 @@ { "source": "/access-api", "destination": "/networks/node-ops/access-onchain-data/access-nodes/accessing-data/access-api", - "permanent": true }, { @@ -270,7 +269,7 @@ }, { "source": "/tooling/fcl-js/tutorials/:path*", - "destination": "/build/getting-started/quickstarts/fcl-quickstart", + "destination": "/build/getting-started/fcl-quickstart", "permanent": true }, { @@ -1233,6 +1232,26 @@ "source": "/tools/clients/flow-go-sdk/error-codes", "destination": "/tools/error-codes", "permanent": true + }, + { + "source": "/build/getting-started/quickstarts/hello-world", + "destination": "/build/getting-started/hello-world", + "permanent": true + }, + { + "source": "/build/getting-started/quickstarts/flow-cli", + "destination": "/build/getting-started/flow-cli", + "permanent": true + }, + { + "source": "/build/getting-started/quickstarts/fcl-quickstart", + "destination": "/build/getting-started/fcl-quickstart", + "permanent": true + }, + { + "source": "build/smart-contracts/cadence", + "destination": "https://cadence-lang.org/docs/", + "permanent": true } ] -} +} \ No newline at end of file From 7b0287cef0afe4e14ed6f381ddb052846cd08e3f Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 21 Oct 2024 15:42:39 -0400 Subject: [PATCH 04/17] Convert missed links to reference-style --- docs/build/getting-started/hello-world.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/build/getting-started/hello-world.md b/docs/build/getting-started/hello-world.md index d695aa6553..c42c1356fd 100644 --- a/docs/build/getting-started/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -22,11 +22,11 @@ After completing this guide, you'll be able to: In later steps, you'll learn how to: -* Create a Flow project using the [Flow CLI](../../tools/flow-cli). -* Add an already-deployed contract to your project with the [Dependency Manager](../../tools/flow-cli/dependency-manager.md). -* Deploy a smart contract locally to the [Flow Emulator](../../tools/emulator). +* Create a Flow project using the [Flow CLI]. +* Add an already-deployed contract to your project with the [Dependency Manager]. +* Deploy a smart contract locally to the [Flow Emulator]. * Write and execute transactions to interact with a deployed smart contract. -* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../tools/clients/fcl-js). +* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library]. ## Calling a Contract With a Script @@ -104,4 +104,8 @@ By understanding the `HelloWorld` contract and how to interact with it, you're b Proceed to the next tutorial to learn how to create your own contracts and deploy them live using the Flow CLI. [Cadence]: https://cadence-lang.org/ -[EVM]: https://flow.com/upgrade/crescendo/evm \ No newline at end of file +[EVM]: https://flow.com/upgrade/crescendo/evm +[Flow CLI]: ../../tools/flow-cli +[Dependency Manager]: ../../tools/flow-cli/dependency-manager.md +[Flow Emulator]: ../../tools/emulator +[Flow Client Library]: ../../tools/clients/fcl-js From ece1a8c72f9f0a8fa73a88010956f7f9af22c38f Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 21 Oct 2024 17:03:12 -0400 Subject: [PATCH 05/17] Fix broken links, more reorg --- docs/build/advanced-concepts/_category_.yml | 2 +- docs/build/app-architecture/index.md | 2 +- docs/build/basics/_category_.yml | 2 +- docs/build/basics/smart-contracts.md | 13 -------- docs/build/flow.md | 31 ++++++++++++++----- docs/build/guides/flow-app-quickstart.md | 2 +- .../guides/mobile/react-native-quickstart.md | 8 ++--- docs/build/smart-contracts/_category_.yml | 2 +- docs/tools/clients/fcl-js/index.md | 2 +- docs/tools/clients/fcl-js/index.mdx.txt | 2 +- docs/tools/clients/fcl-js/scripts.md | 2 +- docs/tools/clients/fcl-js/sdk-guidelines.md | 4 +-- .../flow-go-sdk/{index.mdx => index.md} | 4 +-- .../clients/unity-sdk/samples/ui-usage.md | 4 +-- .../vscode-extension/{index.mdx => index.md} | 2 +- 15 files changed, 43 insertions(+), 39 deletions(-) delete mode 100644 docs/build/basics/smart-contracts.md rename docs/tools/clients/flow-go-sdk/{index.mdx => index.md} (99%) rename docs/tools/vscode-extension/{index.mdx => index.md} (91%) diff --git a/docs/build/advanced-concepts/_category_.yml b/docs/build/advanced-concepts/_category_.yml index c13622dfc6..a760a6f6d1 100644 --- a/docs/build/advanced-concepts/_category_.yml +++ b/docs/build/advanced-concepts/_category_.yml @@ -1,2 +1,2 @@ label: Advanced Concepts -position: 5 \ No newline at end of file +position: 7 \ No newline at end of file diff --git a/docs/build/app-architecture/index.md b/docs/build/app-architecture/index.md index 5b7c455399..a685c58d83 100644 --- a/docs/build/app-architecture/index.md +++ b/docs/build/app-architecture/index.md @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 5 title: App Architecture description: Describes building self-custody and app custody applications on Flow Blockchain. sidebar_custom_props: diff --git a/docs/build/basics/_category_.yml b/docs/build/basics/_category_.yml index 3dfa13e96a..bab95b8f87 100644 --- a/docs/build/basics/_category_.yml +++ b/docs/build/basics/_category_.yml @@ -1,2 +1,2 @@ -label: Basic Concepts +label: Flow Cadence Protocol position: 4 diff --git a/docs/build/basics/smart-contracts.md b/docs/build/basics/smart-contracts.md deleted file mode 100644 index c075403ddf..0000000000 --- a/docs/build/basics/smart-contracts.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -slug: /build/basics/smart-contracts -redirect: /build/smart-contracts/overview -title: Smart Contracts ā†™ ---- - -# Smart Contracts - -Go to [Smart Contracts](../../build/smart-contracts/overview.md) - -import {Redirect} from '@docusaurus/router'; - -; diff --git a/docs/build/flow.md b/docs/build/flow.md index e0c06c66fd..ac2df3db04 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -44,9 +44,19 @@ To get a complete picture on how to build on Flow, follow the šŸ‘ˆ sidebar top t If you like to jump right into the deep end of the pool, take a look below for more direct links to advanced topics! +### Learn Cadence + +To take advantage of the full power of Flow, you'll need to learn [Cadence]. Learning a new language is an investment, but you'll find that Cadence is safer, more explicit, and less dangerous than other blockchain languages. Plus, it unlocks the full power of the Flow protocol! + +### Build with the EVM + +If you're not ready to take the plunge and learn [Cadence], try out "EVM++" by deploying your existing [EVM] contracts. You'll find that Flow EVM is faster and cheaper than nearly every other EVM solution - without compromising on security. + +Deploying on Flow EVM also gives your Solidity contracts access to Flow Cadence features, such as native [VRF]. + ### App Development Quickstart -The [Flow App Quickstart](./guides/flow-app-quickstart.md) covers the Flow core concepts, including: +The [Flow App Quickstart] covers the Flow core concepts, including: - **App Client:** The app client is the interface through which users interact with your app. Web and mobile applications are typical examples of app clients. - **Smart Contract:** A smart contract is a collection of code deployed to a permanent location on the blockchain that defines the core logic for a dApp. @@ -58,7 +68,7 @@ The [Flow App Quickstart](./guides/flow-app-quickstart.md) covers the Flow core ### Core Contracts -The Flow blockchain implements core functionality using its own smart contract language, [Cadence](https://cadence-lang.org/docs/language/). The core functionality is split into a set of contracts, so-called [core contracts](../build/core-contracts/index.md): +The Flow blockchain implements core functionality using its own smart contract language, [Cadence]. The core functionality is split into a set of contracts, called the [core contracts]: - **Fungible Token:** The FungibleToken contract implements the Fungible Token Standard. It is the second contract ever deployed on Flow. - **Flow Token:** The FlowToken contract defines the FLOW network token. @@ -69,17 +79,17 @@ The Flow blockchain implements core functionality using its own smart contract l ### FLOW Token -The [FLOW](../build/core-contracts/03-flow-token.md) token is the native currency for the Flow network. Developers and users can use FLOW to transact on the network. Developers can integrate FLOW directly into their apps for peer-to-peer payments, service charges, or consumer rewards. FLOW can be held, transferred, or transacted peer-to-peer. +The [FLOW] token is the native currency for the Flow network. Developers and users can use FLOW to transact on the network. Developers can integrate FLOW directly into their apps for peer-to-peer payments, service charges, or consumer rewards. FLOW can be held, transferred, or transacted peer-to-peer. ### Technical Background -- The [Flow Technical Primer](https://www.onflow.org/primer) is a great place to start to understand how Flow works. -- The [Three technical whitepapers](https://www.onflow.org/technical-paper) cover the unique innovation behind the Flow blockchain network in-depth. +- The [Flow Technical Primer] is a great place to start to understand how Flow works. +- The [Three technical whitepapers] cover the unique innovation behind the Flow blockchain network in-depth. ### Tokenomics -- To understand more about Flow's Token Economics, and the **FLOW token**, you can read the [Flow Token Economics](https://www.onflow.org/flow-token-economics) guide. -- FLOW tokens are Flow's native Fungible Token. To learn more about how to work with them in your applications, go [here](../build/core-contracts/03-flow-token.md). +- To understand more about Flow's Token Economics, and the **FLOW token**, you can read the [Flow Token Economics] guide. +- FLOW tokens are Flow's native Fungible Token. To learn more about how to work with them in your applications, review the [FLOW] article. [digital assets]: https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets [multi-role architecture]: https://www.onflow.org/primer @@ -95,3 +105,10 @@ The [FLOW](../build/core-contracts/03-flow-token.md) token is the native currenc [Guide for Solidity Developers]: https://cadence-lang.org/docs/solidity-to-cadence [account abstraction]: https://flow.com/account-abstraction [bridge]: https://developers.flow.com/ecosystem/bridges +[Flow App Quickstart]: ./guides/flow-app-quickstart +[core contracts]: ../build/core-contracts/index +[FLOW]: ../build/core-contracts/03-flow-token +[Flow Technical Primer]: https://www.onflow.org/primer +[Three technical whitepapers]: https://www.onflow.org/technical-paper +[Flow Token Economics]: https://www.onflow.org/flow-token-economics +[VRF]: ../evm/guides/vrf diff --git a/docs/build/guides/flow-app-quickstart.md b/docs/build/guides/flow-app-quickstart.md index c2c0634924..80cb9fa5d5 100644 --- a/docs/build/guides/flow-app-quickstart.md +++ b/docs/build/guides/flow-app-quickstart.md @@ -29,7 +29,7 @@ FCL (aka Flow Client Library) wraps the logic needed to communicate with the Flo ::: -This guide assumes a good understanding of React. The concepts are easy to understand and apply to other libraries and framework. A strong understanding of Cadence (Flow's smart contract language) is not required. More information on Cadence, [learning the Cadence language](../smart-contracts/cadence.md). +This guide assumes a good understanding of React. The concepts are easy to understand and apply to other libraries and framework. A strong understanding of Cadence (Flow's smart contract language) is not required. More information on Cadence, [learning the Cadence language](https://cadence-lang.org/docs/language/). ### FCL concepts covered: diff --git a/docs/build/guides/mobile/react-native-quickstart.md b/docs/build/guides/mobile/react-native-quickstart.md index 2d41f23dc2..f5c67ce9ee 100644 --- a/docs/build/guides/mobile/react-native-quickstart.md +++ b/docs/build/guides/mobile/react-native-quickstart.md @@ -12,7 +12,7 @@ sidebar_position: 4 FCL-JS is the easiest way to start building decentralized applications. FCL (aka Flow Client Library) wraps much of the logic you'd have to write yourself on other blockchains. Follow this quick start and you'll have a solid overview of how to build a shippable dapp on Flow. -We're going to make an assumption that you know or understand React; however, the concepts should be easy to understand and transfer to another framework. While this tutorial will make use of Cadence (Flow's smart contract language), you do not need to know it. Instead, we recommend later diving into [learning the Cadence language](../../smart-contracts/cadence.md) once you've gotten the core FCL concepts down. +We're going to make an assumption that you know or understand React; however, the concepts should be easy to understand and transfer to another framework. While this tutorial will make use of Cadence (Flow's smart contract language), you do not need to know it. Instead, we recommend later diving into [learning the Cadence language](https://cadence-lang.org/docs/language/) once you've gotten the core FCL concepts down. In this tutorial, we are going to interact with an existing smart contract on Flow's testnet known as the [Profile Contract](https://testnet.flowdiver.io/contract/A.ba1132bc08f82fe2.Profile). Using this contract, we will create a new profile and edit the profile information, both via a wallet. In order to do this, the FCL concepts we'll cover are: @@ -293,7 +293,7 @@ await fcl.query({ }); ``` -Inside the query you'll see we set two things: `cadence` and `args`. Cadence is Flow's smart contract language we mentioned. For this tutorial, when you look at it you just need to notice that it's importing the `Profile` contract from the account we named `0xProfile` earlier in our config file, then also taking an account address, and reading it. That's it until you're ready to [learn more Cadence](https://cadence-lang.org/docs/tutorial/first-steps). +Inside the query you'll see we set two things: `cadence` and `args`. Cadence is Flow's smart contract language we mentioned. For this tutorial, when you look at it you just need to notice that it's importing the `Profile` contract from the account we named `0xProfile` earlier in our config file, then also taking an account address, and reading it. That's it until you're ready to [learn more Cadence](https://cadence-lang.org/docs). In the `args` section, we are simply passing it our user's account address from the user we set in state after authentication and giving it a type of `Address`. For more possible types, [see this reference](../../../tools/clients/fcl-js/api.md#ftype). @@ -301,9 +301,9 @@ Go ahead and click the "Send Query" button. You should see "No Profile." That's ## Initializing the Account -For the Profile contract to store a Profile in a user's account, it does so by initializing what is called a "resource." A resource is an ownable piece of data and functionality that can live in the user's account storage. This paradigm is known is as "resource-oriented-programming", a principle that is core to Cadence and differentiates its ownership model from other smart contract languages, [read more here](../../smart-contracts/cadence.md#intuiting-ownership-with-resources). Cadence makes it so that resources can only exist in one place at any time, they must be deliberately created, cannot be copied, and if desired, must be deliberately destroyed. +For the Profile contract to store a Profile in a user's account, it does so by initializing what is called a "resource." A resource is an ownable piece of data and functionality that can live in the user's account storage. This paradigm is known is as "resource-oriented-programming", a principle that is core to Cadence and differentiates its ownership model from other smart contract languages, [read more here](https://cadence-lang.org/docs/#intuiting-ownership-with-resources). Cadence makes it so that resources can only exist in one place at any time, they must be deliberately created, cannot be copied, and if desired, must be deliberately destroyed. -> There's a lot more to resources in Cadence than we'll cover in this guide, so if you'd like to know more, check out [this Cadence intro](../../smart-contracts/cadence.md). +> There's a lot more to resources in Cadence than we'll cover in this guide, so if you'd like to know more, check out [this Cadence intro](https://cadence-lang.org/docs). To do this resource initialization on an account, we're going to add another function called `initAccount`. Inside of that function, we're going to add some Cadence code which says, *"Hey, does this account have a profile? If it doesn't, let's add one."* We do that using something called a "transaction." Transactions occur when you want to change the state of the blockchain, in this case, some data in a resource, in a specific account. And there is a cost (transaction fee) in order to do that; unlike a query. diff --git a/docs/build/smart-contracts/_category_.yml b/docs/build/smart-contracts/_category_.yml index fd3d9f747b..572b4909fb 100644 --- a/docs/build/smart-contracts/_category_.yml +++ b/docs/build/smart-contracts/_category_.yml @@ -1,5 +1,5 @@ label: Writing and Deploying Smart Contracts -position: 7 +position: 6 customProps: icon: šŸ§± description: How to deploy smart contracts to mainnet and testnet diff --git a/docs/tools/clients/fcl-js/index.md b/docs/tools/clients/fcl-js/index.md index d4912c0195..2864b53af2 100644 --- a/docs/tools/clients/fcl-js/index.md +++ b/docs/tools/clients/fcl-js/index.md @@ -118,7 +118,7 @@ See the [Flow App Quick Start](../../../build/guides/flow-app-quickstart.md). See the full [API Reference](./api.md) for all FCL functionality. -Learn Flow's smart contract language to build any script or transactions: [Cadence](../../../build/smart-contracts/cadence.md). +Learn Flow's smart contract language to build any script or transactions: [Cadence](https://cadence-lang.org/docs). Explore all of Flow [docs and tools](/). diff --git a/docs/tools/clients/fcl-js/index.mdx.txt b/docs/tools/clients/fcl-js/index.mdx.txt index 58dc870d01..eb37d216f0 100644 --- a/docs/tools/clients/fcl-js/index.mdx.txt +++ b/docs/tools/clients/fcl-js/index.mdx.txt @@ -132,7 +132,7 @@ See the [Flow App Quick Start](../../guides/flow-app-quickstart.mdx). See the full [API Reference](./api.md) for all FCL functionality. -Learn Flow's smart contract language to build any script or transactions: [Cadence](../../../build/guides/smart-contracts/cadence.md). +Learn Flow's smart contract language to build any script or transactions: [Cadence](https://cadence-lang.org/docs). Explore all of Flow [docs and tools](/). diff --git a/docs/tools/clients/fcl-js/scripts.md b/docs/tools/clients/fcl-js/scripts.md index 290f101171..bbfc2b8009 100644 --- a/docs/tools/clients/fcl-js/scripts.md +++ b/docs/tools/clients/fcl-js/scripts.md @@ -29,7 +29,7 @@ console.log(response) // 3 ### A more complicated Script -Things like [Resources](../../../build/smart-contracts/cadence.md#resources) and [Structs](../../../build/smart-contracts/cadence.md#structures) are fairly common place in Cadence. +Things like [Resources](https://cadence-lang.org/docs/language/resources) and [Structs](https://cadence-lang.org/docs/language/composite-types#structures) are fairly common place in Cadence. In the following code snippet, our script defines a struct called `Point`, it then returns a list of them. diff --git a/docs/tools/clients/fcl-js/sdk-guidelines.md b/docs/tools/clients/fcl-js/sdk-guidelines.md index 95ec8d9170..fbc0a8044b 100644 --- a/docs/tools/clients/fcl-js/sdk-guidelines.md +++ b/docs/tools/clients/fcl-js/sdk-guidelines.md @@ -279,7 +279,7 @@ Transaction data is composed and signed with help of the SDK. The signed payload ## Transactions A transaction is nothing more than a signed set of data that includes script code which are instructions on how to mutate the network state and properties that define and limit it's execution. All these properties are explained bellow. -šŸ“– **Script** field is the portion of the transaction that describes the state mutation logic. On Flow, transaction logic is written in [Cadence](../../../build/smart-contracts/cadence.md). Here is an example transaction script: +šŸ“– **Script** field is the portion of the transaction that describes the state mutation logic. On Flow, transaction logic is written in [Cadence](https://cadence-lang.org/docs). Here is an example transaction script: ``` transaction(greeting: String) { execute { @@ -315,7 +315,7 @@ transaction { ``` šŸ“– **Gas limit** is the limit on the amount of computation a transaction requires, and it will abort if it exceeds its gas limit. -Cadence uses metering to measure the number of operations per transaction. You can read more about it in the [Cadence documentation](../../../build/smart-contracts/cadence.md). +Cadence uses metering to measure the number of operations per transaction. You can read more about it in the [Cadence documentation](https://cadence-lang.org/docs). The gas limit depends on the complexity of the transaction script. Until dedicated gas estimation tooling exists, it's best to use the emulator to test complex transactions and determine a safe limit. diff --git a/docs/tools/clients/flow-go-sdk/index.mdx b/docs/tools/clients/flow-go-sdk/index.md similarity index 99% rename from docs/tools/clients/flow-go-sdk/index.mdx rename to docs/tools/clients/flow-go-sdk/index.md index a4ba706c3e..65e9bbf40c 100644 --- a/docs/tools/clients/flow-go-sdk/index.mdx +++ b/docs/tools/clients/flow-go-sdk/index.md @@ -510,7 +510,7 @@ Executing a transaction requires couple of steps: A transaction is nothing more than a signed set of data that includes script code which are instructions on how to mutate the network state and properties that define and limit it's execution. All these properties are explained bellow. -šŸ“– **Script** field is the portion of the transaction that describes the state mutation logic. On Flow, transaction logic is written in [Cadence](../../../build/smart-contracts/cadence.md). Here is an example transaction script: +šŸ“– **Script** field is the portion of the transaction that describes the state mutation logic. On Flow, transaction logic is written in [Cadence](https://cadence-lang.org/docs). Here is an example transaction script: ``` transaction(greeting: String) { @@ -549,7 +549,7 @@ transaction { ``` šŸ“– **Gas limit** is the limit on the amount of computation a transaction requires, and it will abort if it exceeds its gas limit. -Cadence uses metering to measure the number of operations per transaction. You can read more about it in the [Cadence documentation](../../../build/smart-contracts/cadence.md). +Cadence uses metering to measure the number of operations per transaction. You can read more about it in the [Cadence documentation](https://cadence-lang.org/docs). The gas limit depends on the complexity of the transaction script. Until dedicated gas estimation tooling exists, it's best to use the emulator to test complex transactions and determine a safe limit. diff --git a/docs/tools/clients/unity-sdk/samples/ui-usage.md b/docs/tools/clients/unity-sdk/samples/ui-usage.md index 7097f304bd..0b9eb8f8d7 100644 --- a/docs/tools/clients/unity-sdk/samples/ui-usage.md +++ b/docs/tools/clients/unity-sdk/samples/ui-usage.md @@ -199,7 +199,7 @@ flow.AccountContractRemoved ### Scripts -Scripts are cadence code that you write and are executed on the blockchain. They can contain arguments and return values, and can interact with Smart Contracts. Scripts are read-only - they cannot mutate anything on the blockchain. Anything held in local memory is discarded when the script finishes execution. For more information on programming see [Cadence](../../../../build/smart-contracts/cadence.md). +Scripts are cadence code that you write and are executed on the blockchain. They can contain arguments and return values, and can interact with Smart Contracts. Scripts are read-only - they cannot mutate anything on the blockchain. Anything held in local memory is discarded when the script finishes execution. For more information on programming see [Cadence](https://cadence-lang.org/docs). **Execute Simple Script At Latest Block** @@ -257,7 +257,7 @@ For more information about Transactions, see [cadence/language/transactions](htt For more information about Transaction signing, see [concepts/transaction-signing](../../../../build/basics/transactions.md#signing-a-transaction). -For more information about Cadence programming, see [cadence](../../../../build/smart-contracts/cadence.md). +For more information about Cadence programming, see [Cadence](https://cadence-lang.org/docs). **Signing In** diff --git a/docs/tools/vscode-extension/index.mdx b/docs/tools/vscode-extension/index.md similarity index 91% rename from docs/tools/vscode-extension/index.mdx rename to docs/tools/vscode-extension/index.md index 4265c16c01..c06a0f26b1 100644 --- a/docs/tools/vscode-extension/index.mdx +++ b/docs/tools/vscode-extension/index.md @@ -2,7 +2,7 @@ title: Cadence VS Code Extension --- -This extension integrates [Cadence](../../build/smart-contracts/cadence.md), the resource-oriented smart contract programming language of [Flow](https://www.onflow.org/), into [Visual Studio Code](https://code.visualstudio.com/). +This extension integrates [Cadence](https://cadence-lang.org/docs), the resource-oriented smart contract programming language of [Flow](https://www.onflow.org/), into [Visual Studio Code](https://code.visualstudio.com/). It provides features like syntax highlighting, type checking, code completion, etc. Note that most editing features (type checking, code completion, etc.) are implemented in the [Cadence Language Server](https://github.com/onflow/cadence/tree/master/languageserver). From 3853a7f9932f94ca6a383b5dff642c80036ce4e0 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 21 Oct 2024 17:20:05 -0400 Subject: [PATCH 06/17] Fix broken links from .mdx to .md --- CONTRIBUTING.md | 4 ++-- docs/build/basics/accounts.md | 2 +- docs/build/basics/blocks.md | 2 +- docs/build/basics/collections.md | 2 +- docs/build/basics/scripts.md | 2 +- docs/build/basics/transactions.md | 2 +- docs/build/smart-contracts/overview.md | 2 +- docs/networks/staking/08-staking-rewards.md | 4 ++-- docs/tools/clients/fcl-js/api.md | 2 +- docs/tools/clients/index.md | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99eb7264ab..145db33c98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,7 @@ Examples: ## Go SDK -[Flow Go SDK](./flow-go-sdk/index.mdx) provides a set of packages for Go developers to build applications that interact with the Flow network. +[Flow Go SDK](./flow-go-sdk/index.md) provides a set of packages for Go developers to build applications that interact with the Flow network. ## JavaScript (FCL) @@ -119,7 +119,7 @@ Examples: ``` -```markdown index.mdx +```markdown index.md --- sidebar_position: 1 title: Tools diff --git a/docs/build/basics/accounts.md b/docs/build/basics/accounts.md index 8185c9b6e6..71f6ddef5a 100644 --- a/docs/build/basics/accounts.md +++ b/docs/build/basics/accounts.md @@ -221,6 +221,6 @@ There are multiple SDKs implementing the above APIs for different languages: **Javascript SDK** [tools/clients/fcl-js](../../tools/clients/fcl-js/index.md) -**Go SDK** [tools/clients/flow-go-sdk](../../tools/clients/flow-go-sdk/index.mdx) +**Go SDK** [tools/clients/flow-go-sdk](../../tools/clients/flow-go-sdk/index.md) Find a list of all SDKs here: [tools/clients](../../tools/clients/index.md) diff --git a/docs/build/basics/blocks.md b/docs/build/basics/blocks.md index d3e0c8cffc..4d583061f3 100644 --- a/docs/build/basics/blocks.md +++ b/docs/build/basics/blocks.md @@ -71,6 +71,6 @@ There are multiple SDKs implementing the above APIs for different languages: [**Javascript SDK**](../../tools/clients/fcl-js/index.md) -[**Go SDK**](../../tools/clients/flow-go-sdk/index.mdx) +[**Go SDK**](../../tools/clients/flow-go-sdk/index.md) Find a list of all SDKs [here](../../tools/clients/index.md) diff --git a/docs/build/basics/collections.md b/docs/build/basics/collections.md index b772609345..83fda90ee0 100644 --- a/docs/build/basics/collections.md +++ b/docs/build/basics/collections.md @@ -28,6 +28,6 @@ There are multiple SDKs implementing the above APIs for different languages: [**Javascript SDK**](../../tools/clients/fcl-js/index.md) -[**Go SDK**](../../tools/clients/flow-go-sdk/index.mdx) +[**Go SDK**](../../tools/clients/flow-go-sdk/index.md) Find a list of all SDKs [here](../../tools/clients/index.md) diff --git a/docs/build/basics/scripts.md b/docs/build/basics/scripts.md index 662943c743..edcb7c7ba8 100644 --- a/docs/build/basics/scripts.md +++ b/docs/build/basics/scripts.md @@ -73,7 +73,7 @@ There are multiple SDKs implementing the above APIs for different languages: [**Javascript SDK**](../../tools/clients/fcl-js/index.md) -[**Go SDK**](../../tools/clients/flow-go-sdk/index.mdx) +[**Go SDK**](../../tools/clients/flow-go-sdk/index.md) Find a list of all SDKs [here](../../tools/clients/index.md) diff --git a/docs/build/basics/transactions.md b/docs/build/basics/transactions.md index d777334503..5c95629508 100644 --- a/docs/build/basics/transactions.md +++ b/docs/build/basics/transactions.md @@ -442,6 +442,6 @@ There are multiple SDKs implementing the above APIs for different languages: [**Javascript SDK**](../../tools/clients/fcl-js/index.md) -[**Go SDK**](../../tools/clients/flow-go-sdk/index.mdx) +[**Go SDK**](../../tools/clients/flow-go-sdk/index.md) Find a list of all SDKs [here](../../tools/clients/index.md) diff --git a/docs/build/smart-contracts/overview.md b/docs/build/smart-contracts/overview.md index 5598b898c6..507c8681ff 100644 --- a/docs/build/smart-contracts/overview.md +++ b/docs/build/smart-contracts/overview.md @@ -25,7 +25,7 @@ To build confidently, you will want to set up the appropriate local environment - [Flow CLI](../../tools/flow-cli/index.md): A utility to directly interact with the chain and manage accounts and contracts. - [Flow Emulator](../../tools/emulator/index.md): A lightweight server that simulates the Flow blockchain (strongly recommended during development). - [Flow Dev Wallet](https://github.com/onflow/fcl-dev-wallet/): A utility to simulate user wallets in development. -- [Visual Studio Code Extension](../../tools/vscode-extension/index.mdx): An IDE integration for developing smart contracts. +- [Visual Studio Code Extension](../../tools/vscode-extension/index.md): An IDE integration for developing smart contracts. - [JS Testing Framework](https://github.com/onflow/flow-js-testing): A framework to test your smart contracts. ## Storing Data on Flow diff --git a/docs/networks/staking/08-staking-rewards.md b/docs/networks/staking/08-staking-rewards.md index 56220372a6..605d6b1158 100644 --- a/docs/networks/staking/08-staking-rewards.md +++ b/docs/networks/staking/08-staking-rewards.md @@ -78,7 +78,7 @@ Events Block #51753836: - amount (UFix64): 17.31047712 ``` -Example using [Flow Go SDK](../../tools/clients/flow-go-sdk/index.mdx) +Example using [Flow Go SDK](../../tools/clients/flow-go-sdk/index.md) ``` package main @@ -196,7 +196,7 @@ Events: ``` -Example using [Flow Go SDK](../../tools/clients/flow-go-sdk/index.mdx) +Example using [Flow Go SDK](../../tools/clients/flow-go-sdk/index.md) ``` package main diff --git a/docs/tools/clients/fcl-js/api.md b/docs/tools/clients/fcl-js/api.md index 9b373a3341..f59ce9ae3f 100644 --- a/docs/tools/clients/fcl-js/api.md +++ b/docs/tools/clients/fcl-js/api.md @@ -590,7 +590,7 @@ _Pass in the following as a single object with the following keys. All keys are | ---------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `cadence` | string **(required)** | A valid cadence transaction. | | `args` | [ArgumentFunction](#argumentfunction) | Any arguments to the script if needed should be supplied via a function that returns an array of arguments. | -| `limit` | number | Compute (Gas) limit for query. Read the [documentation about computation cost](../flow-go-sdk/index.mdx#gas-limit) for information about how computation cost is calculated on Flow. | +| `limit` | number | Compute (Gas) limit for query. Read the [documentation about computation cost](../flow-go-sdk/index.md#gas-limit) for information about how computation cost is calculated on Flow. | | `proposer` | [AuthorizationFunction](#authorization-function) | The authorization function that returns a valid [AuthorizationObject](#authorizationobject) for the [proposer role](#TransactionRolesObject). | #### Returns diff --git a/docs/tools/clients/index.md b/docs/tools/clients/index.md index 9a3e4aa9cc..b0a28dc45b 100644 --- a/docs/tools/clients/index.md +++ b/docs/tools/clients/index.md @@ -2,7 +2,7 @@ ## Go SDK -[Flow Go SDK](./flow-go-sdk/index.mdx) provides a set of packages for Go developers to build applications that interact with the Flow network. +[Flow Go SDK](./flow-go-sdk/index.md) provides a set of packages for Go developers to build applications that interact with the Flow network. ## Python SDK From f5c5e78024493b3f6cac4c9f2ee88da38e6d18cf Mon Sep 17 00:00:00 2001 From: Chase Fleming Date: Mon, 21 Oct 2024 15:37:52 -0700 Subject: [PATCH 07/17] Move runner output to right panel (#957) Co-authored-by: Chase Fleming <1666730+chasefleming@users.noreply.github.com> --- docs/build/getting-started/hello-world.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build/getting-started/hello-world.md b/docs/build/getting-started/hello-world.md index c42c1356fd..b0eb3953be 100644 --- a/docs/build/getting-started/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -56,7 +56,7 @@ Let's break down what this script does: - **Run the Script**: Click the Run button to execute the script. - **View the Output**: Observe the output returned by the script. You should see the current value of the `greeting` variable, which is `"Hello, World!"`. - + ## Understanding the `HelloWorld` Contract From 779d6475d01591e52519ac4de97cca05cf354285 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Tue, 22 Oct 2024 08:49:23 -0400 Subject: [PATCH 08/17] Resolve merge conflicts --- docs/build/basics/smart-contracts.md | 13 +++++++++++++ docs/build/getting-started/hello-world.md | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 docs/build/basics/smart-contracts.md diff --git a/docs/build/basics/smart-contracts.md b/docs/build/basics/smart-contracts.md new file mode 100644 index 0000000000..c075403ddf --- /dev/null +++ b/docs/build/basics/smart-contracts.md @@ -0,0 +1,13 @@ +--- +slug: /build/basics/smart-contracts +redirect: /build/smart-contracts/overview +title: Smart Contracts ā†™ +--- + +# Smart Contracts + +Go to [Smart Contracts](../../build/smart-contracts/overview.md) + +import {Redirect} from '@docusaurus/router'; + +; diff --git a/docs/build/getting-started/hello-world.md b/docs/build/getting-started/hello-world.md index b0eb3953be..726ec8eeee 100644 --- a/docs/build/getting-started/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -22,11 +22,19 @@ After completing this guide, you'll be able to: In later steps, you'll learn how to: +<<<<<<< HEAD * Create a Flow project using the [Flow CLI]. * Add an already-deployed contract to your project with the [Dependency Manager]. * Deploy a smart contract locally to the [Flow Emulator]. * Write and execute transactions to interact with a deployed smart contract. * Display data from a Cadence smart contract on a React frontend using the [Flow Client Library]. +======= +* Create a Flow project using the [Flow CLI](../../tools/flow-cli). +* Add an already-deployed contract to your project with the [Dependency Manager](../../tools/flow-cli/dependency-manager.md). +* Deploy a smart contract locally to the [Flow Emulator](../../tools/emulator). +* Write and execute transactions to interact with a deployed smart contract. +* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../tools/clients/fcl-js). +>>>>>>> 673dc72e5 (Update Why Flow and supporting first-pass at smoothing organization) ## Calling a Contract With a Script From 2269dd235bc3bc271f34535e11538db3e159655a Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Tue, 22 Oct 2024 08:43:26 -0400 Subject: [PATCH 09/17] Fix last mdx link --- docs/tools/flow-cli/lint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/flow-cli/lint.md b/docs/tools/flow-cli/lint.md index 05f09d1fdd..1f86bfb83c 100644 --- a/docs/tools/flow-cli/lint.md +++ b/docs/tools/flow-cli/lint.md @@ -29,5 +29,5 @@ test.cdc:35:6: removal-hint: unnecessary force operator ``` :::info -The Cadence Linter is also available in the [Cadence VSCode extension](../vscode-extension/index.mdx), which provides real-time feedback as you write your code. +The Cadence Linter is also available in the [Cadence VSCode extension](../vscode-extension/index.md), which provides real-time feedback as you write your code. ::: \ No newline at end of file From b9717bf9b4755a25e25ce64d090a8c298d289bef Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 21 Oct 2024 15:39:04 -0400 Subject: [PATCH 10/17] Update Why Flow and supporting first-pass at smoothing organization --- docs/build/flow.md | 2 ++ docs/build/getting-started/hello-world.md | 26 ++++++----------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/docs/build/flow.md b/docs/build/flow.md index ac2df3db04..dee0024701 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -19,6 +19,8 @@ Flow is a fast, decentralized, and developer-friendly blockchain designed to be ### Flow Cadence +- **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. +- **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. - **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. - **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. - **Resource-oriented programming:** Smart contracts on Flow are natively written in [Cadence], an easier and safer programming language for crypto assets and apps. diff --git a/docs/build/getting-started/hello-world.md b/docs/build/getting-started/hello-world.md index 726ec8eeee..6d64c2cd7c 100644 --- a/docs/build/getting-started/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -1,10 +1,10 @@ --- sidebar_position: 1 -sidebar_label: Hello World +sidebar_label: 1 - Smart Contract Basics --- import VerticalSplit from "./vertical-split.svg" -# Hello World +# Part 1 - Smart Contract Basics In this quickstart guide, you'll interact with your first smart contract on the Flow Testnet. `Testnet` is a public instance of the Flow blockchain designed for experimentation, where you can deploy and invoke smart contracts without incurring any real-world costs. @@ -22,19 +22,11 @@ After completing this guide, you'll be able to: In later steps, you'll learn how to: -<<<<<<< HEAD -* Create a Flow project using the [Flow CLI]. -* Add an already-deployed contract to your project with the [Dependency Manager]. -* Deploy a smart contract locally to the [Flow Emulator]. +* Create a Flow project using the [Flow CLI](../../../tools/flow-cli). +* Add an already-deployed contract to your project with the [Dependency Manager](../../../tools/flow-cli/dependency-manager.md). +* Deploy a smart contract locally to the [Flow Emulator](../../../tools/emulator). * Write and execute transactions to interact with a deployed smart contract. -* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library]. -======= -* Create a Flow project using the [Flow CLI](../../tools/flow-cli). -* Add an already-deployed contract to your project with the [Dependency Manager](../../tools/flow-cli/dependency-manager.md). -* Deploy a smart contract locally to the [Flow Emulator](../../tools/emulator). -* Write and execute transactions to interact with a deployed smart contract. -* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../tools/clients/fcl-js). ->>>>>>> 673dc72e5 (Update Why Flow and supporting first-pass at smoothing organization) +* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../../tools/clients/fcl-js). ## Calling a Contract With a Script @@ -112,8 +104,4 @@ By understanding the `HelloWorld` contract and how to interact with it, you're b Proceed to the next tutorial to learn how to create your own contracts and deploy them live using the Flow CLI. [Cadence]: https://cadence-lang.org/ -[EVM]: https://flow.com/upgrade/crescendo/evm -[Flow CLI]: ../../tools/flow-cli -[Dependency Manager]: ../../tools/flow-cli/dependency-manager.md -[Flow Emulator]: ../../tools/emulator -[Flow Client Library]: ../../tools/clients/fcl-js +[EVM]: https://flow.com/upgrade/crescendo/evm \ No newline at end of file From a092597134edf1fc9bd0648e957c5ce3da653885 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 21 Oct 2024 15:39:04 -0400 Subject: [PATCH 11/17] Update Why Flow and supporting first-pass at smoothing organization --- docs/build/getting-started/hello-world.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/build/getting-started/hello-world.md b/docs/build/getting-started/hello-world.md index 6d64c2cd7c..831ebd5a57 100644 --- a/docs/build/getting-started/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -1,10 +1,10 @@ --- sidebar_position: 1 -sidebar_label: 1 - Smart Contract Basics +sidebar_label: Hello World --- import VerticalSplit from "./vertical-split.svg" -# Part 1 - Smart Contract Basics +# Hello World In this quickstart guide, you'll interact with your first smart contract on the Flow Testnet. `Testnet` is a public instance of the Flow blockchain designed for experimentation, where you can deploy and invoke smart contracts without incurring any real-world costs. @@ -22,11 +22,11 @@ After completing this guide, you'll be able to: In later steps, you'll learn how to: -* Create a Flow project using the [Flow CLI](../../../tools/flow-cli). -* Add an already-deployed contract to your project with the [Dependency Manager](../../../tools/flow-cli/dependency-manager.md). -* Deploy a smart contract locally to the [Flow Emulator](../../../tools/emulator). +* Create a Flow project using the [Flow CLI](../../tools/flow-cli). +* Add an already-deployed contract to your project with the [Dependency Manager](../../tools/flow-cli/dependency-manager.md). +* Deploy a smart contract locally to the [Flow Emulator](../../tools/emulator). * Write and execute transactions to interact with a deployed smart contract. -* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../../tools/clients/fcl-js). +* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../tools/clients/fcl-js). ## Calling a Contract With a Script From 2baebe8c1bded23c8299b29372b1cd639e356add Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Tue, 22 Oct 2024 09:27:55 -0400 Subject: [PATCH 12/17] Fix additional relative links --- docs/build/flow.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/build/flow.md b/docs/build/flow.md index dee0024701..b77fb0241d 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -29,10 +29,10 @@ Flow is a fast, decentralized, and developer-friendly blockchain designed to be ### Flow EVM -- **Speed, Cost, and Compatibility**: Flow EVM can **already** run all of your audited Solidity contracts at **less than 1 second, less than 1 cent per transaction** (for transfers, etc.). +- **Speed, Cost, and Compatibility**: Flow EVM can already run all of your audited Solidity contracts at less than 1 second, less than 1 cent per transaction (for transfers, etc.). - **Bridge from Other EVM Networks**: You can [bridge] hundreds of assets from dozens of chains to Flow. - **VM Token Bridge**: Assets can be bridged between Flow Cadence and Flow EVM easily with the VM token bridge. -- **Access to Cadence**: You can access Cadence features and contracts from Flow EVM to take advantage of features such as native VRF, higher computation for lower cost, and any asset on Cadence Flow. +- **Access to Cadence**: You can access Cadence features and contracts from Flow EVM to take advantage of features such as native [VRF], higher computation for lower cost, and any asset on Cadence Flow. :::tip @@ -54,7 +54,7 @@ To take advantage of the full power of Flow, you'll need to learn [Cadence]. Le If you're not ready to take the plunge and learn [Cadence], try out "EVM++" by deploying your existing [EVM] contracts. You'll find that Flow EVM is faster and cheaper than nearly every other EVM solution - without compromising on security. -Deploying on Flow EVM also gives your Solidity contracts access to Flow Cadence features, such as native [VRF]. +Deploying on Flow EVM also gives your Solidity contracts access to many Flow Cadence features, such as native [VRF]. ### App Development Quickstart @@ -90,26 +90,26 @@ The [FLOW] token is the native currency for the Flow network. Developers and use ### Tokenomics -- To understand more about Flow's Token Economics, and the **FLOW token**, you can read the [Flow Token Economics] guide. +- To understand more about Flow's Token Economics, and the FLOW token, read the [Flow Token Economics] guide. - FLOW tokens are Flow's native Fungible Token. To learn more about how to work with them in your applications, review the [FLOW] article. [digital assets]: https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets [multi-role architecture]: https://www.onflow.org/primer -[onchain randomness]: https://developers.flow.com/build/advanced-concepts/randomness +[onchain randomness]: ./advanced-concepts/randomness [paying $10+ USD per number]: https://docs.chain.link/vrf/v2-5/billing [scale without sharding]: https://www.onflow.org/post/flow-blockchain-multi-node-architecture-advantages [a day]: https://docs.zksync.io/zk-stack/concepts/finality#finality-on-zksync-era [a week]: https://docs.optimism.io/stack/rollup/overview#fault-proofs -[happens in 20 seconds]: https://developers.flow.com/build/basics/transactions#flow -[signer roles]: https://developers.flow.com/build/basics/transactions#signer-roles +[happens in 20 seconds]: ./basics/transactions#flow +[signer roles]: ./basics/transactions#signer-roles [Cadence]: https://cadence-lang.org/ [EVM]: https://flow.com/upgrade/crescendo/evm [Guide for Solidity Developers]: https://cadence-lang.org/docs/solidity-to-cadence [account abstraction]: https://flow.com/account-abstraction -[bridge]: https://developers.flow.com/ecosystem/bridges +[bridge]: ../ecosystem/bridges [Flow App Quickstart]: ./guides/flow-app-quickstart -[core contracts]: ../build/core-contracts/index -[FLOW]: ../build/core-contracts/03-flow-token +[core contracts]: ./core-contracts +[FLOW]: ./core-contracts/flow-token [Flow Technical Primer]: https://www.onflow.org/primer [Three technical whitepapers]: https://www.onflow.org/technical-paper [Flow Token Economics]: https://www.onflow.org/flow-token-economics From cad28fee731b8d8f6933dee2bce8f87481dd4cbb Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Tue, 22 Oct 2024 16:20:20 -0400 Subject: [PATCH 13/17] Apply feedback --- docs/build/flow.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/build/flow.md b/docs/build/flow.md index b77fb0241d..77d6f187df 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -13,7 +13,7 @@ Flow is a fast, decentralized, and developer-friendly blockchain designed to be ### Flow Blockchain - **Multi-role architecture:** Flow's [multi-role architecture] allows the network to [scale without sharding] to serve billions of users without reducing the decentralization of consensus. -- **True Fast Finality**: For most other networks, it takes minutes, [a day], or even [a week] to reach hard finality - the point in which a transaction cannot be reversed. On Flow, this [happens in 20 seconds], without compromising security. +- **True Fast Finality**: For most other networks, it takes minutes, [a day], or even [a week] to reach hard finality - the point in which a transaction cannot be reversed. On Flow, this [happens in well under 20 seconds], without compromising security. - **Native VRF**: Flow provides [onchain randomness] at the protocol level. Instead of implementing complex setup and [paying $10+ USD per number], simply call the built-in function. - **EVM Equivalence**: The [Cadence] VM is powerful enough to allow other VMs to run inside of it, almost like a Docker Container. The first one integrated in this way is [EVM], because of the comfort of many builders with Solidity and the EVM RPC API. @@ -23,16 +23,17 @@ Flow is a fast, decentralized, and developer-friendly blockchain designed to be - **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. - **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. - **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. -- **Resource-oriented programming:** Smart contracts on Flow are natively written in [Cadence], an easier and safer programming language for crypto assets and apps. +- **Security:** Smart contracts on Flow are natively written in [Cadence], an easier, safer, and more secure programming language for crypto assets and apps. It's the first high-level, [resource-oriented] programming language. - **Developer ergonomics:** This network is designed to maximize developer productivity. Examples range from upgradeable smart contracts and built-in logging support to the Flow Emulator. - **Consumer onboarding:** Flow was designed for mainstream consumers, with payment onramps catalyzing a safe and low-friction path from fiat to crypto. ### Flow EVM -- **Speed, Cost, and Compatibility**: Flow EVM can already run all of your audited Solidity contracts at less than 1 second, less than 1 cent per transaction (for transfers, etc.). +- **Speed, Cost, and Compatibility**: Flow EVM can already run all of your audited Solidity contracts at [less than 1 second], less than 1 cent per transaction ([usually way less!]). Unlike L2 solutions, Flow EVM reaches true finality in seconds - not in [a week]! - **Bridge from Other EVM Networks**: You can [bridge] hundreds of assets from dozens of chains to Flow. - **VM Token Bridge**: Assets can be bridged between Flow Cadence and Flow EVM easily with the VM token bridge. - **Access to Cadence**: You can access Cadence features and contracts from Flow EVM to take advantage of features such as native [VRF], higher computation for lower cost, and any asset on Cadence Flow. +- **EVM Equivalence:** Flow EVM is truly _EVM Equivalent_, not just _EVM Compatible_. It runs exactly the same as EVM mainnet, which means builders won't run into "minor" variances or endless "quirks" when they try to integrate. If it works on Ethereum Mainnet, it will work with Flow EVM. :::tip @@ -100,9 +101,12 @@ The [FLOW] token is the native currency for the Flow network. Developers and use [scale without sharding]: https://www.onflow.org/post/flow-blockchain-multi-node-architecture-advantages [a day]: https://docs.zksync.io/zk-stack/concepts/finality#finality-on-zksync-era [a week]: https://docs.optimism.io/stack/rollup/overview#fault-proofs -[happens in 20 seconds]: ./basics/transactions#flow +[less than 1 second]: https://evm.flowscan.io/stats +[usually way less!]: https://evm.flowscan.io/stats +[happens in well under 20 seconds]: ./basics/transactions#flow [signer roles]: ./basics/transactions#signer-roles [Cadence]: https://cadence-lang.org/ +[resource-oriented]: https://flow.com/post/resources-programming-ownership [EVM]: https://flow.com/upgrade/crescendo/evm [Guide for Solidity Developers]: https://cadence-lang.org/docs/solidity-to-cadence [account abstraction]: https://flow.com/account-abstraction From 00943db481b8470eedc811623d69a431760f3149 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Wed, 23 Oct 2024 14:31:38 -0400 Subject: [PATCH 14/17] Temporarily revert changes to Why Flow --- docs/build/basics/_category_.yml | 2 +- docs/build/flow.md | 111 +++++++------------------------ 2 files changed, 26 insertions(+), 87 deletions(-) diff --git a/docs/build/basics/_category_.yml b/docs/build/basics/_category_.yml index bab95b8f87..4fcde33299 100644 --- a/docs/build/basics/_category_.yml +++ b/docs/build/basics/_category_.yml @@ -1,2 +1,2 @@ -label: Flow Cadence Protocol +label: Flow Protocol position: 4 diff --git a/docs/build/flow.md b/docs/build/flow.md index 77d6f187df..f8a5c12b8e 100644 --- a/docs/build/flow.md +++ b/docs/build/flow.md @@ -6,60 +6,20 @@ sidebar_position: 1 # Why Flow -Flow is a fast, decentralized, and developer-friendly blockchain designed to be the foundation for a new generation of games, apps, and [digital assets] that power them. It is based on a unique, [multi-role architecture], and designed to [scale without sharding], allowing for massive improvements in speed and throughput while preserving a developer-friendly, ACID-compliant environment. It natively allows development of smart contracts in the powerful [Cadence] language, and also supports full [EVM] equivalence with contracts written in Solidity. +Flow is a fast, decentralized, and developer-friendly blockchain designed to be the foundation for a new generation of games, apps, and [digital assets](https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets) that power them. It is based on a unique, [multi-role architecture](https://www.onflow.org/primer), and designed to [scale without sharding](https://www.onflow.org/post/flow-blockchain-multi-node-architecture-advantages), allowing for massive improvements in speed and throughput while preserving a developer-friendly, ACID-compliant environment. ## What Makes Flow Unique -### Flow Blockchain - -- **Multi-role architecture:** Flow's [multi-role architecture] allows the network to [scale without sharding] to serve billions of users without reducing the decentralization of consensus. -- **True Fast Finality**: For most other networks, it takes minutes, [a day], or even [a week] to reach hard finality - the point in which a transaction cannot be reversed. On Flow, this [happens in well under 20 seconds], without compromising security. -- **Native VRF**: Flow provides [onchain randomness] at the protocol level. Instead of implementing complex setup and [paying $10+ USD per number], simply call the built-in function. -- **EVM Equivalence**: The [Cadence] VM is powerful enough to allow other VMs to run inside of it, almost like a Docker Container. The first one integrated in this way is [EVM], because of the comfort of many builders with Solidity and the EVM RPC API. - -### Flow Cadence - -- **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. -- **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. -- **Native Account Abstraction**: Flow has protocol-native [account abstraction]. All accounts are smart accounts, supporting scripting, multiple keys, multi-signature transactions, and walletless onboarding with social logins. -- **Gasless Transactions**: One of the three built-in [signer roles] for a Flow transaction is the _signer_. In other words, having one account sign a transaction and another pay for that transaction is simple. -- **Security:** Smart contracts on Flow are natively written in [Cadence], an easier, safer, and more secure programming language for crypto assets and apps. It's the first high-level, [resource-oriented] programming language. +- **Multi-role architecture:** Flow's node architecture allows the network to scale to serve billions of users without sharding or reducing the decentralization of consensus. +- **Resource-oriented programming:** Smart contracts on Flow are written in Cadence, an easier and safer programming language for crypto assets and apps. - **Developer ergonomics:** This network is designed to maximize developer productivity. Examples range from upgradeable smart contracts and built-in logging support to the Flow Emulator. - **Consumer onboarding:** Flow was designed for mainstream consumers, with payment onramps catalyzing a safe and low-friction path from fiat to crypto. -### Flow EVM - -- **Speed, Cost, and Compatibility**: Flow EVM can already run all of your audited Solidity contracts at [less than 1 second], less than 1 cent per transaction ([usually way less!]). Unlike L2 solutions, Flow EVM reaches true finality in seconds - not in [a week]! -- **Bridge from Other EVM Networks**: You can [bridge] hundreds of assets from dozens of chains to Flow. -- **VM Token Bridge**: Assets can be bridged between Flow Cadence and Flow EVM easily with the VM token bridge. -- **Access to Cadence**: You can access Cadence features and contracts from Flow EVM to take advantage of features such as native [VRF], higher computation for lower cost, and any asset on Cadence Flow. -- **EVM Equivalence:** Flow EVM is truly _EVM Equivalent_, not just _EVM Compatible_. It runs exactly the same as EVM mainnet, which means builders won't run into "minor" variances or endless "quirks" when they try to integrate. If it works on Ethereum Mainnet, it will work with Flow EVM. - -:::tip - -If you're already comfortable with Solidity, be sure to check out how [Cadence] works in our [Guide for Solidity Developers]! - -::: - -## Learning Shortcuts - -To get a complete picture on how to build on Flow, follow the šŸ‘ˆ sidebar top to bottom. This path will give you the most thorough onboarding experience. - -If you like to jump right into the deep end of the pool, take a look below for more direct links to advanced topics! - -### Learn Cadence +The following chapters summarize the content in this section. Read on more for details. -To take advantage of the full power of Flow, you'll need to learn [Cadence]. Learning a new language is an investment, but you'll find that Cadence is safer, more explicit, and less dangerous than other blockchain languages. Plus, it unlocks the full power of the Flow protocol! +## App Development -### Build with the EVM - -If you're not ready to take the plunge and learn [Cadence], try out "EVM++" by deploying your existing [EVM] contracts. You'll find that Flow EVM is faster and cheaper than nearly every other EVM solution - without compromising on security. - -Deploying on Flow EVM also gives your Solidity contracts access to many Flow Cadence features, such as native [VRF]. - -### App Development Quickstart - -The [Flow App Quickstart] covers the Flow core concepts, including: +The [Flow App Quickstart](./guides/flow-app-quickstart.md) covers the Flow core concepts, including: - **App Client:** The app client is the interface through which users interact with your app. Web and mobile applications are typical examples of app clients. - **Smart Contract:** A smart contract is a collection of code deployed to a permanent location on the blockchain that defines the core logic for a dApp. @@ -69,9 +29,9 @@ The [Flow App Quickstart] covers the Flow core concepts, including: - **Script:** A script is a request made to the blockchain that returns information about the state of your dApp's smart contracts. - **Flow Client Library (FCL):** The Flow Client Library is a framework that provides a standard interface to connect client applications and user wallets. -### Core Contracts +## Core Contracts -The Flow blockchain implements core functionality using its own smart contract language, [Cadence]. The core functionality is split into a set of contracts, called the [core contracts]: +The Flow blockchain implements core functionality using its own smart contract language, [Cadence](https://cadence-lang.org/docs/language). The core functionality is split into a set of contracts, so-called [core contracts](../build/core-contracts): - **Fungible Token:** The FungibleToken contract implements the Fungible Token Standard. It is the second contract ever deployed on Flow. - **Flow Token:** The FlowToken contract defines the FLOW network token. @@ -80,41 +40,20 @@ The Flow blockchain implements core functionality using its own smart contract l - **Staking Table:** The FlowIDTableStaking contract is the central table that manages staked nodes, delegation, and rewards. - **Epoch Contract:** The FlowEpoch contract is the state machine that manages Epoch phases and emits service events. -### FLOW Token - -The [FLOW] token is the native currency for the Flow network. Developers and users can use FLOW to transact on the network. Developers can integrate FLOW directly into their apps for peer-to-peer payments, service charges, or consumer rewards. FLOW can be held, transferred, or transacted peer-to-peer. - -### Technical Background - -- The [Flow Technical Primer] is a great place to start to understand how Flow works. -- The [Three technical whitepapers] cover the unique innovation behind the Flow blockchain network in-depth. - -### Tokenomics - -- To understand more about Flow's Token Economics, and the FLOW token, read the [Flow Token Economics] guide. -- FLOW tokens are Flow's native Fungible Token. To learn more about how to work with them in your applications, review the [FLOW] article. - -[digital assets]: https://www.onflow.org/post/flow-blockchain-cadence-programming-language-resources-assets -[multi-role architecture]: https://www.onflow.org/primer -[onchain randomness]: ./advanced-concepts/randomness -[paying $10+ USD per number]: https://docs.chain.link/vrf/v2-5/billing -[scale without sharding]: https://www.onflow.org/post/flow-blockchain-multi-node-architecture-advantages -[a day]: https://docs.zksync.io/zk-stack/concepts/finality#finality-on-zksync-era -[a week]: https://docs.optimism.io/stack/rollup/overview#fault-proofs -[less than 1 second]: https://evm.flowscan.io/stats -[usually way less!]: https://evm.flowscan.io/stats -[happens in well under 20 seconds]: ./basics/transactions#flow -[signer roles]: ./basics/transactions#signer-roles -[Cadence]: https://cadence-lang.org/ -[resource-oriented]: https://flow.com/post/resources-programming-ownership -[EVM]: https://flow.com/upgrade/crescendo/evm -[Guide for Solidity Developers]: https://cadence-lang.org/docs/solidity-to-cadence -[account abstraction]: https://flow.com/account-abstraction -[bridge]: ../ecosystem/bridges -[Flow App Quickstart]: ./guides/flow-app-quickstart -[core contracts]: ./core-contracts -[FLOW]: ./core-contracts/flow-token -[Flow Technical Primer]: https://www.onflow.org/primer -[Three technical whitepapers]: https://www.onflow.org/technical-paper -[Flow Token Economics]: https://www.onflow.org/flow-token-economics -[VRF]: ../evm/guides/vrf +## FLOW Token + +The [FLOW](../build/core-contracts/flow-token) token is the native currency for the Flow network. Developers and users can use FLOW to transact on the network. Developers can integrate FLOW directly into their apps for peer-to-peer payments, service charges, or consumer rewards. FLOW can be held, transferred, or transacted peer-to-peer. + +## Technical Background + +- The [Flow Technical Primer](https://www.onflow.org/primer) is a great place to start to understand how Flow works. +- The [Three technical whitepapers](https://www.onflow.org/technical-paper) cover the unique innovation behind the Flow blockchain network in-depth. + +## Tokenomics + +- To understand more about Flow's Token Economics, and the **FLOW token**, you can read the [Flow Token Economics](https://www.onflow.org/flow-token-economics) guide. +- FLOW tokens are Flow's native Fungible Token. To learn more about how to work with them in your applications, go [here](../build/core-contracts/flow-token). + +## More Concepts + +If you're a developer, looking to get a better understanding of working with Flow in your applications, use the šŸ‘ˆ left-hand navigation to explore the concepts pages. \ No newline at end of file From 33c8c6332d97436d83489d880d568ce0d947e59d Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Wed, 23 Oct 2024 12:11:17 -0700 Subject: [PATCH 15/17] Update docs/build/smart-contracts/learn-cadence.md Co-authored-by: Alex <12097569+nialexsan@users.noreply.github.com> --- docs/build/smart-contracts/learn-cadence.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/build/smart-contracts/learn-cadence.md b/docs/build/smart-contracts/learn-cadence.md index 38de28d479..4a7df41c89 100644 --- a/docs/build/smart-contracts/learn-cadence.md +++ b/docs/build/smart-contracts/learn-cadence.md @@ -4,6 +4,5 @@ slug: /build/learn-cadence title: Learn Cadence ā†—ļø --- -import {Redirect} from '@docusaurus/router'; ; \ No newline at end of file From 0ea5b8bd7b62b57d1f8e87164276eac63bf9b5e4 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Wed, 23 Oct 2024 16:00:12 -0400 Subject: [PATCH 16/17] Address feedback --- docs/build/differences-vs-evm/index.md | 15 +++++++++------ docs/build/getting-started/fcl-quickstart.md | 12 +++++++----- docs/build/getting-started/flow-cli.md | 14 ++++++++------ docs/build/getting-started/hello-world.md | 2 ++ docs/build/smart-contracts/learn-cadence.md | 1 + 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/docs/build/differences-vs-evm/index.md b/docs/build/differences-vs-evm/index.md index 0409b8a7ea..2dbf432b83 100644 --- a/docs/build/differences-vs-evm/index.md +++ b/docs/build/differences-vs-evm/index.md @@ -27,7 +27,7 @@ This natively enables interesting use cases, like key revocation, rotation, and :::warning -You must run an explicit account creation transaction on Flow to create a new account. [Flow CLI] can create an account on any network with a given public key. +You must run an explicit account creation transaction on Flow to create a new account. [Flow CLI] can create an account on any network with a given public key. Doing so requires a [very small fee] to be paid in FLOW. ::: @@ -67,7 +67,7 @@ Here are some additional resources that can help you get started with Cadence: ## Transactions and Scripts -You can interact with the state on most other blockchains by cryptographically authorizing smart contract function calls. On Flow, transactions are more complex and are written with Cadence code. This means that any number of contracts and function calls can be composed together atomically to mutate the blockchain state. +You can interact with the state on most other blockchains by cryptographically authorizing smart contract function calls. On Flow, transactions offer rich functionality through Cadence code. This allows you to seamlessly combine multiple contracts and function calls into a single transaction that updates the blockchain state - all executing together as one unified operation. Here is a sample transaction that mints an NFT from `ExampleNFT` contract on Testnet: @@ -187,19 +187,22 @@ If you're already familiar with blockchain development, here's a comparison betw - [overflow](https://github.com/bjartek/overflow) for testing in Go. - [js-testing](https://github.com/onflow/flow-js-testing) for testing in JS. + + [Why Flow]: ../flow.md -[EVM]: ../../evm/about -[accounts on Ethereum]: https://ethereum.org/en/developers/docs/accounts/ +[EVM]: ../../evm/about.md +[accounts on Ethereum]: https://ethereum.org/en/developers/docs/accounts [Flow CLI]: ../../tools/flow-cli/accounts/create-accounts.md +[very small fee]: ../basics/fees.md#fee-structure [Flow account model]: ../basics/accounts.md [Accounts]: ../basics/accounts.md -[storage]: http://localhost:3000/build/basics/accounts#storage +[storage]: ../basics/accounts.md#storage [Cadence]: https://cadence-lang.org/ [Resources]: https://cadence-lang.org/docs/language/resources [Capability-based Security]: https://en.wikipedia.org/wiki/Capability-based_security [Entitlements]: https://cadence-lang.org/docs/1.0/language/access-control#entitlements [Capability-based Access Control]: https://cadence-lang.org/docs/language/capabilities -[Guide for Solidity Developers](https://cadence-lang.org/docs/solidity-to-cadence) +[Guide for Solidity Developers]: https://cadence-lang.org/docs/solidity-to-cadence [The Cadence tutorial]: https://cadence-lang.org/docs/tutorial/first-steps [transaction nonce]: https://ethereum.org/en/developers/docs/accounts/#an-account-examined [Transactions]: ../basics/transactions.md diff --git a/docs/build/getting-started/fcl-quickstart.md b/docs/build/getting-started/fcl-quickstart.md index deac8e81f1..bd532d649a 100644 --- a/docs/build/getting-started/fcl-quickstart.md +++ b/docs/build/getting-started/fcl-quickstart.md @@ -157,10 +157,12 @@ Run `npm start` again. After a moment, the greeting from `HelloWorld` will appe For a deeper dive into writing an FCL app, such as how to change the chain state with FCL, check out [the app quickstart guide] or the [FCL documentation]. -[Flow Client Library]: ../../tools/clients/fcl-js -[Cadence]: https://cadence-lang.org/ + + +[Flow Client Library]: ../../tools/clients/fcl-js/index.md +[Cadence]: https://cadence-lang.org [React]: https://react.dev/learn -[Create React App]: https://create-react-app.dev/ +[Create React App]: https://create-react-app.dev [view the contract here]: https://f.dnz.dev/0xa1296b1e2e90ca5b/HelloWorld -[the app quickstart guide]: ../guides/flow-app-quickstart -[FCL documentation]: ../../tools/clients/fcl-js \ No newline at end of file +[the app quickstart guide]: ../guides/flow-app-quickstart.md +[FCL documentation]: ../../tools/clients/fcl-js/index.md \ No newline at end of file diff --git a/docs/build/getting-started/flow-cli.md b/docs/build/getting-started/flow-cli.md index d404d3cc3e..7b667444fa 100644 --- a/docs/build/getting-started/flow-cli.md +++ b/docs/build/getting-started/flow-cli.md @@ -241,14 +241,16 @@ If you want to continue on generating your own contracts, you can also use the t After that, it's easy to add your contract to your project configuration using the Flow CLI [`config` commands]. -[Flow Command Line Interface]: ../../tools/flow-cli + + +[Flow Command Line Interface]: ../../tools/flow-cli/index.md [Cadence]: https://cadence-lang.org/ -[configuration docs]: ../../tools/flow-cli/flow.json/configuration +[configuration docs]: ../../tools/flow-cli/flow.json/configuration.md [homebrew]: https://brew.sh/ [installation guide]: ../../tools/flow-cli/install [0xa1296b1e2e90ca5b]: https://contractbrowser.com/A.9dca641e9a4b691b.HelloWorld [Dependency Manager]: ../../tools/flow-cli/dependency-manager -[basic scripts]: ../basics/scripts -[basic transactions]: ../basics/transactions -[`generate` documentation]: ../../tools/flow-cli/boilerplate -[`config` commands]: https://developers.flow.com/tools/flow-cli/flow.json/manage-configuration \ No newline at end of file +[basic scripts]: ../basics/scripts.md +[basic transactions]: ../basics/transactions.md +[`generate` documentation]: ../../tools/flow-cli/boilerplate.md +[`config` commands]: ../../tools/flow-cli/flow.json/manage-configuration.md \ No newline at end of file diff --git a/docs/build/getting-started/hello-world.md b/docs/build/getting-started/hello-world.md index 9b16679694..69f9a51e70 100644 --- a/docs/build/getting-started/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -101,5 +101,7 @@ By understanding the `HelloWorld` contract and how to interact with it, you're b Proceed to the next tutorial to learn how to create your own contracts and deploy them live using the Flow CLI. + + [Cadence]: https://cadence-lang.org/ [EVM]: https://flow.com/upgrade/crescendo/evm \ No newline at end of file diff --git a/docs/build/smart-contracts/learn-cadence.md b/docs/build/smart-contracts/learn-cadence.md index 4a7df41c89..389c5129ca 100644 --- a/docs/build/smart-contracts/learn-cadence.md +++ b/docs/build/smart-contracts/learn-cadence.md @@ -4,5 +4,6 @@ slug: /build/learn-cadence title: Learn Cadence ā†—ļø --- + ; \ No newline at end of file From da37961036d6bd4863868977872128751d82cfee Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Wed, 23 Oct 2024 16:42:46 -0400 Subject: [PATCH 17/17] Readd a few more .md's to links --- docs/build/getting-started/hello-world.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/build/getting-started/hello-world.md b/docs/build/getting-started/hello-world.md index 69f9a51e70..0bbb9c62b3 100644 --- a/docs/build/getting-started/hello-world.md +++ b/docs/build/getting-started/hello-world.md @@ -22,11 +22,11 @@ After completing this guide, you'll be able to: In later steps, you'll learn how to: -* Create a Flow project using the [Flow CLI](../../tools/flow-cli). +* Create a Flow project using the [Flow CLI](../../tools/flow-cli/index.md). * Add an already-deployed contract to your project with the [Dependency Manager](../../tools/flow-cli/dependency-manager.md). -* Deploy a smart contract locally to the [Flow Emulator](../../tools/emulator). +* Deploy a smart contract locally to the [Flow Emulator](../../tools/emulator/index.md). * Write and execute transactions to interact with a deployed smart contract. -* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../tools/clients/fcl-js). +* Display data from a Cadence smart contract on a React frontend using the [Flow Client Library](../../tools/clients/fcl-js/index.md). ## Calling a Contract With a Script