# @0xweb/hardhat

> 0xweb plugin for Hardhat

Latest version **0.1.43** (published 2026-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @0xweb/hardhat
pnpm add @0xweb/hardhat
yarn add @0xweb/hardhat
bun add @0xweb/hardhat
```

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.43 |
| Published | 2026-06-17 |
| First published | 2022-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 249.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Alex Kit |
| Maintainers | tenbits |
| Keywords | web3, contracts, evm |

## Links

- npm: https://www.npmjs.com/package/@0xweb/hardhat
- Repository: https://github.com/0xweb-org/hardhat
- Homepage: https://github.com/0xweb-org/hardhat#readme
- Issues: https://github.com/0xweb-org/hardhat/issues
- npm.io page: https://npm.io/package/@0xweb/hardhat

## Dependencies (6)

- [alot](https://npm.io/package/alot.md) ^0.3.0
- [memd](https://npm.io/package/memd.md) ^0.3.10
- [0xweb](https://npm.io/package/0xweb.md) ^0.11.2
- [atma-io](https://npm.io/package/atma-io.md) ^1.3.5
- [dequanto](https://npm.io/package/dequanto.md) ^0.2.31
- [solidity-coverage](https://npm.io/package/solidity-coverage.md) ^0.8.16

## Recent versions

- 0.1.43 (latest) — 2026-06-17
- 0.1.41 — 2026-03-07
- 0.1.39 — 2026-03-07
- 0.1.37 — 2025-12-04
- 0.1.35 — 2025-12-04
- 0.1.34 — 2025-12-03
- 0.1.33 — 2025-10-22
- 0.1.27 — 2024-12-09
- 0.1.26 — 2024-12-06
- 0.1.24 — 2024-01-26
- 0.1.23 — 2024-01-22
- 0.1.20 — 2023-11-02
- 0.1.19 — 2023-10-30
- 0.1.18 — 2023-10-30
- 0.1.17 — 2023-10-30
- … 17 more at https://npm.io/package/@0xweb/hardhat/versions

## README

# [`0xweb`](https://0xweb.org) plugin for [Hardhat](https://hardhat.org/)


----
[![npm version](https://badge.fury.io/js/@0xweb%2Fhardhat.svg)](https://badge.fury.io/js/@0xweb%2Fhardhat)
[![CircleCI](https://circleci.com/gh/0xweb-org/hardhat.svg?style=svg)](https://circleci.com/gh/0xweb-org/hardhat)


The plugin generates `0xWeb` classes for compiled solidity contracts, making the blockchain development transparent.

> We use [📦 dequanto library](https://github.com/0xweb-org/dequanto) for the classes

---
[Documentation 📜](https://docs.0xweb.org/hardhat/info)
---

# Install

### Install automatically the dependencies and configurations
```bash
# install 0xweb
$ npm i 0xweb -g

# initialize 0xweb and hardhat project
$ 0xweb init --hardhat
```



# Compile

> `any/directory/Foo.sol`

```solidity
pragma solidity ^0.8.2;

contract Foo {
    string public name;

    function setName(string memory _name) public {
        name = _name;
    }
}
```

> Plugin adds also ability to specify the `sources` folder. As per default this is `/contracts/**.sol`

```bash
$ npx hardhat compile --sources ./any/directory/
```

# Use in local development

> `example.ts`
```ts
import { Foo } from '0xc/hardhat/Foo/Foo.ts'
import { HardhatProvider } from '@dequanto/hardhat/HardhatProvider'

// automatically deploys the contract to hardhat chain
const deployer = new HardhatProvider();
const foo = await deployer.deployClass<Foo>(Foo, { arguments: [ 'Hello' ] });

// write
const tx = await foo.setName('Hello world')
const receipt = await tx.wait();

// read
const text = await foo.name();

```

# Use already deployed contracts to any chain

If the contract is already deployed, initialize the contract with the Address as normal class. If the contract is deployed to any other chain - set also the client in constructor

> `example.ts`
```ts
import { Foo } from '0xc/hardhat/Foo/Foo.ts'
import { EthWeb3Client } from '@dequanto/clients/EthWeb3Client'


const client =  new EthWeb3Client();
const foo = new Foo('0x12345...', client);

// write
const tx = await foo.setName('Hello world');
const receipt = tx.wait();
// read
const text = await foo.name();
```


# Additional parameters

- `npx hardhat compile --sources /foo/bar/qux` - compiles solidity files which are located outside the `/contracts` folder
- `npx hardhat compile --artifacts /dist` - set custom folder for artifacts (ABI JSONs and TS contracts)
- `npx hardhat compile --watch` - Compile the sources and waits to recompile on changes
- `npx hardhat compile --package path/to/package/folder` - You can split your project into packages, and with the command compile the contracts in a package, the sources will be searched in that directory, and the artifacts output will be written to that directory
- `npx hardhat compile --tsgen false` - Do not generate the TS classes. Installs all the contracts from the sources directory.
- `npx hardhat compile --install TimelockController` - Installs only specified Artifact name or *.sol paths. Comma separated.
----

---
_Source: https://npm.io/package/@0xweb/hardhat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
