### Vue Getting Started Source: https://wagmi.sh/react/api/hooks/useWriteContract A guide to help new users quickly set up and start using Wagmi with Vue.js. ```APIDOC vue_getting-started.md: Getting started guide for Wagmi with Vue.js. ``` -------------------------------- ### Example Extension Installation Source: https://context7_llms An example of installing an extension from a GitHub repository. If the branch name is omitted, it defaults to the repository's main branch. ```bash npx create-eth@latest -e ChangoMan/charts-extension ``` -------------------------------- ### Vue.js Introduction and Guides Source: https://wagmi.sh/react/api/hooks/useReadContract Guides and introductory materials for integrating web3 functionalities into Vue.js applications. Covers topics from installation and setup to advanced guides on TanStack Query, Viem, error handling, SSR, and contract interactions. ```APIDOC Vue.js Documentation: Introduction: Why Wagmi: Explains the benefits of using Wagmi with Vue. Installation: Steps to install the library. Getting Started: Basic setup and usage. TypeScript: TypeScript integration details. Guides: TanStack Query: Integrating with TanStack Query for state management. Viem: Using Viem for blockchain interactions. Error Handling: Strategies for managing errors. Chain Properties: Understanding and using chain properties. SSR: Server-side rendering considerations. Connect Wallet: Guide for connecting user wallets. Send Transaction: How to send transactions. Read from Contract: Reading data from smart contracts. Write to Contract: Writing data to smart contracts. FAQ / Troubleshooting: Common questions and solutions. Configuration: createConfig: Function to create the application's web3 configuration. createStorage: Function to create custom storage solutions. Chains: Information about supported blockchain chains. Connectors: baseAccount: Base connector class. injected: Connector for injected wallets (e.g., MetaMask). ``` -------------------------------- ### Install Yarn from Sources Source: https://yarnpkg.com/getting-started/install Installs the latest Yarn build directly from the repository. This command clones, builds, and installs Yarn, storing the binary in `.yarn/releases` and referencing it via `.yarnrc.yml`. ```shell yarn set version from sources ``` -------------------------------- ### ScaffoldETH.io CLI Commands Source: https://wagmi.sh/react/api/hooks/useAccount Documentation for the ScaffoldETH.io command-line interface, used for project setup, configuration, and code generation. It includes installation guides, configuration options, and specific commands for initializing and generating project components. ```APIDOC CLI Documentation: Introduction: - Why Wagmi CLI: Explains the benefits and purpose of using the Wagmi CLI. - Installation: Guides on how to install the CLI tool. - Getting Started: Basic steps to begin using the CLI. Guides: - Migrate from v1 to v2: Instructions for migrating existing projects from v1 to v2 of the CLI. Config File: - Configuring CLI: How to set up and configure the CLI using a configuration file. - Config Options: Details on available configuration parameters. Commands: - generate: Command to generate project files and code based on templates or ABIs. - Usage: `wagmi generate [options]` - init: Command to initialize a new ScaffoldETH.io project. - Usage: `wagmi init [options]` Plugins: - actions: Information about the actions plugin. - blockExplorer: Information about the blockExplorer plugin. - etherscan: Information about the etherscan plugin. - fetch: Information about the fetch plugin. ``` ```bash # Example: Installing the CLI npm install -g @wagmi/cli # Example: Initializing a new project # wagmi init # Example: Generating code from ABI # wagmi generate --abi=./path/to/your/abi.json --out=./src/generated.ts ``` -------------------------------- ### Install Yarn on Windows via Scoop Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn on Windows using the Scoop command-line installer. Scoop can also install Node.js if it's not already present on the system. ```powershell scoop install yarn ``` ```powershell scoop install nodejs ``` -------------------------------- ### Install and Use blo Library Source: https://github.com/bpierre/blo Provides instructions for installing the 'blo' library using package managers like npm, pnpm, or yarn. It also includes a JavaScript example demonstrating how to import the 'blo' function and generate an image source from an Ethereum address. ```bash npm i -S blo pnpm add blo yarn add blo ``` ```javascript import { blo } from "blo"; img.src = blo("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"); ``` -------------------------------- ### Setup Yarn PATH Environment Variable (Bash) Source: https://classic.yarnpkg.com/en/docs/install/ Configures the system's PATH environment variable to allow Yarn executables to be run from any directory. This involves adding the Yarn bin directory to the PATH and updating the shell profile. ```bash export PATH="$PATH:/opt/yarn-[version]/bin" # The path may vary ``` ```bash export PATH="$PATH:`yarn global bin`" ``` ```fish set -U fish_user_paths (yarn global bin) $fish_user_paths ``` -------------------------------- ### Install Corepack and Initialize Yarn Project Source: https://yarnpkg.com/getting-started/install Installs the Corepack tool globally, which is used to manage package manager versions on a per-project basis. Subsequently, it initializes a new project with Yarn v2+ compatibility. ```shell npm install -g corepack yarn init -2 ``` -------------------------------- ### Scaffold-ETH 2 Project Setup Source: https://context7_llms Guides the user through setting up a new Scaffold-ETH 2 project, allowing selection of Solidity framework and project name. It also provides instructions for navigating and editing project files. ```bash npx create-eth@latest cd project-name ``` -------------------------------- ### Install Yarn via Shell Script (macOS/Unix) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn using a shell script downloaded from yarnpkg.com. This method is recommended for macOS and generic Unix environments. The script handles downloading and setting up Yarn. ```shell curl -o- -L https://yarnpkg.com/install.sh | bash ``` ```shell curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --rc ``` ```shell curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly ``` ```shell curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version [version] ``` -------------------------------- ### Check Yarn Installation Source: https://classic.yarnpkg.com/en/docs/install/ Command to verify if Yarn has been successfully installed and is accessible in the system's PATH. It displays the installed Yarn version. ```bash yarn --version ``` -------------------------------- ### Install Yarn via Tarball Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn by downloading and extracting a tarball. This method requires manual PATH configuration. It covers stable, release candidate, and nightly builds. ```shell cd /opt wget https://yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ cd /opt wget https://yarnpkg.com/latest-rc.tar.gz tar zvxf latest-rc.tar.gz # Yarn is now in /opt/yarn-[version]/ cd /opt wget https://nightly.yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```shell # Verify tarball using GPG wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import wget https://yarnpkg.com/latest.tar.gz.asc gpg --verify latest.tar.gz.asc # Look for "Good signature from 'Yarn Packaging'" in the output ``` -------------------------------- ### Install Yarn from Specific Branch Source: https://yarnpkg.com/getting-started/install Installs a specific version of Yarn from a given branch in the repository using the `--branch` flag. This is useful for testing specific pull requests or development branches. ```shell yarn set version from sources --branch 1211 ``` -------------------------------- ### Install Yarn via npm Source: https://classic.yarnpkg.com/en/docs/install/ Installs or upgrades Yarn globally using the npm package manager. Requires Node.js and npm to be installed. ```shell npm install --global yarn ``` -------------------------------- ### Install Yarn on Debian/Ubuntu via APT Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn using the official Debian package repository. This method requires configuring the repository and updating the package list before installation. ```shell # Configure repository for stable builds curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list # Configure repository for RC builds curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ rc main" | sudo tee /etc/apt/sources.list.d/yarn.list # Configure repository for nightly builds curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://nightly.yarnpkg.com/debian/ nightly main" | sudo tee /etc/apt/sources.list.d/yarn.list # Update package list and install Yarn sudo apt update && sudo apt install yarn ``` ```shell # For Ubuntu 16.04 or below, configure NodeSource repository first if needed. # If cmdtest is causing issues, remove it: sudo apt remove cmdtest ``` ```shell # If using nvm, install Yarn without Node.js dependency sudo apt update && sudo apt install --no-install-recommends yarn ``` ```bash # Workaround for 'nodejs' vs 'node' naming issues alias node=nodejs ``` -------------------------------- ### Install Yarn on Windows via Chocolatey Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn on Windows using the Chocolatey package manager. This command also ensures Node.js is installed, which is a prerequisite for Yarn. ```powershell choco install yarn ``` -------------------------------- ### Install Yarn via Script (Bash) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn using the official installation script. This method is suitable for macOS and generic Unix environments. It supports installing the latest stable version, release candidates (--rc), or nightly builds. ```bash curl -o- -L https://yarnpkg.com/install.sh | bash ``` ```bash curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --rc ``` ```bash curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly ``` ```bash curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version [version] ``` -------------------------------- ### Manually Install Yarn via Tarball (Bash) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn by downloading and extracting a tarball. This method requires manual extraction and is suitable for custom installations or when script-based installation is not preferred. It covers stable, RC, and nightly tarballs. ```bash cd /opt wget https://yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```bash cd /opt wget https://yarnpkg.com/latest-rc.tar.gz tar zvxf latest-rc.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```bash cd /opt wget https://nightly.yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` -------------------------------- ### Install Yarn via Tarball (Manual) Source: https://classic.yarnpkg.com/en/docs/install/ Manually installs Yarn by downloading a tarball and extracting it. This method requires downloading the tarball, extracting it to a desired directory (e.g., /opt), and then setting up the PATH. ```bash cd /opt wget https://yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```bash cd /opt wget https://yarnpkg.com/latest-rc.tar.gz tar zvxf latest-rc.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```bash cd /opt wget https://nightly.yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` -------------------------------- ### Manual Install via Tarball (macOS/Unix) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn by manually downloading and extracting a tarball. This method requires verifying the tarball's GPG signature for security. The extracted files contain the Yarn installation. ```shell cd /opt wget https://yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```shell cd /opt wget https://yarnpkg.com/latest-rc.tar.gz tar zvxf latest-rc.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```shell cd /opt wget https://nightly.yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```shell wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import wget https://yarnpkg.com/latest.tar.gz.asc gpg --verify latest.tar.gz.asc # Look for "Good signature from 'Yarn Packaging'" in the output ``` -------------------------------- ### Manual Yarn Install via Tarball (Unix/macOS) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn by downloading and extracting a tarball. This method requires manual extraction and PATH configuration. It supports stable, RC, and nightly versions. ```shell cd /opt wget https://yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```shell cd /opt wget https://yarnpkg.com/latest-rc.tar.gz tar zvxf latest-rc.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` ```shell cd /opt wget https://nightly.yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ ``` -------------------------------- ### Scaffold-ETH 2 Extension Usage Source: https://context7_llms Demonstrates how to use the `-e` flag with `create-eth` to install extensions, allowing for customized project setups. It points to further documentation for available extensions. ```bash npx create-eth@latest -e extension-name ``` -------------------------------- ### Manual Yarn Install via Tarball (Unix) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn on Unix-like systems by downloading and extracting a tarball. This method requires manual PATH configuration and optionally GPG verification of the downloaded archive. ```bash cd /opt wget https://yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz ``` ```bash cd /opt wget https://yarnpkg.com/latest-rc.tar.gz tar zvxf latest-rc.tar.gz ``` ```bash cd /opt wget https://nightly.yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz ``` ```bash wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import wget https://yarnpkg.com/latest.tar.gz.asc gpg --verify latest.tar.gz.asc ``` -------------------------------- ### Install Extension via CLI Source: https://context7_llms Command to install an extension during the initial setup of a new Scaffold-ETH 2 project. Specify the GitHub repository and an optional branch name. ```bash npx create-eth@latest -e {github-username}/{extension-repo-name}:{branch-name} ``` -------------------------------- ### Install Yarn via Shell Script (Unix/macOS) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn using a provided shell script. This method is suitable for macOS and generic Unix environments. It supports installing stable, RC, or nightly builds, and allows specifying a version. ```shell curl -o- -L https://yarnpkg.com/install.sh | bash ``` ```shell curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --rc ``` ```shell curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly ``` ```shell curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version [version] ``` -------------------------------- ### Install Yarn via Script (Bash) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn on macOS and generic Unix environments using a provided shell script. Supports installing the latest stable, release candidate (--rc), or nightly builds. The script includes GPG signature verification for security. ```bash curl -o- -L https://yarnpkg.com/install.sh | bash ``` ```bash curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --rc ``` ```bash curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly ``` ```bash curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version [version] ``` -------------------------------- ### Theme and Data Attribute Initialization Source: https://yarnpkg.com/getting-started/install This JavaScript code initializes the theme based on URL parameters or local storage and applies data attributes from URL parameters to the document element. It ensures a consistent user experience by managing theme preferences and dynamic data. ```javascript function() { function setTheme(theme) { document.documentElement.setAttribute("data-theme", theme); } var initialTheme = function() { try { return new URLSearchParams(window.location.search).get("docusaurus-theme"); } catch (e) { // Handle potential errors, e.g., if URLSearchParams is not available } }() || function() { try { return window.localStorage.getItem("theme"); } catch (e) { // Handle potential errors, e.g., if localStorage is not available } }(); setTheme(initialTheme !== null ? initialTheme : "light"); }(); function() { try { const params = new URLSearchParams(window.location.search).entries(); for (var [key, value] of params) { if (key.startsWith("docusaurus-data-")) { var attributeName = key.replace("docusaurus-data-", "data-"); document.documentElement.setAttribute(attributeName, value); } } } catch (e) { // Handle potential errors } }(); ``` -------------------------------- ### Add Yarn Bin to PATH (Manual) Source: https://classic.yarnpkg.com/en/docs/install/ Adds the Yarn binary directory to your system's PATH environment variable. This is useful if Yarn is installed in a custom location. Ensure you replace '[version]' with your actual Yarn version. ```shell export PATH="$PATH:/opt/yarn-[version]/bin" ``` -------------------------------- ### Wagmi Configuration Example Source: https://wagmi.sh/react/api/hooks/useReadContract Provides a basic configuration setup for wagmi, including defining chains and transports. This configuration is essential for connecting to Ethereum networks and interacting with contracts. ```ts import { http, createConfig } from 'wagmi' import { mainnet, sepolia } from 'wagmi/chains' export const config = createConfig({ chains: [mainnet, sepolia], transports: { [mainnet.id]: http(), [sepolia.id]: http(), }, }) ``` -------------------------------- ### Example Deploy Script Source: https://www.npmjs.com/package/hardhat-deploy A basic Hardhat deployment script demonstrating how to use the `deployments.deploy` function to deploy a contract with specified parameters. ```JavaScript module.exports = async ({ getNamedAccounts, deployments, getChainId }) => { const { deploy } = deployments; const { deployer } = await getNamedAccounts(); // Deploys 'GenericMetaTxProcessor' only if it's not deployed or its code has changed. await deploy('GenericMetaTxProcessor', { from: deployer, gasLimit: 4000000, args: [], // Example of adding libraries if needed: // libraries: { // 'MyLib': '0x1234567890123456789012345678901234567890' // } }); }; // Optional: Define tags, dependencies, or skip logic for this script // module.exports.tags = ['core', 'token']; // module.exports.dependencies = ['Token']; // module.exports.skip = async ({ getChainId }) => { // const chainId = await getChainId(); // return chainId === '1337'; // Skip on local development chain // }; // module.exports.id = 'GenericMetaTxProcessorDeployment'; // Unique ID for single execution tracking ``` -------------------------------- ### Update Yarn to Canary Source: https://yarnpkg.com/getting-started/install Updates the project's Yarn version to the latest Release Candidate (canary) build. This is useful for testing features not yet released on the stable channel. ```shell yarn set version canary ``` -------------------------------- ### Install Ponder Extension Source: https://scaffoldeth.io/extensions Provides a pre-configured setup for ponder.sh, helping you get started quickly with event indexing. ```shell npx create-eth@latest -e ponder ``` -------------------------------- ### Basic Deployment Script Example Source: https://www.npmjs.com/package/hardhat-deploy A standard Hardhat deployment script that deploys a 'Token' contract. It logs deployment details and specifies the 'Token' tag. ```javascript module.exports = async ({ getNamedAccounts, deployments }) => { const { deployIfDifferent, log } = deployments; const namedAccounts = await getNamedAccounts(); const { deployer } = namedAccounts; const deployResult = await deploy('Token', { from: deployer, args: ['hello', 100], }); if (deployResult.newlyDeployed) { log( `contract Token deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed} gas` ); } }; module.exports.tags = ['Token']; ``` -------------------------------- ### Clone and Install Create-ETH CLI Source: https://context7_llms Steps to clone the create-eth repository and install its dependencies, preparing the environment for extension development. ```bash git clone https://github.com/scaffold-eth/create-eth.git cd create-eth yarn install ``` -------------------------------- ### Wagmi CLI Guides Source: https://wagmi.sh/react/api/hooks/useWalletClient Guides for using the Wagmi CLI, including migration steps from previous versions. ```APIDOC Migrate from v1 to v2 - Step-by-step guide for migrating from Wagmi v1 to v2. - Link: /cli/guides/migrate-from-v1-to-v2 ``` -------------------------------- ### TypeScript Deployment Script Example Source: https://www.npmjs.com/package/hardhat-deploy A basic structure for a TypeScript deployment script using `hardhat-deploy`. It leverages `HardhatRuntimeEnvironment` and `DeployFunction` types for enhanced developer experience and type safety. ```typescript import {HardhatRuntimeEnvironment} from 'hardhat/types'; import {DeployFunction} from 'hardhat-deploy/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // code here }; export default func; ``` -------------------------------- ### Install hardhat-deploy Source: https://www.npmjs.com/package/hardhat-deploy Installs the hardhat-deploy package using npm. This is the primary method to add the plugin to your Hardhat project. ```shell npm install hardhat-deploy ``` -------------------------------- ### Create Test Fixture with Hardhat Deployments Source: https://www.npmjs.com/package/hardhat-deploy Demonstrates how to create a test fixture using `deployments.createFixture`. This fixture deploys contracts, mints tokens, and returns contract instances and account information for testing. It ensures tests start from a fresh deployment snapshot. ```javascript const setupTest = deployments.createFixture( async ({deployments, getNamedAccounts, ethers}, options) => { await deployments.fixture(); // ensure you start from a fresh deployments const {tokenOwner} = await getNamedAccounts(); const TokenContract = await ethers.getContract('Token', tokenOwner); await TokenContract.mint(10).then((tx) => tx.wait()); //this mint is executed once and then `createFixture` will ensure it is snapshotted return { tokenOwner: { address: tokenOwner, TokenContract, }, }; } ); describe('Token', () => { it('testing 1 2 3', async function () { const {tokenOwner} = await setupTest(); await tokenOwner.TokenContract.mint(2); }); }); ``` -------------------------------- ### Deployment Folder Structure Example Source: https://www.npmjs.com/package/hardhat-deploy Illustrates the required directory structure for storing contract deployment artifacts. Each network has its own folder containing contract JSON files and a `.chainId` file. ```shell deployments/ mainnet/ .chainId Greeter.json rinkeby/ .chainId Greeter.json Registry.json rinkeby2/ .chainId Greeter.json Registry.json ``` -------------------------------- ### hardhat-deploy Installation Source: https://www.npmjs.com/package/hardhat-deploy Command to install the hardhat-deploy npm package. ```bash npm i hardhat-deploy ``` -------------------------------- ### Basic Hardhat Deploy Script Source: https://www.npmjs.com/package/hardhat-deploy Example of a basic deployment script for the hardhat-deploy plugin. It defines a deployment function that deploys a contract named 'MyContract' with arguments and logs the deployment process. The script also includes tags for managing deployment order and dependencies. ```javascript module.exports = async ({getNamedAccounts, deployments}) => { const {deploy} = deployments; const {deployer} = await getNamedAccounts(); await deploy('MyContract', { from: deployer, args: ['Hello'], log: true, }); }; module.exports.tags = ['MyContract']; ``` -------------------------------- ### Install hardhat-deploy-ethers for Ethers.js Integration Source: https://www.npmjs.com/package/hardhat-deploy Installs the hardhat-deploy-ethers package to enhance integration with ethers.js, providing additional features for accessing deployments as ethers contracts. Also installs necessary ethers dependencies. ```bash npm install --save-dev @nomiclabs/hardhat-ethers hardhat-deploy-ethers ethers ``` -------------------------------- ### Fork, Clone, and Set Upstream Repository Source: https://github.com/susam/gitpr This section outlines the initial steps for contributing to a project. It covers forking the upstream repository to your personal account, cloning your fork locally, and adding the original repository as an 'upstream' remote. This setup allows you to easily pull changes from the main project and manage your contributions. ```shell git clone https://GITHUB/USER/REPO.git cd REPO git remote add upstream https://GITHUB/UPSTREAM-OWNER/REPO.git git remote -v ``` -------------------------------- ### Run Create-ETH CLI Source: https://context7_llms Initiates the create-eth command-line interface to start a new Scaffold-ETH project instance, which can then be modified for extension development. ```shell yarn cli ``` -------------------------------- ### Install Node.js with Devbox Source: https://nodejs.org/en/download/ Installs Devbox, initializes it in a project, adds Node.js, and then opens a Devbox shell to verify the Node.js version. ```bash # Download and install Devbox curl -fsSL https://get.jetify.com/devbox | bash # Initialize Devbox in your project devbox init # Download and install Node.js: devbox add node@${props.release.major} # Open a Devbox shell devbox shell # Verify the Node.js version: node -v # Should print "${props.release.versionWithPrefix}". ``` -------------------------------- ### Install hardhat-deploy Package Source: https://www.npmjs.com/package/hardhat-deploy Installs the hardhat-deploy package as a development dependency for your Hardhat project. This enables custom deployment scripts and management. ```bash npm install -D hardhat-deploy ``` -------------------------------- ### Initialize and Push Extension Repository Source: https://context7_llms Commands to initialize a Git repository for the created extension, commit changes, and push it to a remote origin on GitHub. ```bash cd create-eth/externalExtensions/${extensionName} git init git add . git commit -m "Initial commit of my extension" git remote add origin git push -u origin main ``` -------------------------------- ### Install Yarn with MacPorts (macOS) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn on macOS using the MacPorts package manager. Similar to Homebrew, MacPorts will also install Node.js if it's a dependency and not found. ```bash sudo port install yarn ``` -------------------------------- ### Hardhat Node Task Source: https://www.npmjs.com/package/hardhat-deploy Starts a local Hardhat Network node. This task is often used in conjunction with the deploy task for local testing. ```APIDOC hardhat node [options] Starts a local Hardhat Network node. Options: --port The port to run the node on (default: 8545). --hostname The hostname to run the node on (default: localhost). --network The Hardhat Network configuration to use. --fork Forks from a given mainnet fork. --fork-block-number Forks from a specific block number. --no-fork Disables forking. --save-tx-hash Saves the transaction hash for each deployment. --save-deployments Saves deployment information to a file. --export Exports deployment information to the specified path. --export-all Exports all deployment information to the specified path. --watch Watches for changes in deployment scripts and re-runs. --trace Enables detailed tracing for debugging. --etherscan-verify Enables automatic verification on Etherscan after deployment. --sourcify Enables automatic verification on Sourcify after deployment. --gas-price Sets the gas price for transactions. --gas-limit Sets the gas limit for transactions. --tx-wait-confirmations Waits for 'n' confirmations before proceeding. --force-deploy Forces deployment even if already deployed. --script Specifies a single deployment script to run. --config Specifies a custom hardhat config file. Related Tasks: hardhat deploy hardhat test hardhat console ``` -------------------------------- ### Install Foundry Tools Source: https://book.getfoundry.sh/reference/cli/cast/wallet Installs or updates the Foundry development tools including forge, cast, anvil, and chisel. It downloads the installer script and executes it to set up the environment. The `-i nightly` flag installs the latest nightly release. ```shell curl -L https://foundry.paradigm.xyz | bash foundryup foundryup -i nightly ``` -------------------------------- ### Install Yarn with Homebrew (macOS) Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn on macOS using the Homebrew package manager. Homebrew also handles the installation of Node.js if it's not already present on the system. ```bash brew install yarn ``` -------------------------------- ### Install Yarn on Alpine Linux Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn on Alpine Linux (3.6+) using the apk package manager. This command installs the latest stable version available in the Alpine repositories. ```shell apk add yarn ``` -------------------------------- ### Git Pull Request Workflow Guide Source: https://github.com/susam/gitpr A quick reference guide detailing the standard workflow for forking a repository and submitting pull requests on GitHub. ```Markdown ## Quick reference guide on fork and pull request workflow 1. **Fork the repository**: Create a personal copy of the original repository on your GitHub account. 2. **Clone your fork**: Download your forked repository to your local machine. ```bash git clone https://github.com//.git ``` 3. **Add upstream remote**: Link your local repository to the original repository to fetch updates. ```bash cd git remote add upstream https://github.com//.git ``` 4. **Create a new branch**: Start a new branch for your changes. ```bash git checkout -b feature-branch-name ``` 5. **Make your changes**: Edit, add, or delete files as needed. 6. **Stage and commit your changes**: Record your modifications. ```bash git add . git commit -m "Add descriptive commit message" ``` 7. **Push your branch**: Upload your changes to your fork on GitHub. ```bash git push origin feature-branch-name ``` 8. **Create a Pull Request**: Open a pull request from your branch to the original repository's main branch on GitHub. 9. **Sync with upstream**: Periodically update your fork with changes from the original repository. ```bash git fetch upstream git checkout main git merge upstream/main git push origin main ``` ``` -------------------------------- ### Install Yarn on Arch Linux Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn using the Arch Linux package manager 'pacman'. This is the recommended method for Arch users. ```shell pacman -S yarn ``` -------------------------------- ### Scaffold-ETH 2 Installation Requirements Source: https://context7_llms Lists the essential tools required for setting up Scaffold-ETH 2, including Node.js, Yarn, and Git. It also mentions the optional requirement of Foundryup for Foundry users. ```bash # Requirements: # Node (>= v20.18.3) # Yarn (v1 or v2+) # Git # Optional for Foundry: # Foundryup installed (getfoundry.sh) ``` -------------------------------- ### Initialize Forge Project Source: https://book.getfoundry.sh/reference/cli/cast/wallet Initializes a new Foundry project in a specified directory. This command sets up the basic directory structure and configuration files required for a Foundry project. ```shell forge init Counter ``` -------------------------------- ### Initialize Forge Project Source: https://getfoundry.sh/ Initializes a new Foundry project in a specified directory. This command sets up the basic directory structure and configuration files required for a Foundry project. ```shell forge init Counter ``` -------------------------------- ### Install Yarn on CentOS/Fedora/RHEL Source: https://classic.yarnpkg.com/en/docs/install/ Installs Yarn using RPM package repositories for CentOS, Fedora, and RHEL. It includes steps to configure the Yarn repository and optionally NodeSource for Node.js. ```shell curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo ``` ```shell curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash - ``` ```shell sudo yum install yarn ``` ```shell sudo dnf install yarn ``` -------------------------------- ### Scaffold-ETH 2 Development Pointers Source: https://context7_llms Provides guidance on editing smart contracts, deployment scripts, frontend files, and configuration for both Hardhat and Foundry frameworks. Includes commands for running tests. ```bash # Hardhat # Edit smart contract: packages/hardhat/contracts/YourContract.sol # Edit deployment scripts: packages/hardhat/deploy # Edit frontend homepage: packages/nextjs/app/page.tsx # Edit app config: packages/nextjs/scaffold.config.ts # Edit smart contract test: packages/hardhat/test # Run tests: yarn hardhat:test ``` ```bash # Foundry # Edit smart contract: packages/foundry/contracts/YourContract.sol # Edit deployment scripts: packages/foundry/script # Edit frontend homepage: packages/nextjs/app/page.tsx # Edit app config: packages/nextjs/scaffold.config.ts # Edit smart contract test: packages/foundry/test # Run tests: yarn foundry:test ``` -------------------------------- ### ScaffoldETH.io React Guides Source: https://wagmi.sh/react/api/hooks/useReadContract Guides covering various aspects of using ScaffoldETH.io, including wallet connection, transaction handling, and specific library integrations. ```APIDOC Guides - TanStack Query: Integration with TanStack Query for state management. - Viem: Usage and integration of the Viem library. - Error Handling: Strategies for handling errors in dApps. - Ethers.js Adapters: Using Ethers.js with ScaffoldETH.io. - Chain Properties: Managing and accessing chain-specific data. - SSR: Server-Side Rendering with ScaffoldETH.io. - Connect Wallet: Step-by-step guide to connecting wallets. - Send Transaction: How to send transactions from your dApp. - Read from Contract: Fetching data from smart contracts. - Write to Contract: Interacting with smart contracts by sending transactions. - FAQ / Troubleshooting: Common questions and solutions. - Migrate from v1 to v2: Guidance for upgrading from previous versions. ``` -------------------------------- ### Git: Fork, Clone, and Setup Upstream Source: https://github.com/susam/gitpr Commands to fork an upstream repository, clone your fork locally, and configure the upstream remote for keeping your fork updated. This sets up your local environment for contribution. ```git git clone https://GITHUB/USER/REPO.git cd REPO git remote add upstream https://GITHUB/UPSTREAM-OWNER/REPO.git git remote -v ``` -------------------------------- ### Import Private Key into Keystore Source: https://docs.scaffoldeth.io/deploying/deploy-smart-contracts Imports an existing private key into a new keystore. You will be prompted for a keystore name, the private key itself, and an encryption password. The keystore will be created in `~/.foundry/keystore`. ```shell yarn account:import ```