blockx-deploy
v1.1.3
Published
A powerful tool for generating, deploying, and auditing smart contracts on Arbitrum using Gemini 2.0-Flash LLM and Web3Modal
Maintainers
Readme
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
# Install globally for CLI usage
npm install -g blockx-deploy
# Or install as a project dependency
npm install blockx-deployConfiguration
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_prefixOr use the CLI to configure:
blockx-deploy initUsage
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 apiThe API server will be available at http://localhost:3000 with the following endpoints:
GET /api/health- Check API healthGET /api/config/validate- Validate configurationPOST /api/contracts/generate- Generate a contractPOST /api/wallet/connect- Connect to a walletPOST /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 webThe 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
# 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-uiWhat'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
