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

Make OpenZeppelin account contracts deployed by hardhat Upgradable #326

Open
zeapherine opened this issue Feb 27, 2023 · 6 comments
Open
Labels
enhancement New feature or request OnlyDust Open for OnlyDust contributors

Comments

@zeapherine
Copy link

Since to migrating to cairo v1 after the starknet regenesis, we will need the account contract to be upgradable.

@FabijanC FabijanC added enhancement New feature or request OnlyDust Open for OnlyDust contributors labels Feb 27, 2023
@TsBauer
Copy link
Contributor

TsBauer commented Mar 3, 2023

I'd love to fix this issue😊

@TsBauer
Copy link
Contributor

TsBauer commented Mar 8, 2023

We've implemented a Cairo v0.11 proxy which uses replace_class to make the proxy itself upgradable to Cairo 1.0.
We're unsure how to proceed and have a couple of questions:

  • How should we implement tests? Right now, this seems impossible because v0.11 is not live yet.
  • Should the proxy implementation reside in an MIT licensed repo at our organization such that only the compilation artifacts are kept in this repo?
  • The currently used OZ account contract version is 0.5.1. Should this be upgraded to v0.6.1 at this opportunity?

Actually, anything which helps to pinpoint the scope of this issue is much appreciated😊

@FabijanC
Copy link
Collaborator

FabijanC commented Mar 9, 2023

@TsBauer

We've implemented a Cairo v0.11 proxy which uses replace_class to make the proxy itself upgradable to Cairo 1.0.

When you say you've implemented it, do you mean that you've written a smart contract yourself? Or reused something from the OpenZeppelin repo?

  • How should we implement tests? Right now, this seems impossible because v0.11 is not live yet.

I'm ok with you creating a complete PR only when starknet 0.11 becomes live. Perhaps for now it can be a draft PR which instead of testing on starknet-devnet or testing on alpha-goerli (https://alpha4.starknet.io/) tests on the integration network (https://external.integration.starknet.io/). But I'm also ok with temporarily pausing this issue.

  • Should the proxy implementation reside in an MIT licensed repo at our organization such that only the compilation artifacts are kept in this repo?

I'm ok with this approach if you don't think there is a better way.

  • The currently used OZ account contract version is 0.5.1. Should this be upgraded to v0.6.1 at this opportunity?

Yes, you can upgrade to OZ v0.6.1

@FabijanC FabijanC moved this from 🆕 New to 🏗 In progress in starknet-hardhat-plugin Mar 9, 2023
@TsBauer
Copy link
Contributor

TsBauer commented Mar 9, 2023

@FabijanC

When you say you've implemented it, do you mean that you've written a smart contract yourself? Or reused something from the OpenZeppelin repo?

We reused the OpenZeppelin proxy and merely added an upgrade function which allows to upgrade the proxy itself with the replace_class syscall.

@FabijanC
Copy link
Collaborator

@TsBauer

We reused the OpenZeppelin proxy and merely added an upgrade function which allows to upgrade the proxy itself with the replace_class syscall.

Surely OpenZeppelin isn't already working on this functionality? Maybe this: OpenZeppelin/cairo-contracts#583

A problem with writing our own account classes is that we (or someone) will have to declare them on all testnets and mainnets.

@TsBauer
Copy link
Contributor

TsBauer commented Mar 11, 2023

@FabijanC

We reused the OpenZeppelin proxy and merely added an upgrade function which allows to upgrade the proxy itself with the replace_class syscall.

Surely OpenZeppelin isn't already working on this functionality? Maybe this: OpenZeppelin/cairo-contracts#583

A problem with writing our own account classes is that we (or someone) will have to declare them on all testnets and mainnets.

I overlooked this PR when doing my research. Thanks for making me aware of this. You're certainly right. That's the way to go.

I'll use the integration network for testing and open a draft PR in the upcoming days.

@ivpavici ivpavici moved this from 🆕 New to 📋 Backlog in starknet-hardhat-plugin Apr 18, 2023
@ivpavici ivpavici moved this from 📋 Backlog to 🏗 In progress in starknet-hardhat-plugin Apr 18, 2023
@ivpavici ivpavici moved this from 🏗 In progress to 📋 Backlog in starknet-hardhat-plugin Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request OnlyDust Open for OnlyDust contributors
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants