From 4dd99591feb5b4e32ad36f753a5807da59735341 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 17 Apr 2024 18:45:41 +0530 Subject: [PATCH 01/26] icon for solcan --- apps/remix-ide/src/app/tabs/locales/en/udapp.json | 1 + libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index bd9ff8b6d7..e752fd1bc9 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -111,6 +111,7 @@ "udapp.tooltipTextRemove": "Remove from the list", "udapp.tooltipTextEdit": "Create a DApp using this contract in the main panel", "udapp.tooltipTextPin": "Pin contract", + "udapp.tooltipTextSolScan": "Run Solidity scan for contract", "udapp.tooltipText8": "Click for docs about using 'receive'/'fallback'", "udapp.tooltipText9": "The Calldata to send to fallback function of the contract.", "udapp.tooltipText10": "Send data to contract.", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 6192777e31..935f9a35fc 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -307,6 +307,9 @@ export function UniversalDappUI(props: UdappProps) { > )} + }> + + { props.isPinnedContract && props.instance.pinnedAt ? (
From 06e6510b3a833d14d842c33e2fb164b4449b21a7 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 24 May 2024 13:45:58 +0530 Subject: [PATCH 02/26] added permission modal --- .../src/app/tabs/locales/en/udapp.json | 7 ++++++- .../src/lib/components/universalDappUI.tsx | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index e752fd1bc9..7ebb3b8605 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -80,6 +80,12 @@ "udapp.pinnedAt": "Pinned at", "udapp.filePath": "File path", + "udapp.solScan.iconTooltip": "Run Solidity scan for contract", + "udapp.solScan.modalTitle": "Permission to share code", + "udapp.solScan.modalMessage": "Contract code will be shared to third party Solidity Scan.\n Would you like to continue?", + "udapp.solScan.modalOkLabel": "Continue", + "udapp.solScan.modalCancelLabel": "Cancel", + "udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx", "udapp.transactionsRecorded": "Transactions recorded", "udapp.transactionsCountTooltip": "The number of recorded transactions", @@ -111,7 +117,6 @@ "udapp.tooltipTextRemove": "Remove from the list", "udapp.tooltipTextEdit": "Create a DApp using this contract in the main panel", "udapp.tooltipTextPin": "Pin contract", - "udapp.tooltipTextSolScan": "Run Solidity scan for contract", "udapp.tooltipText8": "Click for docs about using 'receive'/'fallback'", "udapp.tooltipText9": "The Calldata to send to fallback function of the contract.", "udapp.tooltipText10": "Send data to contract.", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 935f9a35fc..f555c7532f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -6,6 +6,7 @@ import { FuncABI } from '@remix-project/core-plugin' import { CopyToClipboard } from '@remix-ui/clipboard' import * as remixLib from '@remix-project/remix-lib' import * as ethJSUtil from '@ethereumjs/util' +import { AppModal } from '@remix-ui/app' import { ContractGUI } from './contractGUI' import { TreeView, TreeViewItem } from '@remix-ui/tree-view' import { BN } from 'bn.js' @@ -217,6 +218,20 @@ export function UniversalDappUI(props: UdappProps) { setCalldataValue(value) } + const askPermissionToScan = async () => { + + const modal: AppModal = { + id: 'SolidityScanPermissionHandler', + title: , + message: , + okLabel: , + cancelLabel: + } + + const result = await props.plugin.call('notification', 'modal', modal) + console.log('askPermissionToScan----> result----->', result) + } + const label = (key: string | number, value: string) => { return (
@@ -308,7 +323,7 @@ export function UniversalDappUI(props: UdappProps) { )} }> - +
{ props.isPinnedContract && props.instance.pinnedAt ? ( From 777f678f61902a529f572138e087b7ea1601ed63 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 29 May 2024 16:09:20 +0530 Subject: [PATCH 03/26] websocket calls --- .../src/lib/components/universalDappUI.tsx | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index f555c7532f..4925e2400b 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -6,6 +6,7 @@ import { FuncABI } from '@remix-project/core-plugin' import { CopyToClipboard } from '@remix-ui/clipboard' import * as remixLib from '@remix-project/remix-lib' import * as ethJSUtil from '@ethereumjs/util' +import axios from 'axios' import { AppModal } from '@remix-ui/app' import { ContractGUI } from './contractGUI' import { TreeView, TreeViewItem } from '@remix-ui/tree-view' @@ -218,6 +219,99 @@ export function UniversalDappUI(props: UdappProps) { setCalldataValue(value) } + const handleScanContinue = async () => { + console.log('inside handleScanContinue') + + const workspace = await props.plugin.call('filePanel', 'getCurrentWorkspace') + const fileName = props.instance.filePath || `${workspace.name}/${props.instance.contractData.contract.file}` + console.log('fileName---->', fileName) + // const existsOrNot = await props.plugin.call('fileManager', 'exists', fileName) + // console.log('existsOrNot---->', existsOrNot) + // const file = await props.plugin.call('fileManager', 'readFile', fileName) + const file = `// SPDX-License-Identifier: GPL-3.0 + + pragma solidity >=0.8.2 <0.9.0; + + /** + * @title Storage + * @dev Store & retrieve value in a variable + * @custom:dev-run-script ./scripts/deploy_with_ethers.ts + */ + contract Storage { + + constructor() payable {} + + uint256 number; + + /** + * @dev Store value in variable + * @param num value to store + */ + function store(uint256 num) public { + number = num; + } + + /** + * @dev Return value + * @return value of 'number' + */ + function retrieve() public view returns (uint256){ + return number; + } + }` + console.log('file---->', file) + + const urlResponse = await axios.post(`https://solidityscan.remixproject.org/`, { + file, + fileName + }) + console.log('urlResponse----->', urlResponse.data) + + + // websocket connection + + if (urlResponse.data.status === 'success') { + const ws = new WebSocket('wss://api-ws.solidityscan.com') + ws.addEventListener('error', console.error); + const bearerToken = "" + + ws.addEventListener('open', (event) => { + const tokenRegRequest = { + "action": "message", + "payload": { + "type": "auth_token_register", + "body": { + "auth_token": bearerToken + } + } + } + ws.send(JSON.stringify(tokenRegRequest)) + }) + + ws.addEventListener('message', (event) => { + const data = JSON.parse(event.data) + if (data.type === "auth_token_register" && data.payload.message === "Auth token registered.") { + + const request2 = { + "action": "message", + "payload": { + "type": "private_project_scan_initiate", + "body": { + "file_urls": [ + urlResponse.data.result.url + ], + "project_name": "TestRemix", + "project_type": "new" + } + } + } + ws.send(JSON.stringify(request2)) + } + + }) + } + } + const askPermissionToScan = async () => { const modal: AppModal = { @@ -225,6 +319,7 @@ export function UniversalDappUI(props: UdappProps) { title: , message: , okLabel: , + okFn: handleScanContinue, cancelLabel: } From fba3013fd1976bde706f406042e9ed879ede96fc Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Sat, 1 Jun 2024 21:16:19 +0530 Subject: [PATCH 04/26] websocket proxy serve --- .../src/lib/components/universalDappUI.tsx | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 4925e2400b..edc81f737c 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -220,11 +220,8 @@ export function UniversalDappUI(props: UdappProps) { } const handleScanContinue = async () => { - console.log('inside handleScanContinue') - const workspace = await props.plugin.call('filePanel', 'getCurrentWorkspace') const fileName = props.instance.filePath || `${workspace.name}/${props.instance.contractData.contract.file}` - console.log('fileName---->', fileName) // const existsOrNot = await props.plugin.call('fileManager', 'exists', fileName) // console.log('existsOrNot---->', existsOrNot) // const file = await props.plugin.call('fileManager', 'readFile', fileName) @@ -259,40 +256,27 @@ export function UniversalDappUI(props: UdappProps) { return number; } }` - console.log('file---->', file) const urlResponse = await axios.post(`https://solidityscan.remixproject.org/`, { file, fileName }) - console.log('urlResponse----->', urlResponse.data) - // websocket connection if (urlResponse.data.status === 'success') { - const ws = new WebSocket('wss://api-ws.solidityscan.com') + const ws = new WebSocket('wss://solidityscan.remixproject.org/solidityscan') + ws.addEventListener('error', console.error); - const bearerToken = "" ws.addEventListener('open', (event) => { - const tokenRegRequest = { - "action": "message", - "payload": { - "type": "auth_token_register", - "body": { - "auth_token": bearerToken - } - } - } - ws.send(JSON.stringify(tokenRegRequest)) + console.log('Connected to the server.') }) ws.addEventListener('message', (event) => { const data = JSON.parse(event.data) if (data.type === "auth_token_register" && data.payload.message === "Auth token registered.") { - - const request2 = { + const reqToInitScan = { "action": "message", "payload": { "type": "private_project_scan_initiate", @@ -300,12 +284,12 @@ export function UniversalDappUI(props: UdappProps) { "file_urls": [ urlResponse.data.result.url ], - "project_name": "TestRemix", + "project_name": "RemixProject", "project_type": "new" } } } - ws.send(JSON.stringify(request2)) + ws.send(JSON.stringify(reqToInitScan)) } }) From 5d9f931aa5cfda1ca41ad81ba68d55227be36449 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 11:54:56 +0530 Subject: [PATCH 05/26] handle error --- .../src/app/tabs/locales/en/udapp.json | 1 + .../src/lib/components/universalDappUI.tsx | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index 7ebb3b8605..c0103f9d44 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -85,6 +85,7 @@ "udapp.solScan.modalMessage": "Contract code will be shared to third party Solidity Scan.\n Would you like to continue?", "udapp.solScan.modalOkLabel": "Continue", "udapp.solScan.modalCancelLabel": "Cancel", + "udapp.solScan.errModalTitle": "Error", "udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx", "udapp.transactionsRecorded": "Transactions recorded", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index edc81f737c..30541b2944 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -220,6 +220,7 @@ export function UniversalDappUI(props: UdappProps) { } const handleScanContinue = async () => { + await props.plugin.call('notification', 'toast', 'Running scan...') const workspace = await props.plugin.call('filePanel', 'getCurrentWorkspace') const fileName = props.instance.filePath || `${workspace.name}/${props.instance.contractData.contract.file}` // const existsOrNot = await props.plugin.call('fileManager', 'exists', fileName) @@ -270,10 +271,10 @@ export function UniversalDappUI(props: UdappProps) { ws.addEventListener('error', console.error); ws.addEventListener('open', (event) => { - console.log('Connected to the server.') + console.log('Connected to the solidityscan server.') }) - ws.addEventListener('message', (event) => { + ws.addEventListener('message', async (event) => { const data = JSON.parse(event.data) if (data.type === "auth_token_register" && data.payload.message === "Auth token registered.") { const reqToInitScan = { @@ -290,6 +291,14 @@ export function UniversalDappUI(props: UdappProps) { } } ws.send(JSON.stringify(reqToInitScan)) + } else if (data.type === "scan_status" && data.payload.scan_status === "download_failed") { + const modal: AppModal = { + id: 'SolidityScanError', + title: , + message: data.payload.scan_status_err_message, + okLabel: 'Close' + } + await props.plugin.call('notification', 'modal', modal) } }) @@ -304,11 +313,10 @@ export function UniversalDappUI(props: UdappProps) { message: , okLabel: , okFn: handleScanContinue, - cancelLabel: + cancelLabel: , } - const result = await props.plugin.call('notification', 'modal', modal) - console.log('askPermissionToScan----> result----->', result) + await props.plugin.call('notification', 'modal', modal) } const label = (key: string | number, value: string) => { From 0bcf95f0b094e6f80a2b049611fea25b1849f34e Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 14:09:22 +0530 Subject: [PATCH 06/26] fix file read error --- .../src/app/tabs/locales/en/udapp.json | 2 +- .../src/lib/components/universalDappUI.tsx | 39 ++----------------- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index c0103f9d44..f39051be18 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -85,7 +85,7 @@ "udapp.solScan.modalMessage": "Contract code will be shared to third party Solidity Scan.\n Would you like to continue?", "udapp.solScan.modalOkLabel": "Continue", "udapp.solScan.modalCancelLabel": "Cancel", - "udapp.solScan.errModalTitle": "Error", + "udapp.solScan.errModalTitle": "Scanning error", "udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx", "udapp.transactionsRecorded": "Transactions recorded", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 30541b2944..4d6d74dbc5 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -223,40 +223,8 @@ export function UniversalDappUI(props: UdappProps) { await props.plugin.call('notification', 'toast', 'Running scan...') const workspace = await props.plugin.call('filePanel', 'getCurrentWorkspace') const fileName = props.instance.filePath || `${workspace.name}/${props.instance.contractData.contract.file}` - // const existsOrNot = await props.plugin.call('fileManager', 'exists', fileName) - // console.log('existsOrNot---->', existsOrNot) - // const file = await props.plugin.call('fileManager', 'readFile', fileName) - const file = `// SPDX-License-Identifier: GPL-3.0 - - pragma solidity >=0.8.2 <0.9.0; - - /** - * @title Storage - * @dev Store & retrieve value in a variable - * @custom:dev-run-script ./scripts/deploy_with_ethers.ts - */ - contract Storage { - - constructor() payable {} - - uint256 number; - - /** - * @dev Store value in variable - * @param num value to store - */ - function store(uint256 num) public { - number = num; - } - - /** - * @dev Return value - * @return value of 'number' - */ - function retrieve() public view returns (uint256){ - return number; - } - }` + const filePath = `.workspaces/${fileName}` + const file = await props.plugin.call('fileManager', 'readFile', filePath) const urlResponse = await axios.post(`https://solidityscan.remixproject.org/`, { file, @@ -271,11 +239,12 @@ export function UniversalDappUI(props: UdappProps) { ws.addEventListener('error', console.error); ws.addEventListener('open', (event) => { - console.log('Connected to the solidityscan server.') + console.log('Connected to the server.') }) ws.addEventListener('message', async (event) => { const data = JSON.parse(event.data) + console.log('data---->', data) if (data.type === "auth_token_register" && data.payload.message === "Auth token registered.") { const reqToInitScan = { "action": "message", From 4db0ce9c3ba928979c821a328442069e693a130a Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 19:49:14 +0530 Subject: [PATCH 07/26] scan success --- apps/remix-ide/src/app/tabs/locales/en/udapp.json | 2 ++ .../run-tab/src/lib/components/universalDappUI.tsx | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index f39051be18..25b82c58b3 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -86,6 +86,8 @@ "udapp.solScan.modalOkLabel": "Continue", "udapp.solScan.modalCancelLabel": "Cancel", "udapp.solScan.errModalTitle": "Scanning error", + "udapp.solScan.successModalTitle": "Scanning successful", + "udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx", "udapp.transactionsRecorded": "Transactions recorded", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 4d6d74dbc5..420ad0e138 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -231,8 +231,6 @@ export function UniversalDappUI(props: UdappProps) { fileName }) - // websocket connection - if (urlResponse.data.status === 'success') { const ws = new WebSocket('wss://solidityscan.remixproject.org/solidityscan') @@ -268,6 +266,16 @@ export function UniversalDappUI(props: UdappProps) { okLabel: 'Close' } await props.plugin.call('notification', 'modal', modal) + } else if (data.type === "scan_status" && data.payload.scan_status === "scan_done") { + console.log('data.payload--->', data.payload) + + const modal: AppModal = { + id: 'SolidityScanSuccess', + title: , + message: 'Scan successful', + okLabel: 'Close' + } + await props.plugin.call('notification', 'modal', modal) } }) From f90eef6b332a876797bbc7d3ddec5d1846f3ac88 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:01:15 +0530 Subject: [PATCH 08/26] successful scan --- .../src/lib/components/solScanTable.tsx | 26 +++++++++++++++++++ .../src/lib/components/universalDappUI.tsx | 21 ++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx new file mode 100644 index 0000000000..81fec80473 --- /dev/null +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -0,0 +1,26 @@ +// eslint-disable-next-line no-use-before-define +import React from 'react' + +interface SolScanTableProps { + scanDetails: Record[] +} + +export function SolScanTable(props: SolScanTableProps) { + + return ( + + + + + + + + + + + + + +
h1h2
r1r2
+ ) +} diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 420ad0e138..9fbf8f23eb 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -226,10 +226,7 @@ export function UniversalDappUI(props: UdappProps) { const filePath = `.workspaces/${fileName}` const file = await props.plugin.call('fileManager', 'readFile', filePath) - const urlResponse = await axios.post(`https://solidityscan.remixproject.org/`, { - file, - fileName - }) + const urlResponse = await axios.post(`https://solidityscan.remixproject.org/uploadFile`, { file, fileName}) if (urlResponse.data.status === 'success') { const ws = new WebSocket('wss://solidityscan.remixproject.org/solidityscan') @@ -244,13 +241,14 @@ export function UniversalDappUI(props: UdappProps) { const data = JSON.parse(event.data) console.log('data---->', data) if (data.type === "auth_token_register" && data.payload.message === "Auth token registered.") { + // Message on Bearer token successful registration const reqToInitScan = { "action": "message", "payload": { "type": "private_project_scan_initiate", "body": { "file_urls": [ - urlResponse.data.result.url + urlResponse.data.result.url ], "project_name": "RemixProject", "project_type": "new" @@ -259,6 +257,8 @@ export function UniversalDappUI(props: UdappProps) { } ws.send(JSON.stringify(reqToInitScan)) } else if (data.type === "scan_status" && data.payload.scan_status === "download_failed") { + // Message on failed scan + const modal: AppModal = { id: 'SolidityScanError', title: , @@ -267,12 +267,21 @@ export function UniversalDappUI(props: UdappProps) { } await props.plugin.call('notification', 'modal', modal) } else if (data.type === "scan_status" && data.payload.scan_status === "scan_done") { + // Message on successful scan + console.log('data.payload--->', data.payload) + const url = data.payload.scan_details.link + + const {data: scanData} = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) + console.log('scanData--->', scanData) + const scanDetails = scanData.scan_report.multi_file_scan_details + console.log('scanDetails--->', scanDetails) + const modal: AppModal = { id: 'SolidityScanSuccess', title: , - message: 'Scan successful', + message: `Scan successful`, okLabel: 'Close' } await props.plugin.call('notification', 'modal', modal) From 8296b0e25cd70f74d4ba00b0c0ad4d6bc48c2e7f Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:31:00 +0530 Subject: [PATCH 09/26] show table for result --- .../src/lib/components/solScanTable.tsx | 44 ++++++++++++------- .../src/lib/components/universalDappUI.tsx | 14 +++--- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index 81fec80473..83e16ce0fa 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -6,21 +6,33 @@ interface SolScanTableProps { } export function SolScanTable(props: SolScanTableProps) { + const {scanDetails} = props - return ( - - - - - - - - - - - - - -
h1h2
r1r2
- ) + return ( + + + + + + + + + + + { + Array.from(scanDetails, (template) => { + return ( + + + + + + + ) + }) + } + + +
IDNAMESEVERITYDESCRIPTION
{template.template_details.issue_id}{template.template_details.issue_name}{template.template_details.issue_severity}{template.template_details.static_issue_description}
+ ) } diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 9fbf8f23eb..2d6fb253b7 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -9,6 +9,7 @@ import * as ethJSUtil from '@ethereumjs/util' import axios from 'axios' import { AppModal } from '@remix-ui/app' import { ContractGUI } from './contractGUI' +import { SolScanTable } from './solScanTable' import { TreeView, TreeViewItem } from '@remix-ui/tree-view' import { BN } from 'bn.js' import { CustomTooltip, is0XPrefixed, isHexadecimal, isNumeric, shortenAddress } from '@remix-ui/helper' @@ -220,7 +221,7 @@ export function UniversalDappUI(props: UdappProps) { } const handleScanContinue = async () => { - await props.plugin.call('notification', 'toast', 'Running scan...') + await props.plugin.call('notification', 'toast', 'Processing data to scan...') const workspace = await props.plugin.call('filePanel', 'getCurrentWorkspace') const fileName = props.instance.filePath || `${workspace.name}/${props.instance.contractData.contract.file}` const filePath = `.workspaces/${fileName}` @@ -233,8 +234,8 @@ export function UniversalDappUI(props: UdappProps) { ws.addEventListener('error', console.error); - ws.addEventListener('open', (event) => { - console.log('Connected to the server.') + ws.addEventListener('open', async (event) => { + await props.plugin.call('notification', 'toast', 'Initiating scan...') }) ws.addEventListener('message', async (event) => { @@ -273,15 +274,12 @@ export function UniversalDappUI(props: UdappProps) { const url = data.payload.scan_details.link const {data: scanData} = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) - console.log('scanData--->', scanData) - const scanDetails = scanData.scan_report.multi_file_scan_details - console.log('scanDetails--->', scanDetails) - + const scanDetails: Record[] = scanData.scan_report.multi_file_scan_details const modal: AppModal = { id: 'SolidityScanSuccess', title: , - message: `Scan successful`, + message: , okLabel: 'Close' } await props.plugin.call('notification', 'modal', modal) From 57f48d8ddecbb0c621c51dc6a013a7fb3d70cd6d Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:32:17 +0530 Subject: [PATCH 10/26] linting fix --- .../src/lib/components/solScanTable.tsx | 56 +++++++++---------- .../src/lib/components/universalDappUI.tsx | 24 ++++---- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index 83e16ce0fa..45d55c9e2d 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -6,33 +6,33 @@ interface SolScanTableProps { } export function SolScanTable(props: SolScanTableProps) { - const {scanDetails} = props + const { scanDetails } = props - return ( - - - - - - - - - - - { - Array.from(scanDetails, (template) => { - return ( - - - - - - - ) - }) - } - - -
IDNAMESEVERITYDESCRIPTION
{template.template_details.issue_id}{template.template_details.issue_name}{template.template_details.issue_severity}{template.template_details.static_issue_description}
- ) + return ( + + + + + + + + + + + { + Array.from(scanDetails, (template) => { + return ( + + + + + + + ) + }) + } + + +
IDNAMESEVERITYDESCRIPTION
{template.template_details.issue_id}{template.template_details.issue_name}{template.template_details.issue_severity}{template.template_details.static_issue_description}
+ ) } diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 2d6fb253b7..7992fe8bb5 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -227,13 +227,13 @@ export function UniversalDappUI(props: UdappProps) { const filePath = `.workspaces/${fileName}` const file = await props.plugin.call('fileManager', 'readFile', filePath) - const urlResponse = await axios.post(`https://solidityscan.remixproject.org/uploadFile`, { file, fileName}) + const urlResponse = await axios.post(`https://solidityscan.remixproject.org/uploadFile`, { file, fileName }) if (urlResponse.data.status === 'success') { const ws = new WebSocket('wss://solidityscan.remixproject.org/solidityscan') ws.addEventListener('error', console.error); - + ws.addEventListener('open', async (event) => { await props.plugin.call('notification', 'toast', 'Initiating scan...') }) @@ -246,14 +246,14 @@ export function UniversalDappUI(props: UdappProps) { const reqToInitScan = { "action": "message", "payload": { - "type": "private_project_scan_initiate", - "body": { - "file_urls": [ - urlResponse.data.result.url - ], - "project_name": "RemixProject", - "project_type": "new" - } + "type": "private_project_scan_initiate", + "body": { + "file_urls": [ + urlResponse.data.result.url + ], + "project_name": "RemixProject", + "project_type": "new" + } } } ws.send(JSON.stringify(reqToInitScan)) @@ -273,7 +273,7 @@ export function UniversalDappUI(props: UdappProps) { console.log('data.payload--->', data.payload) const url = data.payload.scan_details.link - const {data: scanData} = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) + const { data: scanData } = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) const scanDetails: Record[] = scanData.scan_report.multi_file_scan_details const modal: AppModal = { @@ -284,7 +284,7 @@ export function UniversalDappUI(props: UdappProps) { } await props.plugin.call('notification', 'modal', modal) } - + }) } } From b4e672227e01979ef542c74854e0e49c9bec07a8 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:49:35 +0530 Subject: [PATCH 11/26] table improvement --- libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index 45d55c9e2d..ae32e5d28e 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -9,7 +9,7 @@ export function SolScanTable(props: SolScanTableProps) { const { scanDetails } = props return ( - +
@@ -22,7 +22,7 @@ export function SolScanTable(props: SolScanTableProps) { { Array.from(scanDetails, (template) => { return ( - + From 3c3d994dd287fa6b79dabb02e12ade6f20510adb Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 4 Jun 2024 14:02:13 +0530 Subject: [PATCH 12/26] update text --- apps/remix-ide/src/app/tabs/locales/en/udapp.json | 4 ++-- libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index 25b82c58b3..27b5b4cb40 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -80,9 +80,9 @@ "udapp.pinnedAt": "Pinned at", "udapp.filePath": "File path", - "udapp.solScan.iconTooltip": "Run Solidity scan for contract", + "udapp.solScan.iconTooltip": "Click to scan this contract for vulnerabilities using third-party SolidityScan [BETA]", "udapp.solScan.modalTitle": "Permission to share code", - "udapp.solScan.modalMessage": "Contract code will be shared to third party Solidity Scan.\n Would you like to continue?", + "udapp.solScan.modalMessage": "To scan the contract for vulnerabilities & possible risks, smart contract code will be shared to third-party SolidityScan (https://solidityscan.com/).\n\n Would you like to continue?", "udapp.solScan.modalOkLabel": "Continue", "udapp.solScan.modalCancelLabel": "Cancel", "udapp.solScan.errModalTitle": "Scanning error", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 7992fe8bb5..da1994379d 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -240,7 +240,6 @@ export function UniversalDappUI(props: UdappProps) { ws.addEventListener('message', async (event) => { const data = JSON.parse(event.data) - console.log('data---->', data) if (data.type === "auth_token_register" && data.payload.message === "Auth token registered.") { // Message on Bearer token successful registration const reqToInitScan = { @@ -269,8 +268,7 @@ export function UniversalDappUI(props: UdappProps) { await props.plugin.call('notification', 'modal', modal) } else if (data.type === "scan_status" && data.payload.scan_status === "scan_done") { // Message on successful scan - - console.log('data.payload--->', data.payload) + const url = data.payload.scan_details.link const { data: scanData } = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) From b3a0a1423792b9e969e314e62aeb60770cd91ee1 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 4 Jun 2024 14:23:53 +0530 Subject: [PATCH 13/26] matomo --- .../run-tab/src/lib/components/universalDappUI.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index da1994379d..9b24d8e725 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -222,6 +222,7 @@ export function UniversalDappUI(props: UdappProps) { const handleScanContinue = async () => { await props.plugin.call('notification', 'toast', 'Processing data to scan...') + _paq.push(['trackEvent', 'udapp', 'solidityScan', 'initiateScan']) const workspace = await props.plugin.call('filePanel', 'getCurrentWorkspace') const fileName = props.instance.filePath || `${workspace.name}/${props.instance.contractData.contract.file}` const filePath = `.workspaces/${fileName}` @@ -258,7 +259,7 @@ export function UniversalDappUI(props: UdappProps) { ws.send(JSON.stringify(reqToInitScan)) } else if (data.type === "scan_status" && data.payload.scan_status === "download_failed") { // Message on failed scan - + _paq.push(['trackEvent', 'udapp', 'solidityScan', 'scanFailed']) const modal: AppModal = { id: 'SolidityScanError', title: , @@ -268,7 +269,7 @@ export function UniversalDappUI(props: UdappProps) { await props.plugin.call('notification', 'modal', modal) } else if (data.type === "scan_status" && data.payload.scan_status === "scan_done") { // Message on successful scan - + _paq.push(['trackEvent', 'udapp', 'solidityScan', 'scanSuccess']) const url = data.payload.scan_details.link const { data: scanData } = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) @@ -288,7 +289,7 @@ export function UniversalDappUI(props: UdappProps) { } const askPermissionToScan = async () => { - + _paq.push(['trackEvent', 'udapp', 'solidityScan', 'askPermissionToScan']) const modal: AppModal = { id: 'SolidityScanPermissionHandler', title: , From fdf48b1250394fac8badb99b465315e6214e12a9 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Jun 2024 14:47:56 +0530 Subject: [PATCH 14/26] parse html description --- libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index ae32e5d28e..10da3376ff 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -1,5 +1,6 @@ // eslint-disable-next-line no-use-before-define import React from 'react' +import parse from 'html-react-parser'; interface SolScanTableProps { scanDetails: Record[] @@ -26,7 +27,7 @@ export function SolScanTable(props: SolScanTableProps) { - + ) }) From 9139c088100a3c12eef33d0d84aeb9ff92729c62 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Jun 2024 20:25:00 +0530 Subject: [PATCH 15/26] increase modal size --- libs/remix-ui/app/src/lib/remix-app/context/provider.tsx | 3 ++- libs/remix-ui/app/src/lib/remix-app/interface/index.ts | 1 + libs/remix-ui/app/src/lib/remix-app/reducer/modals.ts | 1 + .../modal-dialog/src/lib/remix-ui-modal-dialog.tsx | 2 +- libs/remix-ui/modal-dialog/src/lib/types/index.ts | 1 + .../run-tab/src/lib/components/universalDappUI.tsx | 7 ++++--- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/app/src/lib/remix-app/context/provider.tsx b/libs/remix-ui/app/src/lib/remix-app/context/provider.tsx index 5b64e8e5f6..c6dc3d057b 100644 --- a/libs/remix-ui/app/src/lib/remix-app/context/provider.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/context/provider.tsx @@ -23,7 +23,7 @@ export const ModalProvider = ({ children = [], reducer = modalReducer, initialSt } const modal = (modalData: AppModal) => { - const { id, title, message, validationFn, okLabel, okFn, cancelLabel, cancelFn, modalType, defaultValue, hideFn, data } = modalData + const { id, title, message, validationFn, okLabel, okFn, cancelLabel, cancelFn, modalType, modalParentClass, defaultValue, hideFn, data } = modalData return new Promise((resolve, reject) => { dispatch({ type: modalActionTypes.setModal, @@ -37,6 +37,7 @@ export const ModalProvider = ({ children = [], reducer = modalReducer, initialSt cancelLabel, cancelFn, modalType: modalType || ModalTypes.default, + modalParentClass, defaultValue: defaultValue, hideFn, resolve, diff --git a/libs/remix-ui/app/src/lib/remix-app/interface/index.ts b/libs/remix-ui/app/src/lib/remix-app/interface/index.ts index 17afcc9e35..5dacecdf4d 100644 --- a/libs/remix-ui/app/src/lib/remix-app/interface/index.ts +++ b/libs/remix-ui/app/src/lib/remix-app/interface/index.ts @@ -18,6 +18,7 @@ export interface AppModal { cancelLabel?: string | JSX.Element cancelFn?: () => void, modalType?: ModalTypes, + modalParentClass?: string defaultValue?: string hideFn?: () => void, resolve?: (value?:any) => void, diff --git a/libs/remix-ui/app/src/lib/remix-app/reducer/modals.ts b/libs/remix-ui/app/src/lib/remix-app/reducer/modals.ts index 4578170385..a24c8af6aa 100644 --- a/libs/remix-ui/app/src/lib/remix-app/reducer/modals.ts +++ b/libs/remix-ui/app/src/lib/remix-app/reducer/modals.ts @@ -18,6 +18,7 @@ export const modalReducer = (state: ModalState = ModalInitialState, action: Moda cancelLabel: action.payload.cancelLabel, cancelFn: action.payload.cancelFn, modalType: action.payload.modalType, + modalParentClass: action.payload.modalParentClass, defaultValue: action.payload.defaultValue, hideFn: action.payload.hideFn, resolve: action.payload.resolve, diff --git a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx index d7e966dcc7..fbeaafe439 100644 --- a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx +++ b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx @@ -85,7 +85,7 @@ export const ModalDialog = (props: ModalDialogProps) => { style={{ display: props.hide ? 'none' : 'block' }} role="dialog" > -
+
void, modalClass?: string, + modalParentClass?: string showCancelIcon?: boolean, hide?: boolean, handleHide: (hideState?: boolean) => void, diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 9b24d8e725..ca2cfd9cac 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -279,7 +279,8 @@ export function UniversalDappUI(props: UdappProps) { id: 'SolidityScanSuccess', title: , message: , - okLabel: 'Close' + okLabel: 'Close', + modalParentClass: 'modal-lg' } await props.plugin.call('notification', 'modal', modal) } @@ -296,7 +297,7 @@ export function UniversalDappUI(props: UdappProps) { message: , okLabel: , okFn: handleScanContinue, - cancelLabel: , + cancelLabel: } await props.plugin.call('notification', 'modal', modal) @@ -392,7 +393,7 @@ export function UniversalDappUI(props: UdappProps) { > )} - }> + }>
From 42c76adff3db8d55e91d43b80987a693ca426870 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 13:18:02 +0530 Subject: [PATCH 16/26] modal details updated --- .../src/app/tabs/locales/en/udapp.json | 4 ++-- .../src/lib/components/solScanTable.tsx | 9 ++++++-- .../src/lib/components/universalDappUI.tsx | 23 ++++++++++++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index 27b5b4cb40..e33a897607 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -85,8 +85,8 @@ "udapp.solScan.modalMessage": "To scan the contract for vulnerabilities & possible risks, smart contract code will be shared to third-party SolidityScan (https://solidityscan.com/).\n\n Would you like to continue?", "udapp.solScan.modalOkLabel": "Continue", "udapp.solScan.modalCancelLabel": "Cancel", - "udapp.solScan.errModalTitle": "Scanning error", - "udapp.solScan.successModalTitle": "Scanning successful", + "udapp.solScan.errModalTitle": "Scan error", + "udapp.solScan.successModalTitle": "Scan result", "udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx", diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index 10da3376ff..f9d6b4b910 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -3,13 +3,17 @@ import React from 'react' import parse from 'html-react-parser'; interface SolScanTableProps { - scanDetails: Record[] + scanDetails: Record[], + fileName: string } export function SolScanTable(props: SolScanTableProps) { - const { scanDetails } = props + const { scanDetails, fileName } = props return ( + <> +

Scanning successful! {scanDetails.length} warnings found for file: {fileName}

+

See the warning details below. For more details, Sign up with SolidityScan

ID
{template.template_details.issue_id} {template.template_details.issue_name} {template.template_details.issue_severity}{template.template_details.issue_id} {template.template_details.issue_name} {template.template_details.issue_severity}{template.template_details.static_issue_description}{parse(template.template_details.static_issue_description)}
@@ -35,5 +39,6 @@ export function SolScanTable(props: SolScanTableProps) {
+ ) } diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index ca2cfd9cac..eae66a0b5f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -275,12 +275,23 @@ export function UniversalDappUI(props: UdappProps) { const { data: scanData } = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) const scanDetails: Record[] = scanData.scan_report.multi_file_scan_details - const modal: AppModal = { - id: 'SolidityScanSuccess', - title: , - message: , - okLabel: 'Close', - modalParentClass: 'modal-lg' + let modal: AppModal + + if (scanDetails && scanDetails.length) { + modal = { + id: 'SolidityScanSuccess', + title: , + message: , + okLabel: 'Close', + modalParentClass: 'modal-lg' + } + } else { + modal = { + id: 'SolidityScanError', + title: , + message: "Some error occurred! Please try again", + okLabel: 'Close' + } } await props.plugin.call('notification', 'modal', modal) } From cb47bb6e71dcefb329a02ee0302d01fba266aab2 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 14:05:43 +0530 Subject: [PATCH 17/26] show remediation --- libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx | 8 +++++--- .../run-tab/src/lib/components/universalDappUI.tsx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index f9d6b4b910..80ea2f0cb2 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -13,14 +13,15 @@ export function SolScanTable(props: SolScanTableProps) { return ( <>

Scanning successful! {scanDetails.length} warnings found for file: {fileName}

-

See the warning details below. For more details, Sign up with SolidityScan

+

See the warning details below. For more details, Sign up with SolidityScan

- + + @@ -28,10 +29,11 @@ export function SolScanTable(props: SolScanTableProps) { Array.from(scanDetails, (template) => { return ( - + + ) }) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index eae66a0b5f..3b912f7437 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -283,7 +283,7 @@ export function UniversalDappUI(props: UdappProps) { title: , message: , okLabel: 'Close', - modalParentClass: 'modal-lg' + modalParentClass: 'modal-xl' } } else { modal = { From 8ea90653de1cc038675ba8e6f58ce245c96588f2 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 14:15:28 +0530 Subject: [PATCH 18/26] linting fix --- .../src/lib/components/solScanTable.tsx | 56 +++++++++---------- .../src/lib/components/universalDappUI.tsx | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index 80ea2f0cb2..b8d797b586 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -12,35 +12,35 @@ export function SolScanTable(props: SolScanTableProps) { return ( <> -

Scanning successful! {scanDetails.length} warnings found for file: {fileName}

-

See the warning details below. For more details, Sign up with SolidityScan

-
ID NAME SEVERITYCONFIDENCE DESCRIPTIONREMEDIATION
{template.template_details.issue_id} {template.template_details.issue_name} {template.template_details.issue_severity}{template.template_details.issue_confidence} {parse(template.template_details.static_issue_description)}{template.template_details.issue_remediation ? parse(template.template_details.issue_remediation) : 'Not Available' }
- - - - - - - - - - - { - Array.from(scanDetails, (template) => { - return ( - - - - - - - - ) - }) - } +

Scanning successful! {scanDetails.length} warnings found for file: {fileName}

+

See the warning details below. For more details, Sign up with SolidityScan

+
NAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATION
{template.template_details.issue_name}{template.template_details.issue_severity}{template.template_details.issue_confidence}{parse(template.template_details.static_issue_description)}{template.template_details.issue_remediation ? parse(template.template_details.issue_remediation) : 'Not Available' }
+ + + + + + + + + + + { + Array.from(scanDetails, (template) => { + return ( + + + + + + + + ) + }) + } - -
NAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATION
{template.template_details.issue_name}{template.template_details.issue_severity}{template.template_details.issue_confidence}{parse(template.template_details.static_issue_description)}{template.template_details.issue_remediation ? parse(template.template_details.issue_remediation) : 'Not Available' }
+ + ) } diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 3b912f7437..abc3a95c20 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -406,7 +406,7 @@ export function UniversalDappUI(props: UdappProps) { )} }> - +
{ props.isPinnedContract && props.instance.pinnedAt ? (
From 3220d19954b5d63cf7f1edf83398dcdb078b85ad Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 16:32:04 +0530 Subject: [PATCH 19/26] update text --- libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index b8d797b586..b24791877f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -13,7 +13,7 @@ export function SolScanTable(props: SolScanTableProps) { return ( <>

Scanning successful! {scanDetails.length} warnings found for file: {fileName}

-

See the warning details below. For more details, Sign up with SolidityScan

+

See the warning details below. For more details, Go to SolidityScan

From 3f8b3a2ba98807adac63a5a530219aa56a4e9272 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 6 Jun 2024 22:06:54 +0100 Subject: [PATCH 20/26] fix icon spacing --- .../src/lib/components/universalDappUI.tsx | 33 ++++++++++--------- libs/remix-ui/run-tab/src/lib/css/run-tab.css | 7 ++++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index abc3a95c20..e56dffe7aa 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -390,23 +390,26 @@ export function UniversalDappUI(props: UdappProps) {
-
-
- - - - - + + + + + From 14337c1cca818b4d45b483b6c753f5749e6f6f58 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 10 Jun 2024 17:17:52 +0530 Subject: [PATCH 23/26] linting fix --- .../run-tab/src/lib/components/solScanTable.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index 0fc61d80b5..4c447365d2 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -17,11 +17,11 @@ export function SolScanTable(props: SolScanTableProps) {
NAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATIONNAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATION
- - - - - + + + + + From 623e20f3ee021fd4b702340bbd11136ef01e9056 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Jun 2024 13:30:51 +0530 Subject: [PATCH 24/26] fetch code from sepolia only --- libs/remix-ui/workspace/src/lib/actions/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index d15cfea28b..8b1f828e78 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -136,10 +136,7 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. if (!etherscanKey) etherscanKey = '2HKUX5ZVASZIKWJM8MIQVCRUVZ6JAWT531' const networks = [ { id: 1, name: 'mainnet' }, - { id: 3, name: 'ropsten' }, - { id: 4, name: 'rinkeby' }, - { id: 42, name: 'kovan' }, - { id: 5, name: 'goerli' } + { id: 11155111, name: 'sepolia' } ] let found = false const workspaceName = 'code-sample' From 3ae36a673f3ed410e20cf67b7520e88612777025 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 10 Jun 2024 17:25:19 +0530 Subject: [PATCH 25/26] fix e2e --- apps/remix-ide-e2e/src/tests/url.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 679fb72951..62a9fa4d66 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -97,9 +97,20 @@ module.exports = { .refreshPage() .pause(7000) .currentWorkspaceIs('code-sample') + .waitForElementVisible('*[data-id=treeViewLitreeViewItemsepolia]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemsepolia/0xdac17f958d2ee523a2206206994597c13d831ec7"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemsepolia/0xdac17f958d2ee523a2206206994597c13d831ec7/MetaMultiSigWallet.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract MetaMultiSigWallet {') !== -1) + + }) .waitForElementVisible('*[data-id=treeViewLitreeViewItemmainnet]') + .click('*[data-id=treeViewLitreeViewItemmainnet]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') + .click('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') + .click('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') .getEditorValue((content) => { browser.assert.ok(content && content.indexOf( 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) From 3964e4b3a6dad882777000a6882b4264698123af Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 10 Jun 2024 17:39:15 +0530 Subject: [PATCH 26/26] e2e update --- apps/remix-ide-e2e/src/tests/url.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 62a9fa4d66..7c8fa078cd 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -98,8 +98,7 @@ module.exports = { .pause(7000) .currentWorkspaceIs('code-sample') .waitForElementVisible('*[data-id=treeViewLitreeViewItemsepolia]') - .waitForElementVisible('*[data-id="treeViewLitreeViewItemsepolia/0xdac17f958d2ee523a2206206994597c13d831ec7"]') - .waitForElementVisible('*[data-id="treeViewLitreeViewItemsepolia/0xdac17f958d2ee523a2206206994597c13d831ec7/MetaMultiSigWallet.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemsepolia/0xdac17f958d2ee523a2206206994597c13d831ec7/contracts/MetaMultiSigWallet.sol"]') .getEditorValue((content) => { browser.assert.ok(content && content.indexOf( 'contract MetaMultiSigWallet {') !== -1)
NAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATIONNAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATION