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

How to Upgrade without Changing Name or Creating New Contract ? #56

Open
obumnwabude opened this issue Jun 14, 2024 · 1 comment
Open

Comments

@obumnwabude
Copy link

All the examples make it look like to upgrade a contract, you are changing the proxy to a new implementation address whose Contract name is different from the old implementation. (BoxV2 against Box).

But how do you make changes to the old implementation without changing its name and successfully upgrade the proxy?

For example, you fix a simple logic in one line of code in Box and then you want the proxy to reflect this. But then following the provided steps don't work. Even after setting unsafeSkipAllChecks to false in opts.

So how do you upgrade without changing name?

@ericglau
Copy link
Member

ericglau commented Jun 18, 2024

You could use the same contract name in a differently named Solidity file, then refer to that contract using its fully qualified contract name in the format FILE_PATH:CONTRACT_NAME. For example, "contracts/BoxV2.sol:Box"

The purpose of requiring both versions of the contract is to allow storage layout validations to be run.

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

No branches or pull requests

2 participants