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

@towns-labs/contracts

v3.0.0

Published

Solidity smart contracts for EIP-7702 account abstraction, intent-based execution, and cross-chain settlement.

Readme

Towns Protocol Contracts

Solidity smart contracts for EIP-7702 account abstraction, intent-based execution, and cross-chain settlement.

Quick Start

# Install dependencies
bun install

# Copy environment variables
cp .env.example .env

# Start local development (Anvil + deploy + generate config)
bun run dev

Scripts

bun run dev              # Start Anvil, deploy contracts, generate config
bun run build            # Compile contracts and generate TypeScript ABIs
bun run generate         # Generate TypeScript ABIs only
bun run test             # Run tests with verbose output
bun run test:gas         # Run tests with gas report
bun run coverage         # Generate coverage report
bun run fmt              # Format with Prettier
bun run lint             # Check Prettier formatting
bun run deploy:local     # Deploy to local Anvil (for CI)
bun run deploy:dev       # Deploy to Base Sepolia
bun run deploy:stage     # Deploy to Base Mainnet (stage context)
bun run deploy:prod      # Deploy to Base Mainnet (prod context)
bun run make-config      # Generate deployment config

Configuration

Environment Variables

Set in .env (copy from .env.example):

| Name | Description | |------|-------------| | ANVIL_RPC_URL | Local Anvil endpoint | | LOCAL_PRIVATE_KEY | Deployment key (first Anvil account) | | RPC_84532 | Base Sepolia RPC (for bytecode copying) | | RELAYER_MNEMONIC | Mnemonic for relayer signer generation | | RELAYER_COUNT | Number of relayer signers |

Deployment Config

Chain-specific settings live in deployments/config.toml:

| Context | Chain | Description | |---------|-------|-------------| | local | anvil (31337) | Local Anvil development | | dev | base-sepolia (84532) | Base Sepolia testnet | | stage | base (8453) | Base Mainnet | | prod | base (8453) | Base Mainnet |

Each chain section includes:

  • RPC endpoint URL
  • Constructor arguments for contracts
  • Relayer mnemonic and count

Architecture

| Contract | Purpose | |----------|---------| | TownsAccount | EIP-7702 account with key management | | Orchestrator | Intent verification, gas compensation, execution | | GuardedExecutor | Execution guards and spend limits | | Escrow | Token escrow with cross-chain settlement | | SimpleFunder | Relayer funding mechanism | | LayerZeroSettler | Cross-chain settlement via LayerZero v2 | | Simulator | Gas simulation for orchestrator calls |

Deployment

First-time Setup

  1. Configure environment:
cp .env.example .env
# Edit .env with your RPC URLs and private keys
  1. Configure deployment in deployments/config.toml:

    • Set constructor arguments per chain
    • Configure relayer mnemonic and count
  2. Deploy:

# Local development
make deploy-local-unified

# Dev (Base Sepolia)
make deploy-dev-unified

# Production (Base Mainnet)
make deploy-unified CHAINS=8453 CONTEXT=prod
  1. Generate TypeScript ABIs:
bun run build

Updating Contracts

make deploy-dev-unified                     # Redeploy to dev
make deploy-unified CHAINS=8453 CONTEXT=prod  # Redeploy to prod

Selective Deployment

Deploy specific contracts only:

make deploy-unified CHAINS=84532 CONTRACTS=SimpleFunder,SimpleSettler

Deployment Artifacts

  • deployments/envs/<context>/<chainId>/ - Contract addresses
  • broadcast/ - Transaction records
  • deployments/addresses.json - Address mappings

Testing

bun run test                          # All tests
bun run test:gas                      # With gas report
bun run coverage                      # Coverage summary
forge test --match-test testName      # Specific test
forge test --match-contract Contract  # Specific contract