# Tooling for Hardhat

OVM 1.0 Page

This page refers to the current state of the Optimistic Ethereum network. Some of the information may be relevant to OVM 2.0, which will be deployed in October, but some of it may change.

TIP

For more detailed step by step instructions check out the hardhat tutorial (opens new window).

# Installation

All you need to start building apps for Optimistic Ethereum with hardhat (opens new window) is the @eth-optimism/hardhat-ovm package. Install it via npm or yarn:

yarn add @eth-optimism/hardhat-ovm

# Configuration

You'll need to make the following two changes to hardhat.config.js:

  1. Import the plugin:

    // hardhat.config.js
    ...
    require('@eth-optimism/hardhat-ovm')
    ...
    
  2. Add an optimistic network to your exported config:

    ...
    module.exports = {
       ...
       networks: {
          ...
          optimistic: {
             url: 'http://127.0.0.1:8545', // this is the default port
             accounts: { mnemonic: 'test test test test test test test test test test test junk' },
             gasPrice: 15000000, // required
             ovm: true // required
          }
       }
       ...
    }
       
    

# Usage

Simply add --network optimistic whenever you want to test, deploy, or compile an Optimistic Ethereum app. For instance:

npx hardhat compile --network optimistic