Deploy smart contracts to ToroNet.
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 testnetCommonJS:
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);--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
Each successful deployment writes a JSON dump under deployments/ with two
files per run:
deployments/<chainId>-<contractName>-<unix_timestamp>.json
deployments/<chainId>-<contractName>-latest.json
The 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