Skip to content

PumpGuru/zksync-contract-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contract Deployment Examples

This repository contains examples of how to deploy smart contracts and smart contract factories (contracts that can deploy other contracts) on Abstract using:

Get a copy of the contract-deployment example directory from the Abstract Examples repository:

mkdir -p contract-deployment && curl -L https://codeload.github.com/Abstract-Foundation/examples/tar.gz/main | tar -xz --strip=2 -C contract-deployment examples-main/contract-deployment && cd contract-deployment

Hardhat

  1. Change directory into the hardhat folder and install the dependencies.

    cd hardhat
    npm install

This is the setup instructions for the smart contracts of this repository.

  1. Compiling the contracts.

    npx hardhat compile
  2. Create a new Hardhat configuration variable for your wallet private key.

    When prompted, enter the private key of the wallet you want to use to deploy the contract. It is strongly recommended to use a new wallet for this purpose.

    npx hardhat vars set WALLET_PRIVATE_KEY
  3. Run the deploy script to deploy the smart contract account factory and create a smart account via the factory.

    Note: The defaultNetwork inside hardhat.config.ts is set to abstractTestnet. You will need testnet ETH from a faucet in your wallet to deploy the contract to Abstract.

    npx hardhat deploy-zksync --script deploy-mycontract.ts
    npx hardhat deploy-zksync --script deploy-account.ts

Ethers / zksync-ethers

  1. Change directory into the clients folder.

    cd clients
    
    # or if you were in the hardhat folder
    cd ../clients
  2. Install the dependencies.

    npm install
  3. Set your private key inside an environment variable.

    cp .env.example .env

    Replace the PRIVATE_KEY value with your wallet private key.

  4. Run the scripts

    npm run run-ethers
    npm run run-viem

Useful Links

About

Contract deploy project for zksync

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published