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

hardhat-forta

v0.0.3

Published

Forta Agent Hardhat Plugin

Downloads

16

Readme

Forta Hardhat Plugin

npm version

This is a Hardhat plugin that integrates Forta Agent development tools enabling teams to quickly add security/operational monitoring for their smart contracts. You can either start from a sample agent project, or initialize from an existing template. To learn more about Forta, check out the docs here.

Installation

You can install the Forta plugin to your Hardhat project using the following command

npm install -D hardhat-forta

This will install the Forta plugin as a dev dependency in your package.json. The last step is to update your hardhat.config.js file to import the plugin by adding the following line

require("hardhat-forta");

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

import "hardhat-forta";

Tasks

This plugin adds the following tasks to Hardhat:

  • forta:init

    Initialize a sample project. Similar to forta-agent init.

    Usage: hardhat [GLOBAL OPTIONS] forta:init [--python] [--typescript]
    
    OPTIONS:
    
      --python      Initialize as Python project
      --typescript  Initialize as Typescript project
    
    forta:init: Initialize a Forta Agent project
  • forta:init:template

    Initializes an agent project based on existing templates.

    Usage: hardhat [GLOBAL OPTIONS] forta:init:template
    
    forta:init:template: Initialize a Forta Agent project from a template
  • forta:run

    Runs a Forta Agent with blockchain data. Similar to forta-agent run.

    Usage: hardhat [GLOBAL OPTIONS] forta:run --block <STRING> [--config-file <STRING>] --file <STRING> [--nocache] --prod <STRING> --range <STRING> --tx <STRING>
    
    OPTIONS:
    
     --tx          Run with the specified transaction hash
     --block       Run with the specified block hash/number
     --range       Run with the specified block range (e.g. 15..20)
     --file        Run with the specified json file
     --config-file Specify a config file (default: "forta.config.json")
     --nocache     Disables writing to the cache (but reads are still enabled)
    
    forta:run: Run a Forta Agent with blockchain data
  • forta:test

    Runs the unit tests of a Forta Agent project

    Usage: hardhat [GLOBAL OPTIONS] forta:test
    
    forta:test: Run unit tests for a Forta Agent
  • forta:publish

    Deploy a Forta Agent to the network. Similar to forta-agent publish.

    Usage: hardhat [GLOBAL OPTIONS] forta:publish [--config-file <STRING>]
    
    OPTIONS:
    
      --config-file Specify a config file (default: "forta.config.json")
    
    forta:publish: Publish a Forta Agent to the network
  • forta:push

    Build a Forta Agent Docker image and push it to the repository. Similar to forta-agent push.

    Usage:hardhat [GLOBAL OPTIONS] forta:push [--config-file <STRING>]
    
    OPTIONS:
    
    --config-file Specify a config file (default: "forta.config.json")
    
    forta:push: Push a Forta Agent image to the repository
  • forta:disable

    Disables a Forta Agent. Similar to forta-agent disable.

    Usage: hardhat [GLOBAL OPTIONS] forta:disable
    
    forta:disable: Disable a Forta Agent
  • forta:enable

    Enables a previously disabled Forta Agent. Similar to forta-agent enable.

    Usage: hardhat [GLOBAL OPTIONS] forta:enable
    
    forta:enable: Enable a Forta Agent
  • forta:keyfile

    Displays keyfile information. Similar to forta-agent keyfile.

    Usage: hardhat [GLOBAL OPTIONS] forta:keyfile
    
    forta:keyfile: Print out keyfile information

Environment extensions

This plugin does not extend the environment.

Configuration

This plugin adds an optional forta entry to Hardhat's config, which allows specifying the directory where your agents are located

module.exports = {
  forta: {
    contextPath: "my-agent", // default: "agents"
  },
};

Usage

All of the tasks can be called through npx hardhat <task> inside the Hardhat project.