Giter Site home page Giter Site logo

william3johnson / openzeppelin-nile-upgrades Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openzeppelin/openzeppelin-nile-upgrades

0.0 1.0 0.0 224 KB

Plugin for Nile to deploy and manage upgradeable contracts on StarkNet.

License: MIT License

Python 79.01% Cairo 20.99%

openzeppelin-nile-upgrades's Introduction

OpenZeppelin Nile Upgrades

Plugin for Nile to deploy and manage upgradeable contracts on StarkNet.

⚠️ WARNING! ⚠️

This plugin does not currently validate contracts for upgrade safety.

This repo contains highly experimental code. Expect rapid iteration. Use at your own risk.

Usage

deploy_proxy

Deploy an upgradeable proxy for an implementation contract.

nile deploy_proxy [OPTIONS] SIGNER CONTRACT_NAME [INITIALIZER_ARGS]...

SIGNER - private key alias for the Account to use.

CONTRACT_NAME - the name of the implementation contract.
    
INITIALIZER_ARGS - arguments for the initializer function.

Options:
  --initializer TEXT  Initializer function name. Defaults to 'initializer'
  --alias TEXT        Unique identifier for your proxy.
  --max_fee TEXT      Maximum fee for the transaction. Defaults to 0.

Example usage in scripts with Nile Runtime Environment:

proxy_address = nre.deploy_proxy(["PKEY1", "my_contract_v1", "arg for initializer"])

upgrade_proxy

Upgrade a proxy to a different implementation contract.

nile upgrade_proxy [OPTIONS] SIGNER PROXY_ADDRESS_OR_ALIAS CONTRACT_NAME

SIGNER - private key alias for the Account to use.

PROXY_ADDRESS_OR_ALIAS - the proxy address or alias.

CONTRACT_NAME - the name of the implementation contract to upgrade to.

Options:
  --max_fee TEXT  Maximum fee for the transaction. Defaults to 0.
  --help          Show this message and exit.

Example usage in scripts with Nile Runtime Environment:

tx_hash = nre.upgrade_proxy(["PKEY1", proxy_address, "my_contract_v2"])

Contribute

Installation

  1. Install Poetry
  2. Clone https://github.com/OpenZeppelin/nile
  3. Clone this project.
  4. From this project's root, setup venv and install dependencies:
python3 -m venv env
source env/bin/activate
poetry install
pip3 install -e <your_path_to_nile_repo_from_step_2>
pip3 install -e .

Testing

poetry run pytest tests

openzeppelin-nile-upgrades's People

Contributors

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