Skip to content

A program showing how to use a proxy for creating upgradeable smart contracts

Notifications You must be signed in to change notification settings

codebestia/smart-contract-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Contract Proxy

This is program for showing how to use proxies for creating smart contract that can be updateable. This is useful for cases where the programmer or community wants to upgrade some functionalities in smart contract and as you know, the blockchain cannot be edited.

Prerequisites

Please install or have installed the below program:

Installation

  1. Install Brownie, if you haven't already. Here is a simple way to install brownie.
pip install eth-brownie

Or, if that doesn't work, via pipx

pip install --user pipx
pipx ensurepath
# restart your terminal
pipx install eth-brownie
  1. Clone this repo
# open your terminal
git clone https://github.com/codebestia/smart-contract-proxy.git
cd smart-contract-proxy
  1. Install ganache-cli
npm install -g ganache-cli

If you want to be able to deploy to testnets, do the following.

  1. Set your environment variables

Set your PRIVATE_KEY environment variables.

You can find your PRIVATE_KEY from your ethereum wallet like metamask.

Create a .env file in the contract directory and add your environment variables to the .env file:

export PRIVATE_KEY=<PRIVATE_KEY>

DO NOT SEND YOUR KEY TO GITHUB If you do that, people can steal all your funds. Ideally use an account with no real money in it.

Then, make sure your brownie-config.yaml has:

dotenv: .env

Usage/Examples

  1. Compile the smart contracts
brownie compile
  1. Deploy and Interaction for local ganache chain
brownie run scripts/deploy.py

for testnet

brownie run scripts/deploy.py --network sepolia

About

A program showing how to use a proxy for creating upgradeable smart contracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published