You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scraped_docs/developers_flow_com/blockchain_development_tutorials_cadence_cadence_advantages_native_data_availibility_with_cadence_scripts.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,8 +46,6 @@ On this page
46
46
47
47
# Native Data Availability With Cadence Scripts
48
48
49
-
## Overview[](#overview"Direct link to Overview")
50
-
51
49
In Solidity, you can only retrieve data from **view** functions that the contract author anticipated and included in the original contract. If the exact query you want is not exposed, teams typically rely on a *data availability service* such as The Graph, Covalent, Alchemy Enhanced APIs, Reservoir, or NFTScan to compute and serve that view.
52
50
53
51
In Cadence, **scripts** are general-purpose read programs. They can traverse public account storage, read public capabilities, and compose types from multiple contracts to answer new questions without modifying those contracts. You are not limited to the pre-written surface area of a single contract's views.
@@ -81,7 +79,7 @@ tip
81
79
82
80
If you are new to [*Hybrid Custody*](/blockchain-development-tutorials/cadence/account-management), the high-level idea is that in Cadence, a parent account can manage one or more child accounts through managed capabilities. This guide uses those capabilities to enumerate NFT collections the parent can control.
83
81
84
-
## Getting Started[](#getting-started"Direct link to Getting Started")
82
+
## Get started[](#get-started"Direct link to Get started")
85
83
86
84
Create a new Flow project and generate a script file:
87
85
@@ -119,7 +117,7 @@ We will **revise one script file** in four passes, and run it after each step. T
119
117
120
118
---
121
119
122
-
## Querying the account to find child accounts[](#querying-the-account-to-find-child-accounts"Direct link to Querying the account to find child accounts")
120
+
## Query the account to find child accounts[](#query-the-account-to-find-child-accounts"Direct link to Query the account to find child accounts")
123
121
124
122
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.
125
123
@@ -920,7 +918,7 @@ This demonstrates how you can easily modify Cadence scripts to answer different
920
918
* If you see empty results in Step 4, confirm `isTopShot` matches the identifiers you observed in Step 3.
921
919
* 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.
922
920
923
-
## How This Compares to Solidity[](#how-this-compares-to-solidity"Direct link to How This Compares to Solidity")
921
+
## How This compares to Solidity[](#how-this-compares-to-solidity"Direct link to How This compares to Solidity")
924
922
925
923
***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.
926
924
***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.
@@ -950,7 +948,7 @@ This approach gives you the freedom to build applications that can access any on
950
948
951
949
[Edit this page](https://github.com/onflow/docs/tree/main/docs/blockchain-development-tutorials/cadence/cadence-advantages/native-data-availibility-with-cadence-scripts.md)
952
950
953
-
Last updated on **Oct 27, 2025** by **cshannon1218**
951
+
Last updated on **Oct 30, 2025** by **cshannon1218**
*[Overview](#overview)*[Objectives](#objectives)*[Prerequisites](#prerequisites)*[Getting Started](#getting-started)*[Querying the account to find child accounts](#querying-the-account-to-find-child-accounts)*[Listing the storage paths found in each child account](#listing-the-storage-paths-found-in-each-child-account)*[Detecting NFT collections the parent can control](#detecting-nft-collections-the-parent-can-control)*[Filtering NFT collection to find and return Top Shots](#filtering-nft-collection-to-find-and-return-top-shots)*[Extending the script to include AllDay NFTs](#extending-the-script-to-include-allday-nfts)*[Troubleshooting](#troubleshooting)*[How This Compares to Solidity](#how-this-compares-to-solidity)*[Conclusion](#conclusion)
965
+
*[Objectives](#objectives)*[Prerequisites](#prerequisites)*[Get started](#get-started)*[Query the account to find child accounts](#query-the-account-to-find-child-accounts)*[Listing the storage paths found in each child account](#listing-the-storage-paths-found-in-each-child-account)*[Detecting NFT collections the parent can control](#detecting-nft-collections-the-parent-can-control)*[Filtering NFT collection to find and return Top Shots](#filtering-nft-collection-to-find-and-return-top-shots)*[Extending the script to include AllDay NFTs](#extending-the-script-to-include-allday-nfts)*[Troubleshooting](#troubleshooting)*[How This compares to Solidity](#how-this-compares-to-solidity)*[Conclusion](#conclusion)
0 commit comments