Skip to main content
AI tutorials

Deploy and Manage Solidity Contracts from Your Terminal with Arbitrage Contract Deployer

Learn how to install and configure Arbitrage Contract Deployer, compile Solidity files, deploy contracts to Ethereum Mainnet, call read and write functions, review gas costs, manage saved deployments, and run the mempool stream.

Deploy and Manage Solidity Contracts from Your Terminal with Arbitrage Contract Deployer

What You Will Learn

Arbitrage Contract Deployer is a Node.js command-line toolkit for compiling, deploying, and interacting with Solidity contracts directly from a terminal. This tutorial explains how to install it, connect a wallet to Ethereum Mainnet, deploy a contract, use the interactive menu, and monitor supported mempool activity.

Important: This project works only with Ethereum Mainnet. Transactions use real ETH and may cost real money. Review every contract, address, and transaction before confirming it.

Key Features

  • Compiles Solidity contracts on demand with solc, without Remix or Hardhat.
  • Resolves imports from local files, node_modules, GitHub, and npm-compatible CDNs.
  • Deploys contracts to Ethereum Mainnet through an RPC connection.
  • Stores deployed addresses, ABIs, and dates in deployments.json.
  • Provides an arrow-key interface for deploying contracts and calling functions.
  • Classifies contract functions as read-only, write, or payable operations.
  • Previews gas estimates, fees, and approximate ETH and USD costs.
  • Uses a Chainlink oracle to obtain the ETH/USD rate for fee estimates.
  • Can run a separate mempool stream process with formatted transaction output.

Prerequisites

You need Node.js 18 or newer because the project requires the built-in fetch functionality. The README also lists npm 9 or newer. You will need an Ethereum Mainnet RPC endpoint, a wallet private key, and enough ETH to pay for any deployment or write transaction you confirm.

Install the Project

1. Clone the repository

Clone the project and change into its directory. Replace the repository path with the repository location you are using.

git clone https://github.com/yoge7388095s/eth-trading-bot
cd <your-repo>

You can also download the repository as a ZIP archive and extract it into a local folder.

2. Install dependencies

Install the packages declared in package.json:

npm install

This installs the two primary dependencies:

  • ethers for providers, wallets, ABI handling, and transactions.
  • solc for compiling Solidity from Node.js.

After installation, the project should contain a node_modules directory. If it does not, inspect the output from npm install and resolve the installation error before continuing.

Configure the Wallet and RPC Connection

Create a file named .env in the project root. Add your private key and an Ethereum Mainnet RPC URL:

PRIVATE_KEY=0xYourPrivateKey
RPC_URL=https://ethereum-rpc.publicnode.com

The README lists these example RPC endpoints:

  • https://ethereum-rpc.publicnode.com
  • https://eth.llamarpc.com
  • https://cloudflare-eth.com
  • https://mainnet.infura.io/v3/<KEY>
  • https://eth-mainnet.g.alchemy.com/v2/<KEY>

Keep .env private and ensure it is included in .gitignore. The file contains credentials that should never be committed to a public repository.

Start the Interactive Deployer

Launch the main interface with:

node start

If the project defines an npm start script, you can alternatively run:

npm start

The application checks the network, wallet, and balance, then opens its interactive menu. A typical menu includes options similar to:

=== 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

Use the arrow keys to select an item, press Enter to confirm a selection, and use the displayed OK or Cancel controls when the program requests transaction approval. Press Ctrl+C to exit.

Compile and Deploy a Solidity Contract

1. Add or select a Solidity file

Place a Solidity file in the project directory, or select an existing .sol file through the deployment menu. The compiler builds the contract based on its file name and resolves supported imports automatically.

2. Review compilation and deployment details

Select Deploy <file>.sol from the main menu. The application compiles the contract, prepares the deployment transaction, and previews its gas requirements before asking for confirmation.

3. Confirm the transaction

Review the gas estimate, current fee, maximum fee, wallet balance, and contract details. Confirm only when the values and target network are correct. After the transaction is mined, the tool displays the deployed address and an Etherscan link.

Deployment information is saved locally in deployments.json. This lets you reopen a deployed contract later without entering its address and ABI again.

Understand the Gas Preview

Before deployment and supported write operations, the tool presents a gas preview. Its calculation follows the process documented in the README:

  1. estimateGas provides an estimated gas requirement.
  2. The gas limit is calculated as the estimate plus a 10 percent buffer.
  3. The maximum fee per gas is calculated as two times the base fee plus the priority fee.
  4. The interface shows both an expected current-block fee and a maximum possible fee.
  5. A Chainlink ETH/USD rate is used to estimate the fee in dollars.

A preview can include values such as estimated gas units, gas limit, base fee, priority fee, maximum fee per gas, expected ETH cost, maximum ETH cost, and wallet balance. Treat the maximum fee as an upper estimate and confirm that your balance can cover the transaction.

Open a Saved Deployment and Call Functions

Choose Open deployed <name> to work with a contract previously saved in deployments.json. The interface labels available functions according to their behavior:

  • [read] identifies view and pure functions that do not send transactions.
  • [write] identifies state-changing functions that require a transaction.
  • [payable] identifies functions that can accept ETH.
  • [info] Contract balance displays the contract balance.
  • <- Back to main menu returns to the main menu.

Read-only calls can be used to inspect contract state. Write and payable calls go through a gas preview and require confirmation before a transaction is sent. The interface also provides an OK action so you can cancel instead of submitting an operation.

Run the Mempool Stream

The mempool stream runs as a separate process. Start it manually with:

node mempool.js

The stream formats detected activity with details such as the buyer, router, ETH amount, token, method, transaction ID, and resulting status output. The README also shows deal and profit displays for the stream's supported workflow.

The token source is erc20.json, which follows the Uniswap Token List Schema format from the Sequence Token Directory. The loader supports either a bare token array or an object containing a tokens array. It filters invalid addresses and zero addresses, keeps tokens with chainId equal to 1, and extracts each token's address, symbol, and name.

If erc20.json is missing, the stream falls back to random addresses and displays a warning. Stop the stream with Ctrl+C, or use the stop option when it appears in the interactive interface.

Use Solidity Imports

The built-in compiler supports several import styles:

  • GitHub URLs, such as import "https://github.com/Uniswap/v3-core/...";
  • npm-style CDN imports, such as import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
  • Packages available in local node_modules.
  • Relative local imports, such as import "./MyLib.sol";

GitHub links using the github.com/owner/repo/blob/branch/path form are automatically converted to their raw.githubusercontent.com equivalent.

Project Structure

The main files and directories have these roles:

  • start.js is the entry point for node start.
  • deploy.js contains deployment logic and the interactive menu.
  • mempool.js runs the separate mempool stream.
  • erc20.json contains the token list used by the stream.
  • deployments.json stores saved deployment data and is created automatically.
  • lib/ui.js manages colors, menus, boxes, and logging.
  • lib/env.js handles environment variables, deployment data, and explorer links.
  • lib/compile.js handles compilation and import resolution.
  • lib/chain.js handles gas, receipts, and ETH pricing.
  • lib/contract.js handles deployment, function calls, and stream launching.

Advanced Tips and Operational Checks

  • Confirm that your RPC endpoint is for Ethereum Mainnet. The application expects chain ID 1 and refuses other networks.
  • Check the wallet balance before confirming a deployment or write operation.
  • Use deployments.json as local deployment data and avoid committing sensitive or unintended test information.
  • Review contract source code, imported dependencies, destination addresses, and payable values before submitting transactions.
  • Check the installed Solidity compiler version with node -e "console.log(require('solc').version())".
  • Verify that dependencies are present with ls node_modules | head.
  • Remember that the project does not provide multisig support, ABI export to TypeScript types, or Tenderly transaction simulation according to its current roadmap.

Security Checklist

  1. Never publish or commit PRIVATE_KEY.
  2. Keep .env in .gitignore.
  3. Use a wallet with only the funds required for the operation.
  4. Read every gas preview before selecting OK.
  5. Verify that the interface reports Ethereum Mainnet and chain ID 1.
  6. Inspect contracts and addresses carefully before using write or payable functions.

Useful Commands

npm install
node start
npm start
node mempool.js
node -e "console.log(require('solc').version())"
ls node_modules | head

Conclusion

Arbitrage Contract Deployer provides a terminal-based workflow for compiling Solidity, deploying contracts to Ethereum Mainnet, reopening saved deployments, calling contract functions, and reviewing transaction costs. Once Node.js, the dependencies, and a secure .env file are configured, the interactive menu guides deployment and contract operations while showing gas and ETH/USD estimates. Because all Mainnet transactions use real funds, operate conservatively and confirm every transaction only after reviewing its details.

The project is released under the MIT license. Contributions should keep credentials out of commits and ensure that deployments.json contains only appropriate local data.