Comments (3)
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.
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.
Good call! I have fixed this here.
from foundry-upgrades-f23.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundry-upgrades-f23.