DeployX
A secure Telegram bot for deploying smart contracts on the Mantle Sepolia Testnet using Node.js and ethers.js.
視頻
描述
🤖 DeployX - Telegram Smart Contract Deployment Bot
A secure Telegram bot for deploying smart contracts on the Mantle Sepolia Testnet using Node.js and ethers.js.
🚀 Features
Mantle Sepolia Testnet: Deploy to Mantle Sepolia Testnet with optimized configuration
Secure Private Key Handling: Session-only usage with comprehensive security warnings
Flexible Contract Input: Support for bytecode + ABI or Solidity source code
Interactive Deployment Flow: Step-by-step guided deployment process
Real-time Feedback: Transaction monitoring and confirmation updates
Block Explorer Links: Direct links to view deployed contracts
Contract Registry Integration: Optional automatic registration of deployed contracts
🛡️ Security Features
Session-Only Keys: Private keys are never stored or logged
Clear Warnings: Multiple security reminders throughout the process
Testnet Recommendations: Promotes safe testing practices
Input Validation: Comprehensive validation of all user inputs
Error Handling: Safe failure recovery without exposing sensitive data
📋 Prerequisites
Node.js (v16 or higher)
A Telegram Bot Token (from @BotFather)
Some cryptocurrency for gas fees (testnet tokens are free)
⚙️ Installation
Clone or download this repository
Install dependencies:
Configure environment variables:
cp env.example .envEdit
.envand add your Telegram bot token:TELEGRAM_BOT_TOKEN=your_actual_bot_token_hereStart the bot:
npm start
🔧 Configuration
Required Environment Variables
TELEGRAM_BOT_TOKEN: Your Telegram bot token from BotFather
Optional Environment Variables
You can override the default Mantle Sepolia RPC URL by setting this in your .env file:
MANTLE_RPC_URL(defaults to https://rpc.sepolia.mantle.xyz)
Contract Registry Configuration
To enable automatic contract registration and viewing:
Deploy the ContractRegistry contract from
contracts/ContractRegistry.solto your desired networkAdd the contract address and network to your
.envfile:CONTRACT_REGISTRY_ADDRESS=0x1234567890123456789012345678901234567890 CONTRACT_REGISTRY_NETWORK=mantle-testnet
When configured, deployed contracts will be automatically registered with:
Contract name
Contract address
Deployment network
Transaction hash
Deployer address
Timestamp
Users can then view their deployed contracts using /mycontracts.
Demo Private Key (Optional)
For testing purposes, you can configure a demo private key:
PRIVATE_KEY=0x1234567890abcdef...
⚠️ SECURITY WARNING: Only use for testing! Never use real funds with the demo key. When users choose "Use Demo Key", contracts will be deployed using this key and owned by you (the bot administrator).
Users will see two options:
Use Demo Key: Deploys with your configured demo key (you own the contract)
Enter My Own Key: Users provide their own private key (they own the contract)
📖 Usage
Getting Started
Find your bot on Telegram and send
/startUse
/deployto begin the deployment processFollow the interactive prompts to provide contract details
Use
/mycontractsto view your previously deployed contracts
Deployment Steps
Contract Input: Choose between bytecode+ABI or Solidity source
Constructor Parameters: Provide parameters as JSON array
Contract Name: Assign a name for registry tracking
Private Key: Choose between demo key or enter your own
Confirmation: Review and confirm deployment
Viewing Your Contracts
Use /mycontracts to view all contracts you've deployed through this bot:
Send
/mycontractsProvide your Ethereum address
View your complete contract history with:
Contract names and addresses
Deployment networks
Transaction hashes
Timestamps
Block explorer links
Using Bytecode + ABI
{
"bytecode": "0x608060405234801561001057600080fd5b50d3801561001d57600080fd5b50600436106100365760003560e01c80635c60da1b1461003b575b600080fd5b6100436100b5565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b73000000000000000000000000000000000000000090565b9091019056fe",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]
}Using Solidity Source
pragma solidity ^0.8.0;
contract SimpleStorage {
uint256 private value;
constructor(uint256 _initialValue) {
value = _initialValue;
}
function set(uint256 _value) public {
value = _value;
}
function get() public view returns (uint256) {
return value;
}
}🌐 Supported Networks
Network | Type | Recommended | Block Explorer |
|---|---|---|---|
Mantle Sepolia Testnet | Testnet | Yes |
🚨 Security Warnings
⚠️ CRITICAL SECURITY NOTICE
NEVER share your private key with anyone!
Private keys give complete control over your funds
This bot only uses your private key for deployment during your session
Keys are never stored, logged, or transmitted anywhere
Always use testnets for development and testing
Use dedicated addresses with minimal funds for deployment
Best Practices
Test on Testnets First: Always deploy to testnets before mainnet
Use Dedicated Addresses: Create separate addresses for deployment
Minimal Funds: Keep only necessary funds in deployment addresses
Verify Contracts: Test your contracts thoroughly before deployment
Backup Information: Save contract addresses and transaction hashes
🤝 Commands
/start- Initialize the bot and show welcome message/deploy- Start contract deployment process/mycontracts- View your deployed contracts from the registry/networks- List available networks/help- Show help and security information
Images



📝 License
This project is open source. Please use responsibly and follow security best practices.