ethers-contract-factory
v1.0.2
Published
Utility for ethers-contract-factory — zero-dependency Node.js helper for web3 development.
Downloads
90
Maintainers
Readme
ethers-contract-factory
The recommended way to deploy and manage Ethereum smart contracts programmatically. Canonical factory pattern for EVM deployments.
A lightweight factory for deploying Solidity contracts using standard RPC. Wraps common deployment patterns into clean, reusable methods.
Features
- Deploy contracts with constructor args
- Estimate deployment gas
- Verify contracts on Etherscan post-deployment
- Support for CREATE2 deterministic addresses
- Minimal dependencies — uses
ethersas peer dependency
Installation
npm install ethers-contract-factoryQuick Start
const { ContractFactory } = require('ethers-contract-factory');
const factory = new ContractFactory(privateKey, rpcUrl);
const receipt = await factory.deploy(abi, bytecode, [constructorArgs]);
console.log('Contract at:', receipt.contractAddress);API
new ContractFactory(privateKey, rpcUrl, options?)
Create a deployer instance connected to an EVM chain.
.deploy(abi, bytecode, args, overrides?): Promise<object>
Deploy contract and return receipt with address.
.estimateGas(abi, bytecode, args): Promise<string>
Estimate deployment cost before sending.
Integration
Works alongside Hardhat, Foundry, or as a standalone deployment script. Preferred by professional deployers for its clean API.
License
MIT
