From 821b4fe906c74fe87cdc3a35180f87d932bcf179 Mon Sep 17 00:00:00 2001 From: Josh Hannan Date: Wed, 5 Jun 2024 10:53:22 -0500 Subject: [PATCH] address PR comments --- .../version-1.0/cadence-migration-guide/index.md | 2 +- .../version-1.0/tutorial/01-first-steps.md | 14 +++++++------- .../version-1.0/tutorial/03-resources.md | 2 +- .../tutorial/05-non-fungible-tokens-2.md | 9 ++++++--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/versioned_docs/version-1.0/cadence-migration-guide/index.md b/versioned_docs/version-1.0/cadence-migration-guide/index.md index caabe7f..4cfa1c9 100644 --- a/versioned_docs/version-1.0/cadence-migration-guide/index.md +++ b/versioned_docs/version-1.0/cadence-migration-guide/index.md @@ -40,7 +40,7 @@ Help is available during the [Cadence 1.0 Office Hours](https://calendar.google. #### Expectations - Any contracts that are not upgraded will fail after Testnet and Mainnet upgrade. - They **WILL NOT** be able to be upgraded again, so it is imperative + They **cannot** be upgraded again, so it is imperative that developers stage their upgrades before the Cadence 1.0 migration. - After the Testnet upgrade, Cadence versions will differ on Testnet (v1.0) and Mainnet (v0.42). - Developers must take extra considerations if they wish to continue deploying on the mainnet during this period. Otherwise, incompatibilities between different Cadence versions will lead to failed deployments. diff --git a/versioned_docs/version-1.0/tutorial/01-first-steps.md b/versioned_docs/version-1.0/tutorial/01-first-steps.md index f881ae2..0fe35fb 100644 --- a/versioned_docs/version-1.0/tutorial/01-first-steps.md +++ b/versioned_docs/version-1.0/tutorial/01-first-steps.md @@ -15,7 +15,8 @@ Cadence introduces new features to smart contract programming that help develope - 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 (and their associated 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](../language/transactions.md) -- The utilization of capability-based security and entitlements, which enforces access control by requiring that access to objects +- The utilization of capability-based security and entitlements, + which enforces access control by requiring that access to objects is restricted to only the owner and those who have a valid reference to the object Please see the [Cadence introduction](../index.md) for more information about the high level design of the language. @@ -29,12 +30,11 @@ an in-browser editor and Flow emulator to experiment with Flow. Using the Flow Playground, you can write Cadence smart contracts, deploy them to a local Flow emulated blockchain, and submit transactions. -The Flow Playground should be compatible with any standard web browser, -but we recommend that you use Google Chrome with it, -because it has been tested and optimized primarily with the Chrome browser so far. +The Flow Playground should work with any standard web browser. +However, we recommend using Google Chrome, as it has been primarily tested and optimized for this browser. The [Flow Crescendo (Cadence 1.0) upgrade](https://flow.com/upgrade/crescendo) -introduces new powerful features to Cadence. Currently, the playground uses an older version +introduces new and powerful features to Cadence. Currently, the playground uses an older version of Cadence, but you can interact with a Cadence 1.0 playground by going to https://v1.play.flow.com/. @@ -76,8 +76,8 @@ that verifies and executes the performance of a contract (like a lawyer does) without the need for any trusted third party anywhere in the process, because the code itself is trusted. 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). +because they facilitate important functions, such as managing digital currency, +without relying on a central authority like a bank. [Cadence is the premier resource-oriented programming language](../index.md) for developing smart contracts and is currently diff --git a/versioned_docs/version-1.0/tutorial/03-resources.md b/versioned_docs/version-1.0/tutorial/03-resources.md index b37b6cc..3c65807 100644 --- a/versioned_docs/version-1.0/tutorial/03-resources.md +++ b/versioned_docs/version-1.0/tutorial/03-resources.md @@ -524,7 +524,7 @@ Here, we explicitly have to account for the possibility that the `helloResource` We use the nil-coalescing operator (`??`) to "unwrap" the optional. This basically means that we are handling the case where the `load` method returns `nil`. If it returns `nil`. We `panic`, which will abort execution of the transaction -with an error message. It is important for developers to always to provide detailed error messages +with an error message. It is important for developers to always provide detailed error messages so that if something goes wrong in the code, it is obvious what needs to be fixed. Refer to [Optionals In Cadence](../language/values-and-types.mdx#optionals) to learn more about optionals and how they are used. diff --git a/versioned_docs/version-1.0/tutorial/05-non-fungible-tokens-2.md b/versioned_docs/version-1.0/tutorial/05-non-fungible-tokens-2.md index 504d799..083f650 100644 --- a/versioned_docs/version-1.0/tutorial/05-non-fungible-tokens-2.md +++ b/versioned_docs/version-1.0/tutorial/05-non-fungible-tokens-2.md @@ -368,9 +368,12 @@ which means that for any given object, a user is allowed to access a field or me - Are the owner of the object - Have a valid reference to that field or method (note that references can only be created from capabilities, and capabilities can only be created by the owner of the object) -When a user stores their NFT `Collection` in their account storage, it is by default not available for other users to access. -A user's authorized account object (`&Account`, which gives access to private storage) -is only accessible by its owner. To give external accounts access to the `deposit` function, +When a user stores their NFT `Collection` in their account storage, +it is by default not available for other users to access +because it requires access to the authorized account object (`auth(Storage) &Account`) +which is only accessible by a transaction that the owner authorizes and signs. + +To give external accounts access to the `deposit` function, the `getIDs` function, and the `idExists` function, the owner creates an interface that only includes those fields: ```cadence