|
|
|
@ -242,10 +242,14 @@ export class Blockchain extends Plugin { |
|
|
|
|
if (hasPreviousDeploys) { |
|
|
|
|
const deployments = await this.call('fileManager', 'readFile', `.deploys/upgradeable-contracts/${networkName}/UUPS.json`) |
|
|
|
|
const parsedDeployments = JSON.parse(deployments) |
|
|
|
|
const oldImplementationAddress = parsedDeployments.deployments[proxyAddress].implementationAddress |
|
|
|
|
const proxyDeployment = parsedDeployments.deployments[proxyAddress] |
|
|
|
|
|
|
|
|
|
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`) |
|
|
|
|
} |
|
|
|
|
parsedDeployments.deployments[proxyAddress] = { |
|
|
|
|
date: new Date().toISOString(), |
|
|
|
|
contractName: contractName, |
|
|
|
|