Description
The registration key doesn't serve any purpose (anymore) after switching to an expire date based logic instead of one-time keys.
As a devx improvement, we could now simplify the logic to this:
registerApp(configWord)
for registration through the constructor, invoked by a deployer.registerApp(app, configWord)
for registration through a factory contract.
Overloading isn't an issue in the Solidity API (it's a devx issue only with e.g. ethers.js).
registerAppWithKey
and registerAppByFactory
can be kept for a while marked as deprecated (for backwards compatibility) and later removed. But docs and examples shouldn't use them anymore.
Internally (in governance contract and scripts) we can either keep the logic as is (declaring e.g. the empty string as default key) or simplify the code. It could be simplified to just whitelist deployers, regardless of EOA or contract.
If we want to keep the distinction and associated constraints (EOA: call only from constructor), that could be achieved implicitly by checking if the msg.sender is an EOA or contract in registerApp
.