Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ contract UpgradeProtocolRegistry is DeployProtocolRegistryImpl {
}

function testScript() public virtual override {
if (
!Env.isCoreProtocolDeployed()
|| (_areProxiesDeployed()
&& Env.getProxyAdminBySlot(address(Env.proxy.protocolRegistry())) == Env.proxyAdmin())
) {
if (!Env.isCoreProtocolDeployed()) {
return;
}

// 1. Deploy the Protocol Registry Proxy
// If proxies are not deployed, deploy them
if (!_areProxiesDeployed()) {
Expand All @@ -42,6 +39,12 @@ contract UpgradeProtocolRegistry is DeployProtocolRegistryImpl {
_addContractsToEnv();
}

// If the proxy has been upgraded already, return
if (_areProxiesDeployed() && Env.getProxyAdminBySlot(address(Env.proxy.protocolRegistry())) == Env.proxyAdmin())
{
return;
}

// 2. Deploy the Protocol Registry Implementation
_mode = OperationalMode.EOA; // Set to EOA mode so we can deploy the impls in the EOA script
DeployProtocolRegistryImpl._runAsEOA();
Expand Down
Loading