From a09b99c292fd544759ef3c87d3ab4bb8fec93214 Mon Sep 17 00:00:00 2001 From: Robert Chu Date: Tue, 30 Jul 2024 03:15:35 -0700 Subject: [PATCH] Updates readme. --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5e49fc2..c7b3beb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# `viem-mock-contract` +# `@term-finance/viem-mock-contract` This project adds the ability to deploy a mock contract to the blockchain using the `hardhat-viem` plugin for `hardhat`. @@ -10,13 +10,13 @@ To install this project, run the following commands: `npm`: ```shell -npm install --save-dev viem-mock-contract +npm install --save-dev @term-finance/viem-mock-contract ``` `yarn`: ```shell -yarn add --dev viem-mock-contract +yarn add --dev @term-finance/viem-mock-contract ``` ## Usage @@ -24,18 +24,20 @@ yarn add --dev viem-mock-contract To use this project, add the following to your `hardhat.config.js`: ```javascript -require("viem-mock-contract"); +require("@term-finance/viem-mock-contract"); ``` Then, you can write tests that deploy a mock contract to the blockchain: ```typescript import hre from "hardhat"; -import { deployMock } from "viem-mock-contract"; +import { deployMock } from "@term-finance/viem-mock-contract"; describe("MyContract", () => { it("should deploy a mock contract", async () => { - const mockContract = await deployMock(); + const reader = await hre.viem.getPublicClient(); + const [signer] = await hre.viem.getWalletClients(); + const mockContract = await deployMock(signer, reader); // Add expectations to mock await deployMock.setup(