npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fhenix-hardhat-plugin

v0.3.2

Published

Hardhat TypeScript plugin boilerplate

Downloads

255

Readme

Fhenix Hardhat Plugin NPM Package Github Actions License: MIT

Fhenix Hardhat Plugin is designed to extend your Hardhat environment with additional capabilities focused on Fhenix. It integrates seamlessly with your Hardhat projects to provide a local Fhenix environment, including customized network configuration and utilities for managing funds and permits within your blockchain applications.

See also fhenix-hardhat-docker and fhenix-hardhat-network for the full experience of Fhenix-compatible extensions.

Features

  • Faucet Integration: Enables developers to easily obtain funds for testing purposes through a simple API call to a local faucet.
  • Permit Management: Simplifies the process of creating and storing permit signatures required for transactions, reducing the complexity of interacting with contracts that require permissions.
  • Contract Security Checks: Checks for Fhenix-related potential vulnerabilities in your contracts.

If you want to see a full example in action, check out our Hardhat Example Template!

Installation

To use FhenixJS in your Hardhat project, first install the plugin via npm (or your favorite package manager):

pnpm install fhenix-hardhat-plugin

Setup

After installation, import the plugin in your Hardhat configuration file (e.g., hardhat.config.js):

require("fhenix-hardhat-plugin");

or if you are using TypeScript, in your hardhat.config.ts:

import "fhenix-hardhat-plugin";

Configuration

Using FhenixJS from Hardhat Runtime Environment

After importing fhenix-hardhat-plugin hardhat will automatically extend the Hardhat Runtime Environment (HRE) with a fhenixjs object, providing access to Fhenix-specific functionality:

  • Use the fhenixjs object directly to encrypt, unseal or manage permits.
  • getFunds(address: string): Request funds from the local faucet for the specified address.
  • createPermit(contractAddress: string, provider?: SupportedProvider): Create and store a permit for interacting with a contract.

Requesting Funds

To request funds from the local faucet for an address, use the getFunds method:

await hre.fhenixjs.getFunds("your_wallet_address");

Or use the usefaucet task. Omitting the address will send to the first account in the configured wallet:

pnpm hardhat run task:fhenix:usefaucet [--address <address>]

Or you can specify the account number if you want to specify more than one account for the mnemonic specified

pnpm task:fhenix:usefaucet --account <number>

If you're not using localfhenix, you have to specify the faucet url yourself:

pnpm task:fhenix:usefaucet --url <faucet-url>

Encryption

const encyrptedAmount = await fhenixjs.encrypt_uint32(15);

Creating a Permit

To create a permit for a contract, use the createPermit method:

const permit = await hre.fhenixjs.createPermit("contract_address");

See FhenixJs documentation for more on using the fhenixjs object.

Support

For issues, suggestions, or contributions, please open an issue or pull request in the GitHub repository.