Skip to content

mahreenabbad/upgradable-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proxy Contract Deployment with OpenZeppelin, Hardhat, and Alchemy

This guide will walk you through deploying a proxy contract using OpenZeppelin's upgradeable contract framework with Hardhat on the Ethereum Sepolia network. We will use Alchemy for connecting to the network.

Prerequisites

Ensure you have the following installed:

Project Setup

  1. Initialize Your Project

    mkdir my-upgradeable-contract
    cd my-upgradeable-contract
    npm install
  2. Create the .env File

    Create a file named .env in the root of your project and add the following content:

    ALCHEMY_API_KEY=your-alchemy-api-key
    PRIVATE_KEY=your-ethereum-wallet-private-key
    ETHERSCAN_API_KEY=your-etherscan-api-key
    

    Replace the placeholders with your actual keys.

Deployment Steps

  1. Deploy the Initial Version

    Run the following command to deploy the initial version of your contract:

    npx hardhat run --network sepolia ./scripts/deploy_box_v1.js

    After running this script, note the contract addresses from the output.

  2. Verify the Contract on Etherscan

    Verify the proxy contract on Etherscan with:

    npx hardhat verify --network sepolia <YOUR_PROXY_CONTRACT_ADDRESS>
  3. Upgrade to the New Version

    To upgrade to the new version of your contract, run:

    npx hardhat run --network sepolia ./scripts/upgrade_box_v2.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published