🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

blockx-deploy

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockx-deploy

A powerful tool for generating, deploying, and auditing smart contracts on Arbitrum using Gemini 2.0-Flash LLM and Web3Modal

latest
Source
npmnpm
Version
1.1.3
Version published
Weekly downloads
9
200%
Maintainers
1
Weekly downloads
 
Created
Source

BlockX Deploy

Version License

A powerful tool for generating, deploying, and verifying smart contracts on Arbitrum using Gemini 2.0-Flash LLM. BlockX Deploy simplifies the entire smart contract development lifecycle, from generation to deployment and verification. Designed for developers who want to quickly create and deploy smart contracts without writing code from scratch.

npm version License: MIT

Features

  • AI-Powered Contract Generation: Create smart contracts by describing your requirements in natural language
  • Prompt Enhancement: Automatically enhance prompts with Arbitrum-specific optimizations
  • Flexible Wallet Integration: Connect with user wallets using ethers.js or deploy directly with private keys
  • Contract Deployment: Deploy contracts to Arbitrum networks (mainnet and Sepolia testnet)
  • Contract Verification: Automatically verify deployed contracts on Arbiscan
  • Multiple Interfaces: Use as a library, CLI tool, API server, or web application
  • User-Friendly Web Interface: Generate, deploy, and verify contracts through an intuitive browser UI
  • Secure Key Management: Private keys are stored only in your browser's localStorage for web deployments

Installation

# Install globally for CLI usage
npm install -g blockx-deploy

# Or install as a project dependency
npm install blockx-deploy

Configuration

Set up your API keys in a .env file:

GEMINI_API_KEY=your_gemini_api_key
ARBISCAN_API_KEY=your_arbiscan_api_key
# For deployments with private key (optional, use with caution)
PRIVATE_KEY=your_private_key_without_0x_prefix

Or use the CLI to configure:

blockx-deploy init

Usage

CLI Usage

# Generate a contract
blockx-deploy create --prompt "Create a token sale contract with vesting" --name "TokenSale" --type "CUSTOM"

# Deploy with private key (for automated deployments)
blockx-deploy deploy --file ./contract.sol --name "TokenSale" --private-key "your_private_key"

# Deploy a contract
blockx-deploy deploy --file ./contract.sol --name "TokenSale" --args "arg1,arg2,arg3"

Library Usage

import { ContractGenerator } from 'blockx-deploy';

// Create a new generator instance
const generator = new ContractGenerator();

// Generate a contract
const contract = await generator.generateContract({
  prompt: 'Create a token sale contract with vesting',
  contractName: 'TokenSale',
  enhancePrompt: true,
});

// Deploy with private key (for backend/automated deployments)
const deployResult = await generator.deployWithPrivateKey(
  contract,
  'your_private_key', // Without 0x prefix
  421613 // Arbitrum Goerli testnet chain ID
);

// Deploy contract
const deployResult = await generator.deployContract(contract);

// Verify contract
const verifyResult = await generator.verifyContract(
  deployResult.contractAddress,
  contract
);

API Server

Start the API server:

npx blockx-deploy api

The API server will be available at http://localhost:3000 with the following endpoints:

  • GET /api/health - Check API health
  • GET /api/config/validate - Validate configuration
  • POST /api/contracts/generate - Generate a contract
  • POST /api/wallet/connect - Connect to a wallet
  • POST /api/contracts/deploy - Deploy a contract

Web Interface

Start the web interface with our enhanced launcher script:

# Use the enhanced launcher script (recommended)
npm run start-ui

# Or use the basic web server
npx blockx-deploy web

The web interface will be available at http://localhost:3001 and provides:

  • Intuitive UI: User-friendly interface for all contract operations
  • Secure Key Management: Private keys are stored only in your browser's localStorage
  • Network Selection: Choose between Arbitrum One (mainnet) and Arbitrum Sepolia (testnet)
  • Live Contract Preview: View and edit generated contract source code
  • Deployment Status Tracking: Monitor deployment progress and get transaction details
  • Automatic Browser Opening: The interface automatically opens in your default browser

Web Interface Screenshot

Troubleshooting

Common Issues

  • Network Connection Issues: If you encounter network connection errors when deploying to Arbitrum, try using a different RPC endpoint. You can specify a custom RPC URL in your configuration.

  • Contract Compilation Errors: Make sure your contract imports are correctly specified. The package includes templates for ERC20 and ERC721 tokens that are pre-configured to work with the latest OpenZeppelin contracts.

  • Deployment Failures: Ensure you have enough ETH in your wallet to cover gas costs on the Arbitrum network you're deploying to.

  • Verification Failures: If contract verification fails, you can manually verify the contract on Arbiscan using the contract source code and constructor arguments.

Development

# Clone the repository
git clone https://github.com/blockx-labs/blockx-deploy.git

# Install dependencies
cd blockx-deploy
npm install

# Build the package
npm run build

# Run tests
npm test

# Start the web interface for development
npm run start-ui

What's New in Version 1.1.0

  • Private Key Deployment: Deploy contracts directly using private keys without requiring WalletConnect
  • Arbitrum Sepolia Support: Added support for the Arbitrum Sepolia testnet
  • Enhanced Web Interface: Completely redesigned web interface with improved UX
  • Launcher Script: New start-ui script for easy launching of the web interface
  • Improved Documentation: Comprehensive user guide and API reference
  • TypeScript Fixes: Resolved TypeScript errors and improved type safety
  • Dependency Updates: Updated dependencies to latest compatible versions

Documentation

For detailed documentation, see the following:

License

MIT

Keywords

arbitrum

FAQs

Package last updated on 05 May 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