Skip to content

0x3bfc/hardhat-gasless-deployer

Repository files navigation

hardhat-gasless-deployer

hardhat-gasless-deployer Version

This hardhat plugin allows developers to execute gasless contracts deployments using a GSN provider.

Installation

yarn add hardhat-gasless-deployer

Usage

  • update the hardhat.config.js:

For javascript:

require('hardhat-gasless-deployer');

Or if you are using TypeScript:

import 'hardhat-gasless-deployer';

Configurations

The minimal configuration that must be added before using this plugin is as follows:

module.exports = {
  networks: {
    mainnet: { ... }
  },
  hHGaslessDeployer: {
    contract:"THE_CONTRACT_NAME_TO_BE_DEPLOYED",
    initArgsPath: "PATH_TO_CONSTRUCTOR_ARGS_IN_TS_OR_JS",
    salt: "SALT_FOR_CREATE2_DEPLOYMENT", // Optional
    value: "VALUE_IN_ETH_PASSED_TO_THE_DEPLOYED_CONTRACT", // Optional
    network: "gsn", // ie. local gsn network
    rpcUrls: new ethers.JsonRpcProvider("http://127.0.0.1:8545") as unknown as JsonRpcProvider,
    paymaster: "GET_THIS_ADDRESS_FROM_YOUR_GSN_PROVIDER",
    relayerHub: "GET_THIS_ADDRESS_FROM_YOUR_GSN_PROVIDER",
    forwarder: "GET_THIS_ADDRESS_FROM_YOUR_GSN_PROVIDER",
  },
};

For more details about integrating this plugin into your project, please refer to this working example.

About

Deploy contracts with Hardhat using GSN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published