pull/4109/merge
filip mertens 1 year ago committed by Aniket
parent 3682c51c10
commit 2b192457bc
  1. 14
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts

@ -122,7 +122,10 @@ export class OpenZeppelinProxy extends Plugin {
},
useCall: true
}
// re-use implementation contract's ABI for UI display in udapp and change name to proxy name.
newImplementationContractObject.contractName = newImplementationContractObject.name
newImplementationContractObject.implementationAddress = newImplAddress
newImplementationContractObject.name = proxyName
await this.blockchain.runTx(args, () => { }, () => { }, () => { }, async (error, txResult, _address, returnValue) => {
if (error) {
throw new Error(`error: ${error.message ? error.message : error}`)
@ -142,10 +145,6 @@ export class OpenZeppelinProxy extends Plugin {
dataHex: fnData.replace('0x', '')
}
// re-use implementation contract's ABI for UI display in udapp and change name to proxy name.
newImplementationContractObject.contractName = newImplementationContractObject.name
newImplementationContractObject.implementationAddress = newImplAddress
newImplementationContractObject.name = proxyName
this.blockchain.upgradeProxy(proxyAddress, newImplAddress, data, newImplementationContractObject)
} else {
const fnData = await this.blockchain.getEncodedFunctionHex([newImplAddress], UUPSupgradeAbi)
@ -158,10 +157,7 @@ export class OpenZeppelinProxy extends Plugin {
linkReferences: {},
dataHex: fnData.replace('0x', '')
}
// re-use implementation contract's ABI for UI display in udapp and change name to proxy name.
newImplementationContractObject.contractName = newImplementationContractObject.name
newImplementationContractObject.implementationAddress = newImplAddress
newImplementationContractObject.name = proxyName
this.blockchain.upgradeProxy(proxyAddress, newImplAddress, data, newImplementationContractObject)
}
})

Loading…
Cancel
Save