From f37a203e619041c7ce953a684c934fab6e3ac196 Mon Sep 17 00:00:00 2001 From: cshannon1218 Date: Mon, 10 Nov 2025 12:04:29 -0600 Subject: [PATCH] EVM Dev Tools edits --- .../evm/development-tools/foundry.md | 46 +++++++++---------- .../evm/development-tools/hardhat.md | 32 ++++++------- .../evm/development-tools/index.md | 16 +++---- .../evm/development-tools/remix.md | 26 +++++------ 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/docs/blockchain-development-tutorials/evm/development-tools/foundry.md b/docs/blockchain-development-tutorials/evm/development-tools/foundry.md index 11a1786adf..3b0b622d66 100644 --- a/docs/blockchain-development-tutorials/evm/development-tools/foundry.md +++ b/docs/blockchain-development-tutorials/evm/development-tools/foundry.md @@ -7,14 +7,14 @@ sidebar_position: 5 # Using Foundry with Flow -Foundry is a suite of development tools that simplifies the process of developing and deploying Solidity contracts to EVM networks. This guide will walk you through the process of deploying a Solidity contract to Flow EVM using the Foundry development toolchain. You can check out the official Foundry docs [here](https://book.getfoundry.sh/). +Foundry is a suite of development tools that simplifies the process to develop and deploy Solidity contracts to EVM networks. This guide will walk you through thow to deploy a Solidity contract to Flow EVM with the Foundry development toolchain. You can check out the official Foundry docs [here](https://book.getfoundry.sh/). In this guide, we'll deploy an ERC-20 token contract to Flow EVM using Foundry. We'll cover: -- Developing and testing a basic ERC-20 contract -- Deploying the contract to Flow EVM using Foundry tools -- Querying Testnet state -- Mutating Testnet state by sending transactions +- How to develop and teteststing a basic ERC-20 contract +- Deploy the contract to Flow EVM with Foundry tools +- How to query the Testnet state +- How to mutate Testnet state by sending transactions ## Overview @@ -26,9 +26,9 @@ To use Flow across all Foundry tools you need to: --rpc-url https://testnet.evm.nodes.onflow.org ``` -2. Use the `--legacy` flag to disable [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) style transactions. Flow will support EIP-1559 soon and this flag won't be needed. +2. Use the `--legacy` flag to turn off [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) style transactions. Flow will support EIP-1559 soon and this flag won't be needed. -As an example, we'll show you how to deploy a fungible token contract to Flow EVM using Foundry. You will see how the above flags are used in practice. +As an example, we'll show you how to deploy a fungible token contract to Flow EVM with Foundry. You will see how the above flags are used in practice. ## Example: Deploying an ERC-20 Token Contract to Flow EVM @@ -36,7 +36,7 @@ ERC-20 tokens are the most common type of tokens on Ethereum. We'll use [OpenZep ### Installation -The best way to install Foundry, is to use the `foundryup` CLI tool. You can get it using the following command: +The best way to install Foundry, is to use the `foundryup` CLI tool. You can get it with the following command: ```shell curl -L https://foundry.paradigm.xyz | bash @@ -54,7 +54,7 @@ You may need to reload your shell after `foundryup` installation. Check out the official [Installation](https://book.getfoundry.sh/getting-started/installation) guide for more information about different platforms or installing specific versions. -### Wallet Setup +### Wallet setup We first need to generate a key pair for our EVM account. We can do this using the `cast` tool: @@ -70,7 +70,7 @@ You can verify the balance of the account after funding. Replace `$YOUR_ADDRESS` cast balance --ether --rpc-url https://testnet.evm.nodes.onflow.org $YOUR_ADDRESS ``` -### Project Setup +### Project setup First, create a new directory for your project: @@ -93,9 +93,9 @@ forge test The tests should pass. -### Writing the ERC-20 Token Contract +### Write the ERC-20 token contract -We'll use the OpenZeppelin ERC-20 contract template. We can start by adding OpenZeppelin to our project: +We'll use the OpenZeppelin ERC-20 contract template. To start, we'll add OpenZeppelin to our project: ```shell forge install OpenZeppelin/openzeppelin-contracts @@ -117,7 +117,7 @@ contract MyToken is ERC20 { The above is a basic ERC-20 token with the name `MyToken` and symbol `MyT`. It also mints the specified amount of tokens to the contract deployer. The amount is passed as a constructor argument during deployment. -Before compiling, we also need to update the test file. +Before we comnpile, we also need to update the test file. ### Testing @@ -191,7 +191,7 @@ contract MyTokenTest is Test { } ``` -You can now make sure everything is okay by compiling the contracts: +To make sure everything is okay, compile the contracts: ```shell forge compile @@ -205,9 +205,9 @@ forge test They should all succeed. -### Deploying to Flow Testnet +### Deploy to Flow Testnet -We can now deploy `MyToken` using the `forge create` command. We need to provide the RPC URL, private key from a funded account using the faucet, and constructor arguments that is the initial mint amount in this case. We need to use the `--legacy` flag to disable EIP-1559 style transactions. Replace `$DEPLOYER_PRIVATE_KEY` with the private key of the account you created earlier: +We can now deploy `MyToken` with the `forge create` command. We need to provide the RPC URL, private key from a funded account with the faucet, and constructor arguments that is the initial mint amount in this case. We need to use the `--legacy` flag to turn off EIP-1559 style transactions. Replace `$DEPLOYER_PRIVATE_KEY` with the private key of the account you created earlier: ```shell forge create --broadcast src/MyToken.sol:MyToken \ @@ -219,9 +219,9 @@ forge create --broadcast src/MyToken.sol:MyToken \ The above will print the deployed contract address. We'll use it in the next section to interact with the contract. -### Verifying a Smart Contract +### Verify Consumer DeFi -Once deployed, you can verify the contract so that others can see the source code and interact with it from Flow's block explorer. You can use the [`forge verify-contract`](https://book.getfoundry.sh/reference/forge/forge-verify-contract) command: +After you deploy the contract, you can verify it so that others can see the source code and interact with it from Flow's block explorer. You can use the [`forge verify-contract`](https://book.getfoundry.sh/reference/forge/forge-verify-contract) command: ```shell forge verify-contract --rpc-url https://testnet.evm.nodes.onflow.org/ \ @@ -233,11 +233,11 @@ forge verify-contract --rpc-url https://testnet.evm.nodes.onflow.org/ \ :::info -When verifying a Mainnet contract, be sure to use the Mainnet [RPC](../../../build/evm/networks.md) and block explorer URLs. +When you verify a Mainnet contract, be sure to use the Mainnet [RPC](../../../build/evm/networks.md) and block explorer URLs. ::: -### Querying Testnet State +### Query Testnet state Based on the given constructor arguments, the deployer should own `42,000,000 MyT`. We can check the `MyToken` balance of the contract owner. Replace `$DEPLOYED_MYTOKEN_ADDRESS` with the address of the deployed contract and `$DEPLOYER_ADDRESS` with the address of the account you funded earlier: @@ -248,7 +248,7 @@ cast balance \ $DEPLOYER_ADDRESS ``` -This should return the amount specified during deployment. We can also call the associated function directly in the contract: +This will return the amount specified during deployment. We can also call the associated function directly in the contract: ```shell cast call $DEPLOYED_MYTOKEN_ADDRESS \ @@ -267,7 +267,7 @@ cast call $DEPLOYED_MYTOKEN_ADDRESS \ ### Sending Transactions -Let's create a second account and move some tokens using a transaction. You can use `cast wallet new` to create a new test account. You don't need to fund it to receive tokens. Replace `$NEW_ADDRESS` with the address of the new account: +Let's create a second account and move some tokens with a transaction. You can use `cast wallet new` to create a new test account. You don't need to fund it to receive tokens. Replace `$NEW_ADDRESS` with the address of the new account: ```shell cast send $DEPLOYED_MYTOKEN_ADDRESS \ @@ -287,7 +287,7 @@ cast balance \ $NEW_ADDRESS ``` -The deployer should also own less tokens now: +The deployer will also own fewer tokens now: ```shell cast balance \ diff --git a/docs/blockchain-development-tutorials/evm/development-tools/hardhat.md b/docs/blockchain-development-tutorials/evm/development-tools/hardhat.md index ed268b6ebf..b5596cba48 100644 --- a/docs/blockchain-development-tutorials/evm/development-tools/hardhat.md +++ b/docs/blockchain-development-tutorials/evm/development-tools/hardhat.md @@ -7,7 +7,7 @@ sidebar_position: 2 # Flow Hardhat Guide -Hardhat is an Ethereum development tool designed to facilitate the deployment, testing, and debugging of smart contracts. It provides a streamlined experience for developers working with Solidity contracts. +Hardhat is an Ethereum development tool designed to facilitate the deployment, testing, and debugging of Cadence Decentralized Finance (DeFi). It provides a streamlined experience for developers who work with with Solidity contracts. ## Prerequisites @@ -15,7 +15,7 @@ Hardhat is an Ethereum development tool designed to facilitate the deployment, t Node v18 or higher, available for [download here](https://nodejs.org/en/download). -For those new to Hardhat, we recommend exploring the [official documentation](https://hardhat.org/tutorial/creating-a-new-hardhat-project) to get acquainted. The following instructions utilize `npm` to initialize a project and install dependencies: +For those new to Hardhat, we recommend that you exploare the [official documentation](https://hardhat.org/tutorial/creating-a-new-hardhat-project) to get acquainted. The following instructions use `npm` to initialize a project and install dependencies: ### Wallet @@ -34,13 +34,13 @@ npx hardhat init > When prompted, select TypeScript and to use `@nomicfoundation/hardhat-toolbox` to follow along with this guide. -### Fund Your Wallet +### Fund Your wallet -To deploy smart contracts, ensure your wallet has **$FLOW**. Obtain funds by navigating to the Flow [Faucet](https://faucet.flow.com/fund-account) and entering your wallet address. +To deploy Consumer DeFi, ensure your wallet has **$FLOW**. To obtain funds, navigate to the Flow [Faucet](https://faucet.flow.com/fund-account) and enter your wallet address. -## Deploying a Smart Contract with Hardhat +## Deploy DeFi with Hardhat -This section guides you through the process of deploying smart contracts on the Flow network using Hardhat. +This section guides you through the process of how to deploy DeFi on the Flow network with Hardhat. ### Configuration @@ -64,11 +64,11 @@ const config: HardhatUserConfig = { export default config; ``` -To keep this example straightforward, we've included the account's private key directly in `hardhat.config.ts`. However, it is crucial to avoid committing private keys to your Git repository for security reasons. Instead, opt for using environment variables for safer handling of sensitive information. +To keep this example straightforward, we've included the account's private key directly in `hardhat.config.ts`. However, it is crucial to not commit private keys to your Git repository for security reasons. Instead, use environment variables to safely handle sensitive information. -### Deploying HelloWorld Smart Contract +### Deploy HelloWorld DeFi -## HelloWorld Smart Contract +## HelloWorld DeFi ```solidity // SPDX-License-Identifier: MIT @@ -98,7 +98,7 @@ contract HelloWorld { } ``` -Deploying: +Deploy: 1. Create a file named `HelloWorld.sol` under `contracts` directory. 2. Add above `HelloWorld.sol` contract code to new file. @@ -139,9 +139,9 @@ HelloWorld address: 0x3Fe94f43Fb5CdB8268A801f274521a07F7b99dfb You can now search for your deployed contract on the [Flowscan block explorer](https://evm-testnet.flowscan.io/)! -### Get HelloWorld Contract Greeting +### Get HelloWorld contract greeting -Now, we want to get the greeting from the deployed `HelloWorld` smart contract. +Now, we want to get the greeting from the deployed `HelloWorld` Consumer DeFi. ```javascript import { ethers } from 'hardhat'; @@ -181,7 +181,7 @@ Steps: The greeting is: Hello, World! ``` -### Update Greeting on HelloWorld Smart Contract +### Update greeting on HelloWorld DeFi Next, we'll add a script to update the greeting and log it. @@ -231,7 +231,7 @@ Here are the steps to follow: 1. Create an `updateGreeting.ts` script in the `scripts` directory. 2. Paste in the TypeScript above, make sure to update the contract address with the one from deployment in earlier step. 3. Call the new script, `NEW_GREETING='Howdy!' npx hardhat run ./scripts/updateGreeting.ts --network testnet` -4. The output should be +4. The output will be: ```shell ❯ NEW_GREETING='Howdy!' npx hardhat run ./scripts/updateGreeting.ts --network testnet @@ -242,9 +242,9 @@ The greeting is: Howdy! ``` -### Verifying Contract +### Verify Contract -To verify your contract on [Flowscan](https://evm-testnet.flowscan.io/), you can update your Hardhat config file as such including the correct chainID, apiURL and browserURL: +To verify your contract on [Flowscan](https://evm-testnet.flowscan.io/), you can update your Hardhat config file. To do this, include the correct chainID, apiURL and browserURL: ```javascript import { HardhatUserConfig } from 'hardhat/config'; diff --git a/docs/blockchain-development-tutorials/evm/development-tools/index.md b/docs/blockchain-development-tutorials/evm/development-tools/index.md index e1811c5cf8..96e169ab05 100644 --- a/docs/blockchain-development-tutorials/evm/development-tools/index.md +++ b/docs/blockchain-development-tutorials/evm/development-tools/index.md @@ -1,12 +1,12 @@ --- title: Flow EVM Development Tools -description: Comprehensive guides for using popular Solidity development tools and IDEs to build, test, and deploy smart contracts on Flow EVM. +description: Comprehensive guides for using popular Solidity development tools and IDEs to build, test, and deploy Consumer DeFi contracts on Flow EVM. sidebar_position: 3 keywords: - Flow EVM - development tools - Solidity development - - smart contract deployment + - DeFi contract deployment - Foundry - Hardhat - Remix IDE @@ -16,25 +16,25 @@ keywords: # Flow EVM Development Tools -Professional smart contract development requires robust tooling for writing, testing, deploying, and managing Solidity contracts. This section covers the most popular and powerful development tools in the Ethereum ecosystem, adapted for Flow EVM development. From command-line frameworks to browser-based IDEs, these tools provide everything needed for comprehensive smart contract development workflows. +Professional decentralized finance (DeFi) contract development requires robust tooling to write, test, deploy, and manage Solidity contracts. This section covers the most popular and powerful development tools in the Ethereum ecosystem, adapted for Flow EVM development. From command-line frameworks to browser-based IDEs, these tools provide everything you need for comprehensive DeFi contract development workflows. -Each tool offers unique strengths: Foundry excels at testing and gas optimization, Hardhat provides extensive plugin ecosystems and TypeScript support, while Remix enables rapid prototyping without local setup. These tutorials demonstrate how to configure and use each tool effectively with Flow EVM, ensuring you can choose the right development environment for your project needs. +Each tool offers unique strengths: Foundry excels at testing and gas optimization, Hardhat provides extensive plugin ecosystems and TypeScript support, while Remix allows rapid prototyping without local setup. These tutorials demonstrate how to configure and use each tool effectively with Flow EVM, which allows you to choose the right development environment for your project needs. ## [Foundry] -Master Foundry's powerful suite of development tools for advanced Solidity contract development, testing, and deployment on Flow EVM. This comprehensive guide covers setting up Foundry projects, writing and testing ERC-20 contracts with extensive test coverage, and deploying to Flow networks with proper configuration and verification. Learn to leverage Foundry's forge, cast, and anvil tools for complete development workflows including contract interaction and state management. +Master Foundry's powerful suite of development tools for advanced Solidity contract development, testing, and deployment on Flow EVM. This comprehensive guide covers how to set up Foundry projects, write and test ERC-20 contracts with extensive test coverage, and deploy to Flow networks with proper configuration and verification. Learn to leverage Foundry's forge, cast, and anvil tools for complete development workflows, which include contract interaction and state management. ## [Hardhat] -Build and deploy Solidity smart contracts on Flow EVM using Hardhat's comprehensive development environment with TypeScript support and extensive plugins. This tutorial walks through complete project setup, network configuration for Flow testnet and mainnet, contract deployment with custom scripts, and contract verification on Flow's block explorer. You'll implement end-to-end workflows for HelloWorld contract development, testing, and deployment using Hardhat's powerful plugin ecosystem. +Build and deploy Solidity DeFi contracts on Flow EVM with Hardhat's comprehensive development environment with TypeScript support and extensive plugins. This tutorial walks through complete project setup, network configuration for Flow testnet and mainnet, contract deployment with custom scripts, and contract verification on Flow's block explorer. You'll implement end-to-end workflows for HelloWorld contract development, testing, and deployment using Hardhat's powerful plugin ecosystem. ## [Remix] -Develop and deploy smart contracts directly in the browser using Remix IDE with Flow EVM integration for rapid prototyping and development. This guide demonstrates setting up Remix for Flow development, deploying contracts through MetaMask integration, and interacting with deployed contracts using Remix's built-in debugging and interaction tools. Learn to use Remix for quick contract development, testing, and deployment without requiring local development environment setup. +Develop and deploy DeFi contracts directly in the browser with Remix IDE with Flow EVM integration for rapid prototyping and development. This guide demonstrates how to set up Remix for Flow development, deploying contracts through MetaMask integration, and how to interact with deployed contracts with Remix's built-in debugging and interaction tools. Learn to use Remix for quick contract development, testing, and deployment without local development environment setup requirements. ## Conclusion -These development tool guides provide comprehensive coverage of the most popular Solidity development environments, each optimized for Flow EVM development. Whether you prefer command-line tools like Foundry, comprehensive frameworks like Hardhat, or browser-based development with Remix, these tutorials offer practical workflows for building, testing, and deploying professional smart contracts on Flow's high-performance EVM network. +These development tool guides provide comprehensive coverage of the most popular Solidity development environments, each optimized for Flow EVM development. Whether you prefer command-line tools like Foundry, comprehensive frameworks like Hardhat, or browser-based development with Remix, these tutorials offer practical workflows to build, test, and deploy professional DeFi contracts on Flow's high-performance EVM network. diff --git a/docs/blockchain-development-tutorials/evm/development-tools/remix.md b/docs/blockchain-development-tutorials/evm/development-tools/remix.md index ed4bada9a5..845252a1be 100644 --- a/docs/blockchain-development-tutorials/evm/development-tools/remix.md +++ b/docs/blockchain-development-tutorials/evm/development-tools/remix.md @@ -7,9 +7,9 @@ sidebar_position: 3 # Using Remix -Remix is an open-source, web-based development environment tailored for EVM smart contract development. It offers developers a comprehensive suite of tools for writing, deploying, and testing smart contracts in Solidity. For more information, visit [Remix](https://remix.ethereum.org/). +Remix is an open-source, web-based development environment tailored for EVM decentralized finance (DeFi) contract development. It offers developers a comprehensive suite of tools to write, deploy, and test DeFi contracts in Solidity. For more information, visit [Remix](https://remix.ethereum.org/). -## Add the Flow Network to MetaMask +## Add the Flow network to MetaMask ![Add Flow Network](./imgs/Remix-adding-metamask-network.gif) @@ -17,13 +17,13 @@ Navigate to the [Using EVM] page to find the button to add the Flow network info ## Fund Your Flow Account -Navigate to the [Flow Testnet Faucet](https://faucet.flow.com/fund-account) to obtain FLOW tokens necessary for deploying a smart contract. +Navigate to the [Flow Testnet Faucet](https://faucet.flow.com/fund-account) to obtain FLOW tokens necessary to deploy a smart contract. -## Deploying a Smart Contract Using Remix +## Deploy a DeFi contract with Remix -![Deploy Smart Contract](./imgs/Remix-deploy-contract-flowevm.gif) +![Deploy DeFi Contract](./imgs/Remix-deploy-contract-flowevm.gif) -### HelloWorld Smart Contract +### HelloWorld DeFi Contract ```solidity // SPDX-License-Identifier: MIT @@ -55,13 +55,13 @@ contract HelloWorld { ``` -### Steps to Deploy the HelloWorld Smart Contract +### Steps to deploy the HelloWorld DeFi contract 1. Create a file named `HelloWorld.sol`. 2. Select Solidity Compiler and compile `HelloWorld.sol`. 3. Select Deploy & Run Transactions. 4. Make sure to select `Injected Provider - Metamask` in Environment dropdown. -5. Deploy the `HelloWorld` smart contract. +5. Deploy the `HelloWorld` DeFi contract. ## Calling the Deployed Smart Contract @@ -104,17 +104,17 @@ getGreeting(); Follow the steps below to change the greeting and retrieve the new greeting. -## Updating the Deployed Smart Contract +## Updating the deployed DeFi contract -![Update Smart Contract](./imgs/Remix-update-greeting.gif) +![Update DeFi Contract](./imgs/Remix-update-greeting.gif) 1. Select the `HelloWorld.sol` file. 2. Select the `Deploy and Run Transaction` page. 3. Make sure to select `Injected Provider - Metamask` in Environment dropdown. -4. Type a new greeting in the text input next to orange `changeGreeting` button. -5. Click on the orange `changeGreeting` button. +4. Type a new greeting in the text input next to `changeGreeting`. +5. Click `changeGreeting`. 6. Sign the Metamask transaction. -7. Verify the greeting has changed by re-running `get-greeting.js` script above. +7. To verify the greeting changed, re-run the `get-greeting.js` script above.