From 92ecbf3dbfbf594d2afe0ad8eab10554b91c34c0 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 17 Apr 2024 18:45:41 +0530 Subject: [PATCH 01/23] 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 bd9ff8b6d75..e752fd1bc9c 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 6192777e317..935f9a35fcf 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 d3850eb9b650aeeebaa1a69678dd4d10546fc7da Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 24 May 2024 13:45:58 +0530 Subject: [PATCH 02/23] 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 e752fd1bc9c..7ebb3b86056 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 935f9a35fcf..f555c7532f5 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 f110b55acdf0489dacc44a05ed22c9b9d47dec34 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 29 May 2024 16:09:20 +0530 Subject: [PATCH 03/23] 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 f555c7532f5..4925e2400bf 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 231c65a9316940d45f980bba888717f151816d36 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Sat, 1 Jun 2024 21:16:19 +0530 Subject: [PATCH 04/23] 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 4925e2400bf..edc81f737c5 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 7643e38bff0f4b064fa699c206014fe9e9086e99 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 11:54:56 +0530 Subject: [PATCH 05/23] 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 7ebb3b86056..c0103f9d44f 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 edc81f737c5..30541b29440 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 003380a18ac25a2ba48271240a7598d696323425 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 14:09:22 +0530 Subject: [PATCH 06/23] 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 c0103f9d44f..f39051be185 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 30541b29440..4d6d74dbc52 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 b3ebe7544a78d3952f4d2e900988de3e721acd1f Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 19:49:14 +0530 Subject: [PATCH 07/23] 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 f39051be185..25b82c58b33 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 4d6d74dbc52..420ad0e1387 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 cb1dc8cea42451097c9644170757959e9afc0b47 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:01:15 +0530 Subject: [PATCH 08/23] 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 00000000000..81fec804736 --- /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 420ad0e1387..9fbf8f23eb9 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 23e60f28580a320435bbf01ebe570cad57f406bf Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:31:00 +0530 Subject: [PATCH 09/23] 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 81fec804736..83e16ce0faf 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 9fbf8f23eb9..2d6fb253b71 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 a775800acdad9d9ac9e3ebdb9aba001e8530892c Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:32:17 +0530 Subject: [PATCH 10/23] 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 83e16ce0faf..45d55c9e2d3 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 2d6fb253b71..7992fe8bb52 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 eb84f6aefe7c440881cc5f118bcfd22f5517dde7 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 3 Jun 2024 21:49:35 +0530 Subject: [PATCH 11/23] 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 45d55c9e2d3..ae32e5d28ea 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 2275408c45438d4b6bee08da083c666b90929dac Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 4 Jun 2024 14:02:13 +0530 Subject: [PATCH 12/23] 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 25b82c58b33..27b5b4cb40f 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 7992fe8bb52..da1994379dd 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 7df50ea2ac6aca5699160938e4525813f575b009 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 4 Jun 2024 14:23:53 +0530 Subject: [PATCH 13/23] 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 da1994379dd..9b24d8e7253 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 636303656c5d1b7bb0407272b7427456b3135a44 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Jun 2024 14:47:56 +0530 Subject: [PATCH 14/23] 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 ae32e5d28ea..10da3376ff8 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 33bfc8f5ef772a96d00e4f0037f3c38d0eb357a8 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Jun 2024 20:25:00 +0530 Subject: [PATCH 15/23] 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 5b64e8e5f6d..c6dc3d057bb 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 17afcc9e35f..5dacecdf4d5 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 4578170385b..a24c8af6aaa 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 d7e966dcc74..fbeaafe4399 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 9b24d8e7253..ca2cfd9cac9 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 ff0af721e3d08f784c5ba6409088350d2b4bb9f1 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 13:18:02 +0530 Subject: [PATCH 16/23] 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 27b5b4cb40f..e33a8976070 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 10da3376ff8..f9d6b4b9101 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 ca2cfd9cac9..eae66a0b5ff 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 5811a921efab5c71388a9bf3fdd902f3912d49df Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 14:05:43 +0530 Subject: [PATCH 17/23] 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 f9d6b4b9101..80ea2f0cb2c 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 eae66a0b5ff..3b912f7437b 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 ca8c46882729f06ff2d520450afee3cba4d301fd Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 14:15:28 +0530 Subject: [PATCH 18/23] 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 80ea2f0cb2c..b8d797b586c 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 3b912f7437b..abc3a95c20e 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 21b177d1839023788ef23dca2a88ce9768c72131 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 16:32:04 +0530 Subject: [PATCH 19/23] 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 b8d797b586c..b24791877f9 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 4dd3bddc7f891c9db857475f097a05071b5f9916 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 6 Jun 2024 22:06:54 +0100 Subject: [PATCH 20/23] 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 abc3a95c20e..e56dffe7aa6 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 0bf6ee73c78cec794236757fd4ebd8ba06edcb9c Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 10 Jun 2024 17:17:52 +0530 Subject: [PATCH 23/23] 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 0fc61d80b5a..4c447365d2d 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
- - - - - + + + + +
NAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATIONNAMESEVERITYCONFIDENCEDESCRIPTIONREMEDIATION