Git Product home page Git Product logo

playground-upgradability's Introduction

Upgradability playground using OZ libs

Requirements

  • node version: 16.x
  • npm version: 7.x

Usage

  1. Install the dependencies: npm i

  2. Create your env file: cp .env.example .env and fill it with your variables:

  • MNEMONIC: The first account will be used to interact with the blockchain, make sure it has ether.

  • INFURA_PROJECT_ID: Infura id, can be created here for free https://www.infura.io/, alternatively you can set provider for each network for example setting: GOERLI_PROVIDERin case of goerli (check hardhat.config.js for more information)

  • ETHERSCAN_API_KEY: Etherescan api key. Will be used to verify contracts from scripts.

  1. Execute scripts on package.json

For example to deploy and upgrade and transparent proxy use:

npm run deploy:transparent:goerli
npm run update:transparent:goerli

To verify the contract in etherscan, if you set the API KEY, you can execute the prompted command which will be something like this:

you can verify the proxy address with:
npx hardhat verify 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFF --network goerli

Notes

Be aware that when deploying/upgrading contracts using the OZ libs a folder .openzeppelin is created in root of the project and a file for network , for example, for goerli: goerli.json Here will be all the upgradability information (like the proxy admins deployed, the implementations and their storage layout ...) It's mandatory to safe this file, and placed there when upgrading a contract! This will help OZ libs to know which are the proxy admin to interact, perform sanity checks, for example in the storage layout of the previous and new implementation

playground-upgradability's People

Contributors

invocamanman 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.