Build args for txRun call

pull/5370/head
David Disu 3 years ago
parent 4794878f43
commit 8d3e41fe09
  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",
"eslint-disable-next-line 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) {
if (data) {
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 !
*

@ -443,7 +443,6 @@ export const createInstance = async (
return terminalLogger(log)
}
addInstance({ contractData: contractObject, address, name: contractObject.name })
const data = plugin.compilersArtefacts.getCompilerAbstract(contractObject.contract.file)
plugin.compilersArtefacts.addResolvedContract(addressToString(address), data)
@ -453,6 +452,11 @@ export const createInstance = async (
} else {
_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
@ -483,17 +487,16 @@ export const createInstance = async (
return terminalLogger(log)
}))
}
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)
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) => {

Loading…
Cancel
Save