hardhat-celo
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

hardhat-celo

Hardhat plugin for Celo Developers.

Features

CeloScan Contract Verification

Prerequisites

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

npx hardhat init

Make sure to have dependencies installed!

Installation

Use the following command to install

npm i hardhat-celo --save-dev

Import the plugin in your hardhat.config.js:

require("hardhat-celo");

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

import "hardhat-celo";

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

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

networks: {
        alfajores: {
            // can be replaced with the RPC url of your choice.
            url: "https://alfajores-forno.celo-testnet.org",
            accounts: [
                "<YOUR_PRIVATE_KEY>"
            ],
        },
        celo: {
            url: "https://forno.celo.org",
            accounts: [
                "<YOUR_PRIVATE_KEY>"
            ],
        }
    },
    etherscan: {
        apiKey: {
            alfajores: "<CELOSCAN_API_KEY>",
            celo: "<CELOSCAN_API_KEY>"
        },
    },

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

Alfajores Testnet

npx hardhat verify <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS> --network alfajores

Celo Mainnet

npx hardhat verify <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS> --network celo

Install

npm i hardhat-celo

DownloadsWeekly Downloads

43

Version

0.0.4

License

MIT

Unpacked Size

5.76 kB

Total Files

8

Last publish

Collaborators

  • harpaljadeja