|
|
@ -194,7 +194,7 @@ export class Blockchain extends Plugin { |
|
|
|
id: 'confirmProxyDeployment', |
|
|
|
id: 'confirmProxyDeployment', |
|
|
|
title: 'Confirm Update Proxy (ERC1967)', |
|
|
|
title: 'Confirm Update Proxy (ERC1967)', |
|
|
|
message: `Confirm you want to update your proxy contract with the new implementation contract's address: ${newImplAddress}.`, |
|
|
|
message: `Confirm you want to update your proxy contract with the new implementation contract's address: ${newImplAddress}.`, |
|
|
|
modalType: 'modal', |
|
|
|
modalType: 'modal',
|
|
|
|
okLabel: 'OK', |
|
|
|
okLabel: 'OK', |
|
|
|
cancelLabel: 'Cancel', |
|
|
|
cancelLabel: 'Cancel', |
|
|
|
okFn: () => { |
|
|
|
okFn: () => { |
|
|
@ -242,10 +242,14 @@ export class Blockchain extends Plugin { |
|
|
|
if (hasPreviousDeploys) { |
|
|
|
if (hasPreviousDeploys) { |
|
|
|
const deployments = await this.call('fileManager', 'readFile', `.deploys/upgradeable-contracts/${networkName}/UUPS.json`) |
|
|
|
const deployments = await this.call('fileManager', 'readFile', `.deploys/upgradeable-contracts/${networkName}/UUPS.json`) |
|
|
|
const parsedDeployments = JSON.parse(deployments) |
|
|
|
const parsedDeployments = JSON.parse(deployments) |
|
|
|
const oldImplementationAddress = parsedDeployments.deployments[proxyAddress].implementationAddress |
|
|
|
const proxyDeployment = parsedDeployments.deployments[proxyAddress] |
|
|
|
const hasPreviousBuild = await this.call('fileManager', 'exists', `.deploys/upgradeable-contracts/${networkName}/solc-${oldImplementationAddress}.json`) |
|
|
|
|
|
|
|
|
|
|
|
if (proxyDeployment) { |
|
|
|
|
|
|
|
const oldImplementationAddress = proxyDeployment.implementationAddress |
|
|
|
|
|
|
|
const hasPreviousBuild = await this.call('fileManager', 'exists', `.deploys/upgradeable-contracts/${networkName}/solc-${oldImplementationAddress}.json`) |
|
|
|
|
|
|
|
|
|
|
|
if (hasPreviousBuild) await this.call('fileManager', 'remove', `.deploys/upgradeable-contracts/${networkName}/solc-${oldImplementationAddress}.json`) |
|
|
|
if (hasPreviousBuild) await this.call('fileManager', 'remove', `.deploys/upgradeable-contracts/${networkName}/solc-${oldImplementationAddress}.json`) |
|
|
|
|
|
|
|
} |
|
|
|
parsedDeployments.deployments[proxyAddress] = { |
|
|
|
parsedDeployments.deployments[proxyAddress] = { |
|
|
|
date: new Date().toISOString(), |
|
|
|
date: new Date().toISOString(), |
|
|
|
contractName: contractName, |
|
|
|
contractName: contractName, |
|
|
|