Catalog npm
PACKAGE EXPLORERView in registry

@0xsequence/solidity-deployer

npm

A workflow for deploying solidity contracts

blockchaindeployethereumsmart-contractssolidity
Versions collected14
Direct dependencies19From release 0.2.1
Last observed21 Oct, 11:09 UTC

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.

Versions 14

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.1Registry latest4 Jun 202519
0.2.04 Jun 202519
0.1.416 Apr 202519
0.1.316 Apr 202519
0.1.216 Apr 202519
0.1.119 Nov 202419
0.1.05 Aug 202419
0.0.812 Jul 202419
0.0.712 Jul 202419
0.0.629 May 202419
0.0.414 Aug 202319
0.0.39 Aug 202319
0.0.29 Aug 202319
0.0.117 Jul 202318

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

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:08 UTC

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

Record identity

package:3401795610fc03f6f9c4b0a0ab3f9e28500321b61f874ef5e5d6a9bd2e410818