An open API service indexing awesome lists of open source software.

https://github.com/climax-solution/hardhat-optimism


https://github.com/climax-solution/hardhat-optimism

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# hardhat-optimism

Hardhat plugin for Optimism Developers.

## Features

OptimismScan Contract Verification

## Prerequisites

Before the installation steps you need to have your hardhat project initialized using the command

```bash
npx hardhat init
```

Make sure to have dependencies installed!

## Installation

Use the following command to install

```bash
npm i hardhat-optimism --save-dev
```

Import the plugin in your `hardhat.config.js`:

```js
require("hardhat-optimism");
```

Or if you are using TypeScript, in your `hardhat.config.ts`:

```ts
import "hardhat-optimism";
```

Remove / Comment the import for `@nomicfoundation/hardhat-toolbox`

Add the following configuration to the `config` object in `hardhat.config.js`.

```js
networks: {
optimisticGoerli: {
// can be replaced with the RPC url of your choice.
url: "https://goerli.optimism.io",
accounts: [
""
],
},
optimisticEthereum: {
url: "https://mainnet.optimism.io",
accounts: [
""
],
}
},
etherscan: {
apiKey: {
optimisticGoerli: "",
optimisticEthereum: ""
},
},
```

Verify your contracts using the following command (Make sure your contracts are compiled before verification)

Optimism Goerli Testnet

```bash
npx hardhat verify --network optimisticGoerli
```

Optimism Mainnet

```bash
npx hardhat verify --network optimisticEthereum
```