fix bytecode

pull/4143/head
filip mertens 1 year ago
parent 889f1f9419
commit 1542b15ac4
  1. 21
      libs/remix-core-plugin/src/lib/constants/uups.ts
  2. 6
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts

File diff suppressed because one or more lines are too long

@ -1,6 +1,6 @@
import { Plugin } from '@remixproject/engine'
import { ContractAST, ContractSources, DeployOptions } from '../types/contract'
import { EnableProxyURLParam, EnableUpgradeURLParam, GETUUPSProxyVersionAbi, UUPS, UUPSABI, UUPSBytecode, UUPSBytecodeV5, UUPSfunAbi, UUPSupgradeAbi, UUPSupgradeToAndCallAbi } from './constants/uups'
import { EnableProxyURLParam, EnableUpgradeURLParam, GETUUPSProxyVersionAbi, UUPS, UUPSABI, UUPSBytecode, UUPSBytecodeV5, UUPSfunAbi, UUPSfunAbiV5, UUPSupgradeAbi, UUPSupgradeToAndCallAbi } from './constants/uups'
import * as remixLib from '@remix-project/remix-lib'
import * as semver from 'semver'
const txFormat = remixLib.execution.txFormat
@ -104,7 +104,7 @@ export class OpenZeppelinProxy extends Plugin {
contractABI: UUPSABI,
contractByteCode: UUPSBytecodeV5,
contractName: proxyName,
funAbi: UUPSfunAbi,
funAbi: UUPSfunAbiV5,
funArgs: args,
linkReferences: {},
dataHex: UUPSBytecodeV5 + constructorData.replace('0x', ''),
@ -115,6 +115,7 @@ export class OpenZeppelinProxy extends Plugin {
if (!hasUpgradeVersionCall) {
data.contractByteCode = UUPSBytecode
data.dataHex = UUPSBytecode + constructorData.replace('0x', '')
data.funAbi = UUPSfunAbi
this.call('terminal', 'logHtml', `Deploying ERC1967 < 5.0.0 as proxy...`)
}else{
this.call('terminal', 'logHtml', `Deploying ERC1967 >= 5.0.0 as proxy...`)
@ -158,7 +159,6 @@ export class OpenZeppelinProxy extends Plugin {
const response = txFormat.decodeResponse(returnValue, GETUUPSProxyVersionAbi)
version = response[0].split('string: ')[1]
// check if version is >= 5.0.0
console.log('version', response)
}
if (semver.gte(version, '5.0.0')) {

Loading…
Cancel
Save