Can you change a contracts name upon upgrade?

Hi all, this is a quick question.

When using the OpenZeppelin Upgradeability Proxy Pattern, is it possible to change the name of a contract, specifically the logic implementation contract?

I suspect not, but I wanted to clarify. Thanks for any help!

:computer: Environment

:memo:Details

:1234: Code to reproduce

1 Like

Hi @Dyno,

We can change the contract name. See Upgrading Contracts Programmatically where the logic/implementation contract changes from MyContractV0 to MyContractV1.

What we cannot change is the order in which the contract state variables are declared, nor their type. See Modifying Your Contracts for more details.

I recommend appropriately testing the upgrade process.

Hi @abcoathup,

Ah ok I didn’t note that name change in the example. Awesome, thanks for the help. That answers my question perfectly.

1 Like