What do createProxy() and upgradeProxy() do under the hood?

I’m going through the Upgrading Smart Contracts tutorial. I wanted to confirm if I’m correct about what createProxy() and upgradeProxy() do under the hood.

  • createProxy() creates & deploys a pair of new proxy & implementation contracts.
  • upgradeProxy() deployes the new implementation contract and links it with the already deployed proxy contract.

I got a bit confused by the function names, so just asking this to confirm :wink:

Thanks :slight_smile:

2 Likes

Hi @vasa-develop,

That is correct. https://docs.openzeppelin.com/learn/upgrading-smart-contracts#upgrading-contracts-in-js

Though I mostly use the OpenZeppelin CLI to interact with the contract rather than programmatically.

Feel free to ask all the questions that you need. Also, if we can improve the documentation to make it clearer, let me know (or you can submit a Pull Request)

1 Like