diff --git a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts index 28b6346c2f..1f3d21eeb5 100644 --- a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts +++ b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts @@ -11,6 +11,7 @@ const UUPS = '@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.so export class OpenZeppelinProxy extends Plugin { blockchain: any + kind: 'UUPS' | 'Transparent' constructor(blockchain) { super(proxyProfile) this.blockchain = blockchain @@ -18,11 +19,19 @@ export class OpenZeppelinProxy extends Plugin { async isConcerned(ast: ContractAST): Promise { // check in the AST if it's an upgradable contract - if (ast.nodes.find(node => node.absolutePath === UUPS)) return true + if (ast.nodes.find(node => node.absolutePath === UUPS)) { + this.kind = 'UUPS' + return true + } return false } async execute(contractData: ContractData, contractMetadata: any, compiledContracts: any) { // deploy the proxy, or use an existing one + if (this.kind === 'UUPS') this.deployUUPSProxy() + } + + async deployUUPSProxy () { + } } diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index d112d2a6f1..5a271c7673 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -483,16 +483,17 @@ export const createInstance = async ( return terminalLogger(log) })) } - deployContract(selectedContract, args, contractMetadata, compilerContracts, { - continueCb: (error, continueTxExecution, cancelCb) => { - continueHandler(gasEstimationPrompt, error, continueTxExecution, cancelCb) - }, - promptCb: (okCb, cancelCb) => { - promptHandler(passphrasePrompt, okCb, cancelCb) - }, - statusCb, - finalCb - }, confirmationCb) + await plugin.call('openzeppelin-proxy', 'execute') + // deployContract(selectedContract, args, contractMetadata, compilerContracts, { + // continueCb: (error, continueTxExecution, cancelCb) => { + // continueHandler(gasEstimationPrompt, error, continueTxExecution, cancelCb) + // }, + // promptCb: (okCb, cancelCb) => { + // promptHandler(passphrasePrompt, okCb, cancelCb) + // }, + // statusCb, + // finalCb + // }, confirmationCb) } const deployContract = (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) => {