disable deploy and execute kind

pull/2260/head
David Disu 3 years ago
parent 56f3c745e4
commit dd39916cb0
  1. 11
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts
  2. 21
      libs/remix-ui/run-tab/src/lib/actions/index.ts

@ -11,6 +11,7 @@ const UUPS = '@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.so
export class OpenZeppelinProxy extends Plugin { export class OpenZeppelinProxy extends Plugin {
blockchain: any blockchain: any
kind: 'UUPS' | 'Transparent'
constructor(blockchain) { constructor(blockchain) {
super(proxyProfile) super(proxyProfile)
this.blockchain = blockchain this.blockchain = blockchain
@ -18,11 +19,19 @@ export class OpenZeppelinProxy extends Plugin {
async isConcerned(ast: ContractAST): Promise<boolean> { async isConcerned(ast: ContractAST): Promise<boolean> {
// check in the AST if it's an upgradable contract // 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 return false
} }
async execute(contractData: ContractData, contractMetadata: any, compiledContracts: any) { async execute(contractData: ContractData, contractMetadata: any, compiledContracts: any) {
// deploy the proxy, or use an existing one // deploy the proxy, or use an existing one
if (this.kind === 'UUPS') this.deployUUPSProxy()
}
async deployUUPSProxy () {
} }
} }

@ -483,16 +483,17 @@ export const createInstance = async (
return terminalLogger(log) return terminalLogger(log)
})) }))
} }
deployContract(selectedContract, args, contractMetadata, compilerContracts, { await plugin.call('openzeppelin-proxy', 'execute')
continueCb: (error, continueTxExecution, cancelCb) => { // deployContract(selectedContract, args, contractMetadata, compilerContracts, {
continueHandler(gasEstimationPrompt, error, continueTxExecution, cancelCb) // continueCb: (error, continueTxExecution, cancelCb) => {
}, // continueHandler(gasEstimationPrompt, error, continueTxExecution, cancelCb)
promptCb: (okCb, cancelCb) => { // },
promptHandler(passphrasePrompt, okCb, cancelCb) // promptCb: (okCb, cancelCb) => {
}, // promptHandler(passphrasePrompt, okCb, cancelCb)
statusCb, // },
finalCb // statusCb,
}, confirmationCb) // finalCb
// }, confirmationCb)
} }
const deployContract = (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) => { const deployContract = (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) => {

Loading…
Cancel
Save