Skip to content

Dev568145/upgradeable-contracts-solidity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foundry UUPSUpgradeable Contract

This is a demo of an upgradeable contract. Upgradeable contract should generally be avoided.

Getting started

Requirements

Quickstart

git clone https://github.com/Dev568145/foundry-upgrades-f23
cd foundry-upgrades-f23
forge build

Usage

Start local node

make anvil

Deploy

In a new terminal window run:

make deploy

Testing

forge test

for testing specific functions run:

forge test --mt 'function name'

Testing Coverage

forge coverage

and for coverage based testing:

forge coverage --report debug

Deploying to testnet or mainnet

  1. Setup environment variables

  2. Fund you wallet with sepolia testnet ETH

  3. Deploy contract to testnet:

    make deploy ARGS="--network sepolia"
    
  4. Upgrade contract

    make upgrade ARGS="--network sepolia"
    

Estimating gas

You can estimat how much gas each function costs

forge snapshot

Formatting

forge fmt

Acknowledgments

I want to thank Patrick Collins and the team at Cyfrin for this contract. Check out Cyfrin here on github and Patrick Collins on youtube.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published