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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aixweb3/evi-contracts

v1.0.1

Published

AI-powered smart contract generator and deployer for Arbitrum networks with Gemini 2.0 Flash LLM integration

Downloads

10

Readme

EVI Contracts

AI-powered smart contract generator and deployer for Arbitrum networks with Gemini 2.0 Flash LLM integration.

Features

  • AI Smart Contract Generation: Generate Solidity contracts using Google Gemini 2.0 Flash LLM or OpenAI
  • Template-based Generation: Create contracts from pre-defined templates
  • Multi-Network Deployment: Deploy to Arbitrum One and Arbitrum Sepolia
  • Contract Verification: Verify contracts on Arbiscan
  • Multiple Interfaces: Command-line and web interfaces
  • Secure Key Management: Private key or mnemonic for deployment

Installation

npm install -g evi-contracts

Quick Start

Generate a Contract

Using Gemini (default):

evi generate --description "Create an ERC20 token with a fixed supply of 1000000 tokens" --output MyToken.sol

Using OpenAI:

evi generate --description "Create an ERC20 token with a fixed supply of 1000000 tokens" --provider openai --output MyToken.sol

Deploy a Contract

evi deploy --file MyToken.sol --network arbitrumSepolia --args '[1000000]'

Verify a Contract

evi verify --address 0xContractAddress --file MyToken.sol --network arbitrumSepolia

Setup

  1. Create a .env file with your API keys:
# API Keys
OPENAI_API_KEY=your_openai_api_key
GEMINI_API_KEY=your_gemini_api_key
ARBISCAN_API_KEY=your_arbiscan_api_key

# Deployment Credentials (use only one of these)
PRIVATE_KEY=your_private_key
MNEMONIC=your_mnemonic_phrase

# Web Server Configuration
PORT=3001

CLI Usage

For detailed CLI usage instructions, see CLI-USAGE.md.

API Usage

Generate a Contract

const { generateFromDescription } = require('evi-contracts/src/generator');

async function generateContract() {
  const description = "Create an ERC20 token with a fixed supply of 1000000 tokens";
  const options = { provider: 'gemini' }; // or 'openai'
  
  const contractSource = await generateFromDescription(description, options);
  console.log(contractSource);
}

Deploy a Contract

const { deployContract } = require('evi-contracts/src/deployer');

async function deployMyContract() {
  const contractSource = `...your contract source code...`;
  const options = {
    network: 'arbitrumSepolia',
    constructorArgs: [1000000]
  };
  
  const result = await deployContract(contractSource, options);
  console.log(`Contract deployed to: ${result.address}`);
}

Testing Your Installation

After installing the package, follow these steps to verify it works correctly:

Step 1: Check Installation

# Verify the installed version
npx evi --version

Step 2: Explore Available Commands

# View all available commands
npx evi --help

# Get help for specific commands
npx evi generate --help
npx evi deploy --help

Step 3: List Available Templates

# View all contract templates
npx evi list-templates

Step 4: Generate a Contract

# Generate using a template
npx evi generate --template ERC20Token --output TokenFromTemplate.sol

# Or generate using AI (requires API keys in .env)
npx evi generate --description "Create an ERC20 token with 1000000 supply" --provider gemini --output AIToken.sol

Step 5: Review Generated Contract

# View the generated contract
cat TokenFromTemplate.sol

Step 6: Test as a JavaScript Library

Create a test file (test-lib.js):

const { generateFromTemplate } = require('@aixweb3/evi-contracts/src/generator');

async function testLib() {
  try {
    const contract = await generateFromTemplate('ERC20Token', {
      name: 'TestToken',
      symbol: 'TST',
      decimals: 18,
      totalSupply: 1000000
    });
    
    console.log('Successfully generated contract:');
    console.log(contract.slice(0, 300) + '...');
  } catch (error) {
    console.error('Error testing library:', error);
  }
}

testLib();

Run the test:

node test-lib.js

License

MIT

Credits

EVI Contracts is built and maintained by EVI Contributors.