🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@aixweb3/evi-contracts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aixweb3/evi-contracts

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

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
8
-50%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • 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.

Keywords

ethereum

FAQs

Package last updated on 17 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts