Build args for txRun call

pull/2260/head
David Disu 3 years ago
parent dd39916cb0
commit e8e305a287
  1. 3
      .eslintrc.json
  2. 9
      apps/remix-ide/src/blockchain/blockchain.js
  3. 51
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts
  4. 4
      libs/remix-lib/src/execution/txExecution.ts
  5. 27
      libs/remix-ui/run-tab/src/lib/actions/index.ts

@ -30,7 +30,8 @@
"@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-function": "off",
"eslint-disable-next-line no-empty": "off", "eslint-disable-next-line no-empty": "off",
"no-empty": "off", "no-empty": "off",
"jsx-a11y/anchor-is-valid": "off" "jsx-a11y/anchor-is-valid": "off",
"@typescript-eslint/no-inferrable-types": "off"
} }
}, },
{ {

@ -134,6 +134,15 @@ export class Blockchain extends Plugin {
}) })
} }
async deployProxy (proxyData) {
const args = {
useCall: false,
data: proxyData
}
this.runTx(args)
}
createContract (selectedContract, data, continueCb, promptCb, confirmationCb, finalCb) { createContract (selectedContract, data, continueCb, promptCb, confirmationCb, finalCb) {
if (data) { if (data) {
data.contractName = selectedContract.name data.contractName = selectedContract.name

File diff suppressed because one or more lines are too long

@ -27,6 +27,10 @@ export function createContract (from, data, value, gasLimit, txRunner, callbacks
}) })
} }
export async function deployProxy (bytecode, abi, implAddress, signer, _data) {
}
/** /**
* call the current given contract ! that will create a transaction ! * call the current given contract ! that will create a transaction !
* *

@ -443,7 +443,6 @@ export const createInstance = async (
return terminalLogger(log) return terminalLogger(log)
} }
addInstance({ contractData: contractObject, address, name: contractObject.name }) addInstance({ contractData: contractObject, address, name: contractObject.name })
const data = plugin.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) const data = plugin.compilersArtefacts.getCompilerAbstract(contractObject.contract.file)
plugin.compilersArtefacts.addResolvedContract(addressToString(address), data) plugin.compilersArtefacts.addResolvedContract(addressToString(address), data)
@ -453,6 +452,11 @@ export const createInstance = async (
} else { } else {
_paq.push(['trackEvent', 'udapp', 'DeployOnly', plugin.REACT_API.networkName]) _paq.push(['trackEvent', 'udapp', 'DeployOnly', plugin.REACT_API.networkName])
} }
deployMode.forEach(async (mode) => {
const owner = plugin.REACT_API.accounts.selectedAccount
if (mode === 'Deploy with Proxy') await plugin.call('openzeppelin-proxy', 'execute', address, owner)
})
} }
let contractMetadata let contractMetadata
@ -483,17 +487,16 @@ export const createInstance = async (
return terminalLogger(log) return terminalLogger(log)
})) }))
} }
await plugin.call('openzeppelin-proxy', 'execute') deployContract(selectedContract, args, contractMetadata, compilerContracts, {
// deployContract(selectedContract, args, contractMetadata, compilerContracts, { continueCb: (error, continueTxExecution, cancelCb) => {
// continueCb: (error, continueTxExecution, cancelCb) => { continueHandler(gasEstimationPrompt, error, continueTxExecution, cancelCb)
// continueHandler(gasEstimationPrompt, error, continueTxExecution, cancelCb) },
// }, promptCb: (okCb, cancelCb) => {
// promptCb: (okCb, cancelCb) => { promptHandler(passphrasePrompt, okCb, cancelCb)
// promptHandler(passphrasePrompt, okCb, cancelCb) },
// }, statusCb,
// statusCb, finalCb
// finalCb }, confirmationCb)
// }, confirmationCb)
} }
const deployContract = (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) => { const deployContract = (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) => {

Loading…
Cancel
Save