Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvolear committed Jan 6, 2024
1 parent a16307c commit 2243eda
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: tests
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
- dev

jobs:
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[![npm](https://img.shields.io/npm/v/@solarity/hardhat-habits.svg)](https://www.npmjs.com/package/@solarity/hardhat-habits) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org)

# Habits
# Hardhat Habits (hABIts)

The hardhat plugin with common ABI utilities.

## What

This plugin simplifies interation with ABI and enables the following use cases:

- **Interface ID Calculation**: Calculates the Interface ID for a specified smart contract using `hardhat` environment and `solidity-ast` package.

## Installation
Expand All @@ -13,21 +17,22 @@ npm install --save-dev @solarity/hardhat-habits
```

## Usage

To use the module, follow these steps:

1. **Import the Module**:

```typescript
import { getInterfaceID } from '@solarity/hardhat-habits';
import { getInterfaceID } from "@solarity/hardhat-habits";
```

2. **Call the Function**:

```typescript
const interfaceID = await getInterfaceID('YourContractName');
const interfaceID = await getInterfaceID("YourContractName");
```

Replace `'YourContractName'` with the name of your contract.
Replace `"YourContractName"` with the name of your contract.

> [!NOTE]
> If the contract name is ambiguous, the fully qualified name of the contract will have to be specified.
Expand All @@ -39,10 +44,3 @@ This plugin does not add tasks to the Hardhat Runtime Environment.
## Environment extensions

This plugin does not extend the Hardhat Runtime Environment.

## Dependencies

- `solidity-ast`: For parsing Solidity AST.

## License
This module is licensed under [MIT], see the LICENSE file for details.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@solarity/hardhat-habits",
"version": "1.0.0",
"description": "The tool designed to simplify working with Ethereum ABI.",
"description": "The tool to work with Ethereum ABI",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"scripts": {
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"homepage": "https://github.com/dl-solarity/hardhat-habits#readme",
"dependencies": {
"solidity-ast": "^0.4.55"
"solidity-ast": "0.4.55"
},
"peerDependencies": {
"hardhat": "^2.0.0"
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { ContractDefinition, FunctionDefinition, SourceUnit } from "solidity-ast";

import { findAll, isNodeType } from "solidity-ast/utils";

export async function getInterfaceID(contractName: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity ^0.8.20;

import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";
import {IERC1967} from "@openzeppelin/contracts/interfaces/IERC1967.sol";
Expand Down
1 change: 0 additions & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import chaiAsPromised from "chai-as-promised";
chai.use(chaiAsPromised);

import { useEnvironment } from "./helpers";

import { getInterfaceID } from "../src";

import {
Expand Down

0 comments on commit 2243eda

Please sign in to comment.