Skip to content

Conversation

@xiaosongfu
Copy link
Contributor

Why not read hardhat config from hardhat-runtime-environment directly? I can't understand😭, so i create this PR

with the changes, we just need:

let client = new MetamaskClient();

@xiaosongfu
Copy link
Contributor Author

xiaosongfu commented Sep 1, 2023

And then we can do more changes for more convenient use:

In our plugin:

declare module "hardhat/types/runtime" {
  export interface HardhatRuntimeEnvironment {
    metamask: MetamaskClient;
  }
}

extendEnvironment((hre) => {
  hre.metamask = new MetamaskClient();
});

In user's deploy scripts:

const mockPoints = await ethers.deployContract("MockPoints", {
 signer: await hre.metamask.getSigner(),
});
await mockPoints.waitForDeployment();
hre.metamask.close();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant