Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Foundry, Upgradeable Smart Contracts: Pin version in openzeppelin-contracts-upgradeable and initialize proxy in demo code #299

Merged

Conversation

gin
Copy link
Contributor

@gin gin commented Jan 4, 2025

Pin to latest v4 because in openzeppelin-contracts-upgradeable v5, there are 2 changes that result in the tutorial's demo code to not work and returns error:

  1. __Ownable_init() takes a parameter in v5
  2. upgradeTo() deprecated in v5

(Perhaps a note for instructors when they update the lesson in the future 😀)

Latest v4 is v4.9.6
https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/tags


Added a line that's missing in written lesson's demo code, so that forge test works: Initialize proxy.
The line is in the demo code's GitHub repository but not in the demo code in the written lesson.
https://github.com/Cyfrin/foundry-upgrades-cu/blob/main/script/DeployBox.s.sol#L18

Screenshot 2025-01-04 at 2 53 34 PM

Copy link
Contributor

@Equious Equious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great shout! This should get ahead of some of the errors people see here.

@Equious Equious merged commit 4010692 into Cyfrin:dev Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants