Skip to content

Commit

Permalink
Merge pull request #875 from onflow/Aliserag-patch-4
Browse files Browse the repository at this point in the history
Update fcl-quickstart.md
  • Loading branch information
Aliserag authored Aug 26, 2024
2 parents e211e4e + b0f6dbb commit 669b7ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/build/getting-started/quickstarts/fcl-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fcl.config({

## Querying the Chain

On Flow, you can interact with a contract by reading from the chain with a script or changing its state with a transaction. Reading is free and is done with FCL by passing a Cadence (the smart contract language of Flow) script to `fcl.query`. For our example we are going to read from a `HelloWorld` contract deployed to the account `0x9dca641e9a4b691b` on `testnet` (you can [view the contract here](https://f.dnz.dev/0x9dca641e9a4b691b/HelloWorld) to see what it looks like).
On Flow, you can interact with a contract by reading from the chain with a script or changing its state with a transaction. Reading is free and is done with FCL by passing a Cadence (the smart contract language of Flow) script to `fcl.query`. For our example we are going to read from a `HelloWorld` contract deployed to the account `0xa1296b1e2e90ca5b` on `testnet` (you can [view the contract here](https://f.dnz.dev/0xa1296b1e2e90ca5b/HelloWorld) to see what it looks like).

In the same `src/App.js` file, let's create app state to store our greeting and query the chain when the component renders in order to fetch the greeting state from the `HelloWorld` contract.

Expand All @@ -75,7 +75,7 @@ useEffect(() => {
const queryChain = async () => {
const res = await fcl.query({
cadence: `
import HelloWorld from 0x9dca641e9a4b691b
import HelloWorld from 0xa1296b1e2e90ca5b
access(all) fun main(): String {
return HelloWorld.greeting
Expand Down Expand Up @@ -109,7 +109,7 @@ function App() {
const queryChain = async () => {
const res = await fcl.query({
cadence: `
import HelloWorld from 0x9dca641e9a4b691b
import HelloWorld from 0xa1296b1e2e90ca5b
access(all) fun main(): String {
return HelloWorld.greeting
Expand Down Expand Up @@ -139,4 +139,4 @@ You just built an app on Flow!

## Mutating Chain State and More

For a deeper dive into writing an FCL app, such as how to change the chain state with FCL, check out [this guide](../../guides/flow-app-quickstart.md) or the [FCL documentation](../../../tools/clients/fcl-js/index.md).
For a deeper dive into writing an FCL app, such as how to change the chain state with FCL, check out [this guide](../../guides/flow-app-quickstart.md) or the [FCL documentation](../../../tools/clients/fcl-js/index.md).

0 comments on commit 669b7ca

Please sign in to comment.