JSPM

hardhat-safe-deployer

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15928F
  • License MIT

Hardhat plugin to deploy smart-contract via Safe

Package Exports

  • hardhat-safe-deployer
  • hardhat-safe-deployer/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hardhat-safe-deployer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Hardhat Safe Deployer

Overview

The Hardhat Safe Deployer plugin simplifies the deployment of smart contracts to Gnosis Safe using Hardhat. It provides an easy-to-use setup for interacting with a deployer Safe, ensuring secure and reliable deployments.

This repository is a fork of rmeissner's Hardhat Safe Deployer. Special thanks to @rmeissner for the original implementation and inspiration.

Installation

Install the plugin via Yarn:

yarn add github://andrijdavid/hardhat-safe-deployer

Configuration

  1. Import the plugin in your hardhat.config.ts:
import { setupSafeDeployer } from "hardhat-safe-deployer";

2.Configure the deployer by calling setupSafeDeployer with the required parameters:

Example Configuration

Below is an example configuration using dotenv for environment variables:

import { setupSafeDeployer } from "hardhat-safe-deployer";
import dotenv from "dotenv";
import { Wallet } from "ethers";

// Load environment variables.
dotenv.config();
const {
  INFURA_KEY,
  MNEMONIC,
  PRIVATE_KEY,
  MNEMONIC_PATH,
  ETHERSCAN_API_KEY,
  SAFE_SERVICE_URL,
  DEPLOYER_SAFE,
} = process.env;

// Configuration using mnemonic
setupSafeDeployer(
  Wallet.fromMnemonic(MNEMONIC!!, MNEMONIC_PATH),
  DEPLOYER_SAFE,
  SAFE_SERVICE_URL
);

// Or, configuration using private key
setupSafeDeployer({
  signer: new Wallet(PRIVATE_KEY),
  safe: DEPLOYER_SAFE,
  serviceUrl: SAFE_SERVICE_URL,
});

Example Project

For a complete example, check out the Hardhat Safe Deployer Example project.