Introducing Scaffold-ETH-2 with the power of Mainnet Forks

BuildBearBuildBear
3 min read

Fork & Start Now: BuildBearLabs/Scaffold-Eth-2-BuildBear

You are already aware of how Scaffold-ETH2 accelerates your Dapp development ⏱️ time and fast-track to production.

We, with the blessing of the Scaffold-ETH2 Team (Austin and Shiv), introduce to you

Let’s dive into how Scaffold-ETH x BuildBear achieves this.

👉 Firstly, effortlessly fork EVM and EVM-compatible chains directly from the CLI, creating your own Sandbox. Test your application as if you’re on the Mainnet without real-world consequences, saving you time from searching for working RPCs.

👉 Mint unlimited native and ERC20 tokens directly from the CLI or your personal Sandbox faucet. No more wasting ⏱️time searching for working faucets.

👉 Effortlessly debug transactions within your sandbox using the built-in explorer and transaction tracer.

👉 Experience rapid transactions on BuildBear, completing in under 3 seconds.

Quick Starter Guide

Before you begin, install the following tools:

Clone this repo & install dependencies:

git clone <https://github.com/scaffold-eth/scaffold-eth-2.git>
cd scaffold-eth-2
yarn install

Create your private Sandbox:

yarn fork-bb

After running the command, choose the chain you want to fork. Enter the block number from which you wish to fork the chain. Wait for 10 seconds, and your sandbox will be live. The sandbox details like RPC, Faucet, and Explorer URL are stored in packages/buildbear/sandbox.json.

Deploy the contracts:

yarn deploy

This command deploys and verifies smart contracts to the BuildBear Sandbox, located in packages/hardhat/contracts. Customize the deploy script in packages/hardhat/deploy to suit your needs.

Start your NextJS app:

yarn start

Check out your app at: http://localhost:3000.

Use the BuildBear faucet to mint Native and ERC20 Tokens. As shown below mint an unlimited number of Native and ERC20 Tokens directly from Scaffold-eth x BuildBear UI.

Alternative Route: Click on the BuildBear faucet on the homepage, and you’ll be redirected to your Sandbox faucet, where you can mint an unlimited number of Native and ERC20 Tokens.

Navigate to the Debug Contract page.

Here, you can interact with the deployed contracts through a user-friendly interface.

Let’s swap USDC tokens for DAI using the Swap contracts we just deployed.

  1. Mint USDC tokens: Use the faucet to mint 100 USDC tokens.

  2. Grant USDC token allowance: Before swapping, grant USDC token allowance to the swap contract as shown below using the approve function.

Return to the Debug Contracts section, enter the details in the swapExactInputSingle section as shown, and click on send. Sign the transaction on your wallet.

Head to the Explorer to see the swap transactions in detail.

Tweak the app config in packages/nextjs/scaffold.config.ts.

  • Edit your smart contract YourContract.sol in packages/hardhat/contracts.

  • Edit your frontend in packages/nextjs/pages.

  • Edit your deployment scripts in packages/hardhat/deploy.

Conclusion: With Scaffold-ETH-2 x BuildBear, you can streamline Dapp development and testing, reduce development time, and fast-track to production. Leave behind the limitations of public and local Hardhat Testnets.

  • Effortlessly fork EVM and EVM-compatible chains directly from the CLI, creating your own Sandbox. Test your application as if you’re on the Mainnet without real-world consequences, saving you time from searching for working RPCs.

  • Mint unlimited native and ERC20 tokens directly from the CLI or your personal Sandbox faucet. No more wasting time searching for working faucets.

  • Effortlessly debug transactions within your sandbox using the built-in explorer and transaction tracer.

  • Experience rapid transactions on BuildBear, completing in under 3 seconds.

About BuildBear:

BuildBear is a platform tailored for DApp development and testing. Developers gain the freedom to construct a personalized Private Testnet sandbox across a variety of blockchain networks. The liberty to mint unlimited Native and ERC20 tokens, coupled with rapid transaction times on BuildBear (under 3 seconds!), enhances the DApp development lifecycle manifold. The platform comes equipped with tools designed for real-time testing and debugging, ensuring developers can keep tabs on intricate blockchain transactions with unparalleled ease.

Connect with us on Twitter | LinkedIn | Telegram | GitHub

1
Subscribe to my newsletter

Read articles from BuildBear directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

BuildBear
BuildBear

BuildBear is a platform for testing dApps at scale, for teams. It provides users with their own private Testnet to test their smart contracts and dApps, which can be forked from any EVM chain. It also provides a Faucet, Explorer, and RPC for testing purposes.