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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kite-01/contracts

v1.0.4

Published

Contracts for Kite

Readme

Kite Contracts

Kite is a Solidity smart contract system for deploying and settling invoice-style payment flows using a factory and clone pattern. The repo contains the contract implementation, deployment module, generated typechain bindings, and a full Solidity test suite covering native token, ERC20, swaps, refunds, and recovery flows.

What this repo contains

  • contracts/ — the Solidity source for the Kite factory, implementation, interfaces, and library helpers
  • contracts/test/ — Foundry-based contract tests for the protocol behavior
  • ignition/ — Hardhat Ignition deployment module and deployment parameters
  • typechain/ — generated TS bindings produced by the Hardhat typechain plugin
  • artifacts/ — compiled contract artifacts

Core contracts

KiteFactory

The factory deploys deterministic clone instances for each invoice transfer configuration. It exposes:

  • predictAddress(...) for counterfactual address calculation
  • deploy(...) for creating a clone under the operator role
  • settle(...) to execute a payment flow
  • refund(...) to refund funds after expiry or by operator authorization
  • recover(...) to recover stray tokens after settlement

Kite

Each deployed clone represents a single transfer invoice and tracks its status, settlement logic, fee distribution, and permissions. The implementation is designed to be locked down so callers cannot reinitialize or directly manipulate the deployment outside the factory.

Protocol behavior

The contracts support:

  • native ETH and ERC20 payment/in settlement
  • same-token and cross-token settlement flows
  • price routing through a configured Uniswap-style swap router
  • custom fee splits with validation for maximum fee count and minimum output checks
  • expiry-based refunds and post-settlement recovery
  • deterministic deployment by transfer parameters
  • overpayments and refunds that the refund address can't receive (e.g. a contract rejecting ETH) never block settlement or leave the transfer open: the amount stays in the clone for the operator to recover, and Refunded reports the amount actually sent
  • Recovered reports the address the tokens were actually sent to

Tech stack

  • Hardhat 3
  • Solidity 0.8.34
  • OpenZeppelin contracts
  • Uniswap swap-router interfaces
  • viem + typechain generation
  • Foundry-style test suite (forge-std)

Prerequisites

  • Node.js >= 22.13.0
  • npm

Installation

npm install

Common commands

Compile contracts

npm run compile

Build project

npm run build

Run the full test suite

npm test

This runs the Hardhat test command, which includes the Solidity tests under contracts/test/.

Start a local Hardhat node

npm run node

Clean build artifacts

npm run clean

Deployment

The repo includes a Hardhat Ignition deployment for the factory:

npm run deploy-factory

This uses:

  • ignition/modules/KiteFactory.ts
  • ignition/parameters/KiteFactory.json

The default parameters file currently sets both admin and operator to the same address:

{
  "KiteFactoryModule": {
    "admin": "0xA82474B1d4DDac1ed5e4ed047a4A3caD01C200C8",
    "operator": "0xA82474B1d4DDac1ed5e4ed047a4A3caD01C200C8"
  }
}

For a mainnet fork deployment, the project uses the mainnet network configuration from hardhat.config.ts:

npm run deploy-factory:mainnet

This expects the following environment variables to be available:

  • FORK_URL
  • PRIVATE_KEY
  • ETHERSCAN_API_KEY

Configuration notes

The configuration in hardhat.config.ts includes:

  • Solidity compiler version 0.8.34
  • optimizer enabled with runs: 200
  • hardhat and hardhatOp simulated network settings
  • mainnet configured for an HTTP RPC with a configured private key
  • Etherscan verification enabled via ETHERSCAN_API_KEY

Repository structure

.
├── contracts/
│   ├── interfaces/
│   ├── libraries/
│   ├── test/
│   ├── Kite.sol
│   └── KiteFactory.sol
├── ignition/
│   ├── modules/
│   └── parameters/
├── typechain/
├── artifacts/
├── hardhat.config.ts
├── package.json
├── tsconfig.json
├── README.md
└── .gitignore

Notes

This repository is a contracts-focused project rather than a generic Hardhat starter. The implementation and scripts are shaped around the Kite payment factory and the invoice settlement lifecycle, rather than the default sample Counter deployment from a starter template.