Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In Cadence, **scripts** are general-purpose read programs. They can traverse pub

:::info

In Cadence, a _script_ is a read-only program that can access public data across accounts and contracts in a strongly typed way. It does not require gas or user signatures.
In Cadence, a _script_ is a read-only program that can access public data across accounts and contracts in a strongly typed way. It does not require a user signatures not does it incur any fees.

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ After you complete this tutorial, you'll be able to:
- **Implement monitoring and maintenance** practices for production applications.
- **Understand the deployment pipeline** from development to production.

**Prerequisites:**
**Prerequisites:**

- Completed all previous tutorials ([Environment Setup], [Smart Contract Interaction], [Building a Frontend App]).
- Counter contract and frontend app working locally.
Expand All @@ -54,6 +54,7 @@ Flow has several networks for different purposes:
- **Mainnet**: Production network with real Flow tokens.

Each network has its own:

- Access nodes and APIs.
- Account addresses and contract deployments.
- Token economics (free on testnet, real value on mainnet).
Expand All @@ -67,6 +68,7 @@ flow accounts create --network testnet
```

When prompted:

1. **Account name**: Enter `testnet-account`
2. **Select "Testnet" Network**

Expand All @@ -92,7 +94,7 @@ flow accounts fund --network testnet testnet-account
Check your account balance:

```zsh
flow accounts list
flow accounts list
```

You will see your account details with a balance of Flow tokens.
Expand All @@ -106,8 +108,9 @@ flow config add deployment
```

Follow the prompts:

1. **Network**: `testnet`
2. **Account**: `testnet-account`
2. **Account**: `testnet-account`
3. **Contract**: `Counter`
4. **Deploy more contracts**: `yes`
5. **Contract**: `NumberFormatter`
Expand All @@ -117,21 +120,14 @@ Your `flow.json` now includes a testnet deployment section:
```json
{
"deployments": {
"emulator": {
"default": [
"Counter"
],
"emulator-account": [
"NumberFormatter"
]
},
"testnet": {
"testnet-account": [
"Counter",
"NumberFormatter"
]
}
}
"emulator": {
"default": ["Counter"],
"emulator-account": ["NumberFormatter"]
},
"testnet": {
"testnet-account": ["Counter", "NumberFormatter"]
}
}
}
```

Expand All @@ -148,8 +144,8 @@ You will see output similar to:
```zsh
Deploying 2 contracts for accounts: testnet-account

Counter -> 0x9942a81bc6c3c5b7 (d8fe130e5b2212a5c7b3c34fe6e74ede80c750bc4c57e57788e81b247dcd7fe0)
NumberFormatter -> 0x9942a81bc6c3c5b7 (9a550aeefa5ede62cb95f0549084b2ab7abf3a493cf853d50c1c377a7be733b2)
Counter -> 0x9942a81bc6c3c5b7 (d8fe130e5b2212a5c7b3c34fe6e74ede80c750bc4c57e57788e81b247dcd7fe0)
NumberFormatter -> 0x9942a81bc6c3c5b7 (9a550aeefa5ede62cb95f0549084b2ab7abf3a493cf853d50c1c377a7be733b2)

🎉 All contracts deployed successfully
```
Expand All @@ -163,6 +159,7 @@ flow scripts execute cadence/scripts/GetCounter.cdc --network testnet
```

You should see:

```zsh
Result: "0"
```
Expand Down Expand Up @@ -224,7 +221,7 @@ export default function RootLayout({
**Key changes:**

- `accessNodeUrl`: Changed from localhost to Flow's testnet REST API.
- `flowNetwork`: Changed from 'emulator' to 'testnet'.
- `flowNetwork`: Changed from 'emulator' to 'testnet'.
- `discoveryWallet`: Updated to use testnet wallet discovery.

### Test your testnet frontend
Expand All @@ -240,7 +237,7 @@ Visit `http://localhost:3000` and you will see:
1. **Counter value**: Displays the current count from your testnet contract.
2. **Connect Wallet**: You can now connect with various Flow wallets (not just Dev Wallet).
3. **Increment functionality**: Transactions are sent to the live testnet.
4. **Real transaction costs**: Small amounts of testnet Flow are used for gas.
4. **Real transaction costs**: Small amounts of testnet Flow are used to pay for compute units, the Flow Cadence equivalence of gas.

**Important**: When you connect your wallet, make sure to:

Expand Down Expand Up @@ -270,14 +267,15 @@ flow accounts create --network mainnet
```

When prompted:

1. **Account name**: Enter `mainnet-account`
2. **Select "Mainnet" Network**

### Acquire FLOW tokens

You can purchase Flow tokens from major exchanges like [Coinbase], [Moonpay], and [Binance].

To obtain Flow directly from the Flow Wallet, click "Buy" in your account.
To obtain Flow directly from the Flow Wallet, click "Buy" in your account.

![flow-wallet-icons](./imgs/flow-wallet-icons.png)

Expand All @@ -294,8 +292,9 @@ flow config add deployment --network mainnet
```

Follow the prompts:

1. **Network**: `mainnet`
2. **Account**: `mainnet-account`
2. **Account**: `mainnet-account`
3. **Contract**: `Counter`
4. **Deploy more contracts**: `yes`
5. **Contract**: `NumberFormatter`
Expand All @@ -314,27 +313,17 @@ Your `flow.json` will now include mainnet configuration:
}
},
"deployments": {
"emulator": {
"default": [
"Counter"
],
"emulator-account": [
"NumberFormatter"
]
},
"testnet": {
"testnet-account": [
"Counter",
"NumberFormatter"
]
},
"mainnet": {
"mainnet-account": [
"Counter",
"NumberFormatter"
]
}
}
"emulator": {
"default": ["Counter"],
"emulator-account": ["NumberFormatter"]
},
"testnet": {
"testnet-account": ["Counter", "NumberFormatter"]
},
"mainnet": {
"mainnet-account": ["Counter", "NumberFormatter"]
}
}
}
```

Expand Down Expand Up @@ -406,4 +395,4 @@ npm run build
[Flow Wallet]: https://wallet.flow.com/
[Coinbase]: https://www.coinbase.com/en-in/how-to-buy/flow
[Moonpay]: https://www.moonpay.com/buy/flow
[Binance]: https://www.binance.com/en-IN/how-to-buy/flow
[Binance]: https://www.binance.com/en-IN/how-to-buy/flow
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Click `Send Batch Transaction Example` and approve the transaction. You'll see t

:::tip

Currently, the Flow wallet sponsors all gas for all transactions signed with the wallet on both testnet **and mainnet!**
Currently, the Flow wallet sponsors the fees for the compute units (equivalent of gas) for all transactions signed with the wallet on both testnet **and mainnet!**

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/blockchain-development-tutorials/flow-101.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Other defining features of Flow include:
- **Fast finality**, making applications responsive and user-friendly.
- **Resistance to Miner Extractable Value (MEV)**, protecting users from front-running.
- **EVM equivalence**, allowing developers to deploy Solidity contracts on Flow EVM.
- **Low gas fees**, which make applications affordable and accessible to users.
- **Low compute fees (on the Cadence side) and low gas fees (on the EVM side)**, which make applications affordable and accessible to users.

Flow has already powered some of the most successful Web3 products to date, including:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Flash loans allow you to create one transaction during which you:

This scenario may be a scam. A scammer could set up this situation as bait and cancel the buy order the instant someone purchases the NFT that is for sale. You'd have paid a vast amount of money for something worthless.

The great thing about Cadence transactions, with or without Actions, is that you can set up an atomic transaction where everything either works, or is reverted. Either you make 100k, or nothing happens except a tiny expenditure of gas.
The great thing about Cadence transactions, with or without Actions, is that you can set up an atomic transaction where everything either works, or is reverted. Either you make 100k, or nothing happens except a tiny expenditure of compute units.

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ We will update these tutorials, but you may need to refactor your code if the im

Flow, EVM, and other blockchains are a form of a **single** shared computer that anyone can use, with no admin privileges, super user roles, or complete control. For this to work, it must be impossible for any user to freeze the computer, on purpose or by accident.

As a result, most blockchain computers, including EVM and Solana, aren't [Turing Complete], because they can't run an unbounded loop. Each transaction must occur within one block, and can't consume more gas than the limit.
As a result, most blockchain computers, including EVM and Solana, aren't [Turing Complete], because they can't run an unbounded loop. Each transaction must occur within one block, and can't consume more compute units, or gas, than the limit.

While this limitation prevents infinite loops, it makes it so that you can't do anything 100% onchain if you need it to happen at a later time or after a trigger. As a result, developers must often build products that involve a fair amount of traditional infrastructure and requires users to give those developers a great amount of trust that their backend will execute the promised task.

Expand Down Expand Up @@ -291,9 +291,9 @@ let pr = priority == 0
: FlowTransactionScheduler.Priority.Low
```

The `executionEffort` is also supplied as an argument in the transaction. This represents the gas limit for your transaction and used to prepare the estimate for the gas fees that must be paid for the transaction, and directly in the call to `schedule()` the transaction.
The `executionEffort` is also supplied as an argument in the transaction. This represents the compute unit limit for your transaction and used to prepare the estimate for the compute unit fees that must be paid for the transaction, and directly in the call to `schedule()` the transaction.

- `fees`: A [vault] containing the appropriate amount of gas fees needed to pay for the execution of the scheduled transaction.
- `fees`: A [vault] containing the appropriate amount of compute unit fees needed to pay for the execution of the scheduled transaction.

To create the vault, the `estimate()` function calculates the amount needed:

Expand Down
9 changes: 3 additions & 6 deletions docs/blockchain-development-tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ Learn how to implement scheduled transactions for time-based smart contract exec
Cadence tutorials covering Flow's native smart contract language for secure and resource-oriented blockchain development.

- [Mobile Development] - Mobile development tutorials for building Flow blockchain applications on iOS, Android, and React Native platforms.

- [iOS Quickstart] - Build native iOS applications that interact with Flow blockchain using Swift and Flow SDK for mobile-first blockchain experiences.
- [React Native Quickstart] - Get started building mobile applications on Flow using React Native with FCL integration for wallet connections and blockchain interactions.
- [Walletless PWA] - Build a Progressive Web App with walletless authentication on Flow, enabling user onboarding without requiring traditional crypto wallets.
Expand All @@ -97,19 +96,17 @@ Comprehensive tutorials for building on Flow EVM using Solidity smart contracts
- [EVM Setup] - Setup guides for Flow EVM development environment, network configuration, and toolchain preparation.

- [EVM Development Tools] - Overview of development tools for building Solidity smart contracts on Flow EVM, including Hardhat, Foundry, and Remix IDE.

- [Flow Hardhat Guide] - Using Hardhat to deploy a Solidity contract to Flow EVM with step-by-step configuration, deployment, and interaction examples including contract verification.
- [Using Foundry with Flow] - Using Foundry to deploy a Solidity contract to Flow EVM, covering ERC-20 token development, testing, deployment, and state interaction with Foundry tools.
- [Flow Remix Guide] - Deploy and interact with Solidity smart contracts on Flow EVM using the Remix IDE with network configuration and contract verification.

- [EVM Frameworks] - JavaScript frameworks and libraries for building frontend applications that interact with Flow EVM, including RainbowKit, wagmi, Ethers.js, and Web3.js.

- [RainbowKit Integration] - Integrate RainbowKit with Flow EVM to provide wallet connection functionality in React applications with custom wallet support and network configuration.
- [Wagmi Integration] - Integrate wagmi React hooks with Flow EVM for type-safe Ethereum interactions, wallet management, and smart contract integration in React applications.
- [Ethers.js Integration] - Connect to Flow EVM using Ethers.js library for blockchain interactions, smart contract deployment, and transaction management in JavaScript applications.
- [Web3.js Integration] - Use Web3.js library to interact with Flow EVM, covering wallet connections, smart contract interactions, and transaction handling in JavaScript applications.

- [Build a Fully-Onchain Image Gallery] - Learn how to store images up to approximately 32kb onchain on Flow EVM using Solidity smart contracts and Next.js frontend with gas-efficient blockchain storage.
- [Build a Fully-Onchain Image Gallery] - Learn how to store images up to approximately 32kb onchain on Flow EVM using Solidity smart contracts and Next.js frontend. Spend millions of gas for less than a tenth of a cent.

## [Token Development]

Expand All @@ -127,7 +124,7 @@ Build applications that span both Flow EVM and Cadence virtual machines, enablin
- [Cross-VM Application Introduction] - Introduction to building applications that leverage both Flow EVM and Cadence environments for enhanced functionality and cross-VM asset management.
- [Add Flow Cadence to Your wagmi App] - Integrate cross-VM functionality with wagmi React hooks to enable seamless interactions between Flow EVM and Cadence environments in frontend applications.
- [Interacting with COAs] - Interact with Cadence-Owned Accounts (COA) to bridge assets and functionality between Cadence and EVM environments on Flow blockchain.
- [Batched EVM Transactions] - Execute batched transactions on Flow EVM to improve efficiency and enable atomic multi-operation workflows with reduced gas costs.
- [Batched EVM Transactions] - Execute batched transactions on Flow EVM to improve efficiency and enable atomic multi-operation workflows.
- [Direct Calls] - Make direct calls between Cadence and EVM environments on Flow for seamless cross-VM smart contract interactions and data exchange.
- [Cross-VM Bridge] - Use the VM Bridge to transfer assets and data between Flow's Cadence and EVM environments for cross-VM application development.

Expand All @@ -142,7 +139,7 @@ Tutorials for using Flow's native Verifiable Random Function (VRF) to generate c

Implement gasless transaction patterns on Flow to improve user experience by removing the need for users to hold native tokens for gas fees.

- [Gas-Free EVM Endpoint] - Use Flow's gas-free EVM endpoint to enable sponsored transactions that remove gas fee barriers for users interacting with EVM smart contracts.
- [Gas-Free EVM Endpoint] - Build a sponsored transaction EVM endpoint to enable sponsored transactions that remove gas fee barriers for users interacting with EVM smart contracts.

## [Use AI to Build on the Flow Blockchain]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ Congratulations! You've successfully created an NFT collection for the `test-acc

## Get an Account's NFTs

To retrieve the NFTs associated with an account, you'll need a script. Scripts are read-only operations that allow you to query the blockchain. They don't modify the blockchain's state, and therefore, they don't require gas fees or signatures (read more about scripts here).
To retrieve the NFTs associated with an account, you'll need a script. Scripts are read-only operations that allow you to query the blockchain. They don't modify the blockchain's state, and therefore, they don't require compute unit fees or signatures.

To start, create a script file with the `generate` command again:

Expand Down
Loading