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

Use UUPS Upgrade to handle circular dependencies during initial deployment #173

Open
immortal-tofu opened this issue Dec 5, 2024 · 3 comments
Assignees

Comments

@immortal-tofu
Copy link
Collaborator

Today, we need a fresh wallet with a 0 nonce to deploy contracts and we are using precomputed address. This workflow could be more flexible as follow:

  1. Deploy all UUPS proxies with an empty implementation of the core contracts.
  2. Get addresses of the deployed proxies.
  3. Upgrade all proxies with a new implementation using correct addresses.

This method would cost more gas but is more flexible to handle circular dependencies. Each upgrade/deploy for each core contract should have their own task. Also, avoiding .env could be convenient (ie: deploying contract in a CI without context)

@silasdavis
Copy link

Would only cost more gas on deploy right? Since the contract addresses would be baked into the deployed contract code via an ordinary constructor on the implementation contracts. So I'd consider that pretty minor in grand scheme of things.

@jatZama
Copy link
Member

jatZama commented Dec 6, 2024

Would only cost more gas on deploy right? Since the contract addresses would be baked into the deployed contract code via an ordinary constructor on the implementation contracts. So I'd consider that pretty minor in grand scheme of things.

Exactly, the tradeoff of paying slightly more gas in order to have an easier deployment process is acceptable imho.

@bcm-at-zama
Copy link

Mentioned explicitly in the requests by Inco

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

4 participants