From 63e8ce1e3f13c4aff71a5e2cb3b7ff0291b6d1f1 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 8 Jun 2021 16:17:34 +0200 Subject: [PATCH] Extend hre with a kredits instance --- hardhat.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hardhat.config.js b/hardhat.config.js index d0a6553..74f70f7 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -2,9 +2,15 @@ require("@nomiclabs/hardhat-waffle"); require('hardhat-deploy'); require("hardhat-deploy-ethers"); require('@openzeppelin/hardhat-upgrades'); +const Kredits = require('./lib/kredits'); const promptly = require('promptly'); +extendEnvironment(async (hre) => { + hre.kredits = new Kredits(hre.ethers.provider, hre.ethers.provider.getSigner()) + await hre.kredits.init(); +}); + // This is a sample Hardhat task. To learn how to create your own go to // https://hardhat.org/guides/create-task.html task("accounts", "Prints the list of accounts", async () => {