Skip to content

Commit 01d730a

Browse files
committed
sentence case and other cleanup edits.
1 parent 9cb6559 commit 01d730a

File tree

11 files changed

+166
-168
lines changed

11 files changed

+166
-168
lines changed

docs/blockchain-development-tutorials/cadence/cadence-advantages/compose-with-cadence-transactions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ keywords:
1919
- Flowscan
2020
---
2121

22-
# Compose wth Cadence Transactions
22+
# Compose wth Cadence transactions
2323

2424
In this tutorial, you'll **compose with someone else's contracts** on Flow testnet. You'll write a Cadence transaction that reads public state from a contract named `Counter` and only increments the counter when it is odd. Then you'll extend the transaction to mint NFTs when the counter is odd, demonstrating how to compose multiple contracts in a single transaction. Everything runs against testnet using the Flow CLI and the dependency manager.
2525

@@ -44,7 +44,7 @@ After you complete this guide, you will be able to:
4444
- Create: https://developers.flow.com/build/tools/flow-cli/commands#create-accounts
4545
- Fund: https://developers.flow.com/build/tools/flow-cli/commands#fund-accounts
4646

47-
## Getting Started
47+
## Get started
4848

4949
Create a [new project] with the [Flow CLI]:
5050

@@ -229,13 +229,13 @@ You could trigger this same transaction **from an app** and **signed by a wallet
229229

230230
---
231231

232-
## Extend with NFT Minting
232+
## Extend with NFT minting
233233

234234
Now let's take our composition to the next level by adding NFT minting functionality when the counter is odd. We'll use an example NFT contract that's already deployed on testnet.
235235

236236
This is a silly use case, but it demonstrates the complex use cases you can add to your apps, after contract deployment, and even if you aren't the author of any of the contracts!
237237

238-
### Install the NFT Contract
238+
### Install the NFT contract
239239

240240
First, let's install the ExampleNFT contract dependency:
241241

@@ -249,7 +249,7 @@ This repository uses different deployments for core contracts than those that th
249249

250250
:::
251251

252-
### Understanding NFT Minting
252+
### Understand NFT minting
253253

254254
Let's look at how NFT minting works with this contract. The [MintExampleNFT transaction] shows the pattern:
255255

@@ -289,7 +289,7 @@ transaction(
289289

290290
You can copy this functionality and adapt it for our use case.
291291

292-
### Update the IncrementIfOdd Transaction
292+
### Update the IncrementIfOdd transaction
293293

294294
Now let's update our `IncrementIfOdd` transaction to mint an NFT when the counter is odd. You can either modify the existing transaction or create a new one:
295295

@@ -339,7 +339,7 @@ transaction() {
339339
}
340340
```
341341

342-
### Setup NFT Collection
342+
### Setup NFT collection
343343

344344
Before you can mint NFTs, set up an NFT collection in your account. Create a transaction to do this:
345345

@@ -390,7 +390,7 @@ You may need to run the regular `IncrementCounter` transaction first to get an o
390390
flow transactions send cadence/transactions/IncrementCounter.cdc --signer testnet-account --network testnet
391391
```
392392

393-
### View Your NFT
393+
### View your NFT
394394

395395
Click the transaction link in the console to view the transaction in [testnet Flowscan]. After you run the transaction **while the counter is odd**, you'll see an NFT in the `Asset Transfers` tab.
396396

docs/blockchain-development-tutorials/cadence/cadence-advantages/native-data-availibility-with-cadence-scripts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ If you are new to [_Hybrid Custody_], the high-level idea is that in Cadence, a
6060

6161
:::
6262

63-
## Getting Started
63+
## Get started
6464

6565
Create a new Flow project and generate a script file:
6666

@@ -81,7 +81,7 @@ We will **revise one script file** in four passes, and run it after each step. T
8181

8282
---
8383

84-
## Querying the account to find child accounts
84+
## Query the account to find child accounts
8585

8686
To start, write a script that borrows the parent's _Hybrid Custody_ manager and returns the child addresses it controls. This verifies that imports resolve and that the parent account is configured as expected.
8787

@@ -425,7 +425,7 @@ This demonstrates how you can easily modify Cadence scripts to answer different
425425
- If you see empty results in Step 4, confirm `isTopShot` matches the identifiers you observed in Step 3.
426426
- If you are not using _Hybrid Custody_, you can adapt Steps 2-4 to use `getAccount(child)` and scan **publicly exposed** `{NonFungibleToken.CollectionPublic}` capabilities, but you will not be able to assert provider access.
427427

428-
## How This Compares to Solidity
428+
## How This compares to Solidity
429429

430430
- **Solidity views are fixed**: You can only retrieve what the contract author exposed via `view` or `pure` functions. If you need a different aggregation or cross-contract traversal, you typically rely on a _data availability service_ or write a new contract to expose that view.
431431
- **Cadence scripts are flexible**: You compose types across modules, traverse account storage, and read public capabilities at query time. You do not need to redeploy contracts to answer new questions.

docs/blockchain-development-tutorials/cadence/cadence-advantages/upgrading-cadence-contracts.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ After you complete this guide, you will be able to:
4343
- A **funded testnet account** to deploy and update contracts.
4444
- See [Create accounts] and [Fund accounts] in the Flow CLI commands.
4545

46-
## Contract Upgrade Overview
46+
## Contract upgrade overview
4747

4848
Cadence provides a sophisticated contract upgrade system that allows you to modify deployed contracts while ensuring data consistency and preventing runtime crashes. It's crucial for successful upgrades that you understand what you can and can't change.
4949

50-
### What You CAN Upgrade
50+
### What you CAN upgrade
5151

5252
- **Add new functions** - Extend contract functionality with new methods.
5353
- **Add new events** - Emit additional events for monitoring and indexing.
@@ -57,15 +57,15 @@ Cadence provides a sophisticated contract upgrade system that allows you to modi
5757
- **Change access modifiers** - Update visibility of functions and fields.
5858
- **Reorder existing fields** - Field order doesn't affect storage.
5959

60-
### What You CANNOT Upgrade
60+
### What you CANNOT upgrade
6161

6262
- **Add new fields** - Would cause runtime crashes when loading existing data.
6363
- **Change field types** - Would cause deserialization errors.
6464
- **Remove existing fields** - Fields become inaccessible, but data remains.
6565
- **Change enum structures** - Raw values must remain consistent.
6666
- **Change contract name** - Contract address must remain the same.
6767

68-
### Why These Restrictions Exist
68+
### Why these restrictions exist
6969

7070
The [Cadence Contract Updatability documentation](https://cadence-lang.org/docs/language/contract-updatability) explains that these restrictions prevent:
7171

@@ -76,7 +76,7 @@ The [Cadence Contract Updatability documentation](https://cadence-lang.org/docs/
7676

7777
The validation system ensures that existing stored data remains valid and accessible after upgrades.
7878

79-
## Getting Started
79+
## Get started
8080

8181
Create a new Flow project for this tutorial:
8282

@@ -87,7 +87,7 @@ flow init upgrading-contracts-tutorial
8787

8888
Follow the prompts and create a `Basic Cadence project (no dependencies)` then open the new project in your editor.
8989

90-
### Create and Fund Testnet Account
90+
### Create and fund testnet account
9191

9292
You'll need a funded testnet account to deploy and update contracts. In a terminal in the root of your project folder:
9393

@@ -118,7 +118,7 @@ The faucet provides free testnet tokens for development and testing purposes. Th
118118

119119
---
120120

121-
## Deploy the Initial Counter Contract
121+
## Deploy the initial counter contract
122122

123123
To start, let's deploy a simple Counter contract to testnet.
124124

@@ -163,7 +163,7 @@ access(all) contract Counter {
163163
}
164164
```
165165

166-
### Configure Deployment
166+
### Configure deployment
167167

168168
Add testnet deployment configuration to your `flow.json`:
169169

@@ -208,7 +208,7 @@ Counter -> 0x9942a81bc6c3c5b7 (contract deployed successfully)
208208
🎉 All contracts deployed successfully
209209
```
210210

211-
### Test the Initial Contract
211+
### Test the initial contract
212212

213213
Use the provided transaction to test initial functionality:
214214

@@ -278,11 +278,11 @@ Events:
278278

279279
---
280280

281-
## Upgrade the Contract - Part 1: Adding Event for Even Numbers
281+
## Upgrade the contract - Part 1: Add event for even numbers
282282

283283
Let's start with a realistic scenario: What if we've realized it's very important to our users that they know when the counter reaches an even number, but we forgot to add an event for that case? Let's add that functionality first.
284284

285-
### Modify the Counter Contract - First Upgrade
285+
### Modify the Counter contract - first upgrade
286286

287287
Update `cadence/contracts/Counter.cdc` to add the new event and enhance the existing `increment()` function:
288288

@@ -328,7 +328,7 @@ access(all) contract Counter {
328328
}
329329
```
330330

331-
### Key Changes Made - Part 1
331+
### Key changes made - part 1
332332

333333
This first upgrade adds:
334334

@@ -344,11 +344,11 @@ This demonstrates how you can add new behavior and modify existing function beha
344344

345345
---
346346

347-
## Update the Deployed Contract - Part 1
347+
## Update the deployed contract - Part 1
348348

349349
Now let's update the deployed contract on testnet using the Flow CLI update command with our first upgrade.
350350

351-
### Update the Contract
351+
### Update the contract
352352

353353
Use the [Flow CLI update contract command] to upgrade your deployed contract:
354354

@@ -387,7 +387,7 @@ The contract successfully updated! Notice that:
387387

388388
:::
389389

390-
### Test the First Upgrade
390+
### Test the first upgrade
391391

392392
Let's test the new event functionality. Create a simple transaction to test the enhanced `increment()` function:
393393

@@ -427,11 +427,11 @@ Notice that:
427427

428428
---
429429

430-
## Upgrade the Contract - Part 2: Adding More Functionality
430+
## Upgrade the contract - Part 2: add more functionality
431431

432432
Now that we've successfully added the even number event, let's add more functionality to our contract. This demonstrates how you can make multiple incremental upgrades to extend your contract's capabilities.
433433

434-
### Modify the Counter Contract - Second Upgrade
434+
### Modify the Counter contract - second upgrade
435435

436436
Update `cadence/contracts/Counter.cdc` to add the additional functionality:
437437

@@ -500,7 +500,7 @@ access(all) contract Counter {
500500
}
501501
```
502502

503-
### Key Changes Made - Part 2
503+
### Key changes made - part 2
504504

505505
This second upgrade adds:
506506

@@ -511,11 +511,11 @@ This second upgrade adds:
511511

512512
---
513513

514-
## Update the Deployed Contract - Part 2
514+
## Update the deployed contract - Part 2
515515

516516
Now let's update the deployed contract with our second upgrade.
517517

518-
### Update the Contract Again
518+
### Update the contract again
519519

520520
Use the [Flow CLI update contract command] to upgrade your deployed contract with the additional functionality:
521521

@@ -555,7 +555,7 @@ The contract successfully updated again! Notice that:
555555

556556
:::
557557

558-
### Verify the Update
558+
### Verify the update
559559

560560
Let's verify that the existing functionality still works and the new functionality is available.
561561

@@ -597,11 +597,11 @@ Notice that:
597597

598598
---
599599

600-
## Test the New Functionality
600+
## Test the new functionality
601601

602602
Now let's create a transaction to test the new even counter functionality.
603603

604-
### Create Test Transaction
604+
### Create test transaction
605605

606606
Create a new transaction to test the upgraded functionality:
607607

@@ -649,7 +649,7 @@ transaction {
649649
}
650650
```
651651

652-
### Run the Test Transaction
652+
### Run the test transaction
653653

654654
Execute the transaction to test the new functionality:
655655

@@ -665,7 +665,7 @@ You will see logs that show:
665665
- The original `increment()` function still working normally
666666
- The new `CounterIncrementedToEven` event being emitted when incrementing results in an even number
667667

668-
### Verify Final State
668+
### Verify final state
669669

670670
Run the check script again to see the final state:
671671

@@ -687,11 +687,11 @@ This confirms that:
687687

688688
---
689689

690-
## Understanding Contract Upgrades in Cadence
690+
## Understand contract upgrades in Cadence
691691

692692
Cadence provides a sophisticated contract upgrade system that ensures data consistency while allowing controlled modifications. The [Cadence Contract Updatability documentation] provides comprehensive details about the validation rules and restrictions.
693693

694-
### What You Can Upgrade
694+
### What you can upgrade
695695

696696
When you upgrade Cadence contracts, you can:
697697

@@ -705,7 +705,7 @@ When you upgrade Cadence contracts, you can:
705705
- **Change access modifiers** of fields and functions
706706
- **Reorder existing fields** (order doesn't affect storage)
707707

708-
### What You Cannot Change
708+
### What You cannot change
709709

710710
There are important limitations to contract upgrades:
711711

@@ -732,9 +732,9 @@ The validation system focuses on preventing runtime inconsistencies with stored
732732

733733
:::
734734

735-
### Advanced Upgrade Patterns
735+
### Advanced upgrade patterns
736736

737-
#### The `#removedType` Pragma
737+
#### The `#removedType` pragma
738738

739739
For cases where you need to remove a type declaration (which is normally invalid), Cadence provides the `#removedType` pragma. This allows you to "tombstone" a type, which prevents it from being re-added with the same name:
740740

@@ -753,7 +753,7 @@ This pragma:
753753
- **Cannot be removed** after you add it (prevents circumventing restrictions).
754754
- **Only works with composite types**, not interfaces.
755755

756-
#### Enum Upgrade Restrictions
756+
#### Enum upgrade restrictions
757757

758758
Enums have special restrictions due to their raw value representation:
759759

@@ -762,7 +762,7 @@ Enums have special restrictions due to their raw value representation:
762762
- **Cannot change the raw type** of an enum.
763763
- **Cannot change enum case names** (would change stored values' meaning).
764764

765-
### Best Practices
765+
### Best practices
766766

767767
When you upgrade contracts:
768768

@@ -777,7 +777,7 @@ When you upgrade contracts:
777777

778778
---
779779

780-
## Why This Matters
780+
## Why this matters
781781

782782
Cadence's contract upgrade model provides several advantages:
783783

0 commit comments

Comments
 (0)