Catalog npm
Back to packageRELEASE DETAILS

0.1.4

npm

@0xsequence/solidity-deployer

A workflow for deploying solidity contracts

blockchaindeployethereumsmart-contractssolidity
Published16 Apr 2025
Direct dependencies19
Transitive dependenciesNot calculated

README

Current package documentation

Solidity Deployer

Solidity Deployer is a TypeScript project that simplifies the process of deploying, managing, and verifying Solidity smart contracts. It streamlines the deployment process by providing a robust workflow for deploying contracts, deploying guard wallets, recovering funds, and verifying contracts through Etherscan and Tenderly.

Key Features

  • Deploying Guard Wallets
  • Deploying Contracts
  • Verifying Contracts on Tenderly and Etherscan
  • Recovering Funds

Installation

To use Solidity Deployer in your project, you need to have Node.js and Yarn installed. You can install the package via Yarn:

yarn add solidity-deployer

Usage

DeploymentFlow

The DeploymentFlow class is the core of the project, which handles the deployment and management of smart contracts.

Constructor

constructor(tenderly: TenderlyConfiguration | Tenderly, etherscanApiKey: string, signer: Signer, logger?: Logger, deployer?: Deployer)

Initialize a new DeploymentFlow instance with the required configuration options for Tenderly, Etherscan, and other necessary parameters.

Deploying Guard Wallets

deployGuards: (moduleAddr: string, guards: string[]) => Promise<string[]>

This method deploys guard wallets for a given module address and a list of image hashes. It returns a promise that resolves to an array of deployed guard wallet addresses.

Deploying and Verifying Contracts

deployAndVerify: <T extends ContractFactory>(
  friendlyName: string,
  contract: new (signer: Signer) => T,
  verificationRequest: ContractVerificationRequest,
  deploymentArgs?: Parameters<T['deploy']>[],
  contractInstance?: BigNumberish,
  txParams?: providers.TransactionRequest,
  fundsRecoveryAddr?: string,
) => Promise<Contract>

This method deploys and verifies a contract using the provided contract factory and deployment arguments. It also takes a friendly name for the contract, verification request details, and optional transaction parameters and funds recovery address.

Recovering Funds

recoverFunds: (address: string) => Promise<BigNumber>

This method helps to recover all funds in the signer and returns them to the specified address. It returns a promise that resolves to the remaining dust in the signer.

Example

import { Tenderly } from "tenderly";
import { Wallet } from "ethers";
import { DeploymentFlow } from "solidity-deployer";

const tenderlyConfig = {...}; // Your Tenderly configuration
const etherscanApiKey = "your-etherscan-api-key";
const privateKey = "your-private-key";
const networkName = "mainnet";

const signer = new Wallet(privateKey);
const tenderly = new Tenderly(tenderlyConfig);

const deploymentFlow = new DeploymentFlow(tenderly, etherscanApiKey, signer);

async function main() {
  // Deploy and verify a contract
  const contract = ...; // Your contract factory
  const verificationRequest = ...; // Contract verification request
  const deploymentArgs = ...; // Contract deployment arguments

  const deployedContract = await deploymentFlow.deployAndVerify("MyContract", contract, verificationRequest, deploymentArgs);
  console.log("Deployed contract address:", deployedContract.address);

  // Deploy guards
  const moduleAddr = deployedContract.address;
  const guards = [...]; // List of image hashes for each guard wallet
  const deployedGuardWallets = await deploymentFlow.deployGuards(moduleAddr, guards);
  console.log("Deployed guard wallets:", deployedGuardWallets);

  // Recover funds
  const recoveryAddress = "your-recovery-address";
  const remainingDust = await deploymentFlow.recoverFunds(recoveryAddress);
  console.log("Remaining dust in signer:", remainingDust.toString());
}

main()
  .then(() => {
    process.exit(0);
  })
  .catch(error => {
    console.error(error);
    process.exit(1);
  });

License

This project is released under the Apache License 2.0.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 19

Native requirements
19 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.3.5runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^5.7.2runtime
@tenderly/sdk
Environment
{
  "local_name": "@tenderly/sdk",
  "alias": false,
  "peer_metadata": null
}
^0.1.14runtime
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^29.5.0development
solc
Environment
{
  "local_name": "solc",
  "alias": false,
  "peer_metadata": null
}
^0.8.19development
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^8.0.3development
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^16.0.3development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^8.38.0development
ts-jest
Environment
{
  "local_name": "ts-jest",
  "alias": false,
  "peer_metadata": null
}
^29.1.0development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^10.9.1development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^2.8.7development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.0.4development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^29.5.0development
lint-staged
Environment
{
  "local_name": "lint-staged",
  "alias": false,
  "peer_metadata": null
}
^13.2.2development
eslint-plugin-import
Environment
{
  "local_name": "eslint-plugin-import",
  "alias": false,
  "peer_metadata": null
}
^2.27.5development
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^8.8.0development
@typescript-eslint/parser
Environment
{
  "local_name": "@typescript-eslint/parser",
  "alias": false,
  "peer_metadata": null
}
^5.59.0development
@typescript-eslint/eslint-plugin
Environment
{
  "local_name": "@typescript-eslint/eslint-plugin",
  "alias": false,
  "peer_metadata": null
}
^5.59.0development
eslint-plugin-simple-import-sort
Environment
{
  "local_name": "eslint-plugin-simple-import-sort",
  "alias": false,
  "peer_metadata": null
}
^10.0.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "2f5d4aeb121b8ef5a8cff35caf88868e3567b726",
  "tarball": "https://registry.npmjs.org/@0xsequence/solidity-deployer/-/solidity-deployer-0.1.4.tgz",
  "fileCount": 58,
  "integrity": "sha512-KjR11oekEgI8tzwE1FsZgdaz9G5Y4bkY6spFXqAtuMr8rpKVD7/sIXHYNHtn/USi5dutLLFPdpVVpRKUg+HZug==",
  "signatures": [
    {
      "sig": "MEQCH3pAwded+ZGqX8U31koxYhbNT8bM8QITuW5W7ONfSIsCIQDO+M5Izc4msUfSpvPwjbNXsra0QNi8P5RVz6XCvXF8IA==",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 146618
}

Repository

PENDING
0xsequence/solidity-deployer

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:bfbc69b36b41fceffc4b6abf79c0349847b3003fe54cd89277890342548b45bf

Other collected versions

0.2.14 Jun0.2.04 Jun0.1.316 Apr0.1.216 Apr0.1.119 Nov0.1.05 AugView all collected versions →