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

Implement minimal proxy clones creation for StakeVault #101

Closed
0x-r4bbit opened this issue Dec 20, 2024 · 0 comments · Fixed by #115
Closed

Implement minimal proxy clones creation for StakeVault #101

0x-r4bbit opened this issue Dec 20, 2024 · 0 comments · Fixed by #115

Comments

@0x-r4bbit
Copy link
Collaborator

StakeVaults will be created many times, each user will have at least one, possibly more.
We can optimize the cost in creating a vault by using the minimal proxy clone pattern.

This task is about implementing this and providing tests and documentation.

@0x-r4bbit 0x-r4bbit added this to the staking-protocol-refinement milestone Dec 20, 2024
@0x-r4bbit 0x-r4bbit moved this to In Progress in Tasks - Smart Contracts Jan 29, 2025
@0x-r4bbit 0x-r4bbit self-assigned this Jan 29, 2025
0x-r4bbit added a commit that referenced this issue Feb 3, 2025
This commit introduces proxy clones to make create `StakeVault`s as
cheap as possible.

Major changes here are:

- Introduce `VaultFactory` which takes care of creating clones and
  registering them with the stake manager
- Make `StakeVault` and `Initializable` so it can be used as a
  "template" contract to later have proxies point to it
- Adjust the deployment script to also deploy `VaultFactory` and ensure
  The proxy is whitelisted in the stake manager
- Make use of the new proxy clones in tests
- Add a test for `TrustedCodehashAccess` that ensures the proxy
  whitelisting works and setting up a (malicious) proxy is not going to
  work

Closes #101
0x-r4bbit added a commit that referenced this issue Feb 6, 2025
This commit introduces proxy clones to make create `StakeVault`s as
cheap as possible.

Major changes here are:

- Introduce `VaultFactory` which takes care of creating clones and
  registering them with the stake manager
- Make `StakeVault` and `Initializable` so it can be used as a
  "template" contract to later have proxies point to it
- Adjust the deployment script to also deploy `VaultFactory` and ensure
  The proxy is whitelisted in the stake manager
- Make use of the new proxy clones in tests
- Add a test for `TrustedCodehashAccess` that ensures the proxy
  whitelisting works and setting up a (malicious) proxy is not going to
  work

Closes #101
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tasks - Smart Contracts Feb 6, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tasks - Smart Contracts Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment