GithubHelp home page GithubHelp logo

am0rfu5 / proxyupgrade Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 669 KB

Solidity Smart Contracts using Proxy Upgrade Pattern and OpenZeppelin

License: MIT License

Solidity 13.69% JavaScript 86.31%

proxyupgrade's Introduction

ProxyUpgrade: Smart Contract Upgrade Mechanism

ProxyUpgrade is a blockchain project that is meant to be used as an educational example of how to implement an upgradeable smart contract system. This system allows for the seamless upgrade of contract logic while preserving the state, providing a robust solution for evolving blockchain applications.

Getting Started

These instructions will get your copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js and npm (Node Package Manager)
  • An Ethereum wallet with Ether on the Rinkeby test network
  • Hardhat development environment

Installation

  1. Clone the repository:
git clone github.com/Am0rfu5/ProxyUpgrade.git
  1. Install dependencies:

Navigate to the project directory and install the required npm packages:

npm install
  1. Environment Setup:

Create a .env file in the root of the project by copying the .env.example file. Update the .env file with your API_KEYs, including your Ethereum node access key and your Etherscan API key for contract verification.

# Example .env content
API_KEY=<your_api_key_here>
ETHERSCAN_API_KEY=<your_etherscan_api_key_here>

Compile and Deploy Contracts

Compile the smart contracts using Hardhat:

npx hardhat compile

Deploy the contracts to the Rinkeby test network:

npx hardhat run --network rinkeby scripts/<nameOfFile>.js

Deploy Proxy

For deploying a proxy contract:

npx hardhat run scripts/<name_of_file> --network <network_name>

Manual Verification

To verify the implementation manually on the network:

npx hardhat verify --network <NETWORK> <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAMETERS>

Verify on Etherscan

Ensure you have an ETHERSCAN_API_KEY environment variable set. Your deploy script will attempt to verify the contracts on Etherscan automatically if the key is available.

Contracts Overview

The project includes several contracts designed for upgradability and management of tasks:

  • CanUpgradeMe: Initial version with basic functionalities including pausing, minting, and task management.
  • UpgradedFile: An upgraded contract introducing a new file management system.

Each contract is built on OpenZeppelin's upgradeable contract suite, ensuring security and flexibility.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

proxyupgrade's People

Contributors

am0rfu5 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.