From 29c6608d20cc2aa3f0d33872d079684b48c19281 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 12 Jul 2022 19:56:26 +0530 Subject: [PATCH 01/13] update ABI too for live mode --- apps/remix-ide/src/app/tabs/runTab/model/recorder.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js index caa758b180..0852d40096 100644 --- a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js +++ b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js @@ -207,6 +207,9 @@ class Recorder extends Plugin { // resolve the bytecode using the contract name, this ensure getting the last compiled one. const data = await this.call('compilerArtefacts', 'getArtefactsByContractName', tx.record.contractName) tx.record.bytecode = data.artefact.evm.bytecode.object + const updatedABIKeccak = ethutil.bufferToHex(ethutil.keccakFromString(JSON.stringify(data.artefact.abi))) + abis[updatedABIKeccak] = data.artefact.abi + tx.record.abi = updatedABIKeccak } var record = this.resolveAddress(tx.record, accounts, options) var abi = abis[tx.record.abi] From 44a9e12711820a7b009ade6d30f9b707e39fdb32 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 13:35:43 +0530 Subject: [PATCH 02/13] e2e fix --- apps/remix-ide-e2e/src/tests/recorder.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/recorder.test.ts b/apps/remix-ide-e2e/src/tests/recorder.test.ts index 0f896a179e..3cdea544c3 100644 --- a/apps/remix-ide-e2e/src/tests/recorder.test.ts +++ b/apps/remix-ide-e2e/src/tests/recorder.test.ts @@ -118,7 +118,7 @@ module.exports = { }) .clickFunction('retrieve - call') .perform((done) => { - browser.verifyCallReturnValue(addressRef, ['', '0:uint256: 350']) + browser.verifyCallReturnValue(addressRef, ['0:uint256: 350']) .perform(() => done()) }) // change the init state and recompile the same contract. @@ -138,7 +138,7 @@ module.exports = { }) .clickFunction('retrieve - call') .perform((done) => { - browser.verifyCallReturnValue(addressRef, ['', '0:uint256: 300']) + browser.verifyCallReturnValue(addressRef, ['0:uint256: 300']) .perform(() => done()) }) .end() From eb1d72afe13774b02cc9efcb5ad73de719a5c7e0 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 13:41:23 +0530 Subject: [PATCH 03/13] removed from plugin manager --- apps/remix-ide/src/remixAppManager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index fbe147a67b..159f704e1d 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -8,7 +8,8 @@ const requiredModules = [ // services + layout views + system views 'manager', 'config', 'compilerArtefacts', 'compilerMetadata', 'contextualListener', 'editor', 'offsetToLineColumnConverter', 'network', 'theme', 'fileManager', 'contentImport', 'blockchain', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider', 'solidity', 'solidity-logic', 'gistHandler', 'layout', - 'notification', 'permissionhandler', 'walkthrough', 'storage', 'restorebackupzip', 'link-libraries', 'deploy-libraries', 'openzeppelin-proxy', 'hardhat-provider', 'compileAndRun', 'search'] + 'notification', 'permissionhandler', 'walkthrough', 'storage', 'restorebackupzip', 'link-libraries', 'deploy-libraries', 'openzeppelin-proxy', + 'hardhat-provider', 'compileAndRun', 'search', 'recorder'] const dependentModules = ['git', 'hardhat', 'truffle', 'slither'] // module which shouldn't be manually activated (e.g git is activated by remixd) From 7e96d7abb65a804c2d7803b44ce86122278085c0 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 14:42:19 +0530 Subject: [PATCH 04/13] run button disable for non json files --- .../run-tab/src/lib/components/recorderCardUI.tsx | 10 ++++++++-- libs/remix-ui/run-tab/src/lib/run-tab.tsx | 6 ++++-- libs/remix-ui/run-tab/src/lib/types/index.ts | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 51413c2c82..82198f5c8f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -1,11 +1,12 @@ // eslint-disable-next-line no-use-before-define -import React, {useRef, useState} from 'react' +import React, {useRef, useState, useEffect} from 'react' import { RecorderProps } from '../types' import { OverlayTrigger, Tooltip } from 'react-bootstrap' // eslint-disable-line export function RecorderUI (props: RecorderProps) { const inputLive = useRef() const [toggleExpander, setToggleExpander] = useState(false) + const [enableRunButton, setEnableRunButton] = useState(true) const triggerRecordButton = () => { props.storeScenario(props.scenarioPrompt) } @@ -15,6 +16,11 @@ export function RecorderUI (props: RecorderProps) { props.runCurrentScenario(liveMode, props.gasEstimationPrompt, props.passphrasePrompt, props.mainnetPrompt) } + useEffect(() => { + if (props.currentFile.endsWith('.json')) setEnableRunButton(false) + else setEnableRunButton(true) + }, [props.currentFile]) + const toggleClass = () => { setToggleExpander(!toggleExpander) } @@ -60,7 +66,7 @@ export function RecorderUI (props: RecorderProps) { }> - + diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index f8715ac16e..128d315201 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -56,10 +56,11 @@ export function RunTabUI (props: RunTabProps) { storage: null, contract: null }) - runTabInitialState.selectExEnv = props.plugin.blockchain.getProvider() + runTabInitialState.selectExEnv = plugin.blockchain.getProvider() runTabInitialState.selectExEnv = runTabInitialState.selectExEnv === 'vm' ? 'vm-london' : runTabInitialState.selectExEnv const [runTab, dispatch] = useReducer(runTabReducer, runTabInitialState) const REACT_API = { runTab } + const currentfile = plugin.config.get('currentFile') useEffect(() => { initRunTab(plugin)(dispatch) @@ -249,6 +250,7 @@ export function RunTabUI (props: RunTabProps) { runCurrentScenario={runScenario} scenarioPrompt={scenarioPrompt} count={runTab.recorder.transactionCount} + currentFile={currentfile} /> - + ) } diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index dfb526d59d..d27eb1f580 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -173,6 +173,7 @@ export interface RecorderProps { passphrasePrompt: (msg: string) => JSX.Element, scenarioPrompt: (msg: string, defaultValue: string) => JSX.Element, count: number + currentFile: string } export interface InstanceContainerProps { From d4df6204c247da8c49ea50ed26960cf21ee7e5ed Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 15:20:13 +0530 Subject: [PATCH 05/13] show title when Run button disabled --- libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 82198f5c8f..2ce2102e5c 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -66,7 +66,7 @@ export function RecorderUI (props: RecorderProps) { }> - + From 88c8a525c5aa02539363329bc20abfa7c76fad64 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 15:27:33 +0530 Subject: [PATCH 06/13] save button update --- libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 2ce2102e5c..5ff62dd92d 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -54,15 +54,15 @@ export function RecorderUI (props: RecorderProps) {
- Save {props.count} transaction(s) as scenario file. + Save {props.count} transaction{props.count === 1 ? '' : 's'} as scenario file }> - + - Run transaction(s) from the current scenario file. + Run transaction(s) from the current scenario file }> From 88617586b721296c9ee5af9ee5452c02f2da35d6 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 15:36:28 +0530 Subject: [PATCH 07/13] show error for non scenario json file --- apps/remix-ide/src/app/tabs/runTab/model/recorder.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js index 0852d40096..0815799b6b 100644 --- a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js +++ b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js @@ -204,7 +204,7 @@ class Recorder extends Plugin { logCallBack(`Running ${records.length} transaction(s)${liveMsg} ...`) async.eachOfSeries(records, async (tx, index, cb) => { if (liveMode && tx.record.type === 'constructor') { - // resolve the bytecode using the contract name, this ensure getting the last compiled one. + // resolve the bytecode and ABI using the contract name, this ensure getting the last compiled one. const data = await this.call('compilerArtefacts', 'getArtefactsByContractName', tx.record.contractName) tx.record.bytecode = data.artefact.evm.bytecode.object const updatedABIKeccak = ethutil.bufferToHex(ethutil.keccakFromString(JSON.stringify(data.artefact.abi))) @@ -315,11 +315,11 @@ class Recorder extends Plugin { abis = json.abis || {} linkReferences = json.linkReferences || {} } catch (e) { - return cb('Invalid Scenario File. Please try again') + return cb('Invalid scenario file. Please try again') } if (!txArray.length) { - return + return cb('No transactions found in scenario file') } this.run(txArray, accounts, options, abis, linkReferences, confirmationCb, continueCb, promptCb, alertCb, logCallBack, liveMode, (abi, address, contractName) => { From 4bf2cfc09598724bd2b32d3bb19af282892e6b59 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 15:49:24 +0530 Subject: [PATCH 08/13] live mode renamed --- apps/remix-ide/src/app/tabs/runTab/model/recorder.js | 2 +- libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js index 0815799b6b..ea41368448 100644 --- a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js +++ b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js @@ -200,7 +200,7 @@ class Recorder extends Plugin { */ run (records, accounts, options, abis, linkReferences, confirmationCb, continueCb, promptCb, alertCb, logCallBack, liveMode, newContractFn) { this.setListen(false) - const liveMsg = liveMode ? ' in live mode' : '' + const liveMsg = liveMode ? ' with updated contracts' : '' logCallBack(`Running ${records.length} transaction(s)${liveMsg} ...`) async.eachOfSeries(records, async (tx, index, cb) => { if (liveMode && tx.record.type === 'constructor') { diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 5ff62dd92d..d6aac08529 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -49,7 +49,7 @@ export function RecorderUI (props: RecorderProps) {
- +
Date: Thu, 14 Jul 2022 12:28:35 +0530 Subject: [PATCH 09/13] text updates as suggested --- .../run-tab/src/lib/components/recorderCardUI.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index d6aac08529..48e8fa04f0 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -49,21 +49,25 @@ export function RecorderUI (props: RecorderProps) {
- + + If contracts are updated after recording transactions, checking this box
will run recorded transactions with the latest copy of the compiled contracts
+ + }> + +
- Save {props.count} transaction{props.count === 1 ? '' : 's'} as scenario file - + Save {props.count} transaction{props.count === 1 ? '' : 's'} as scenario file }> - Run transaction(s) from the current scenario file - + Run transaction(s) from the current scenario file }> From dcf315890268099159f4e3ff7c7d6d4f1f002445 Mon Sep 17 00:00:00 2001 From: ryestew Date: Tue, 12 Jul 2022 09:06:40 -0400 Subject: [PATCH 10/13] update modal of proxy functionality --- apps/remix-ide/src/blockchain/blockchain.js | 8 ++++---- libs/remix-ui/helper/src/lib/helper-components.tsx | 12 ++++++++++-- .../src/lib/components/contractDropdownUI.tsx | 8 ++++++-- .../run-tab/src/lib/components/contractGUI.tsx | 6 +++--- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 08d4b8f3bd..47ece52eb2 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -141,9 +141,9 @@ export class Blockchain extends Plugin { async deployProxy (proxyData, implementationContractObject) { const proxyModal = { id: 'confirmProxyDeployment', - title: 'ERC1967', + title: 'Confirm Deploy Proxy (ERC1967)', message: `Confirm you want to deploy an ERC1967 proxy contract that is connected to your implementation. - For more info on ERC1967, see https://docs.openzeppelin.com/contracts/4.x/api/proxy#ERC1967Proxy`, + For more info on ERC1967, see: https://docs.openzeppelin.com/contracts/4.x/api/proxy#ERC1967Proxy`, modalType: 'modal', okLabel: 'OK', cancelLabel: 'Cancel', @@ -189,8 +189,8 @@ export class Blockchain extends Plugin { async upgradeProxy(proxyAddress, newImplAddress, data, newImplementationContractObject) { const upgradeModal = { id: 'confirmProxyDeployment', - title: 'ERC1967', - message: `Confirm you want to upgrade your contract to new implementation ${newImplAddress}.`, + title: 'Confirm Update Proxy (ERC1967)', + message: `Confirm you want to update your proxy contract with the new implementation contract's address: ${newImplAddress}.`, modalType: 'modal', okLabel: 'OK', cancelLabel: 'Cancel', diff --git a/libs/remix-ui/helper/src/lib/helper-components.tsx b/libs/remix-ui/helper/src/lib/helper-components.tsx index 8dc4e95a16..fc1cf49e88 100644 --- a/libs/remix-ui/helper/src/lib/helper-components.tsx +++ b/libs/remix-ui/helper/src/lib/helper-components.tsx @@ -98,12 +98,20 @@ export const cancelUpgradeMsg = () => ( export const deployWithProxyMsg = () => (
- NOTE: Deploy With Proxy will initiate two (2) transactions. The first is for the deployment of your implementation contract and the second will be a deployment of an ERC1967 proxy contract. + Deploy with Proxy will initiate two (2) transactions: +
    +
  1. Deploying the implementation contract
  2. +
  3. Deploying an ERC1967 proxy contract
  4. +
) export const upgradeWithProxyMsg = () => (
- NOTE: Upgrade With Proxy will initiate two (2) transactions. The first is for the deployment of your implementation contract and the second will intiate a call to the upgradeTo function in your proxy contract. + Upgrade with Proxy will initiate two (2) transactions: +
    +
  1. Deploying the new implementation contract
  2. +
  3. Updating the proxy contract with the address of the new implementation contract
  4. +
) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 556491bc2c..a224c94242 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -160,8 +160,12 @@ export function ContractDropdownUI (props: ContractDropdownProps) { const isProxyDeployment = (deployMode || []).find(mode => mode === 'Deploy with Proxy') const isContractUpgrade = (deployMode || []).find(mode => mode === 'Upgrade with Proxy') - if (isProxyDeployment || isContractUpgrade) { - props.modal('ERC1967', isProxyDeployment ? deployWithProxyMsg() : upgradeWithProxyMsg(), 'Proceed', () => { + if (isProxyDeployment) { + props.modal('Deploy Implementation & Proxy (ERC1967)', deployWithProxyMsg(), 'Proceed', () => { + props.createInstance(loadedContractData, props.gasEstimationPrompt, props.passphrasePrompt, props.publishToStorage, props.mainnetPrompt, isOverSizePrompt, args, deployMode) + }, 'Cancel', () => {}) + } else if (isContractUpgrade) { + props.modal('Deploy Implementation & Update Proxy', upgradeWithProxyMsg(), 'Proceed', () => { props.createInstance(loadedContractData, props.gasEstimationPrompt, props.passphrasePrompt, props.publishToStorage, props.mainnetPrompt, isOverSizePrompt, args, deployMode) }, 'Cancel', () => {}) } else { diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index 4eb661a6a8..a5352c02fb 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -273,7 +273,7 @@ export function ContractGUI (props: ContractGUIProps) { className="m-0 form-check-label custom-control-label udapp_checkboxAlign" title="An ERC1967 proxy contract will be deployed along with the selected implementation contract." > - Deploy With Proxy + Deploy with Proxy
@@ -314,9 +314,9 @@ export function ContractGUI (props: ContractGUIProps) { htmlFor="upgradeImplementation" data-id="contractGUIUpgradeImplementationLabel" className="m-0 form-check-label custom-control-label udapp_checkboxAlign" - title="The implemetation address will be updated to a new address in the proxy contract." + title="The implementation contract will be deployed and then the proxy contract will be updated with new implementation's address." > - Upgrade With Proxy + Upgrade with Proxy
From 91fc753f47b46eac6426c1346abf63c2314b6c41 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 18:55:29 +0530 Subject: [PATCH 11/13] added description for all plugins --- apps/remix-ide/src/app/components/hidden-panel.tsx | 2 +- apps/remix-ide/src/app/components/main-panel.tsx | 2 +- apps/remix-ide/src/app/components/side-panel.tsx | 2 +- apps/remix-ide/src/app/components/vertical-icons.tsx | 2 +- apps/remix-ide/src/app/files/dgitProvider.js | 2 +- apps/remix-ide/src/app/panels/file-panel.js | 2 +- apps/remix-ide/src/app/panels/terminal.js | 2 +- apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx | 2 +- apps/remix-ide/src/app/tabs/compile-and-run.ts | 2 +- apps/remix-ide/src/app/tabs/external-http-provider.tsx | 2 +- apps/remix-ide/src/app/tabs/foundry-provider.tsx | 2 +- apps/remix-ide/src/app/tabs/ganache-provider.tsx | 2 +- apps/remix-ide/src/app/tabs/runTab/model/recorder.js | 2 +- apps/remix-ide/src/app/tabs/search.tsx | 2 +- apps/remix-ide/src/app/tabs/test-tab.js | 2 +- apps/remix-ide/src/app/udapp/run-tab.js | 2 +- apps/remix-ide/src/app/ui/landing-page/landing-page.js | 2 +- apps/remix-ide/src/walkthroughService.js | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/remix-ide/src/app/components/hidden-panel.tsx b/apps/remix-ide/src/app/components/hidden-panel.tsx index 31c7a0cb0b..6aa78a4052 100644 --- a/apps/remix-ide/src/app/components/hidden-panel.tsx +++ b/apps/remix-ide/src/app/components/hidden-panel.tsx @@ -8,7 +8,7 @@ import { PluginViewWrapper } from '@remix-ui/helper' const profile = { name: 'hiddenPanel', displayName: 'Hidden Panel', - description: '', + description: 'Remix IDE hidden panel', version: packageJson.version, methods: ['addView', 'removeView'] } diff --git a/apps/remix-ide/src/app/components/main-panel.tsx b/apps/remix-ide/src/app/components/main-panel.tsx index 615e03690d..d6dee613fd 100644 --- a/apps/remix-ide/src/app/components/main-panel.tsx +++ b/apps/remix-ide/src/app/components/main-panel.tsx @@ -7,7 +7,7 @@ import { PluginViewWrapper } from '@remix-ui/helper' const profile = { name: 'mainPanel', displayName: 'Main Panel', - description: '', + description: 'Remix IDE main panel', version: packageJson.version, methods: ['addView', 'removeView', 'showContent'] } diff --git a/apps/remix-ide/src/app/components/side-panel.tsx b/apps/remix-ide/src/app/components/side-panel.tsx index bf82defe55..54e56dd210 100644 --- a/apps/remix-ide/src/app/components/side-panel.tsx +++ b/apps/remix-ide/src/app/components/side-panel.tsx @@ -10,7 +10,7 @@ import { PluginViewWrapper } from '@remix-ui/helper' const sidePanel = { name: 'sidePanel', displayName: 'Side Panel', - description: '', + description: 'Remix IDE side panel', version: packageJson.version, methods: ['addView', 'removeView'] } diff --git a/apps/remix-ide/src/app/components/vertical-icons.tsx b/apps/remix-ide/src/app/components/vertical-icons.tsx index d8fe5706f8..24d5b93b2b 100644 --- a/apps/remix-ide/src/app/components/vertical-icons.tsx +++ b/apps/remix-ide/src/app/components/vertical-icons.tsx @@ -10,7 +10,7 @@ import { PluginViewWrapper } from '@remix-ui/helper' const profile = { name: 'menuicons', displayName: 'Vertical Icons', - description: '', + description: 'Remix IDE vertical icons', version: packageJson.version, methods: ['select', 'unlinkContent', 'linkContent'], events: ['toggleContent', 'showContent'] diff --git a/apps/remix-ide/src/app/files/dgitProvider.js b/apps/remix-ide/src/app/files/dgitProvider.js index 8b5ce925c5..aa5b98dfa1 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.js +++ b/apps/remix-ide/src/app/files/dgitProvider.js @@ -18,7 +18,7 @@ const axios = require('axios') const profile = { name: 'dGitProvider', displayName: 'Decentralized git', - description: '', + description: 'Decentralized git provider', icon: 'assets/img/fileManager.webp', version: '0.0.1', methods: ['init', 'localStorageUsed', 'addremote', 'delremote', 'remotes', 'fetch', 'clone', 'export', 'import', 'status', 'log', 'commit', 'add', 'remove', 'rm', 'lsfiles', 'readblob', 'resolveref', 'branches', 'branch', 'checkout', 'currentbranch', 'push', 'pin', 'pull', 'pinList', 'unPin', 'setIpfsConfig', 'zip', 'setItem', 'getItem'], diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index a0d4e5dff3..983a54af70 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -33,7 +33,7 @@ const profile = { methods: ['createNewFile', 'uploadFile', 'getCurrentWorkspace', 'getWorkspaces', 'createWorkspace', 'setWorkspace', 'registerContextMenuItem', 'renameWorkspace', 'deleteWorkspace'], events: ['setWorkspace', 'workspaceRenamed', 'workspaceDeleted', 'workspaceCreated'], icon: 'assets/img/fileManager.webp', - description: ' - ', + description: 'Remix IDE file explorer', kind: 'fileexplorer', location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/file_explorer.html', diff --git a/apps/remix-ide/src/app/panels/terminal.js b/apps/remix-ide/src/app/panels/terminal.js index 6eaa65f6e9..bd89f2d7ce 100644 --- a/apps/remix-ide/src/app/panels/terminal.js +++ b/apps/remix-ide/src/app/panels/terminal.js @@ -20,7 +20,7 @@ const profile = { name: 'terminal', methods: ['log', 'logHtml'], events: [], - description: ' - ', + description: 'Remix IDE terminal', version: packageJson.version } diff --git a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx index 29f7535066..3bec429d25 100644 --- a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx +++ b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx @@ -7,7 +7,7 @@ import { Profile } from '@remixproject/plugin-utils' const profile = { name: 'permissionhandler', displayName: 'permissionhandler', - description: 'permissionhandler', + description: 'Plugin to handle permissions', methods: ['askPermission'] } diff --git a/apps/remix-ide/src/app/tabs/compile-and-run.ts b/apps/remix-ide/src/app/tabs/compile-and-run.ts index d5b298e966..e90d9f5844 100644 --- a/apps/remix-ide/src/app/tabs/compile-and-run.ts +++ b/apps/remix-ide/src/app/tabs/compile-and-run.ts @@ -10,7 +10,7 @@ const _paq = window._paq = window._paq || [] export const profile = { name: 'compileAndRun', displayName: 'Compile and Run', - description: 'after each compilation, run the script defined in Natspec.', + description: 'After each compilation, run the script defined in Natspec.', methods: ['runScriptAfterCompilation'], version: packageJson.version, kind: 'none' diff --git a/apps/remix-ide/src/app/tabs/external-http-provider.tsx b/apps/remix-ide/src/app/tabs/external-http-provider.tsx index 71c7c249c0..9483989843 100644 --- a/apps/remix-ide/src/app/tabs/external-http-provider.tsx +++ b/apps/remix-ide/src/app/tabs/external-http-provider.tsx @@ -6,7 +6,7 @@ const profile = { name: 'basic-http-provider', displayName: 'External Http Provider', kind: 'provider', - description: '', + description: 'External Http Provider', methods: ['sendAsync'], version: packageJson.version } diff --git a/apps/remix-ide/src/app/tabs/foundry-provider.tsx b/apps/remix-ide/src/app/tabs/foundry-provider.tsx index 47e899865a..3c1fbb6256 100644 --- a/apps/remix-ide/src/app/tabs/foundry-provider.tsx +++ b/apps/remix-ide/src/app/tabs/foundry-provider.tsx @@ -10,7 +10,7 @@ const profile = { name: 'foundry-provider', displayName: 'Foundry Provider', kind: 'provider', - description: 'Anvil', + description: 'Foundry Anvil provider', methods: ['sendAsync'], version: packageJson.version } diff --git a/apps/remix-ide/src/app/tabs/ganache-provider.tsx b/apps/remix-ide/src/app/tabs/ganache-provider.tsx index 002e31a3a2..97adac1574 100644 --- a/apps/remix-ide/src/app/tabs/ganache-provider.tsx +++ b/apps/remix-ide/src/app/tabs/ganache-provider.tsx @@ -10,7 +10,7 @@ const profile = { name: 'ganache-provider', displayName: 'Ganache Provider', kind: 'provider', - description: 'Ganache', + description: 'Truffle Ganache provider', methods: ['sendAsync'], version: packageJson.version } diff --git a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js index ea41368448..244d61690f 100644 --- a/apps/remix-ide/src/app/tabs/runTab/model/recorder.js +++ b/apps/remix-ide/src/app/tabs/runTab/model/recorder.js @@ -13,7 +13,7 @@ const _paq = window._paq = window._paq || [] //eslint-disable-line const profile = { name: 'recorder', displayName: 'Recorder', - description: '', + description: 'Records transactions to save and run', version: packageJson.version, methods: [ ] } diff --git a/apps/remix-ide/src/app/tabs/search.tsx b/apps/remix-ide/src/app/tabs/search.tsx index 29e6c6abe7..3e0df1a893 100644 --- a/apps/remix-ide/src/app/tabs/search.tsx +++ b/apps/remix-ide/src/app/tabs/search.tsx @@ -8,7 +8,7 @@ const profile = { methods: [''], events: [], icon: 'assets/img/search_icon.webp', - description: '', + description: 'Find and replace in file explorer', kind: '', location: 'sidePanel', documentation: '', diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 960e2a93ce..3c6e1a4b4c 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -16,7 +16,7 @@ const profile = { methods: ['testFromPath', 'testFromSource', 'setTestFolderPath', 'getTestlibs', 'createTestLibs'], events: [], icon: 'assets/img/unitTesting.webp', - description: 'Fast tool to generate unit tests for your contracts', + description: 'Write and run unit tests for your contracts in Solidity', location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/unittesting.html' } diff --git a/apps/remix-ide/src/app/udapp/run-tab.js b/apps/remix-ide/src/app/udapp/run-tab.js index c9912ecb4c..02087b671f 100644 --- a/apps/remix-ide/src/app/udapp/run-tab.js +++ b/apps/remix-ide/src/app/udapp/run-tab.js @@ -12,7 +12,7 @@ const profile = { name: 'udapp', displayName: 'Deploy & run transactions', icon: 'assets/img/deployAndRun.webp', - description: 'execute and save transactions', + description: 'Execute, save and replay transactions', kind: 'udapp', location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/run.html', diff --git a/apps/remix-ide/src/app/ui/landing-page/landing-page.js b/apps/remix-ide/src/app/ui/landing-page/landing-page.js index 2f8819fc5f..978c4fdb1c 100644 --- a/apps/remix-ide/src/app/ui/landing-page/landing-page.js +++ b/apps/remix-ide/src/app/ui/landing-page/landing-page.js @@ -9,7 +9,7 @@ const profile = { displayName: 'Home', methods: [], events: [], - description: ' - ', + description: 'Remix home tab ', icon: 'assets/img/remixLogo.webp', location: 'mainPanel', version: packageJson.version diff --git a/apps/remix-ide/src/walkthroughService.js b/apps/remix-ide/src/walkthroughService.js index 8f088c443c..d0d466555f 100644 --- a/apps/remix-ide/src/walkthroughService.js +++ b/apps/remix-ide/src/walkthroughService.js @@ -5,7 +5,7 @@ const introJs = require('intro.js') const profile = { name: 'walkthrough', displayName: 'Walkthrough', - description: '', + description: 'Remix walkthrough for beginner', version: packageJson.version, methods: ['start'] } From 1a9977badcfd4d9e006fb2f011a6f86a0a1b215f Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 13 Jul 2022 19:07:50 +0530 Subject: [PATCH 12/13] add maintainedBy to show green badge --- apps/remix-ide/src/app/panels/file-panel.js | 3 ++- apps/remix-ide/src/app/tabs/analysis-tab.js | 3 ++- apps/remix-ide/src/app/tabs/compile-tab.js | 1 + apps/remix-ide/src/app/tabs/debugger-tab.js | 3 ++- apps/remix-ide/src/app/tabs/search.tsx | 3 ++- apps/remix-ide/src/app/tabs/test-tab.js | 3 ++- apps/remix-ide/src/app/udapp/run-tab.js | 1 + 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index 983a54af70..ba45ff806b 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -37,7 +37,8 @@ const profile = { kind: 'fileexplorer', location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/file_explorer.html', - version: packageJson.version + version: packageJson.version, + maintainedBy: 'Remix' } module.exports = class Filepanel extends ViewPlugin { constructor (appManager) { diff --git a/apps/remix-ide/src/app/tabs/analysis-tab.js b/apps/remix-ide/src/app/tabs/analysis-tab.js index f17b0da52b..21c123c9bf 100644 --- a/apps/remix-ide/src/app/tabs/analysis-tab.js +++ b/apps/remix-ide/src/app/tabs/analysis-tab.js @@ -18,7 +18,8 @@ const profile = { kind: 'analysis', location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/static_analysis.html', - version: packageJson.version + version: packageJson.version, + maintainedBy: 'Remix' } class AnalysisTab extends ViewPlugin { diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index 23a53846f7..5ba54ed30f 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -19,6 +19,7 @@ const profile = { location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/solidity_editor.html', version: packageJson.version, + maintainedBy: 'Remix', methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig', 'compileFile', 'getCompilerState'] } diff --git a/apps/remix-ide/src/app/tabs/debugger-tab.js b/apps/remix-ide/src/app/tabs/debugger-tab.js index 63debf4553..a06db0c508 100644 --- a/apps/remix-ide/src/app/tabs/debugger-tab.js +++ b/apps/remix-ide/src/app/tabs/debugger-tab.js @@ -17,7 +17,8 @@ const profile = { kind: 'debugging', location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/debugger.html', - version: packageJson.version + version: packageJson.version, + maintainedBy: 'Remix' } export class DebuggerTab extends DebuggerApiMixin(ViewPlugin) { diff --git a/apps/remix-ide/src/app/tabs/search.tsx b/apps/remix-ide/src/app/tabs/search.tsx index 3e0df1a893..f9a00045cc 100644 --- a/apps/remix-ide/src/app/tabs/search.tsx +++ b/apps/remix-ide/src/app/tabs/search.tsx @@ -12,7 +12,8 @@ const profile = { kind: '', location: 'sidePanel', documentation: '', - version: packageJson.version + version: packageJson.version, + maintainedBy: 'Remix' } export class SearchPlugin extends ViewPlugin { diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 3c6e1a4b4c..b5c9518d23 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -18,7 +18,8 @@ const profile = { icon: 'assets/img/unitTesting.webp', description: 'Write and run unit tests for your contracts in Solidity', location: 'sidePanel', - documentation: 'https://remix-ide.readthedocs.io/en/latest/unittesting.html' + documentation: 'https://remix-ide.readthedocs.io/en/latest/unittesting.html', + maintainedBy: 'Remix' } module.exports = class TestTab extends ViewPlugin { diff --git a/apps/remix-ide/src/app/udapp/run-tab.js b/apps/remix-ide/src/app/udapp/run-tab.js index 02087b671f..c12e67ae87 100644 --- a/apps/remix-ide/src/app/udapp/run-tab.js +++ b/apps/remix-ide/src/app/udapp/run-tab.js @@ -17,6 +17,7 @@ const profile = { location: 'sidePanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/run.html', version: packageJson.version, + maintainedBy: 'Remix', permission: true, events: ['newTransaction'], methods: ['createVMAccount', 'sendTransaction', 'getAccounts', 'pendingTransactionsCount', 'getSettings', 'setEnvironmentMode', 'clearAllInstances', 'addInstance', 'resolveContractAndAddInstance'] From 5399ae515685948432ae724e20cd9bfb2fecbf6f Mon Sep 17 00:00:00 2001 From: David Disu Date: Thu, 14 Jul 2022 11:05:39 +0100 Subject: [PATCH 13/13] Fix duplicate repository name and update clone error message --- .../workspace/src/lib/actions/workspace.ts | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index 12aab6f93d..4e31b8fcf8 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -2,7 +2,7 @@ import React from 'react' import { bufferToHex, keccakFromString } from 'ethereumjs-util' import axios, { AxiosResponse } from 'axios' import { addInputFieldSuccess, cloneRepositoryFailed, cloneRepositoryRequest, cloneRepositorySuccess, createWorkspaceError, createWorkspaceRequest, createWorkspaceSuccess, displayNotification, displayPopUp, fetchWorkspaceDirectoryError, fetchWorkspaceDirectoryRequest, fetchWorkspaceDirectorySuccess, hideNotification, setCurrentWorkspace, setDeleteWorkspace, setMode, setReadOnlyMode, setRenameWorkspace } from './payload' -import { checkSlash, checkSpecialChars, createNonClashingTitle } from '@remix-ui/helper' +import { checkSlash, checkSpecialChars } from '@remix-ui/helper' import { JSONStandardInput, WorkspaceTemplate } from '../types' import { QueryParams } from '@remix-project/remix-lib' @@ -333,11 +333,10 @@ export const cloneRepository = async (url: string) => { const config = plugin.registry.get('config').api const token = config.get('settings/gist-access-token') const repoConfig = { url, token } - const urlArray = url.split('/') - let repoName = urlArray.length > 0 ? urlArray[urlArray.length - 1] : '' try { - repoName = await createNonClashingTitle(repoName, plugin.fileManager) + const repoName = await getRepositoryTitle(url) + await createWorkspace(repoName, 'blank', true, null, true) const promise = plugin.call('dGitProvider', 'clone', repoConfig, repoName, true) @@ -348,11 +347,11 @@ export const cloneRepository = async (url: string) => { if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit') await fetchWorkspaceDirectory(repoName) dispatch(cloneRepositorySuccess()) - }).catch((e) => { + }).catch(() => { const cloneModal = { id: 'cloneGitRepository', title: 'Clone Git Repository', - message: 'An error occured: ' + e, + message: 'An error occurred: Please check that you have the correct URL for the repo. If the repo is private, you need to add your github credentials (with the valid token permissions) in Settings plugin', modalType: 'modal', okLabel: 'OK', okFn: async () => { @@ -370,3 +369,22 @@ export const cloneRepository = async (url: string) => { dispatch(displayPopUp('An error occured: ' + e)) } } + +export const getRepositoryTitle = async (url: string) => { + const urlArray = url.split('/') + let name = urlArray.length > 0 ? urlArray[urlArray.length - 1] : '' + + if (!name) name = 'Undefined' + let _counter + let exist = true + + do { + const isDuplicate = await workspaceExists(name + (_counter || '')) + + if (isDuplicate) _counter = (_counter || 0) + 1 + else exist = false + } while (exist) + const counter = _counter || '' + + return name + counter +}