Coder Social home page Coder Social logo

Comments (3)

S23Web3 avatar S23Web3 commented on August 21, 2024 1

Thanks so much,

note for those who installed version 5, in the UUPSUpgradable contract the function upgradeTo is not present anymore so you probably get an error:

Compiler run failed:

Error (9582): Member "upgradeTo" not found or not visible after argument-dependent lookup in contract BoxV1.

--> script/UpgradeBox.s.sol:32:9:

   |
32 |         proxy.upgradeTo(address(newBox));
   |         ^^^^^^^^^^^^^^^

in lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol

function upgradeTo(address newImplementation) public virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0));
    }

Add this, it is similar to upgradeToAndCall but lacks the data (bytes) parameter
//edited in the resolve in case someone did update to v5 and gets an error, I removed false as the 3rd argument, this might give additional bugs as _upgradeToAndCallUUPS is a mystery for now. If it doesn't matter then for now won't add anything.

//2nd edit, tests passed with version 5 as instructed in the lesson with adding the function above in UUPSUpgradeable, not being stubborn with the version just testing if it works for a fellow student to find a solution if overlooked installing the matching version (4.8.x) of openzeppelin

from foundry-upgrades-f23.

S23Web3 avatar S23Web3 commented on August 21, 2024

The new path is added to a sub map,
import {UUPSUpgradeable} from "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";

I am writing this in case an aspiring security researcher/ dev would get openzeppelin v5 installed. I came across issues when installing and de-installing and re-installing a lower version so that is why. Hope it would help for those who need it.

from foundry-upgrades-f23.

PatrickAlphaC avatar PatrickAlphaC commented on August 21, 2024

Good call! I have fixed this here.

b349a69

from foundry-upgrades-f23.

Related Issues (5)

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.