Skip to content

Commit

Permalink
Add readme section
Browse files Browse the repository at this point in the history
  • Loading branch information
schaable committed Jun 25, 2024
1 parent 7625d6f commit 830a785
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/hardhat-viem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,18 @@ This allows you to deploy a contract linked to the `ExampleLib` library at the a

To deploy a contract, all libraries must be linked. An error will be thrown if any libraries are missing.

#### Using `ContractTypesMap` for easier contract type imports

To simplify importing contract types in `hardhat-viem`, you can use the `ContractTypesMap`. This map contains the contract types of all contracts in your project, indexed by their names.

```typescript
import { ContractTypesMap } from "hardhat/types/artifacts";

const contract: ContractTypesMap["ContractName"];
```

This reduces the need for multiple imports and makes your code cleaner and easier to manage.

## Usage

There are no additional steps you need to take for this plugin to work.
Expand Down

0 comments on commit 830a785

Please sign in to comment.