add batch authenticator deployment script#399
add batch authenticator deployment script#399jjeangal merged 2 commits intocelo-integration-rebase-16.2from
Conversation
|
Claude finished @jjeangal's task in 1m 13s —— View job Code Review: Add Batch Authenticator Deployment Script
SummaryThis is a clean, well-structured standalone deployment script for the What looks good:
Feedback posted as inline comments:
Minor observation: No tests are included for this script. Consider adding a forge test that runs the script against a fork or local chain to verify the deployment flow end-to-end, especially the ownership transfer path. Overall this looks good — the inline comments are suggestions rather than blockers. |
| if (proxyAdminOwner == address(0)) proxyAdminOwner = msg.sender; | ||
|
|
||
| vm.startBroadcast(msg.sender); | ||
|
|
There was a problem hiding this comment.
The proxyAdminOwner is passed to BatchAuthenticator.initialize as the _owner parameter (line 55), which calls __OwnableWithGuardians_init(_owner). But the ProxyAdmin is created with msg.sender as the owner (line 42), and upgradeAndCall is gated by _assertOnlyProxyAdminOrProxyAdminOwner() inside initialize.
This works because msg.sender owns the ProxyAdmin at the time of upgradeAndCall, so the assertion passes. However, after ownership is transferred on line 63, the proxyAdminOwner becomes the ProxyAdmin owner while msg.sender remains the BatchAuthenticator owner set via __OwnableWithGuardians_init — wait, no, proxyAdminOwner is passed as _owner to initialize. That's correct.
One subtle issue: if the caller intends proxyAdminOwner to be a multisig or timelock, the ProxyAdmin ownership is transferred (line 63), but the BatchAuthenticator's Ownable owner is also set to proxyAdminOwner via the initialize call. This means the same address controls both the proxy upgrade path AND the contract's own admin functions. This coupling may be intentional, but it's worth calling out in a comment or the NatSpec so future operators understand the ownership model.
There was a problem hiding this comment.
Code Review
This pull request introduces a new deployment script for the BatchAuthenticator contract, utilizing a proxy pattern with ProxyAdmin. The script handles the deployment of the implementation, proxy, and admin contracts, as well as their initialization and ownership setup. The feedback recommends adding vm.label for the deployed contracts to improve traceability and debugging within Forge traces.
* add batch authenticator deployment script * add labels and warn log
Uh oh!
There was an error while loading. Please reload this page.