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

feat: ownership transfer script can set arbitrary manager #234

Merged
merged 5 commits into from
Oct 30, 2024

Conversation

fedgiac
Copy link
Contributor

@fedgiac fedgiac commented Oct 30, 2024

Description

When the contract is deployed to a new network, we often need to update the manager and the owner to two separate addresses (for example, some administrative and the DAO respectively).
These changes make this easier.

Test Plan

Updated tests.
Try the updated

Note

I added the --slow flag so that the two transactions aren't submitted at the same time. This is to prevent the unlikely scenario where a malicious block builder wouldn't be able to just execute the second transaction by overriding the first from another attempt (which could happen if the first attempt was done with incorrect parameters).

@fedgiac fedgiac requested a review from a team as a code owner October 30, 2024 14:34
README.md Outdated
export NEW_OWNER=0x1111111111111111111111111111111111111111
export RESET_MANAGER=true # true if the new owner should also become the manager, false otherwise
export NEW_OWNER=0x1111111111111111111111111111111111111111
export NEW_MANAGER=0x2222222222222222222222222222222222222222 # optional parameter, the manager does not change if this variable is unset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for safety purposes, wouldn't it be better than we change manager and owner is optional? mostly because if we change the manager but not the owner, it is easy to fix, but if we change the owner and not the manager, and the owner is a SAFE... it will be hard to amend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is intended to be used only during the first deployment of the script, after that both the owner and the manager are expected to be a multisig and this script wouldn't be used anymore.
That is, I wouldn't expect this script to be used to just change the manager.
But this is maybe a good argument to make the manager mandatory and not offer a default behavior if there's no manager.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the unneeded complexity in 14c8f9f.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! the README still applies as it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! The only change is in d3d1a69.

// Optional input
string private constant INPUT_ENV_AUTHENTICATOR_PROXY = "AUTHENTICATOR_PROXY";

address public constant NO_MANAGER = address(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this work in order to determine there's no manager?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a flag to internally communicate in the script that the address was actually unset. This workaround isn't needed after 14c8f9f.

@fedgiac fedgiac enabled auto-merge (squash) October 30, 2024 17:08
@fedgiac fedgiac disabled auto-merge October 30, 2024 17:08
@fedgiac fedgiac merged commit c15d99a into main Oct 30, 2024
9 checks passed
@fedgiac fedgiac deleted the specify-new-manager branch October 30, 2024 17:09
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants