Remove compiler build if previous build exists

pull/3390/head^2
ioedeveloper 2 years ago committed by Aniket
parent 0284df3550
commit b4abf418a6
  1. 6
      apps/remix-ide/src/blockchain/blockchain.js

@ -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,

Loading…
Cancel
Save