[Feat]: Configure the final contract owner at deploy time
Nobody has claimed this yet.
- Dominant language
- Solidity
- Stars
- 4
- Forks
- 2
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 24
Description
Component
Other
Priority
P2
Summary
The mainnet deployment should be run by an external party, so who deploys and who holds each role is decided by whoever runs it. The contracts already allow any choice they make: all ten UUPS proxies are upgradeable, every owner is transferable, roles are grantable and revocable, and the protocol registry can re-point any address. Nothing here blocks governance from upgrading or reconfiguring anything.
What the pipeline does not do is let them arrive at that model in one run. owner = msg.sender is hardcoded in DeployCore, DeployPolicy and WireDeployments, nothing ever calls transferOwnership, and WireDeployments._verifyDeployment asserts that every contract's owner is the deployer. So a deployment ends with the deploying key owning ten proxies, the protocol registry and the store factory, and moving that to governance means roughly a dozen manual transfers with nothing checking that none were missed.
The wire stage calls registry.set and grants roles, both onlyOwner, so the deployer has to own everything during deployment. The intended owner can only be assigned at the end.
Proposal
- Add
DOTNS_OWNER, read the wayWHITELIST_OPERATORalready is inWireDeployments, defaulting to the deploying account so current behaviour is unchanged. - Add a final stage that assigns ownership of every proxy, the protocol registry and the store factory to
DOTNS_OWNER, after wiring. A no-op when the value is the deployer. - Have
_verifyDeploymentassert against the configured owner rather thanmsg.sender - Decide single-step versus two-step ownership.
OwnableUpgradeabletransfers in one call, so a mistypedDOTNS_OWNERpermanently destroys upgrade authority on a contract that can then no longer be upgraded to fix it.Ownable2StepUpgradeablemakes the new owner accept, which may or may not be worth having when the target is a governance account, at the cost of an accept transaction.
Acceptance criteria
-
DOTNS_OWNERsets the final owner and defaults to the deploying account. - A final stage assigns ownership of every proxy, the registry and the store factory, and a re-run changes nothing.
-
_verifyDeploymentchecks the configured owner - A recorded decision on single- versus two-step ownership, implemented if two-step.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing DeployCore, DeployPolicy, and WireDeployments, including how WireDeployments reads WHITELIST_OPERATOR and how _verifyDeployment validates owners. Decide and record whether ownership uses single-step or two-step transfer, then add the final ownership stage and verify that reruns are no-ops and the configured owner is checked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100