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

@mayflower-fi/evm-bytecode

v0.0.5

Published

Compiled bytecode and deployment helpers for May Prog EVM contracts

Readme

@mayflower-fi/evm-bytecode

Compiled bytecode and deployment helpers for May Prog EVM contracts.

Installation

npm install @mayflower-fi/evm-bytecode
# or
yarn add @mayflower-fi/evm-bytecode
# or
pnpm add @mayflower-fi/evm-bytecode

Usage

Basic Contract Deployment

import { ethers } from 'ethers';
import { ContractDeployer, contracts } from '@mayflower-fi/evm-bytecode';

// Connect to network
const provider = new ethers.JsonRpcProvider('http://localhost:8545');
const signer = await provider.getSigner();

// Create deployer
const deployer = new ContractDeployer(signer);

// Deploy TenantFactory
const tenantFactory = await deployer.deploy(contracts.TenantFactory);
console.log('TenantFactory deployed at:', await tenantFactory.getAddress());

Protocol Deployment Helpers

import { deployProtocol, deployTenant, deployMarketGroup, deployMarket } from '@mayflower-fi/evm-bytecode';

// Deploy complete protocol
const protocol = await deployProtocol({ signer });

// Deploy a tenant
const tenant = await deployTenant({
  signer,
  tenantFactory: protocol.tenantFactory,
  name: 'My Tenant',
  symbol: 'MTNT',
  platformFeeRate: 100000n, // 10% in micro-basis points
});

// Deploy a market group
const marketGroup = await deployMarketGroup({
  signer,
  tenant: tenant.tenant,
  marketGroupFactory: protocol.marketGroupFactory,
  name: 'My Markets',
  buyFeeRate: 2500n,  // 0.25%
  sellFeeRate: 2500n, // 0.25%
});

Verify Deployed Contracts

import { verifyBytecode, getContractStats, contracts } from '@mayflower-fi/evm-bytecode';

// Get on-chain bytecode
const onchainBytecode = await provider.getCode(contractAddress);

// Verify it matches expected bytecode
const matches = verifyBytecode(
  onchainBytecode,
  contracts.TenantFactory.deployedBytecode,
  true // Allow metadata changes
);

// Get contract statistics
const stats = getContractStats(contracts.TenantFactory);
console.log('Contract size:', stats.bytecodeSize, 'bytes');
console.log('Functions:', stats.functionCount);
console.log('Events:', stats.eventCount);

Working with Bytecode

import { 
  getBytecodeSize,
  isWithinSizeLimit,
  getInitCodeHash,
  encodeConstructorArgs 
} from '@mayflower-fi/evm-bytecode';

// Check bytecode size
const size = getBytecodeSize(contracts.MarketFactory.bytecode);
const withinLimit = isWithinSizeLimit(contracts.MarketFactory.deployedBytecode);

// Encode constructor arguments
const args = encodeConstructorArgs(
  ['string', 'string', 'address', 'uint256'],
  ['My Token', 'MTK', '0x...', 1000000n]
);

// Get init code hash for CREATE2
const initHash = getInitCodeHash(contracts.MarketFactory.bytecode, args);

Available Contracts

  • TenantFactory - Factory for deploying tenant contracts
  • TenantImplementation - Implementation contract for tenants
  • MarketGroupFactory - Factory for deploying market groups
  • MarketGroupImplementation - Implementation contract for market groups
  • MarketFactory - Factory for deploying markets
  • LinearMarketImplementation - Implementation contract for linear bonding curve markets
  • MarketToken - ERC20 token for market derivatives
  • CallOptionToken - ERC20 token for call options
  • MockERC20 - Mock ERC20 token for testing (if available)

Helper Functions

Deployment

  • deployProtocol() - Deploy complete protocol infrastructure
  • deployTenant() - Deploy a new tenant
  • deployMarketGroup() - Deploy a new market group
  • deployMarket() - Deploy a new market

Bytecode Utilities

  • getBytecodeSize() - Get bytecode size in bytes
  • isWithinSizeLimit() - Check if bytecode is within EIP-170 limit (24KB)
  • getInitCodeHash() - Get init code hash for CREATE2
  • extractConstructorArgs() - Extract constructor args from deployed bytecode
  • verifyBytecode() - Verify on-chain bytecode matches expected
  • encodeConstructorArgs() - Encode constructor arguments
  • decodeConstructorArgs() - Decode constructor arguments
  • getContractStats() - Get contract statistics

Examples

See the examples/ directory for complete examples:

  • deploy-protocol.ts - Deploy the complete protocol
  • verify-deployment.ts - Verify deployed contracts

License

MIT