arb-deploy
v1.0.1
Published
A simple, scalable package for deploying Ethereum smart contracts
Maintainers
Readme
arb-deploy
A simple, scalable npm package for deploying Ethereum smart contracts, specifically designed for MedInvoiceContract and PPTToken contracts.
Features
- Easy deployment of smart contracts to multiple Ethereum networks
- Support for contract verification on block explorers
- Simple CLI interface for quick deployments
- Programmatic API for integration with other tools
- Supports multiple networks including Arbitrum, Optimism, Filecoin, and Celo
Installation
npm install -g arb-deployOr install locally in your project:
npm install --save-dev arb-deployQuick Start
Initialize a new project
arb-deploy initThis will create:
- A
.envfile template for your credentials - A
deploy.config.jsonfile for configuring your deployments
Configure your environment
Edit the .env file with your deployment credentials:
# Ethereum node endpoint
RPC_URL=https://sepolia-rollup.arbitrum.io/rpc
# Private key for deployment (without 0x prefix)
PRIVATE_KEY=your_private_key_here
# API key for contract verification
VERIFY_KEY=your_etherscan_api_key_hereDeploy a single contract
arb-deploy deploy --contract PPTToken --network arbitrumSepolia --args 100000 --verifyDeploy multiple contracts
Create a deploy.config.json file:
{
"network": "arbitrumSepolia",
"verify": true,
"contracts": [
{
"contract": "PPTToken",
"constructorArgs": [100000]
},
{
"contract": "MedInvoiceContract",
"constructorArgs": ["<PPTToken-address>"]
}
]
}Then run:
arb-deploy deploy-multiple --config deploy.config.jsonProgrammatic Usage
You can also use arb-deploy programmatically in your JavaScript code:
import { deploy, deployMultiple } from 'arb-deploy';
// Deploy a single contract
const result = await deploy({
contractName: 'PPTToken',
network: 'arbitrumSepolia',
constructorArgs: [100000],
verify: true
});
console.log(`Contract deployed to: ${result.address}`);
// Deploy multiple contracts
const results = await deployMultiple([
{
contractName: 'PPTToken',
constructorArgs: [100000]
},
{
contractName: 'MedInvoiceContract',
constructorArgs: ['<PPTToken-address>']
}
], {
network: 'arbitrumSepolia',
verify: true
});Supported Networks
- Arbitrum Sepolia (testnet)
- Optimism Sepolia (testnet)
- Optimism (mainnet)
- Filecoin Calibration (testnet)
- Celo Alfajores (testnet)
License
MIT
