toronetdeploy
v3.1.2
Published
Deploy smart contracts to ToroNet
Downloads
52
Maintainers
Readme
toronetdeploy
Deploy smart contracts to ToroNet.
Install
Library install:
npm install toronetdeployRun via npx (no global install required):
npx toronetdeploy --file contracts/MyToken.sol --contract MyToken \
--owner 0xYourOwnerAddress --args '["0xabc...", "1000"]' --network testnetLibrary Usage
CommonJS:
const { deployContract } = require('toronetdeploy');
async function run() {
const { address, abi } = await deployContract({
file: 'contracts/MyToken.sol',
contract: 'MyToken',
owner: '0xYourOwnerAddress',
args: ['0xabc...', '1000'],
network: 'testnet',
});
console.log('Deployed at:', address);
console.log('ABI:', abi);
}
run().catch(console.error);ESM:
import { deployContract } from 'toronetdeploy';
const { address, abi } = await deployContract({
file: 'contracts/MyToken.sol',
contract: 'MyToken',
owner: '0xYourOwnerAddress',
args: ['0xabc...', '1000'],
network: 'testnet',
});
console.log('Deployed at:', address);
console.log('ABI:', abi);CLI Usage Options
--filePath to the Solidity file containing the contract--contractName of the contract to deploy (must be in the specified file)--ownerAddress of the owner deploying the contract--argsConstructor arguments as JSON array or comma-separated values--networkNetwork to deploy to (default:testnet)--skip-dumpSkip writing the deployment dump file (defaultfalse)--tokenOptional token for deployment
Deployment Metadata Dumps
Each successful deployment writes a JSON dump under deployments/ with two
files per run:
deployments/<chainId>-<contractName>-<unix_timestamp>.json
deployments/<chainId>-<contractName>-latest.jsonThe dump records deployment inputs, the deployed address/ABI, and (when
available) Foundry artifact metadata and source files for verification. Dumps
are only written after deploySmartContract() succeeds.
License: MIT
Author: Emmanuel Nwafor
