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

Merge registry with factory + move transferOwnership to registry #81

Merged
merged 6 commits into from
Mar 3, 2023

Conversation

PaulRBerg
Copy link
Owner

@PaulRBerg PaulRBerg commented Mar 3, 2023

Description

As discussed in #79, and alluded to in #80, this PR merges the registry with the factory, and moves the transferOwnership function to the registry so that the proxies mapping can get updated when ownership is transferred.

This PR addresses the concern raised by @razgraf regarding the soundness of the currentProxies mapping. Now, the proxy returned by getProxy (the successor of getCurrentProxy) is definitely a proxy owned by owner.

But this PR solves the problem in a non-disruptive way, i.e. it will still be possible to transfer ownership (via the registry).

Deployment Cost

The deployment cost has lowered a bit (by 12k gas).

In v4.0.0-beta.1, the cost was ~528,529, whereas with the version in this PR, it costs ~516,709.

@PaulRBerg PaulRBerg force-pushed the refactor/registry branch 2 times, most recently from 05cca67 to c2fe949 Compare March 3, 2023 14:23
build: switch to "forge-std" fork
docs: update NatSpec comments
feat: add "transientProxyOwner" in registry
refactor: load owner from registry in proxy constructor
refactor: rename "deployer" to "operator" in "DeployProxy" event
refactor: update scripts to match latest contract API
refactor: transfer ownership via registry
test: call "setUp" in proxy tests
test: delete "deployProxy" helper function
test: fuzz addresses in proxy "transferOwnership"
test: fuzz origin, operator, and owner
test: name all fuzz tests as "testFuzz_*"
test: rename "deployer" to "origin" in "computeProxyAddrss"
test: test already existing proxy in all deploy functions
test: test registry "transferOwnership"
test: update tests to match latest contract API
test: use named args for "changePrank"
@PaulRBerg PaulRBerg force-pushed the refactor/registry branch from c2fe949 to fff7a2c Compare March 3, 2023 14:38
@PaulRBerg PaulRBerg merged commit f9dede5 into main Mar 3, 2023
@PaulRBerg PaulRBerg deleted the refactor/registry branch March 3, 2023 15:24
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

Successfully merging this pull request may close these issues.

1 participant