BlockX Deploy

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.

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
npm install -g blockx-deploy
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
blockx-deploy create --prompt "Create a token sale contract with vesting" --name "TokenSale" --type "CUSTOM"
blockx-deploy deploy --file ./contract.sol --name "TokenSale" --private-key "your_private_key"
blockx-deploy deploy --file ./contract.sol --name "TokenSale" --args "arg1,arg2,arg3"
Library Usage
import { ContractGenerator } from 'blockx-deploy';
const generator = new ContractGenerator();
const contract = await generator.generateContract({
prompt: 'Create a token sale contract with vesting',
contractName: 'TokenSale',
enhancePrompt: true,
});
const deployResult = await generator.deployWithPrivateKey(
contract,
'your_private_key',
421613
);
const deployResult = await generator.deployContract(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:
npm run start-ui
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

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
git clone https://github.com/blockx-labs/blockx-deploy.git
cd blockx-deploy
npm install
npm run build
npm test
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