Socket
Socket
Sign inDemoInstall

@typechain/hardhat

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typechain/hardhat - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

6

CHANGELOG.md
# @typechain/hardhat
## 2.0.2
### Patch Changes
- e552df9: Add missing dependency on `fs-extra`
## 2.0.1

@@ -4,0 +10,0 @@

11

package.json

@@ -14,3 +14,3 @@ {

],
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",

@@ -24,4 +24,4 @@ "repository": "https://github.com/ethereum-ts/Typechain",

"scripts": {
"format": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --check \"./**/*.ts\"",
"format:fix": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --write \"./**/*.ts\"",
"format": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --check \"./**/*.ts\" README.md",
"format:fix": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --write \"./**/*.ts\" README.md",
"lint": "eslint --ext .ts src test",

@@ -34,2 +34,5 @@ "lint:fix": "yarn lint --fix",

},
"dependencies": {
"fs-extra": "^9.1.0"
},
"devDependencies": {

@@ -41,3 +44,2 @@ "@nomiclabs/hardhat-ethers": "^2.0.2",

"ethers": "^5.1.3",
"fs-extra": "^9.1.0",
"hardhat": "^2.0.10",

@@ -49,5 +51,4 @@ "rimraf": "^3.0.2",

"hardhat": "^2.0.10",
"ts-generator": "^0.1.1",
"typechain": "^5.0.0"
}
}

@@ -32,14 +32,35 @@ <p align="center">

And add the following statement to your hardhat.config.js:
And add the following statement to your `hardhat.config.js`:
```javascript
require('@typechain/hardhat')
require('@nomiclabs/hardhat-ethers')
require('@nomiclabs/hardhat-waffle')
```
Or, if you are using TypeScript, add this to your hardhat.config.ts:
Or, if you use TypeScript, add this to your `hardhat.config.ts`:
```typescript
import '@typechain/hardhat'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
```
Here's a sample `tsconfig.json`:
```json
{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"resolveJsonModule": true
},
"include": ["./scripts", "./test"],
"files": ["./hardhat.config.ts"]
}
```
## Features

@@ -89,8 +110,7 @@

```ts
import { ethers, waffle } from '@nomiclabs/hardhat'
import { ethers, waffle } from 'hardhat'
import chai from 'chai'
import { Wallet } from 'ethers'
import CounterArtifact from '../artifacts/Counter.json'
import { Counter } from '../typechain/Counter'
import CounterArtifact from '../artifacts/contracts/Counter.sol/Counter.json'
import { Counter } from '../src/types/Counter'

@@ -105,11 +125,10 @@ const { deployContract } = waffle

// 1
const signers = await ethers.signers()
const signers = await ethers.getSigners()
// 2
counter = (await deployContract(<Wallet>signers[0], CounterArtifact)) as Counter
const initialCount = await counter.getCount()
counter = (await deployContract(signers[0], CounterArtifact)) as Counter
// 3
const initialCount = await counter.getCount()
expect(initialCount).to.eq(0)
expect(counter.address).to.properAddress
})

@@ -127,3 +146,3 @@

describe('count down', async () => {
// 5
// 5 - this throw a error with solidity ^0.8.0
it('should fail', async () => {

@@ -130,0 +149,0 @@ await counter.countDown()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc