Files
web/apps/base-docs/docs/tools/hardhat.md
taycaldwell b69c2fa783 Update guides and docs with Sepolia (#233)
* Update guides with Sepolia

* Update docs with Sepolia
2024-01-05 10:08:26 -08:00

1.6 KiB
Raw Blame History

title, slug, description, keywords
title slug description keywords
Hardhat /tools/hardhat Documentation for configuring Hardhat for smart contract development on Base, including setup instructions for mainnet, testnet, and local development environments.
Hardhat
Base
Base network
Base mainnet
Base testnet
hardhat config
hardhat configuration
Ethereum development
smart contract
deployment
mainnet
testnet
local development

Hardhat

Hardhat is an Ethereum development environment for flexible, extensible, and fast smart contract development.

You can use Hardhat to edit, compile, debug, and deploy your smart contracts to Base.


Using Hardhat with Base

To configure Hardhat to deploy smart contracts to Base, update your projects hardhat.config.ts file by adding Base as a network:

networks: {
   // for mainnet
   "base-mainnet": {
     url: 'https://mainnet.base.org',
     accounts: [process.env.PRIVATE_KEY as string],
     gasPrice: 1000000000,
   },
   // for Sepolia testnet
   "base-sepolia": {
     url: "https://sepolia.base.org",
     accounts: [process.env.PRIVATE_KEY as string]
     gasPrice: 1000000000,
   },
   // for local dev environment
   "base-local": {
     url: "http://localhost:8545",
     accounts: [process.env.PRIVATE_KEY as string],
     gasPrice: 1000000000,
   },
 },
 defaultNetwork: "base-local",

:::info

For a complete guide on using Hardhat to deploy contracts on Base, see Deploying a Smart Contract.

:::