From e0e8a2b4a838d8cd5ac234d54a23d3a95f30b41d Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 29 Mar 2021 10:33:29 +0200 Subject: [PATCH 1/6] added tracking of network type usage and ipfs publish --- apps/remix-ide/src/app/tabs/runTab/contractDropdown.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js index fb8f022399..a7e7a38a3c 100644 --- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js +++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js @@ -9,6 +9,7 @@ const confirmDialog = require('../../ui/confirmDialog') const modalDialog = require('../../ui/modaldialog') const MultiParamManager = require('../../ui/multiParamManager') const helper = require('../../../lib/helper') +const _paq = window._paq = window._paq || [] class ContractDropdownUI { constructor (blockchain, dropdownLogic, logCallback, runView) { @@ -300,13 +301,16 @@ class ContractDropdownUI { if (error) { return this.logCallback(error) } - + _paq.push(['trackEvent', 'udapp', 'txTo', this.networkName]) self.event.trigger('newContractInstanceAdded', [contractObject, address, contractObject.name]) const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data) if (self.ipfsCheckedState) { + _paq.push(['trackEvent', 'udapp', 'ipfsPublishChecked']) publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract) + } else { + _paq.push(['trackEvent', 'udapp', 'ipfsPublishNotChecked']) } } From 2736579e65157631184f71d6a9f5e1b426f64559 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 29 Mar 2021 11:31:02 +0200 Subject: [PATCH 2/6] added network to ipfs --- apps/remix-ide/src/app/tabs/runTab/contractDropdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js index a7e7a38a3c..c0df6e2fc0 100644 --- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js +++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js @@ -301,13 +301,12 @@ class ContractDropdownUI { if (error) { return this.logCallback(error) } - _paq.push(['trackEvent', 'udapp', 'txTo', this.networkName]) self.event.trigger('newContractInstanceAdded', [contractObject, address, contractObject.name]) const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data) if (self.ipfsCheckedState) { - _paq.push(['trackEvent', 'udapp', 'ipfsPublishChecked']) + _paq.push(['trackEvent', 'udapp', `ipfsPublishTo_${this.networkName}`]) publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract) } else { _paq.push(['trackEvent', 'udapp', 'ipfsPublishNotChecked']) @@ -344,6 +343,7 @@ class ContractDropdownUI { } deployContract (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) { + _paq.push(['trackEvent', 'udapp', 'DeployContractTo', this.networkName]) const { statusCb } = callbacks if (!contractMetadata || (contractMetadata && contractMetadata.autoDeployLib)) { return this.blockchain.deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) From 4969deda6f5699dc44bdcb328c29b798c988f3c5 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 31 Mar 2021 11:09:04 +0200 Subject: [PATCH 3/6] added tracking for Deploy, LL calls, At Address, Transact, Publish Metada --- .../remix-ide/src/app/tabs/runTab/contractDropdown.js | 5 +++-- .../src/app/tabs/runTab/model/dropdownlogic.js | 11 +++++++---- apps/remix-ide/src/app/udapp/run-tab.js | 2 ++ apps/remix-ide/src/app/ui/universal-dapp-ui.js | 2 ++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js index c0df6e2fc0..89d92724a8 100644 --- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js +++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js @@ -306,10 +306,10 @@ class ContractDropdownUI { const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data) if (self.ipfsCheckedState) { - _paq.push(['trackEvent', 'udapp', `ipfsPublishTo_${this.networkName}`]) + _paq.push(['trackEvent', 'udapp', `DeployAndPublish_${this.networkName}`]) publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract) } else { - _paq.push(['trackEvent', 'udapp', 'ipfsPublishNotChecked']) + _paq.push(['trackEvent', 'udapp', 'DeployOnly']) } } @@ -399,6 +399,7 @@ class ContractDropdownUI { return modalDialogCustom.alert(error) } if (loadType === 'abi') { + _paq.push(['trackEvent', 'udapp', 'AtAddressFromABI']) return this.event.trigger('newContractABIAdded', [abi, address]) } var selectedContract = this.getSelectedContract() diff --git a/apps/remix-ide/src/app/tabs/runTab/model/dropdownlogic.js b/apps/remix-ide/src/app/tabs/runTab/model/dropdownlogic.js index a2d01d02f4..15764a6dbe 100644 --- a/apps/remix-ide/src/app/tabs/runTab/model/dropdownlogic.js +++ b/apps/remix-ide/src/app/tabs/runTab/model/dropdownlogic.js @@ -1,7 +1,8 @@ -var remixLib = require('@remix-project/remix-lib') -var txHelper = remixLib.execution.txHelper -var CompilerAbstract = require('../../../compiler/compiler-abstract') -var EventManager = remixLib.EventManager +const remixLib = require('@remix-project/remix-lib') +const txHelper = remixLib.execution.txHelper +const CompilerAbstract = require('../../../compiler/compiler-abstract') +const EventManager = remixLib.EventManager +const _paq = window._paq = window._paq || [] class DropdownLogic { constructor (compilersArtefacts, config, editor, runView) { @@ -50,9 +51,11 @@ class DropdownLogic { } catch (e) { return cb('Failed to parse the current file as JSON ABI.') } + _paq.push(['trackEvent', 'udapp', 'AtAddressLoadWithABI']) cb(null, 'abi', abi) }) } else { + _paq.push(['trackEvent', 'udapp', 'AtAddressLoadWithInstance']) cb(null, 'instance') } } diff --git a/apps/remix-ide/src/app/udapp/run-tab.js b/apps/remix-ide/src/app/udapp/run-tab.js index b3ba8013be..cc0d2f6ab6 100644 --- a/apps/remix-ide/src/app/udapp/run-tab.js +++ b/apps/remix-ide/src/app/udapp/run-tab.js @@ -15,6 +15,7 @@ const RecorderUI = require('../tabs/runTab/recorder.js') const DropdownLogic = require('../tabs/runTab/model/dropdownlogic.js') const ContractDropdownUI = require('../tabs/runTab/contractDropdown.js') const toaster = require('../ui/tooltip') +const _paq = window._paq = window._paq || [] const UniversalDAppUI = require('../ui/universal-dapp-ui') @@ -91,6 +92,7 @@ export class RunTab extends ViewPlugin { } sendTransaction (tx) { + _paq.push(['trackEvent', 'udapp', 'sendTx']) return this.blockchain.sendTransaction(tx) } diff --git a/apps/remix-ide/src/app/ui/universal-dapp-ui.js b/apps/remix-ide/src/app/ui/universal-dapp-ui.js index 3573403b78..e29a8126b9 100644 --- a/apps/remix-ide/src/app/ui/universal-dapp-ui.js +++ b/apps/remix-ide/src/app/ui/universal-dapp-ui.js @@ -14,6 +14,7 @@ var txFormat = remixLib.execution.txFormat const txHelper = remixLib.execution.txHelper var TreeView = require('./TreeView') var txCallBacks = require('./sendTxCallbacks') +const _paq = window._paq = window._paq || [] function UniversalDAppUI (blockchain, logCallback) { this.blockchain = blockchain @@ -243,6 +244,7 @@ UniversalDAppUI.prototype.runTransaction = function (lookupOnly, args, valArr, i outputOverride.appendChild(decoded) } } + _paq.push(['trackEvent', 'udapp', lookupOnly ? 'call' : args.funABI.type !== 'fallback' ? 'lowLevelInteracions' : 'transact']) const params = args.funABI.type !== 'fallback' ? inputsValues : '' this.blockchain.runOrCallContractMethod( args.contractName, From 4ddb0bb2efca20c892ff22a2cc53e7b40d39da3d Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 6 Apr 2021 11:29:23 +0200 Subject: [PATCH 4/6] added network name for deploy without publishing --- apps/remix-ide/src/app/tabs/runTab/contractDropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js index 89d92724a8..67635df52f 100644 --- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js +++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js @@ -309,7 +309,7 @@ class ContractDropdownUI { _paq.push(['trackEvent', 'udapp', `DeployAndPublish_${this.networkName}`]) publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract) } else { - _paq.push(['trackEvent', 'udapp', 'DeployOnly']) + _paq.push(['trackEvent', 'udapp', `DeployOnly_${this.networkName}`]) } } From edf0f501ac25afa427afa9a3c61c0033fabd8f26 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 7 Apr 2021 10:25:25 +0200 Subject: [PATCH 5/6] iremoved doublicate data collecting --- apps/remix-ide/src/app/tabs/runTab/contractDropdown.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js index 67635df52f..2a8336125d 100644 --- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js +++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js @@ -399,7 +399,6 @@ class ContractDropdownUI { return modalDialogCustom.alert(error) } if (loadType === 'abi') { - _paq.push(['trackEvent', 'udapp', 'AtAddressFromABI']) return this.event.trigger('newContractABIAdded', [abi, address]) } var selectedContract = this.getSelectedContract() From aecbc8463dcd19ad26943e5bed17ed907021d78f Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 12 Apr 2021 12:23:07 +0200 Subject: [PATCH 6/6] added more info for call` --- apps/remix-ide/src/app/ui/universal-dapp-ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/ui/universal-dapp-ui.js b/apps/remix-ide/src/app/ui/universal-dapp-ui.js index e29a8126b9..e3eb358090 100644 --- a/apps/remix-ide/src/app/ui/universal-dapp-ui.js +++ b/apps/remix-ide/src/app/ui/universal-dapp-ui.js @@ -244,7 +244,8 @@ UniversalDAppUI.prototype.runTransaction = function (lookupOnly, args, valArr, i outputOverride.appendChild(decoded) } } - _paq.push(['trackEvent', 'udapp', lookupOnly ? 'call' : args.funABI.type !== 'fallback' ? 'lowLevelInteracions' : 'transact']) + const info = `${lookupOnly ? 'call' : args.funABI.type !== 'fallback' ? 'lowLevelInteracions' : 'transact'}_${this.blockchain.executionContext.executionContext}` + _paq.push(['trackEvent', 'udapp', info]) const params = args.funABI.type !== 'fallback' ? inputsValues : '' this.blockchain.runOrCallContractMethod( args.contractName,